[Lemon-commits] Peter Kovacs: Port two images for SplitNodes fro...
Lemon HG
hg at lemon.cs.elte.hu
Mon Feb 22 19:46:51 CET 2010
details: http://lemon.cs.elte.hu/hg/lemon-tutorial/rev/e1725bb7e821
changeset: 40:e1725bb7e821
user: Peter Kovacs <kpeter [at] inf.elte.hu>
date: Sun Feb 21 18:34:28 2010 +0100
description:
Port two images for SplitNodes from SVN -r3524
diffstat:
Makefile.in | 11 +++-
adaptors.dox | 10 +++
images/splitnodes1.eps | 116 ++++++++++++++++++++++++++++++++++++++
images/splitnodes2.eps | 146 ++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 282 insertions(+), 1 deletions(-)
diffs (truncated from 328 to 300 lines):
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
@@ -2,8 +2,13 @@
EPS_IMAGES18 =
+EPS_IMAGES27 = \
+ splitnodes1.eps \
+ splitnodes2.eps
+
EPS_IMAGES = \
- $(EPS_IMAGES18)
+ $(EPS_IMAGES18) \
+ $(EPS_IMAGES27)
PNG_IMAGES = \
$(EPS_IMAGES:%.eps=gen-images/%.png)
@@ -18,6 +23,10 @@
-mkdir -p gen-images
$(GS_COMMAND) -sDEVICE=pngalpha -r18 -sOutputFile=$@ $<
+$(EPS_IMAGES27:%.eps=gen-images/%.png): gen-images/%.png: images/%.eps
+ -mkdir -p gen-images
+ $(GS_COMMAND) -sDEVICE=pngalpha -r27 -sOutputFile=$@ $<
+
html: Doxyfile-gen $(PNG_IMAGES)
-mkdir -p gen-dox
./scripts/titlegen.py
diff --git a/adaptors.dox b/adaptors.dox
--- a/adaptors.dox
+++ b/adaptors.dox
@@ -359,6 +359,12 @@
The maximum number of \e edge \e disjoint paths from a source node to
a sink node in a digraph can be easily computed using a maximum flow
algorithm with all arc capacities set to 1.
+For example, in the following digraph, four arc disjoint paths can be found
+from the node on the left to the node on the right.
+
+\image html splitnodes1.png
+\image latex splitnodes1.eps "Arc disjoint paths" width=\textwidth
+
On the other hand, \e node \e disjoint paths cannot be found directly
using a standard algorithm.
However, \ref SplitNodes adaptor makes it really simple.
@@ -366,6 +372,10 @@
bottleneck of the flow (i.e. the minimum cut) will be formed by bind arcs,
thus the found flow will correspond to the union of some node disjoint
paths in terms of the original digraph.
+For example, in the above digraph, there are only three node disjoint paths.
+
+\image html splitnodes2.png
+\image latex splitnodes2.eps "Node disjoint paths" width=\textwidth
In flow, circulation and matching problems, the residual network is of
particular importance, which is implemented in \ref ResidualDigraph.
diff --git a/images/splitnodes1.eps b/images/splitnodes1.eps
new file mode 100644
--- /dev/null
+++ b/images/splitnodes1.eps
@@ -0,0 +1,116 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: edge disjoint path
+%%Copyright: (C) 2006 LEMON Project
+%%Creator: LEMON, graphToEps()
+%%CreationDate: Fri May 12 01:53:21 2006
+%%BoundingBox: -290 -170 470 230
+%%EndComments
+/lb { setlinewidth setrgbcolor newpath moveto
+ 4 2 roll 1 index 1 index curveto stroke } bind def
+/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
+/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
+/sq { newpath 2 index 1 index add 2 index 2 index add moveto
+ 2 index 1 index sub 2 index 2 index add lineto
+ 2 index 1 index sub 2 index 2 index sub lineto
+ 2 index 1 index add 2 index 2 index sub lineto
+ closepath pop pop pop} bind def
+/di { newpath 2 index 1 index add 2 index moveto
+ 2 index 2 index 2 index add lineto
+ 2 index 1 index sub 2 index lineto
+ 2 index 2 index 2 index sub lineto
+ closepath pop pop pop} bind def
+/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
+ setrgbcolor 1.1 div c fill
+ } bind def
+/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
+ setrgbcolor 1.1 div sq fill
+ } bind def
+/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
+ setrgbcolor 1.1 div di fill
+ } bind def
+/nfemale { 0 0 0 setrgbcolor 3 index 0.0909091 1.5 mul mul setlinewidth
+ newpath 5 index 5 index moveto 5 index 5 index 5 index 3.01 mul sub
+ lineto 5 index 4 index .7 mul sub 5 index 5 index 2.2 mul sub moveto
+ 5 index 4 index .7 mul add 5 index 5 index 2.2 mul sub lineto stroke
+ 5 index 5 index 5 index c fill
+ setrgbcolor 1.1 div c fill
+ } bind def
+/nmale {
+ 0 0 0 setrgbcolor 3 index 0.0909091 1.5 mul mul setlinewidth
+ newpath 5 index 5 index moveto
+ 5 index 4 index 1 mul 1.5 mul add
+ 5 index 5 index 3 sqrt 1.5 mul mul add
+ 1 index 1 index lineto
+ 1 index 1 index 7 index sub moveto
+ 1 index 1 index lineto
+ exch 5 index 3 sqrt .5 mul mul sub exch 5 index .5 mul sub lineto
+ stroke
+ 5 index 5 index 5 index c fill
+ setrgbcolor 1.1 div c fill
+ } bind def
+/arrl 1 def
+/arrw 0.3 def
+/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
+/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
+ /w exch def /len exch def
+ newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
+ len w sub arrl sub dx dy lrl
+ arrw dy dx neg lrl
+ dx arrl w add mul dy w 2 div arrw add mul sub
+ dy arrl w add mul dx w 2 div arrw add mul add rlineto
+ dx arrl w add mul neg dy w 2 div arrw add mul sub
+ dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
+ arrw dy dx neg lrl
+ len w sub arrl sub neg dx dy lrl
+ closepath fill } bind def
+/cshow { 2 index 2 index moveto dup stringwidth pop
+ neg 2 div fosi .35 mul neg rmoveto show pop pop} def
+
+gsave
+10 dup scale
+%Edges:
+gsave
+15.6433 0.3 0.841178 -0.540758 -27 5 1 0 0 arr
+19.5913 0.3 0.874157 0.485643 -27 5 1 0 0 arr
+10.1803 0.3 0.98387 -0.178885 -20 17 1 0 0 arr
+20.587 0.3 0.972806 0.231621 -18 -14 1 0 0 arr
+15.7631 0.3 0.95448 -0.298275 -13 -4 0 0 0 arr
+15.9706 0.3 0.707107 -0.707107 -9 15 1 0 0 arr
+16.4642 0.3 0.916157 0.400819 -13 -4 1 0 0 arr
+14.5242 0.3 0.966235 -0.257663 -12 7 0 0 0 arr
+10.6619 0.3 0.857493 0.514496 -9 15 1 0 0 arr
+22.4094 0.3 0.939793 -0.341743 3 3 1 0 0 arr
+27.1602 0.3 0.958798 -0.284088 1 21 1 0 0 arr
+25.9258 0.3 0.928477 0.371391 3 3 1 0 0 arr
+25.9072 0.3 0.743294 0.668965 25 -15 1 0 0 arr
+20.5407 0.3 0.928477 0.371391 25 -5 1 0 0 arr
+18.7231 0.3 0.861934 -0.50702 28 13 1 0 0 arr
+14.2315 0.3 0.393919 0.919145 39 -11 0 0 0 arr
+10.6619 0.3 0.514496 -0.857493 39 13 1 0 0 arr
+20.0238 0.3 0.428086 -0.903738 -27 5 1 0 0 arr
+21.8035 0.3 0.964764 -0.263117 3 -9 1 0 0 arr
+14.1328 0.3 0.991228 0.132164 -27 5 0 0 0 arr
+13.5602 0.3 0.961524 0.274721 25 -15 0 0 0 arr
+10 0.3 1 0 28 13 1 0 0 arr
+12.8924 0.3 0.503871 0.863779 -27 5 1 0 0 arr
+grestore
+%Nodes:
+gsave
+-27 5 1 1 1 1 nc
+-13 -4 1 1 1 1 nc
+-9 15 1 1 1 1 nc
+3 -9 1 1 1 1 nc
+3 3 1 1 1 1 nc
+1 21 1 1 1 1 nc
+25 -5 1 1 1 1 nc
+28 13 1 1 1 1 nc
+45 3 1 1 1 1 nc
+-18 -14 1 1 1 1 nc
+25 -15 1 1 1 1 nc
+-12 7 1 1 1 1 nc
+39 -11 1 1 1 1 nc
+39 13 1 1 1 1 nc
+-20 17 1 1 1 1 nc
+grestore
+grestore
+showpage
diff --git a/images/splitnodes2.eps b/images/splitnodes2.eps
new file mode 100644
--- /dev/null
+++ b/images/splitnodes2.eps
@@ -0,0 +1,146 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: node disjoint path
+%%Copyright: (C) 2006 LEMON Project
+%%Creator: LEMON, graphToEps()
+%%CreationDate: Fri May 12 01:53:21 2006
+%%BoundingBox: -290 -170 520 230
+%%EndComments
+/lb { setlinewidth setrgbcolor newpath moveto
+ 4 2 roll 1 index 1 index curveto stroke } bind def
+/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
+/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
+/sq { newpath 2 index 1 index add 2 index 2 index add moveto
+ 2 index 1 index sub 2 index 2 index add lineto
+ 2 index 1 index sub 2 index 2 index sub lineto
+ 2 index 1 index add 2 index 2 index sub lineto
+ closepath pop pop pop} bind def
+/di { newpath 2 index 1 index add 2 index moveto
+ 2 index 2 index 2 index add lineto
+ 2 index 1 index sub 2 index lineto
+ 2 index 2 index 2 index sub lineto
+ closepath pop pop pop} bind def
+/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
+ setrgbcolor 1.1 div c fill
+ } bind def
+/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
+ setrgbcolor 1.1 div sq fill
+ } bind def
+/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
+ setrgbcolor 1.1 div di fill
+ } bind def
+/nfemale { 0 0 0 setrgbcolor 3 index 0.0909091 1.5 mul mul setlinewidth
+ newpath 5 index 5 index moveto 5 index 5 index 5 index 3.01 mul sub
+ lineto 5 index 4 index .7 mul sub 5 index 5 index 2.2 mul sub moveto
+ 5 index 4 index .7 mul add 5 index 5 index 2.2 mul sub lineto stroke
+ 5 index 5 index 5 index c fill
+ setrgbcolor 1.1 div c fill
+ } bind def
+/nmale {
+ 0 0 0 setrgbcolor 3 index 0.0909091 1.5 mul mul setlinewidth
+ newpath 5 index 5 index moveto
+ 5 index 4 index 1 mul 1.5 mul add
+ 5 index 5 index 3 sqrt 1.5 mul mul add
+ 1 index 1 index lineto
+ 1 index 1 index 7 index sub moveto
+ 1 index 1 index lineto
+ exch 5 index 3 sqrt .5 mul mul sub exch 5 index .5 mul sub lineto
+ stroke
+ 5 index 5 index 5 index c fill
+ setrgbcolor 1.1 div c fill
+ } bind def
+/arrl 1 def
+/arrw 0.3 def
+/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
+/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
+ /w exch def /len exch def
+ newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
+ len w sub arrl sub dx dy lrl
+ arrw dy dx neg lrl
+ dx arrl w add mul dy w 2 div arrw add mul sub
+ dy arrl w add mul dx w 2 div arrw add mul add rlineto
+ dx arrl w add mul neg dy w 2 div arrw add mul sub
+ dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
+ arrw dy dx neg lrl
+ len w sub arrl sub neg dx dy lrl
+ closepath fill } bind def
+/cshow { 2 index 2 index moveto dup stringwidth pop
+ neg 2 div fosi .35 mul neg rmoveto show pop pop} def
+
+gsave
+10 dup scale
+%Edges:
+gsave
+4 0.3 1 0 -27 5 0 0 0 arr
+4 0.3 1 0 -13 -4 1 0 0 arr
+4 0.3 1 0 -9 15 1 0 0 arr
+4 0.3 1 0 3 -9 1 0 0 arr
+4 0.3 1 0 3 3 1 0 0 arr
+4 0.3 1 0 1 21 1 0 0 arr
+4 0.3 1 0 25 -5 1 0 0 arr
+4 0.3 1 0 28 13 1 0 0 arr
+4 0.3 1 0 45 3 0 0 0 arr
+4 0.3 1 0 -18 -14 1 0 0 arr
+4 0.3 1 0 25 -15 1 0 0 arr
+4 0.3 1 0 -12 7 0 0 0 arr
+4 0.3 1 0 39 -11 0 0 0 arr
+4 0.3 1 0 39 13 0 0 0 arr
+4 0.3 1 0 -20 17 1 0 0 arr
+11.7279 0.3 0.707107 -0.707107 -22 5 1 0 0 arr
+15.4012 0.3 0.792624 0.609711 -22 5 0 0 0 arr
+5.32455 0.3 0.948683 -0.316228 -15 17 1 0 0 arr
+15.7631 0.3 0.95448 0.298275 -13 -14 1 0 0 arr
+11.083 0.3 0.910366 -0.413803 -8 -4 0 0 0 arr
+12.8924 0.3 0.503871 -0.863779 -4 15 0 0 0 arr
+12.0384 0.3 0.843661 0.536875 -8 -4 1 0 0 arr
+9.77033 0.3 0.928477 -0.371391 -7 7 0 0 0 arr
+6.81025 0.3 0.640184 0.768221 -4 15 1 0 0 arr
+17.7883 0.3 0.904819 -0.425797 8 3 1 0 0 arr
+22.4094 0.3 0.939793 -0.341743 6 21 1 0 0 arr
+21.3607 0.3 0.894427 0.447214 8 3 0 0 0 arr
+22.4307 0.3 0.640184 0.768221 30 -15 1 0 0 arr
+16 0.3 0.882353 0.470588 30 -5 1 0 0 arr
+14.6205 0.3 0.768221 -0.640184 33 13 1 0 0 arr
+13.0357 0.3 0.071247 0.997459 44 -11 0 0 0 arr
+9.04987 0.3 0.0995037 -0.995037 44 13 0 0 0 arr
+18.4165 0.3 0.20601 -0.97855 -22 5 1 0 0 arr
+17.0278 0.3 0.94299 -0.33282 8 -9 1 0 0 arr
+9.19804 0.3 0.980581 0.196116 -22 5 0 0 0 arr
+8.84886 0.3 0.913812 0.406138 30 -15 0 0 0 arr
+5 0.3 1 0 33 13 0 0 0 arr
+11.1655 0.3 0.164399 0.986394 -22 5 1 0 0 arr
+grestore
+%Nodes:
+gsave
+-27 5 1 1 1 1 nc
+-22 5 1 1 1 1 nc
+-13 -4 1 1 1 1 nc
+-8 -4 1 1 1 1 nc
+-9 15 1 1 1 1 nc
More information about the Lemon-commits
mailing list