summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-02-17 22:35:27 +0000
committerKarl Berry <karl@freefriends.org>2018-02-17 22:35:27 +0000
commit7a5d7c25a9af35767193321e810c8b379757bf34 (patch)
treeec8b2fb1385ec06c954c25cfb170851286cf527d
parent77cea4c016ed732551b4b94fc5c452180a894123 (diff)
adigraph (17feb18)
git-svn-id: svn://tug.org/texlive/trunk@46659 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/adigraph/LICENSE21
-rw-r--r--Master/texmf-dist/doc/latex/adigraph/README.md145
-rw-r--r--Master/texmf-dist/doc/latex/adigraph/adigraph_library_example.pdfbin0 -> 30254 bytes
-rw-r--r--Master/texmf-dist/doc/latex/adigraph/adigraph_library_example.tex99
-rw-r--r--Master/texmf-dist/doc/latex/adigraph/img_examples/example_1.jpgbin0 -> 8232 bytes
-rw-r--r--Master/texmf-dist/doc/latex/adigraph/img_examples/example_cut.jpgbin0 -> 11032 bytes
-rw-r--r--Master/texmf-dist/tex/latex/adigraph/adigraph.sty359
-rwxr-xr-xMaster/tlpkg/bin/tlpkg-ctan-check2
-rw-r--r--Master/tlpkg/tlpsrc/adigraph.tlpsrc0
-rw-r--r--Master/tlpkg/tlpsrc/collection-pictures.tlpsrc1
10 files changed, 626 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/adigraph/LICENSE b/Master/texmf-dist/doc/latex/adigraph/LICENSE
new file mode 100644
index 00000000000..9b7cf6e7164
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/adigraph/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 Luca Cappelletti
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/Master/texmf-dist/doc/latex/adigraph/README.md b/Master/texmf-dist/doc/latex/adigraph/README.md
new file mode 100644
index 00000000000..b2e269014de
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/adigraph/README.md
@@ -0,0 +1,145 @@
+# Smart Augmenting Graphs
+
+Copyright 2018 Luca Cappelletti
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+A tex package to draw **augmenting graphs** easily and to draw **cuts** on them too.
+
+This package requires the packages **fp**, **xparse**, **xstring** and **tikz** (in particular tikz/calc). If you don't have them you can proceed by installing them by running:
+
+```bash
+sudo tlmgr instal fp xparse xstring tikz
+```
+
+I'm currently looking into publishing this package on ctan, until then you'll have to download it and include in locally with the usual:
+
+```latex
+\usepackage{adigraph}
+```
+
+Then, suppose you want to create a graph as the following:
+
+![alt text][graph]
+
+We start by defining a new graph:
+
+```latex
+ \NewAdigraph{myAdigraph}{
+ s,0,0,b,red;
+ 1,2,2;
+ 3,2,-2;
+ 2,6,2;
+ 4,6,-2;
+ t,8,0,e,blue;
+ }{
+ s,3,25;
+ s,1,25;
+ 3,1,5;
+ 3,4,20;
+ 4,2,5;
+ 2,3,15,0,near start;
+ 4,1,5,0,near start;
+ 1,2,35;
+ 2,t,20;
+ 4,t,30;
+ }
+```
+
+In the first argument we are defining the *nodes*, while in the second one we are defining the *edges*. The name of this particular graph will be *myAdigraph*.
+
+We now want to draw this graph. We proceed as follows:
+
+```latex
+\begin{figure}
+ \center
+ \myAdigraph{}
+ \caption{My Personal Graph}
+\end{figure}
+```
+
+Suppose now we want to show the steps for calculating the maximum flow of the graph. We just add the edited edges inside the now empty argument of the *\myAdigraph*:
+
+```latex
+\begin{figure}
+ \center
+ \myAdigraph{
+ s,3,5,20,1;
+ 3,4,0,20,1;
+ 4,t,20,10,1;
+ }
+ \caption{Sending 10 units over $s,3,4,t$}
+\end{figure}
+
+\begin{figure}
+ \center
+ \myAdigraph{
+ s,3,5,20;
+ 3,4,0,20;
+ s,1,20,5,1;
+ 4,1,5,0,red,blue,near start;
+ 4,t,15,15,1;
+ }
+ \caption{Sending 5 units over $s,1,4,t$}
+\end{figure}
+
+\begin{figure}
+ \center
+ \myAdigraph{
+ s,3,5,20;
+ 3,4,0,20;
+ s,1,15,10,1;
+ 1,2,25,10,1;
+ 4,2,5,0,1;
+ 4,t,10,20,1;
+ }
+ \caption{Sending 5 units over $s,1,2,4,t$}
+\end{figure}
+
+\begin{figure}
+ \center
+ \myAdigraph{
+ s,3,5,20;
+ 3,4,0,20;
+ s,1,5,20,1;
+ 1,2,15,20,1;
+ 4,2,5,0;
+ 2,t,0,20,1;
+ 4,t,10,20;
+ }
+ \caption{Sending 10 units over $s,1,2,t$}
+\end{figure}
+
+\begin{figure}
+ \center
+ \myAdigraph[
+ 3,4;
+ 2,t;
+ ]{
+ s,3,5,20;
+ 3,4,0,20;
+ s,1,5,20,1;
+ 1,2,15,20,1;
+ 4,2,5,0;
+ 2,t,0,20,1;
+ 4,t,10,20;
+ }
+ \caption{Showing minimum cut}
+\end{figure}
+```
+
+The working example in latex is found in the file *adigraph_library_example.tex*.
+
+The result with the cuts is the following:
+
+![alt text][cuts]
+
+Have a nice day!
+**Luca Cappelletti**
+
+[graph]: https://github.com/LucaCappelletti94/smart_augmenting_graphs/blob/master/img_examples/example_1.jpg?raw=true "Graph example"
+[cuts]: https://github.com/LucaCappelletti94/smart_augmenting_graphs/blob/master/img_examples/example_cut.jpg?raw=true "Example with cuts" \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/adigraph/adigraph_library_example.pdf b/Master/texmf-dist/doc/latex/adigraph/adigraph_library_example.pdf
new file mode 100644
index 00000000000..9ed04629655
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/adigraph/adigraph_library_example.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/adigraph/adigraph_library_example.tex b/Master/texmf-dist/doc/latex/adigraph/adigraph_library_example.tex
new file mode 100644
index 00000000000..021d66cc4a7
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/adigraph/adigraph_library_example.tex
@@ -0,0 +1,99 @@
+\documentclass{report}
+
+\usepackage{adigraph}
+
+\begin{document}
+
+\NewAdigraph{myAdigraph}{
+ s,0,0,b,red;
+ 1,2,2;
+ 3,2,-2;
+ 2,6,2;
+ 4,6,-2;
+ t,8,0,e,blue;
+}{
+ s,3,15,10;
+ s,1,25;
+ 3,1,5;
+ 3,4,10,10;
+ 4,2,0,5;
+ 2,3,15,0,black,black,near start;
+ 4,1,0,5,black,black,near start;
+ 1,2,30,5;
+ 2,t,10,10;
+ 4,t,30;
+}
+
+\begin{figure}
+ \center
+ \myAdigraph{}
+ \caption{My Personal Graph}
+\end{figure}
+
+\begin{figure}
+ \center
+ \myAdigraph{
+ s,3,5,20,1;
+ 3,4,0,20,1;
+ 4,t,20,10,1;
+ }
+ \caption{Sending 10 units over $s,3,4,t$}
+\end{figure}
+
+\begin{figure}
+ \center
+ \myAdigraph{
+ s,3,5,20;
+ 3,4,0,20;
+ s,1,20,5,1;
+ 4,1,5,0,red,blue,near start;
+ 4,t,15,15,1;
+ }
+ \caption{Sending 5 units over $s,1,4,t$}
+\end{figure}
+
+\begin{figure}
+ \center
+ \myAdigraph{
+ s,3,5,20;
+ 3,4,0,20;
+ s,1,15,10,1;
+ 1,2,25,10,1;
+ 4,2,5,0,1;
+ 4,t,10,20,1;
+ }
+ \caption{Sending 5 units over $s,1,2,4,t$}
+\end{figure}
+
+\begin{figure}
+ \center
+ \myAdigraph{
+ s,3,5,20;
+ 3,4,0,20;
+ s,1,5,20,1;
+ 1,2,15,20,1;
+ 4,2,5,0;
+ 2,t,0,20,1;
+ 4,t,10,20;
+ }
+ \caption{Sending 10 units over $s,1,2,t$}
+\end{figure}
+
+\begin{figure}
+ \center
+ \myAdigraph[
+ 3,4;
+ 2,t;
+ ]{
+ s,3,5,20;
+ 3,4,0,20;
+ s,1,5,20,1;
+ 1,2,15,20,1;
+ 4,2,5,0;
+ 2,t,0,20,1;
+ 4,t,10,20;
+ }
+ \caption{Showing minimum cut}
+\end{figure}
+
+\end{document} \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/adigraph/img_examples/example_1.jpg b/Master/texmf-dist/doc/latex/adigraph/img_examples/example_1.jpg
new file mode 100644
index 00000000000..651e4aba6f7
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/adigraph/img_examples/example_1.jpg
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/adigraph/img_examples/example_cut.jpg b/Master/texmf-dist/doc/latex/adigraph/img_examples/example_cut.jpg
new file mode 100644
index 00000000000..20f4c0d75b3
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/adigraph/img_examples/example_cut.jpg
Binary files differ
diff --git a/Master/texmf-dist/tex/latex/adigraph/adigraph.sty b/Master/texmf-dist/tex/latex/adigraph/adigraph.sty
new file mode 100644
index 00000000000..1d12cc9892d
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/adigraph/adigraph.sty
@@ -0,0 +1,359 @@
+%
+% Copyright 2018 Luca Cappelletti
+%
+% Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+%
+% The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+%
+% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+%
+\NeedsTeXFormat{LaTeX2e}[1994/06/01]
+\ProvidesPackage{adigraph}
+ [2018/02/16 v1.0 LaTeX package for creating augmenting directed graphs]
+
+\RequirePackage{fp}
+\RequirePackage{xparse}
+\RequirePackage{xstring}
+\RequirePackage{tikz}
+\usetikzlibrary{calc}
+
+\def\zero{0}
+
+\makeatletter
+\newcommand*{\rom}[1]{\expandafter\@slowromancap\romannumeral #1@}
+
+\NewDocumentCommand{\storeCoordinate}{m m m}{
+ \@namedef{adigraphNode#1#2}{#3}%
+}
+\NewDocumentCommand{\storeParsedEdge}{m m}{
+ \@namedef{parsed#1#2}{1}%
+}
+\makeatother
+\newcommand{\markEdgeAsParsed}[2]{%
+ %
+ % #1 -> First node of edge
+ % #2 -> Second node of edge
+ %
+ \IfInteger{#1}{%
+ \def\nodeA{\rom{#1}}%
+ }{%
+ \def\nodeA{#1}%
+ }%
+ \IfInteger{#2}{%
+ \def\nodeB{\rom{#2}}%
+ }{%
+ \def\nodeB{#2}%
+ }%
+ \storeParsedEdge{\nodeA}{\nodeB}
+}
+
+\newcommand{\edgeWasParsed}[3]{%
+ %
+ % #1 -> Variable to store boolean result
+ % #2 -> First node of edge
+ % #3 -> Second node of edge
+ %
+ \IfInteger{#2}{%
+ \def\nodeA{\rom{#2}}%
+ }{%
+ \def\nodeA{#2}%
+ }%
+ \IfInteger{#3}{%
+ \def\nodeB{\rom{#3}}%
+ }{%
+ \def\nodeB{#3}%
+ }%
+ \ifcsname parsed\nodeA\nodeB\endcsname
+ \FPset{#1}{1}
+ \else%
+ \FPset{#1}{0}
+ \fi%
+}
+
+\newcommand{\saveNodeCoordinate}[3]{
+ %
+ % #1 -> Node name
+ % #2 -> Coordinate, either X or Y
+ % #3 -> Numeric value
+ %
+ \IfInteger{#1}{%
+ \def\nodeName{\rom{#1}}%
+ }{%
+ \def\nodeName{#1}%
+ }%
+ \storeCoordinate{#2}{\nodeName}{#3}
+}
+
+\newcommand{\retrieveNodeCoordinate}[3]{
+ %
+ % #1 -> Variable to store coordinate into
+ % #2 -> Node name
+ % #3 -> Coordinate, either X or Y
+ %
+ \IfInteger{#2}{%
+ \def\nodeName{\rom{#2}}%
+ }{%
+ \def\nodeName{#2}%
+ }%
+
+ \FPset{#1}{\csname adigraphNode#3\nodeName\endcsname}
+}
+
+\newcommand{\saveNodeCoordinates}[3]{
+ %
+ % #1 -> Node name
+ % #2 -> X value
+ % #3 -> Y value
+ %
+ \saveNodeCoordinate{#1}{X}{#2}%
+ \saveNodeCoordinate{#1}{Y}{#3}%
+}
+
+\newcommand{\swp}[3]{
+ %
+ % #1 -> variable to assign
+ % #2 -> First node name
+ % #3 -> Second node name
+ %
+ \retrieveNodeCoordinate{\firstX}{#2}{X}
+ \retrieveNodeCoordinate{\firstY}{#2}{Y}
+ \retrieveNodeCoordinate{\secondX}{#3}{X}
+ \retrieveNodeCoordinate{\secondY}{#3}{Y}
+ %
+ \FPsub{\xSub}{\secondX}{\firstX}
+ \FPsub{\ySub}{\secondY}{\firstY}
+ \FPset{#1}{1}
+ \FPifgt{\xSub}{0}
+ \FPset{#1}{3}
+ \else%
+ \FPset{#1}{4}
+ \fi%
+ %
+ \FPifeq{\xSub}{0}
+ \FPset{\xiszero}{1}
+ \else%
+ \FPset{\xiszero}{0}
+ \fi%
+ %
+ \FPifgt{\ySub}{0}
+ \FPset{\yispos}{1}
+ \else%
+ \FPset{\yispos}{4}
+ \fi%
+ %
+ \FPadd{\xzeroypos}{\xiszero}{\yispos}
+ %
+ \FPifeq{\xzeroypos}{2}
+ \FPset{#1}{1}
+ \fi%
+ \FPifeq{\xzeroypos}{5}
+ \FPset{#1}{2}
+ \fi%
+}
+
+\newcommand{\executeNodeBuilder}[5]{
+ %
+ % #1 is node name
+ % #2 is x coordinate
+ % #3 is y coordinate
+ % #4 is label, that defaults to #1 when absent
+ % #5 is color, that defaults to black when absent
+ %
+ \IfValueT{#2}{
+ \IfValueTF{#4}{
+ \def\nodeLabel{#4}
+ }{
+ \def\nodeLabel{#1}
+ }
+ \IfValueTF{#5}{
+ \def\nodeColor{#5}
+ }{
+ \def\nodeColor{black}
+ }
+ \saveNodeCoordinates{#1}{#2}{#3}
+ \node[vertex,\nodeColor] (#1) at (#2,#3) {$\nodeLabel$};
+ }
+}
+
+\NewDocumentCommand{\nodeBuilder}{ > { \SplitArgument { 4 } { , } } m }{
+ \executeNodeBuilder #1
+}
+
+\newcommand{\executeEdgeBuilder}[7]{
+ %
+ % #1 is first node
+ % #2 is second node
+ % #3 is weight of first edge, which defaults to 0
+ % #4 is weight of second edge, which defaults to 0
+ % #5 Should we color edge? Or first optional color
+ % #6 Second optional color
+ % #7 Label position on axis
+ %
+ \edgeWasParsed{\isParsed}{#1}{#2}
+ \FPifeq{\isParsed}{0}
+ \markEdgeAsParsed{#1}{#2}
+ \markEdgeAsParsed{#2}{#1}
+ \fi%
+ \IfValueT{#2}{
+ \def\firstNode{#1}
+ \def\secondNode{#2}
+ \IfValueTF{#3}{
+ \def\firstEdgeWeight{#3}
+ }{
+ \def\firstEdgeWeight{0}
+ }
+ \IfValueTF{#4}{
+ \def\secondEdgeWeight{#4}
+ }{
+ \def\secondEdgeWeight{0}
+ }
+ \IfValueTF{#7}{
+ \def\labelPosition{#7}
+ }{
+ \def\labelPosition{midway}
+ }
+ \IfValueTF{#6}{
+ \IfValueTF{#5}{
+ \def\firstEdgeColor{#5}
+ \def\secondEdgeColor{#6}
+ }{
+ \def\firstEdgeColor{black}
+ \def\secondEdgeColor{black}
+ }
+ }{
+ \IfValueTF{#5}{
+ \def\firstEdgeColor{red}
+ \def\secondEdgeColor{blue}
+ }{
+ \def\firstEdgeColor{black}
+ \def\secondEdgeColor{black}
+ }
+ }
+
+ \FPadd{\weightSum}{\firstEdgeWeight}{\secondEdgeWeight}
+ \FPmul{\weightMul}{\firstEdgeWeight}{\secondEdgeWeight}
+ \FPadd{\firstZero}{\weightMul}{\firstEdgeWeight}
+ \FPadd{\secondZero}{\weightMul}{\secondEdgeWeight}
+
+ \swp{\firstWeightPositionFlag}{#1}{#2}
+ \swp{\secondWeightPositionFlag}{#2}{#1}
+
+ \FPifeq{\firstWeightPositionFlag}{1}
+ \def\firstWeightPosition{left}
+ \fi
+ \FPifeq{\firstWeightPositionFlag}{2}
+ \def\firstWeightPosition{right}
+ \fi
+ \FPifeq{\firstWeightPositionFlag}{3}
+ \def\firstWeightPosition{above}
+ \fi
+ \FPifeq{\firstWeightPositionFlag}{4}
+ \def\firstWeightPosition{below}
+ \fi
+
+ \FPifeq{\secondWeightPositionFlag}{1}
+ \def\secondWeightPosition{left}
+ \fi
+ \FPifeq{\secondWeightPositionFlag}{2}
+ \def\secondWeightPosition{right}
+ \fi
+ \FPifeq{\secondWeightPositionFlag}{3}
+ \def\secondWeightPosition{above}
+ \fi
+ \FPifeq{\secondWeightPositionFlag}{4}
+ \def\secondWeightPosition{below}
+ \fi
+ \FPifeq{\isParsed}{1}
+ \else
+ \FPifeq{\weightSum}{0}
+ % No edge has weights, so we draw both with no labels.
+ \draw[edge,\firstEdgeColor] (\firstNode) to [bend right=20] (\secondNode);
+ \draw[edge,\secondEdgeColor] (\secondNode) to [bend right=20] (\firstNode);
+ \else
+ \FPifeq{\weightSum}{0}
+ \draw[edge,\firstEdgeColor] (\firstNode) to node[\labelPosition, \secondWeightPosition] {$\firstEdgeWeight$}(\secondNode);
+ \else
+ \FPifeq{\firstZero}{0}
+ \draw[edge,\secondEdgeColor] (\secondNode) to node[\labelPosition, \firstWeightPosition] {$\secondEdgeWeight$}(\firstNode);
+ \FPifeq{\weightMul}{0}
+ \else
+ \draw[edge,\firstEdgeColor] (\firstNode) to [bend right=20] node[\labelPosition, \firstWeightPosition] {$\firstEdgeWeight$}(\secondNode);
+ \draw[edge,\secondEdgeColor] (\secondNode) to [bend right=20] node[\labelPosition, \secondWeightPosition] {$\secondEdgeWeight$}(\firstNode);
+ \fi
+ }
+}
+
+\NewDocumentCommand{\edgeBuilder}{> { \SplitArgument { 6 } { , } } m}{
+ \executeEdgeBuilder #1
+}
+
+\NewDocumentCommand{\calculateOrientation}{m m m}{
+ \retrieveNodeCoordinate{\firstX}{#2}{X}
+ \retrieveNodeCoordinate{\firstY}{#2}{Y}
+ \retrieveNodeCoordinate{\secondX}{#3}{X}
+ \retrieveNodeCoordinate{\secondY}{#3}{Y}
+ \FPsub{\deltaY}{\secondY}{\firstY}
+ \FPsub{\deltaX}{\secondX}{\firstX}
+ \FPifeq{\deltaX}{0}
+ \Fpset{#1}{90}
+ \else
+ \FPdiv{\deltaDiv}{\deltaY}{\deltaX}
+ \FParctan{\arcResult}{\deltaDiv}
+ \FPmul{#1}{\arcResult}{57.2958}
+ \fi
+}
+
+\NewDocumentCommand{\executeCutBuilder}{m m}{
+ \IfValueT{#2}{
+ \calculateOrientation{\orientation}{#1}{#2}
+ \draw[dashed,red,rotate=\orientation] ([yshift=10pt]$(#1)!0.7!(#2)$) -- ([yshift=-10pt]$(#1)!0.7!(#2)$);
+ % %\node[vertex] (d) at (-3,-3) {$ARIAN$};
+ }
+}
+
+\NewDocumentCommand{\cutBuilder}{> { \SplitArgument { 1 } { , } } m}{
+ \executeCutBuilder #1
+}
+
+\NewDocumentCommand{\smartGraph}{> { \SplitList { ; } } m > { \SplitList { ; } } m > { \SplitList { ; } } m > { \SplitList { ; } } m}{
+ %
+ % #1 -> Vertices
+ % #2 -> Edges
+ % #3 -> Modified edges
+ % #4 -> Cuts
+ %
+ \begin{tikzpicture}
+ \tikzset{
+ vertex/.style={circle,draw,minimum size=2em},
+ edge/.style={->,> = latex}
+ }
+
+ % vertices
+ \ProcessList {#1} {\nodeBuilder}
+
+ %edges
+ \ProcessList {#3} {\edgeBuilder}
+ \ProcessList {#2} {\edgeBuilder}
+
+ %cuts
+ \ProcessList {#4} {\cutBuilder}
+ \end{tikzpicture}
+}
+
+\NewDocumentCommand{\NewAdigraph}{m m m}{
+ %
+ % #1 -> Variable to assign to as command
+ % #2 -> Nodes
+ % #3 -> Edges
+ %
+ \expandafter\newcommand\csname #1\endcsname[2][]{
+ %
+ % ##1 -> Modified edges
+ %
+ \smartGraph{#2}{#3}{##2}{##1}
+ }%
+}
+
+\endinput
+%%
+%% End of file `adigraph.sty'. \ No newline at end of file
diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check
index f67bd60e1a0..da615b84f75 100755
--- a/Master/tlpkg/bin/tlpkg-ctan-check
+++ b/Master/tlpkg/bin/tlpkg-ctan-check
@@ -27,7 +27,7 @@ my @TLP_working = qw(
academicons accanthis accfonts achemso
acmart acmconf acro acronym acroterm
active-conf actuarialangle actuarialsymbol
- addfont addlines adfathesis adforn adhocfilelist
+ addfont addlines adfathesis adforn adhocfilelist adigraph
adjmulticol adfsymbols adjustbox adobemapping
adrconv adtrees advdate
ae aecc aeguill afparticle afthesis
diff --git a/Master/tlpkg/tlpsrc/adigraph.tlpsrc b/Master/tlpkg/tlpsrc/adigraph.tlpsrc
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/Master/tlpkg/tlpsrc/adigraph.tlpsrc
diff --git a/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc b/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc
index 7d61f517696..994f1755d28 100644
--- a/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc
+++ b/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc
@@ -4,6 +4,7 @@ longdesc Including TikZ, pict, etc., but MetaPost and PStricks are separate.
#
depend collection-basic
#
+depend adigraph
depend aobs-tikz
depend askmaps
depend asyfig