From 8181d0d95efc568c56d63b5cfb43d2bc3e093620 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 27 Mar 2018 21:24:17 +0000 Subject: adigraph (27mar18) git-svn-id: svn://tug.org/texlive/trunk@47148 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/adigraph/README.md | 21 +-- .../doc/latex/adigraph/adigraph-large.png | Bin 0 -> 158870 bytes .../doc/latex/adigraph/adigraph_documentation.pdf | Bin 94597 -> 104688 bytes .../doc/latex/adigraph/adigraph_documentation.tex | 179 ++++++++++++++++++++- .../doc/latex/adigraph/adigraph_working_test.pdf | Bin 24878 -> 31637 bytes .../doc/latex/adigraph/adigraph_working_test.tex | 45 ++++++ 6 files changed, 227 insertions(+), 18 deletions(-) create mode 100644 Master/texmf-dist/doc/latex/adigraph/adigraph-large.png (limited to 'Master/texmf-dist/doc') diff --git a/Master/texmf-dist/doc/latex/adigraph/README.md b/Master/texmf-dist/doc/latex/adigraph/README.md index aa937ad3acd..5bc102883b6 100644 --- a/Master/texmf-dist/doc/latex/adigraph/README.md +++ b/Master/texmf-dist/doc/latex/adigraph/README.md @@ -29,9 +29,7 @@ More examples and step by step explanation is available in the [documentation](h Suppose you want to create a graph as the following, with an augmenting path highlighted and a couple of cuts: -

- -

+![Basic example](https://github.com/LucaCappelletti94/adigraph/blob/master/img_examples/example_3.jpg?raw=true) We start by defining a new graph, called *myAdigraph*: @@ -63,9 +61,8 @@ At this point the output is the following: \myAdigraph{} ``` -

- -

+![First adigraph](https://github.com/LucaCappelletti94/adigraph/blob/master/img_examples/example_0.jpg?raw=true) + Then we can add the augmenting path as follows: ```latex @@ -74,9 +71,7 @@ Then we can add the augmenting path as follows: } ``` -

- -

+![Augmenting adigraph](https://github.com/LucaCappelletti94/adigraph/blob/master/img_examples/example_1.jpg?raw=true) And the cuts (remember that the paths from previous steps are memorized by the library) are added as follows: @@ -89,9 +84,7 @@ And the cuts (remember that the paths from previous steps are memorized by the l The result with the cuts is the following: -

- -

+![Cuts adigraph](https://github.com/LucaCappelletti94/adigraph/blob/master/img_examples/example_2.jpg?raw=true) You can add both cuts and paths at the same time to keep the latest path highlighted: @@ -104,9 +97,7 @@ You can add both cuts and paths at the same time to keep the latest path highlig } ``` -

- -

+![Cuts adigraph](https://github.com/LucaCappelletti94/adigraph/blob/master/img_examples/example_3.jpg?raw=true) Have a nice day! diff --git a/Master/texmf-dist/doc/latex/adigraph/adigraph-large.png b/Master/texmf-dist/doc/latex/adigraph/adigraph-large.png new file mode 100644 index 00000000000..552c74c4ca2 Binary files /dev/null and b/Master/texmf-dist/doc/latex/adigraph/adigraph-large.png differ diff --git a/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.pdf b/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.pdf index c26a4ddb559..dee66bb844b 100644 Binary files a/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.pdf and b/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.pdf differ diff --git a/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.tex b/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.tex index 1dbcc0fa0bf..4d2773c0d1e 100644 --- a/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.tex +++ b/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.tex @@ -637,7 +637,64 @@ This works only when you don't have a node called \textit{<+>}. When this happen \subsection{Combining Kleene operations} Sadly, operations such as \textit{<*,+>} or \textit{<+,+>} are not currently supported and not for lack of trying. I'll try implementing them again in the future when I'll have more time. -\section{Augmenting paths} +\section{Paths} +A path is specified by the following syntax: \textit{}. + +\NewAdigraph{myPathsTestAdigraph}{ + s:0,0; + 1:2,2; + 3:2,-2; + 2:6,2; + 4:6,-2; + t:8,0; +}{ + s,1:25; + s,3:25; + 3,4:25; + 1,2:35; + 2,t:20; + 4,t:30; + 3,1:10; + 4,2:10; + 2,3:15::near start; + 4,1:5::near start; +} + +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\NewAdigraph{myAdigraph}{ + s:0,0; + 1:2,2; + 3:2,-2; + 2:6,2; + 4:6,-2; + t:8,0; +}{ + s,1:25; + s,3:25; + 3,4:25; + 1,2:35; + 2,t:20; + 4,t:30; + 3,1:10; + 4,2:10; + 2,3:15::near start; + 4,1:5::near start; +} +\myAdigraph{ + s,3,4,2,t; +} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \myPathsTestAdigraph{ + s,3,4,2,t; + } + \end{subfigure} +\end{figure} + +\subsection{Augmenting paths} An augmenting path is specified by the following syntax: \textit{}. It is \textbf{very important} to note that incremental paths called upon the same object are memorized by default. \NewAdigraph{myAdigraph}{ @@ -771,8 +828,123 @@ For example, suppose now we'd like to send another 5 units on the graph edited b \end{subfigure} \end{figure} -\section{Cuts} +\subsection{Custom colored augmenting Paths} +A path is specified by the following syntax: \textit{::}. + +\NewAdigraph{myCustomAugmentingPathAdigraph}{ + s:0,0; + 1:2,2; + 3:2,-2; + 2:6,2; + 4:6,-2; + t:8,0; +}{ + s,1:25; + s,3:25; + 3,4:25; + 1,2:35; + 2,t:20; + 4,t:30; + 3,1:10; + 4,2:10; + 2,3:15::near start; + 4,1:5::near start; +} + +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\NewAdigraph{myAdigraph}{ + s:0,0; + 1:2,2; + 3:2,-2; + 2:6,2; + 4:6,-2; + t:8,0; +}{ + s,1:25; + s,3:25; + 3,4:25; + 1,2:35; + 2,t:20; + 4,t:30; + 3,1:10; + 4,2:10; + 2,3:15::near start; + 4,1:5::near start; +} +\myAdigraph{ + s,3,4,2,t:5:green,blue; +} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \myCustomAugmentingPathAdigraph{ + s,3,4,2,t:5:green,blue; + } + \end{subfigure} +\end{figure} +\subsection{Custom colored Paths} +A path is specified by the following syntax: \textit{::}. \textbf{Note the double colons!}. + +\NewAdigraph{myCustomPathAdigraph}{ + s:0,0; + 1:2,2; + 3:2,-2; + 2:6,2; + 4:6,-2; + t:8,0; +}{ + s,1:25; + s,3:25; + 3,4:25; + 1,2:35; + 2,t:20; + 4,t:30; + 3,1:10; + 4,2:10; + 2,3:15::near start; + 4,1:5::near start; +} + +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\NewAdigraph{myAdigraph}{ + s:0,0; + 1:2,2; + 3:2,-2; + 2:6,2; + 4:6,-2; + t:8,0; +}{ + s,1:25; + s,3:25; + 3,4:25; + 1,2:35; + 2,t:20; + 4,t:30; + 3,1:10; + 4,2:10; + 2,3:15::near start; + 4,1:5::near start; +} +\myAdigraph{ + s,3,4,2,t::green; + s,1,2::red; +} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \myCustomPathAdigraph{ + s,1,2::red; + s,3,4,2,t::green; + } + \end{subfigure} +\end{figure} + +\section{Cuts} The following is to add cuts to show minimum cuts for example, the syntax is: \textit{} \begin{figure} @@ -793,7 +965,7 @@ The following is to add cuts to show minimum cuts for example, the syntax is: \t \end{figure} \subsection{Colored cuts} -If you'd like to color the cuts you just have to add the color as follows: \textit{} +If you'd like to color the cuts you just have to add the color as follows: \textit{}. \textbf{Note that if you want to only add a cut and not an augmenting path and a cut, you still need to add the empty curly braces \{\}.} \begin{figure} \begin{subfigure}{0.49\textwidth} @@ -801,6 +973,7 @@ If you'd like to color the cuts you just have to add the color as follows: \text \myAdigraph{}{ 3,4,red; 2,t,blue; + 2,4,green; } \end{minted} \end{subfigure} diff --git a/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.pdf b/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.pdf index bf6b1b407f5..b6ba3781b74 100644 Binary files a/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.pdf and b/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.pdf differ diff --git a/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.tex b/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.tex index b3aeaec44be..9d91b642c2c 100644 --- a/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.tex +++ b/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.tex @@ -100,6 +100,51 @@ 3,4,blue; } \end{figure} + + \NewAdigraph{myForthAdigraph}{ + 1:4; + 2:4; + 3:4; + 4:4; + 5:4; + 6:4; + 7:4; + 8:4; + }{ + 1,2:5; + 2,3:5; + 3,4:5; + 4,5:5; + 5,6:5; + } + + \begin{figure} + \myForthAdigraph{ + 1,2,3:0; + } + \end{figure} + + \NewAdigraph{myFifthAdigraph}{ + 1:4; + 2:4; + 3:4; + 4:4; + 5:4; + 6:4; + 7:4; + 8:4; + }{ + 1,*,red; + *,4,blue; + 2,3; + 3,4; + } + + \begin{figure} + \myFifthAdigraph{ + 2,3,4::purple; + } + \end{figure} \end{center} \end{document} \ No newline at end of file -- cgit v1.2.3