Browse Source

Version fonctionnelle : Ford Fulkerson avec cout OK (TAF -> Commentaires, tests, emploi avec preferences)

Paul Faure 3 years ago
parent
commit
9d5a451950

+ 28
- 6
Makefile View File

@@ -13,12 +13,18 @@ man:
13 13
 	@echo "\nTous ces modules sont testables (fichier de type 'nom_package'test.ml) grace au module test créé"
14 14
 	@echo "Il est possible de compiler ces fichiers de test avec la cible build_'nom_package'test, un fichier 'nom_package'test.native sera crée"
15 15
 	@echo "Il est possible d'executer ces fichiers de test avec la cible demo_'nom_package'test\n"
16
-	@echo "En ce qui concerne Ford Fulkerson, il a été dans codé le module flot, et, peut être lancé grace au fichier FordFulkerson.ml"
16
+	@echo "En ce qui concerne Ford Fulkerson, il a été codé dans le module flot, et, peut être lancé grace au fichier FordFulkerson.ml"
17 17
 	@echo "Pour simplifier son utilisation, la aussi, des cibles ont été créées : "
18 18
 	@echo "   - build_FordFulkerson : pour compiler le programme et créér FordFulkerson.native"
19 19
 	@echo "   - demo_FordFulkerson GRAPH=\"chemin\" ORIGIN=\"origine\" DESTINATION=\"destination\""
20
-	@echo "        Pour compiler le programme l'executer sur le graphe donné (ex ./graphs/graph1) entre l'origine et la destination donnée (ex 0 et 5)"
20
+	@echo "        Pour compiler le programme l'executer sur le graphe donné (ex ./graphs/flot/graph1) entre l'origine et la destination donnée (ex 0 et 5)"
21 21
 	@echo "        Cela charge le graphe, l'exporte au format svg, applique FordFulkerson, exporte le résultat au format svg, et l'affiche dans Firefox\n"
22
+	@echo "En ce qui concerne Ford Fulkerson avec prise en compte du cout, il a été codé dans le module flotcost, et, peut être lancé grace au fichier FordFulkersonCost.ml"
23
+	@echo "Pour simplifier son utilisation, la aussi, des cibles ont été créées : "
24
+	@echo "   - build_FordFulkersonCost : pour compiler le programme et créér FordFulkersonCost.native"
25
+	@echo "   - demo_FordFulkersonCost GRAPH=\"chemin\" ORIGIN=\"origine\" DESTINATION=\"destination\""
26
+	@echo "        Pour compiler le programme l'executer sur le graphe donné (ex ./graphs.flotcost/graph1) entre l'origine et la destination donnée (ex 0 et 5)"
27
+	@echo "        Cela charge le graphe, l'exporte au format svg, applique FordFulkersonCost, exporte le résultat au format svg, et l'affiche dans Firefox\n"
22 28
 	@echo "En ce qui concerne l'affectation d'emploi, elle a été codée dans le module emploifile, et, peut être lancé grace au fichier emploifiletest.ml"
23 29
 	@echo "Pour simplifier son utilisation, la aussi, des cibles ont été créées : "
24 30
 	@echo "   - build_Emploi : pour compiler le programme et créér emploifiletest.native"
@@ -63,6 +69,24 @@ else
63 69
 	firefox $(GRAPH)output_from_$(ORIGIN)_to_$(DESTINATION).svg
64 70
 endif
65 71
 
72
+build_FordFulkersonCost: 
73
+	@echo "\n==== COMPILING FordFulkersonCost ====\n"
74
+	ocamlbuild FordFulkersonCost.native
75
+
76
+demo_FordFulkersonCost: build_FordFulkersonCost
77
+ifeq ($(GRAPH),null)
78
+	@echo "USAGE : make demo_FordFulkersonCost GRAPH=\"chemin\" ORIGIN=\"origine\" DESTINATION=\"destination\""
79
+else ifeq ($(ORIGIN),-1)
80
+	@echo "USAGE : make demo_FordFulkersonCost GRAPH=\"chemin\" ORIGIN=\"origine\" DESTINATION=\"destination\""
81
+else ifeq ($(DESTINATION),-1)
82
+	@echo "USAGE : make demo_FordFulkersonCost GRAPH=\"chemin\" ORIGIN=\"origine\" DESTINATION=\"destination\""
83
+else
84
+	./FordFulkersonCost.native $(GRAPH) $(ORIGIN) $(DESTINATION) $(GRAPH).dot $(GRAPH)output_from_$(ORIGIN)_to_$(DESTINATION).dot
85
+	dot -Tsvg $(GRAPH).dot > $(GRAPH).svg
86
+	dot -Tsvg $(GRAPH)output_from_$(ORIGIN)_to_$(DESTINATION).dot > $(GRAPH)output_from_$(ORIGIN)_to_$(DESTINATION).svg
87
+	firefox $(GRAPH)output_from_$(ORIGIN)_to_$(DESTINATION).svg
88
+endif
89
+
66 90
 build_Emploi: 
67 91
 	@echo "\n==== COMPILING Emploi ====\n"
68 92
 	ocamlbuild emploifiletest.native
@@ -83,8 +107,6 @@ edit:
83 107
 	code . -n
84 108
 
85 109
 clean:
86
-	-rm -rf _build/
87
-	-rm *.native
88
-	-rm graphs/*.dot
89
-	-rm emplois/*.dot
110
+	@rm -rf _build/
111
+	@rm *.native graphs/*/*.dot emplois/*.dot
90 112
 

graphs/graph1 → graphs/flot/graph1 View File

@@ -12,13 +12,13 @@ n 535 294    % This is node #5.
12 12
 
13 13
 %% Edges
14 14
 
15
-e 3 1 11     % An edge from 3 to 1, labeled "11".
16
-e 3 2 2
17
-e 1 5 21
18
-e 4 5 14
19
-e 1 4 1
20
-e 0 1 7
21
-e 0 3 10
22
-e 3 4 5
23
-e 2 4 12
24
-e 0 2 8
15
+e 3 1 (0/11)     % An edge from 3 to 1, labeled "11".
16
+e 3 2 (0/2)
17
+e 1 5 (0/21)
18
+e 4 5 (0/14)
19
+e 1 4 (0/1)
20
+e 0 1 (0/7)
21
+e 0 3 (0/10)
22
+e 3 4 (0/5)
23
+e 2 4 (0/12)
24
+e 0 2 (0/8)

+ 25
- 0
graphs/flot/graph2 View File

@@ -0,0 +1,25 @@
1
+% Graph saved at Sun Nov 22 2020 11:38:03 GMT+0100 (heure normale d’Europe centrale)
2
+n 23 266
3
+n 177 436
4
+n 175 268
5
+n 329 269
6
+n 483 437
7
+n 481 335
8
+n 175 130
9
+n 646 268
10
+e 3 5 (0/8)
11
+e 3 4 (0/20)
12
+e 4 5 (0/1)
13
+e 2 3 (0/26)
14
+e 1 4 (0/13)
15
+e 1 3 (0/10)
16
+e 0 2 (0/1)
17
+e 0 1 (0/38)
18
+e 1 2 (0/8)
19
+e 4 7 (0/7)
20
+e 5 7 (0/7)
21
+e 3 7 (0/1)
22
+e 6 7 (0/27)
23
+e 3 6 (0/24)
24
+e 0 6 (0/2)
25
+e 4 2 (0/2)

graphs/graph2.svg → graphs/flot/graph2.svg View File


graphs/graph2maximized.svg → graphs/flot/graph2output_from_0_to_7.svg View File


+ 24
- 0
graphs/flotcost/graph1 View File

@@ -0,0 +1,24 @@
1
+%% Test graph #1
2
+
3
+%% Nodes
4
+
5
+n 88 209     % This is node #0, with its coordinates (which are not used by the algorithms).
6
+n 408 183
7
+n 269 491
8
+n 261 297
9
+n 401 394
10
+n 535 294    % This is node #5.
11
+
12
+
13
+%% Edges
14
+
15
+e 3 1 (0/11):0    % An edge from 3 to 1, labeled "11".
16
+e 3 2 (0/2):0
17
+e 1 5 (0/21):0
18
+e 4 5 (0/14):0
19
+e 1 4 (0/1):0
20
+e 0 1 (0/7):0
21
+e 0 3 (0/10):0
22
+e 3 4 (0/5):0
23
+e 2 4 (0/12):0
24
+e 0 2 (0/8):0

+ 25
- 0
graphs/flotcost/graph2 View File

@@ -0,0 +1,25 @@
1
+% Graph saved at Sun Nov 22 2020 11:38:03 GMT+0100 (heure normale d’Europe centrale)
2
+n 23 266
3
+n 177 436
4
+n 175 268
5
+n 329 269
6
+n 483 437
7
+n 481 335
8
+n 175 130
9
+n 646 268
10
+e 3 5 (0/8):10
11
+e 3 4 (0/20):2
12
+e 4 5 (0/1):6
13
+e 2 3 (0/26):1
14
+e 1 4 (0/13):5
15
+e 1 3 (0/10):7
16
+e 0 2 (0/1):9
17
+e 0 1 (0/38):4
18
+e 1 2 (0/8):1
19
+e 4 7 (0/7):8
20
+e 5 7 (0/7):20
21
+e 3 7 (0/1):100
22
+e 6 7 (0/27):10
23
+e 3 6 (0/24):5
24
+e 0 6 (0/2):4
25
+e 4 2 (0/2):2

+ 173
- 0
graphs/flotcost/graph2.svg View File

@@ -0,0 +1,173 @@
1
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
3
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+<!-- Generated by graphviz version 2.40.1 (20161225.0304)
5
+ -->
6
+<!-- Title: finite_state_machine Pages: 1 -->
7
+<svg width="576pt" height="168pt"
8
+ viewBox="0.00 0.00 576.00 167.66" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
9
+<g id="graph0" class="graph" transform="scale(.7451 .7451) rotate(0) translate(4 221)">
10
+<title>finite_state_machine</title>
11
+<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-221 769,-221 769,4 -4,4"/>
12
+<!-- 0 -->
13
+<g id="node1" class="node">
14
+<title>0</title>
15
+<ellipse fill="none" stroke="#000000" cx="18" cy="-170" rx="18" ry="18"/>
16
+<text text-anchor="middle" x="18" y="-166.3" font-family="Times,serif" font-size="14.00" fill="#000000">0</text>
17
+</g>
18
+<!-- 1 -->
19
+<g id="node2" class="node">
20
+<title>1</title>
21
+<ellipse fill="none" stroke="#000000" cx="134.5" cy="-170" rx="18" ry="18"/>
22
+<text text-anchor="middle" x="134.5" y="-166.3" font-family="Times,serif" font-size="14.00" fill="#000000">1</text>
23
+</g>
24
+<!-- 0&#45;&gt;1 -->
25
+<g id="edge5" class="edge">
26
+<title>0&#45;&gt;1</title>
27
+<path fill="none" stroke="#000000" d="M36.2031,-170C54.9263,-170 84.3483,-170 106.1283,-170"/>
28
+<polygon fill="#000000" stroke="#000000" points="106.4247,-173.5001 116.4247,-170 106.4247,-166.5001 106.4247,-173.5001"/>
29
+<text text-anchor="middle" x="76" y="-173.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/38):4</text>
30
+</g>
31
+<!-- 2 -->
32
+<g id="node3" class="node">
33
+<title>2</title>
34
+<ellipse fill="none" stroke="#000000" cx="248" cy="-170" rx="18" ry="18"/>
35
+<text text-anchor="middle" x="248" y="-166.3" font-family="Times,serif" font-size="14.00" fill="#000000">2</text>
36
+</g>
37
+<!-- 0&#45;&gt;2 -->
38
+<g id="edge6" class="edge">
39
+<title>0&#45;&gt;2</title>
40
+<path fill="none" stroke="#000000" d="M33.24,-179.5937C39.4596,-183.0898 46.8591,-186.7364 54,-189 96.0798,-202.339 108.9716,-200.1853 153,-197 177.6373,-195.2176 184.3578,-196.1568 208,-189 212.8933,-187.5187 217.9435,-185.525 222.7389,-183.3849"/>
41
+<polygon fill="#000000" stroke="#000000" points="224.586,-186.3809 232.0923,-178.9039 221.5616,-180.068 224.586,-186.3809"/>
42
+<text text-anchor="middle" x="134.5" y="-202.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/1):9</text>
43
+</g>
44
+<!-- 6 -->
45
+<g id="node7" class="node">
46
+<title>6</title>
47
+<ellipse fill="none" stroke="#000000" cx="489" cy="-18" rx="18" ry="18"/>
48
+<text text-anchor="middle" x="489" y="-14.3" font-family="Times,serif" font-size="14.00" fill="#000000">6</text>
49
+</g>
50
+<!-- 0&#45;&gt;6 -->
51
+<g id="edge4" class="edge">
52
+<title>0&#45;&gt;6</title>
53
+<path fill="none" stroke="#000000" d="M21.3995,-152.2335C30.8372,-108.8434 61.6242,-1 134.5,-1 134.5,-1 134.5,-1 368.5,-1 400.5227,-1 436.8671,-6.9593 461.1901,-11.8213"/>
54
+<polygon fill="#000000" stroke="#000000" points="460.6433,-15.2823 471.1455,-13.8848 462.064,-8.4279 460.6433,-15.2823"/>
55
+<text text-anchor="middle" x="248" y="-4.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/2):4</text>
56
+</g>
57
+<!-- 1&#45;&gt;2 -->
58
+<g id="edge13" class="edge">
59
+<title>1&#45;&gt;2</title>
60
+<path fill="none" stroke="#000000" d="M152.7357,-170C170.7721,-170 198.6359,-170 219.5779,-170"/>
61
+<polygon fill="#000000" stroke="#000000" points="219.8096,-173.5001 229.8095,-170 219.8095,-166.5001 219.8096,-173.5001"/>
62
+<text text-anchor="middle" x="189.5" y="-173.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/8):1</text>
63
+</g>
64
+<!-- 3 -->
65
+<g id="node4" class="node">
66
+<title>3</title>
67
+<ellipse fill="none" stroke="#000000" cx="368.5" cy="-110" rx="18" ry="18"/>
68
+<text text-anchor="middle" x="368.5" y="-106.3" font-family="Times,serif" font-size="14.00" fill="#000000">3</text>
69
+</g>
70
+<!-- 1&#45;&gt;3 -->
71
+<g id="edge14" class="edge">
72
+<title>1&#45;&gt;3</title>
73
+<path fill="none" stroke="#000000" d="M150.13,-161.0292C167.9089,-151.2583 198.0988,-135.9624 226,-128 264.4851,-117.0172 310.7245,-112.7305 339.8686,-111.0607"/>
74
+<polygon fill="#000000" stroke="#000000" points="340.3392,-114.5415 350.1495,-110.5403 339.9853,-107.5504 340.3392,-114.5415"/>
75
+<text text-anchor="middle" x="248" y="-131.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/10):7</text>
76
+</g>
77
+<!-- 4 -->
78
+<g id="node5" class="node">
79
+<title>4</title>
80
+<ellipse fill="none" stroke="#000000" cx="489" cy="-173" rx="18" ry="18"/>
81
+<text text-anchor="middle" x="489" y="-169.3" font-family="Times,serif" font-size="14.00" fill="#000000">4</text>
82
+</g>
83
+<!-- 1&#45;&gt;4 -->
84
+<g id="edge15" class="edge">
85
+<title>1&#45;&gt;4</title>
86
+<path fill="none" stroke="#000000" d="M149.9862,-179.5295C156.297,-183.0168 163.7935,-186.6741 171,-189 194.5076,-196.5871 201.3627,-195.2176 226,-197 324.9521,-204.1588 351.7778,-206.7637 449,-187 453.5018,-186.0849 458.187,-184.7833 462.6985,-183.3383"/>
87
+<polygon fill="#000000" stroke="#000000" points="463.8681,-186.6372 472.1584,-180.0401 461.5636,-180.0274 463.8681,-186.6372"/>
88
+<text text-anchor="middle" x="310" y="-205.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/13):5</text>
89
+</g>
90
+<!-- 2&#45;&gt;3 -->
91
+<g id="edge16" class="edge">
92
+<title>2&#45;&gt;3</title>
93
+<path fill="none" stroke="#000000" d="M262.8134,-159.4744C270.1945,-154.4644 279.3674,-148.5824 288,-144 305.3679,-134.7806 325.7838,-126.1815 341.7095,-119.9377"/>
94
+<polygon fill="#000000" stroke="#000000" points="343.3722,-123.0482 351.4494,-116.1919 340.8595,-116.5147 343.3722,-123.0482"/>
95
+<text text-anchor="middle" x="310" y="-147.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/26):1</text>
96
+</g>
97
+<!-- 3&#45;&gt;4 -->
98
+<g id="edge9" class="edge">
99
+<title>3&#45;&gt;4</title>
100
+<path fill="none" stroke="#000000" d="M385.6794,-115.9565C402.3502,-122.034 428.1207,-132.2257 449,-144 454.8837,-147.318 460.9327,-151.3388 466.4885,-155.3162"/>
101
+<polygon fill="#000000" stroke="#000000" points="464.6022,-158.2748 474.7185,-161.4232 468.7736,-152.6534 464.6022,-158.2748"/>
102
+<text text-anchor="middle" x="427" y="-147.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/20):2</text>
103
+</g>
104
+<!-- 5 -->
105
+<g id="node6" class="node">
106
+<title>5</title>
107
+<ellipse fill="none" stroke="#000000" cx="623.5" cy="-110" rx="18" ry="18"/>
108
+<text text-anchor="middle" x="623.5" y="-106.3" font-family="Times,serif" font-size="14.00" fill="#000000">5</text>
109
+</g>
110
+<!-- 3&#45;&gt;5 -->
111
+<g id="edge10" class="edge">
112
+<title>3&#45;&gt;5</title>
113
+<path fill="none" stroke="#000000" d="M386.839,-110C430.764,-110 542.258,-110 595.008,-110"/>
114
+<polygon fill="#000000" stroke="#000000" points="595.3272,-113.5001 605.3272,-110 595.3272,-106.5001 595.3272,-113.5001"/>
115
+<text text-anchor="middle" x="489" y="-113.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/8):10</text>
116
+</g>
117
+<!-- 3&#45;&gt;6 -->
118
+<g id="edge7" class="edge">
119
+<title>3&#45;&gt;6</title>
120
+<path fill="none" stroke="#000000" d="M372.3196,-92.2531C377.0014,-74.9343 386.6789,-49.1832 405,-35 420.6866,-22.8562 442.8183,-18.7505 460.4268,-17.6042"/>
121
+<polygon fill="#000000" stroke="#000000" points="460.8429,-21.0914 470.708,-17.2275 460.5865,-14.0961 460.8429,-21.0914"/>
122
+<text text-anchor="middle" x="427" y="-38.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/24):5</text>
123
+</g>
124
+<!-- 7 -->
125
+<g id="node8" class="node">
126
+<title>7</title>
127
+<ellipse fill="none" stroke="#000000" cx="747" cy="-87" rx="18" ry="18"/>
128
+<text text-anchor="middle" x="747" y="-83.3" font-family="Times,serif" font-size="14.00" fill="#000000">7</text>
129
+</g>
130
+<!-- 3&#45;&gt;7 -->
131
+<g id="edge8" class="edge">
132
+<title>3&#45;&gt;7</title>
133
+<path fill="none" stroke="#000000" d="M386.2912,-107.1758C424.7779,-101.2277 518.6976,-87.5819 598,-83 620.6289,-81.6926 626.338,-82.5377 649,-83 672.5577,-83.4806 699.2809,-84.6103 718.8646,-85.547"/>
134
+<polygon fill="#000000" stroke="#000000" points="718.7848,-89.0472 728.9445,-86.0422 719.1283,-82.0556 718.7848,-89.0472"/>
135
+<text text-anchor="middle" x="554.5" y="-92.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/1):100</text>
136
+</g>
137
+<!-- 4&#45;&gt;2 -->
138
+<g id="edge1" class="edge">
139
+<title>4&#45;&gt;2</title>
140
+<path fill="none" stroke="#000000" d="M470.6756,-172.7719C428.8612,-172.2514 326.174,-170.9731 276.2149,-170.3512"/>
141
+<polygon fill="#000000" stroke="#000000" points="276.157,-166.8503 266.1142,-170.2255 276.0698,-173.8498 276.157,-166.8503"/>
142
+<text text-anchor="middle" x="368.5" y="-175.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/2):2</text>
143
+</g>
144
+<!-- 4&#45;&gt;5 -->
145
+<g id="edge3" class="edge">
146
+<title>4&#45;&gt;5</title>
147
+<path fill="none" stroke="#000000" d="M503.1682,-161.2157C510.5427,-155.4836 519.9005,-148.8109 529,-144 550.5587,-132.602 576.7678,-123.5098 596.1108,-117.6061"/>
148
+<polygon fill="#000000" stroke="#000000" points="597.2117,-120.9304 605.8078,-114.737 595.2257,-114.218 597.2117,-120.9304"/>
149
+<text text-anchor="middle" x="554.5" y="-147.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/1):6</text>
150
+</g>
151
+<!-- 4&#45;&gt;7 -->
152
+<g id="edge2" class="edge">
153
+<title>4&#45;&gt;7</title>
154
+<path fill="none" stroke="#000000" d="M507.2453,-172.2131C546.8874,-169.7899 642.7939,-160.0143 711,-121 716.9745,-117.5826 722.7331,-112.9772 727.8266,-108.2612"/>
155
+<polygon fill="#000000" stroke="#000000" points="730.5932,-110.446 735.2184,-100.9141 725.6585,-105.4813 730.5932,-110.446"/>
156
+<text text-anchor="middle" x="623.5" y="-164.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/7):8</text>
157
+</g>
158
+<!-- 5&#45;&gt;7 -->
159
+<g id="edge12" class="edge">
160
+<title>5&#45;&gt;7</title>
161
+<path fill="none" stroke="#000000" d="M641.458,-106.6556C661.8544,-102.8571 695.3838,-96.6127 719.1732,-92.1823"/>
162
+<polygon fill="#000000" stroke="#000000" points="719.8302,-95.6202 729.0204,-90.3484 718.5486,-88.7385 719.8302,-95.6202"/>
163
+<text text-anchor="middle" x="689" y="-105.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/7):20</text>
164
+</g>
165
+<!-- 6&#45;&gt;7 -->
166
+<g id="edge11" class="edge">
167
+<title>6&#45;&gt;7</title>
168
+<path fill="none" stroke="#000000" d="M507.1048,-16.3439C546.877,-13.5703 643.6843,-11.6152 711,-50 717.7443,-53.8457 724.0463,-59.3254 729.4332,-64.8928"/>
169
+<polygon fill="#000000" stroke="#000000" points="726.8824,-67.2907 736.1673,-72.3939 732.0914,-62.6145 726.8824,-67.2907"/>
170
+<text text-anchor="middle" x="623.5" y="-30.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/27):10</text>
171
+</g>
172
+</g>
173
+</svg>

+ 173
- 0
graphs/flotcost/graph2output_from_0_to_7.svg View File

@@ -0,0 +1,173 @@
1
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
3
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+<!-- Generated by graphviz version 2.40.1 (20161225.0304)
5
+ -->
6
+<!-- Title: finite_state_machine Pages: 1 -->
7
+<svg width="576pt" height="161pt"
8
+ viewBox="0.00 0.00 576.00 161.11" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
9
+<g id="graph0" class="graph" transform="scale(.7129 .7129) rotate(0) translate(4 222)">
10
+<title>finite_state_machine</title>
11
+<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-222 804,-222 804,4 -4,4"/>
12
+<!-- 0 -->
13
+<g id="node1" class="node">
14
+<title>0</title>
15
+<ellipse fill="none" stroke="#000000" cx="18" cy="-170" rx="18" ry="18"/>
16
+<text text-anchor="middle" x="18" y="-166.3" font-family="Times,serif" font-size="14.00" fill="#000000">0</text>
17
+</g>
18
+<!-- 1 -->
19
+<g id="node2" class="node">
20
+<title>1</title>
21
+<ellipse fill="none" stroke="#000000" cx="141.5" cy="-170" rx="18" ry="18"/>
22
+<text text-anchor="middle" x="141.5" y="-166.3" font-family="Times,serif" font-size="14.00" fill="#000000">1</text>
23
+</g>
24
+<!-- 0&#45;&gt;1 -->
25
+<g id="edge9" class="edge">
26
+<title>0&#45;&gt;1</title>
27
+<path fill="none" stroke="#000000" d="M36.2229,-170C56.4714,-170 89.4248,-170 113.0716,-170"/>
28
+<polygon fill="#000000" stroke="#000000" points="113.2024,-173.5001 123.2024,-170 113.2024,-166.5001 113.2024,-173.5001"/>
29
+<text text-anchor="middle" x="79.5" y="-173.8" font-family="Times,serif" font-size="14.00" fill="#000000">(28/38):4</text>
30
+</g>
31
+<!-- 2 -->
32
+<g id="node3" class="node">
33
+<title>2</title>
34
+<ellipse fill="none" stroke="#000000" cx="258.5" cy="-170" rx="18" ry="18"/>
35
+<text text-anchor="middle" x="258.5" y="-166.3" font-family="Times,serif" font-size="14.00" fill="#000000">2</text>
36
+</g>
37
+<!-- 0&#45;&gt;2 -->
38
+<g id="edge8" class="edge">
39
+<title>0&#45;&gt;2</title>
40
+<path fill="none" stroke="#000000" d="M33.2252,-179.6411C39.4427,-183.1438 46.8447,-186.7825 54,-189 99.1276,-202.9855 112.8781,-200.4091 160,-197 184.6373,-195.2176 191.2476,-195.7819 215,-189 220.9903,-187.2896 227.2359,-184.9326 233.0636,-182.4601"/>
41
+<polygon fill="#000000" stroke="#000000" points="234.6712,-185.5749 242.358,-178.2835 231.802,-179.1899 234.6712,-185.5749"/>
42
+<text text-anchor="middle" x="141.5" y="-202.8" font-family="Times,serif" font-size="14.00" fill="#000000">(1/1):9</text>
43
+</g>
44
+<!-- 6 -->
45
+<g id="node7" class="node">
46
+<title>6</title>
47
+<ellipse fill="none" stroke="#000000" cx="517" cy="-18" rx="18" ry="18"/>
48
+<text text-anchor="middle" x="517" y="-14.3" font-family="Times,serif" font-size="14.00" fill="#000000">6</text>
49
+</g>
50
+<!-- 0&#45;&gt;6 -->
51
+<g id="edge7" class="edge">
52
+<title>0&#45;&gt;6</title>
53
+<path fill="none" stroke="#000000" d="M21.9607,-152.2335C32.7914,-108.8434 67.1855,-1 141.5,-1 141.5,-1 141.5,-1 389.5,-1 424.0856,-1 463.4892,-7.222 489.2227,-12.1377"/>
54
+<polygon fill="#000000" stroke="#000000" points="488.8716,-15.6359 499.3606,-14.1424 490.2296,-8.7689 488.8716,-15.6359"/>
55
+<text text-anchor="middle" x="258.5" y="-4.8" font-family="Times,serif" font-size="14.00" fill="#000000">(2/2):4</text>
56
+</g>
57
+<!-- 1&#45;&gt;2 -->
58
+<g id="edge10" class="edge">
59
+<title>1&#45;&gt;2</title>
60
+<path fill="none" stroke="#000000" d="M159.5248,-170C178.3644,-170 208.1888,-170 230.1787,-170"/>
61
+<polygon fill="#000000" stroke="#000000" points="230.2619,-173.5001 240.2619,-170 230.2619,-166.5001 230.2619,-173.5001"/>
62
+<text text-anchor="middle" x="196.5" y="-173.8" font-family="Times,serif" font-size="14.00" fill="#000000">(8/8):1</text>
63
+</g>
64
+<!-- 3 -->
65
+<g id="node4" class="node">
66
+<title>3</title>
67
+<ellipse fill="none" stroke="#000000" cx="389.5" cy="-110" rx="18" ry="18"/>
68
+<text text-anchor="middle" x="389.5" y="-106.3" font-family="Times,serif" font-size="14.00" fill="#000000">3</text>
69
+</g>
70
+<!-- 1&#45;&gt;3 -->
71
+<g id="edge11" class="edge">
72
+<title>1&#45;&gt;3</title>
73
+<path fill="none" stroke="#000000" d="M157.1137,-160.9715C174.878,-151.149 205.0549,-135.8069 233,-128 276.5908,-115.8223 329.2227,-111.867 360.9908,-110.5924"/>
74
+<polygon fill="#000000" stroke="#000000" points="361.4322,-114.0795 371.3085,-110.2442 361.1961,-107.0835 361.4322,-114.0795"/>
75
+<text text-anchor="middle" x="258.5" y="-131.8" font-family="Times,serif" font-size="14.00" fill="#000000">(10/10):7</text>
76
+</g>
77
+<!-- 4 -->
78
+<g id="node5" class="node">
79
+<title>4</title>
80
+<ellipse fill="none" stroke="#000000" cx="517" cy="-173" rx="18" ry="18"/>
81
+<text text-anchor="middle" x="517" y="-169.3" font-family="Times,serif" font-size="14.00" fill="#000000">4</text>
82
+</g>
83
+<!-- 1&#45;&gt;4 -->
84
+<g id="edge12" class="edge">
85
+<title>1&#45;&gt;4</title>
86
+<path fill="none" stroke="#000000" d="M156.9862,-179.5295C163.297,-183.0168 170.7935,-186.6741 178,-189 201.5076,-196.5871 208.3627,-195.2176 233,-197 341.2526,-204.8317 370.57,-208.2744 477,-187 481.5047,-186.0995 486.1915,-184.8055 490.7036,-183.3635"/>
87
+<polygon fill="#000000" stroke="#000000" points="491.8731,-186.6624 500.1635,-180.0655 489.5687,-180.0526 491.8731,-186.6624"/>
88
+<text text-anchor="middle" x="327.5" y="-206.8" font-family="Times,serif" font-size="14.00" fill="#000000">(10/13):5</text>
89
+</g>
90
+<!-- 2&#45;&gt;3 -->
91
+<g id="edge1" class="edge">
92
+<title>2&#45;&gt;3</title>
93
+<path fill="none" stroke="#000000" d="M273.8517,-159.9613C282.0252,-154.8398 292.3566,-148.714 302,-144 321.8281,-134.3074 345.1638,-125.3551 362.7474,-119.0722"/>
94
+<polygon fill="#000000" stroke="#000000" points="364.0895,-122.3106 372.3658,-115.696 361.771,-115.7057 364.0895,-122.3106"/>
95
+<text text-anchor="middle" x="327.5" y="-147.8" font-family="Times,serif" font-size="14.00" fill="#000000">(11/26):1</text>
96
+</g>
97
+<!-- 3&#45;&gt;4 -->
98
+<g id="edge4" class="edge">
99
+<title>3&#45;&gt;4</title>
100
+<path fill="none" stroke="#000000" d="M406.8513,-115.2758C424.9355,-121.1068 453.817,-131.3663 477,-144 482.9312,-147.2323 488.9985,-151.2201 494.5569,-155.1929"/>
101
+<polygon fill="#000000" stroke="#000000" points="492.668,-158.15 502.7798,-161.3126 496.8472,-152.5345 492.668,-158.15"/>
102
+<text text-anchor="middle" x="451.5" y="-147.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/20):2</text>
103
+</g>
104
+<!-- 5 -->
105
+<g id="node6" class="node">
106
+<title>5</title>
107
+<ellipse fill="none" stroke="#000000" cx="655" cy="-110" rx="18" ry="18"/>
108
+<text text-anchor="middle" x="655" y="-106.3" font-family="Times,serif" font-size="14.00" fill="#000000">5</text>
109
+</g>
110
+<!-- 3&#45;&gt;5 -->
111
+<g id="edge3" class="edge">
112
+<title>3&#45;&gt;5</title>
113
+<path fill="none" stroke="#000000" d="M407.7489,-110C453.33,-110 572.4081,-110 626.9644,-110"/>
114
+<polygon fill="#000000" stroke="#000000" points="626.9745,-113.5001 636.9745,-110 626.9744,-106.5001 626.9745,-113.5001"/>
115
+<text text-anchor="middle" x="517" y="-113.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/8):10</text>
116
+</g>
117
+<!-- 3&#45;&gt;6 -->
118
+<g id="edge5" class="edge">
119
+<title>3&#45;&gt;6</title>
120
+<path fill="none" stroke="#000000" d="M393.275,-92.1949C397.922,-74.8309 407.5731,-49.0454 426,-35 443.903,-21.3539 469.4557,-17.5511 488.9285,-16.9055"/>
121
+<polygon fill="#000000" stroke="#000000" points="489.0607,-20.4047 499.034,-16.8292 489.0078,-13.4049 489.0607,-20.4047"/>
122
+<text text-anchor="middle" x="451.5" y="-38.8" font-family="Times,serif" font-size="14.00" fill="#000000">(21/24):5</text>
123
+</g>
124
+<!-- 7 -->
125
+<g id="node8" class="node">
126
+<title>7</title>
127
+<ellipse fill="none" stroke="#000000" cx="782" cy="-87" rx="18" ry="18"/>
128
+<text text-anchor="middle" x="782" y="-83.3" font-family="Times,serif" font-size="14.00" fill="#000000">7</text>
129
+</g>
130
+<!-- 3&#45;&gt;7 -->
131
+<g id="edge2" class="edge">
132
+<title>3&#45;&gt;7</title>
133
+<path fill="none" stroke="#000000" d="M407.5388,-107.2308C447.0183,-101.3265 544.1009,-87.6599 626,-83 651.7362,-81.5357 658.2276,-82.4743 684,-83 707.5577,-83.4806 734.2809,-84.6103 753.8646,-85.547"/>
134
+<polygon fill="#000000" stroke="#000000" points="753.7848,-89.0472 763.9445,-86.0422 754.1283,-82.0556 753.7848,-89.0472"/>
135
+<text text-anchor="middle" x="582.5" y="-92.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/1):100</text>
136
+</g>
137
+<!-- 4&#45;&gt;2 -->
138
+<g id="edge14" class="edge">
139
+<title>4&#45;&gt;2</title>
140
+<path fill="none" stroke="#000000" d="M498.8429,-172.7893C454.4603,-172.2742 340.2134,-170.9483 286.8064,-170.3285"/>
141
+<polygon fill="#000000" stroke="#000000" points="286.7172,-166.8273 276.6772,-170.211 286.6359,-173.8269 286.7172,-166.8273"/>
142
+<text text-anchor="middle" x="389.5" y="-175.8" font-family="Times,serif" font-size="14.00" fill="#000000">(2/2):2</text>
143
+</g>
144
+<!-- 4&#45;&gt;5 -->
145
+<g id="edge15" class="edge">
146
+<title>4&#45;&gt;5</title>
147
+<path fill="none" stroke="#000000" d="M531.145,-161.1716C538.5136,-155.4283 547.8731,-148.7588 557,-144 579.7089,-132.1594 607.4298,-122.9818 627.5865,-117.1625"/>
148
+<polygon fill="#000000" stroke="#000000" points="628.6814,-120.4907 637.371,-114.4292 626.798,-113.7488 628.6814,-120.4907"/>
149
+<text text-anchor="middle" x="582.5" y="-147.8" font-family="Times,serif" font-size="14.00" fill="#000000">(1/1):6</text>
150
+</g>
151
+<!-- 4&#45;&gt;7 -->
152
+<g id="edge13" class="edge">
153
+<title>4&#45;&gt;7</title>
154
+<path fill="none" stroke="#000000" d="M535.1832,-172.3502C575.6433,-170.1927 675.1262,-160.9019 746,-121 751.9976,-117.6233 757.7649,-113.0332 762.8593,-108.319"/>
155
+<polygon fill="#000000" stroke="#000000" points="765.629,-110.5004 770.2474,-100.9651 760.6908,-105.5392 765.629,-110.5004"/>
156
+<text text-anchor="middle" x="655" y="-165.8" font-family="Times,serif" font-size="14.00" fill="#000000">(7/7):8</text>
157
+</g>
158
+<!-- 5&#45;&gt;7 -->
159
+<g id="edge16" class="edge">
160
+<title>5&#45;&gt;7</title>
161
+<path fill="none" stroke="#000000" d="M672.9266,-106.7534C694.1056,-102.9179 729.5798,-96.4934 754.3011,-92.0163"/>
162
+<polygon fill="#000000" stroke="#000000" points="754.9484,-95.4561 764.1646,-90.23 753.7009,-88.5682 754.9484,-95.4561"/>
163
+<text text-anchor="middle" x="724" y="-105.8" font-family="Times,serif" font-size="14.00" fill="#000000">(1/7):20</text>
164
+</g>
165
+<!-- 6&#45;&gt;7 -->
166
+<g id="edge6" class="edge">
167
+<title>6&#45;&gt;7</title>
168
+<path fill="none" stroke="#000000" d="M535.0678,-16.2147C575.7163,-13.0695 676.2556,-10.2303 746,-50 752.7443,-53.8457 759.0463,-59.3254 764.4332,-64.8928"/>
169
+<polygon fill="#000000" stroke="#000000" points="761.8824,-67.2907 771.1673,-72.3939 767.0914,-62.6145 761.8824,-67.2907"/>
170
+<text text-anchor="middle" x="655" y="-29.8" font-family="Times,serif" font-size="14.00" fill="#000000">(23/27):10</text>
171
+</g>
172
+</g>
173
+</svg>

+ 0
- 119
graphs/graph1.svg View File

@@ -1,119 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
3
- "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
-<!-- Generated by graphviz version 2.40.1 (20161225.0304)
5
- -->
6
-<!-- Title: finite_state_machine Pages: 1 -->
7
-<svg width="468pt" height="155pt"
8
- viewBox="0.00 0.00 468.00 155.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
9
-<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 151)">
10
-<title>finite_state_machine</title>
11
-<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-151 464,-151 464,4 -4,4"/>
12
-<!-- 0 -->
13
-<g id="node1" class="node">
14
-<title>0</title>
15
-<ellipse fill="none" stroke="#000000" cx="18" cy="-72" rx="18" ry="18"/>
16
-<text text-anchor="middle" x="18" y="-68.3" font-family="Times,serif" font-size="14.00" fill="#000000">0</text>
17
-</g>
18
-<!-- 1 -->
19
-<g id="node2" class="node">
20
-<title>1</title>
21
-<ellipse fill="none" stroke="#000000" cx="230" cy="-129" rx="18" ry="18"/>
22
-<text text-anchor="middle" x="230" y="-125.3" font-family="Times,serif" font-size="14.00" fill="#000000">1</text>
23
-</g>
24
-<!-- 0&#45;&gt;1 -->
25
-<g id="edge3" class="edge">
26
-<title>0&#45;&gt;1</title>
27
-<path fill="none" stroke="#000000" d="M33.7865,-81.2522C39.9557,-84.6211 47.1765,-88.269 54,-91 99.4559,-109.1933 111.9645,-111.5225 160,-121 173.6881,-123.7007 189.075,-125.5829 201.9295,-126.8399"/>
28
-<polygon fill="#000000" stroke="#000000" points="201.7645,-130.3391 212.0388,-127.7529 202.3942,-123.3675 201.7645,-130.3391"/>
29
-<text text-anchor="middle" x="124" y="-120.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/7)</text>
30
-</g>
31
-<!-- 2 -->
32
-<g id="node3" class="node">
33
-<title>2</title>
34
-<ellipse fill="none" stroke="#000000" cx="230" cy="-18" rx="18" ry="18"/>
35
-<text text-anchor="middle" x="230" y="-14.3" font-family="Times,serif" font-size="14.00" fill="#000000">2</text>
36
-</g>
37
-<!-- 0&#45;&gt;2 -->
38
-<g id="edge1" class="edge">
39
-<title>0&#45;&gt;2</title>
40
-<path fill="none" stroke="#000000" d="M33.5624,-62.5042C50.6578,-52.5764 79.2494,-37.429 106,-30 138.0931,-21.0873 176.447,-18.5552 201.9154,-17.9523"/>
41
-<polygon fill="#000000" stroke="#000000" points="202.0401,-21.4509 211.9857,-17.799 201.9335,-14.4517 202.0401,-21.4509"/>
42
-<text text-anchor="middle" x="124" y="-33.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/8)</text>
43
-</g>
44
-<!-- 3 -->
45
-<g id="node4" class="node">
46
-<title>3</title>
47
-<ellipse fill="none" stroke="#000000" cx="124" cy="-72" rx="18" ry="18"/>
48
-<text text-anchor="middle" x="124" y="-68.3" font-family="Times,serif" font-size="14.00" fill="#000000">3</text>
49
-</g>
50
-<!-- 0&#45;&gt;3 -->
51
-<g id="edge2" class="edge">
52
-<title>0&#45;&gt;3</title>
53
-<path fill="none" stroke="#000000" d="M36.4638,-72C52.8034,-72 76.9,-72 95.6768,-72"/>
54
-<polygon fill="#000000" stroke="#000000" points="95.7478,-75.5001 105.7478,-72 95.7478,-68.5001 95.7478,-75.5001"/>
55
-<text text-anchor="middle" x="71" y="-75.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/10)</text>
56
-</g>
57
-<!-- 4 -->
58
-<g id="node5" class="node">
59
-<title>4</title>
60
-<ellipse fill="none" stroke="#000000" cx="336" cy="-77" rx="18" ry="18"/>
61
-<text text-anchor="middle" x="336" y="-73.3" font-family="Times,serif" font-size="14.00" fill="#000000">4</text>
62
-</g>
63
-<!-- 1&#45;&gt;4 -->
64
-<g id="edge8" class="edge">
65
-<title>1&#45;&gt;4</title>
66
-<path fill="none" stroke="#000000" d="M245.0629,-118.54C251.3806,-114.3756 258.8975,-109.7034 266,-106 279.9421,-98.7302 296.1255,-91.9268 309.4176,-86.7392"/>
67
-<polygon fill="#000000" stroke="#000000" points="310.8396,-89.9428 318.9335,-83.1062 308.3428,-83.4032 310.8396,-89.9428"/>
68
-<text text-anchor="middle" x="283" y="-109.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/1)</text>
69
-</g>
70
-<!-- 5 -->
71
-<g id="node6" class="node">
72
-<title>5</title>
73
-<ellipse fill="none" stroke="#000000" cx="442" cy="-108" rx="18" ry="18"/>
74
-<text text-anchor="middle" x="442" y="-104.3" font-family="Times,serif" font-size="14.00" fill="#000000">5</text>
75
-</g>
76
-<!-- 1&#45;&gt;5 -->
77
-<g id="edge9" class="edge">
78
-<title>1&#45;&gt;5</title>
79
-<path fill="none" stroke="#000000" d="M248.0836,-128.5282C280.0821,-127.5014 348.7104,-124.4359 406,-116 408.7554,-115.5943 411.6138,-115.0954 414.4607,-114.5469"/>
80
-<polygon fill="#000000" stroke="#000000" points="415.4575,-117.9135 424.5166,-112.4195 414.0086,-111.0651 415.4575,-117.9135"/>
81
-<text text-anchor="middle" x="336" y="-128.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/21)</text>
82
-</g>
83
-<!-- 2&#45;&gt;4 -->
84
-<g id="edge4" class="edge">
85
-<title>2&#45;&gt;4</title>
86
-<path fill="none" stroke="#000000" d="M247.5773,-22.1058C262.3009,-26.0393 283.4971,-32.8836 300,-43 305.868,-46.5972 311.5868,-51.2698 316.6757,-55.9935"/>
87
-<polygon fill="#000000" stroke="#000000" points="314.5106,-58.7744 324.0851,-63.311 319.4295,-53.7939 314.5106,-58.7744"/>
88
-<text text-anchor="middle" x="283" y="-46.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/12)</text>
89
-</g>
90
-<!-- 3&#45;&gt;1 -->
91
-<g id="edge7" class="edge">
92
-<title>3&#45;&gt;1</title>
93
-<path fill="none" stroke="#000000" d="M140.6839,-79.438C155.0433,-85.9962 176.1987,-96.0348 194,-106 198.0407,-108.262 202.2519,-110.7888 206.31,-113.3166"/>
94
-<polygon fill="#000000" stroke="#000000" points="204.5111,-116.3206 214.8237,-118.7498 208.2768,-110.4198 204.5111,-116.3206"/>
95
-<text text-anchor="middle" x="177" y="-109.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/11)</text>
96
-</g>
97
-<!-- 3&#45;&gt;2 -->
98
-<g id="edge6" class="edge">
99
-<title>3&#45;&gt;2</title>
100
-<path fill="none" stroke="#000000" d="M137.2363,-59.5488C143.7245,-53.9303 151.8776,-47.5494 160,-43 173.3681,-35.5124 189.3939,-29.5925 202.7364,-25.3968"/>
101
-<polygon fill="#000000" stroke="#000000" points="203.7509,-28.7466 212.328,-22.527 201.7443,-22.0404 203.7509,-28.7466"/>
102
-<text text-anchor="middle" x="177" y="-46.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/2)</text>
103
-</g>
104
-<!-- 3&#45;&gt;4 -->
105
-<g id="edge5" class="edge">
106
-<title>3&#45;&gt;4</title>
107
-<path fill="none" stroke="#000000" d="M142.075,-72.4263C179.0769,-73.299 263.6846,-75.2944 307.9054,-76.3374"/>
108
-<polygon fill="#000000" stroke="#000000" points="307.891,-79.8379 317.9707,-76.5748 308.0561,-72.8399 307.891,-79.8379"/>
109
-<text text-anchor="middle" x="230" y="-77.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/5)</text>
110
-</g>
111
-<!-- 4&#45;&gt;5 -->
112
-<g id="edge10" class="edge">
113
-<title>4&#45;&gt;5</title>
114
-<path fill="none" stroke="#000000" d="M353.5037,-82.119C370.1518,-86.9878 395.4477,-94.3856 414.7371,-100.0269"/>
115
-<polygon fill="#000000" stroke="#000000" points="413.8898,-103.4256 424.4703,-102.8734 415.8547,-96.7071 413.8898,-103.4256"/>
116
-<text text-anchor="middle" x="389" y="-100.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/14)</text>
117
-</g>
118
-</g>
119
-</svg>

+ 0
- 119
graphs/graph1output_from_0_to_1.svg View File

@@ -1,119 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
3
- "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
-<!-- Generated by graphviz version 2.43.0 (0)
5
- -->
6
-<!-- Title: finite_state_machine Pages: 1 -->
7
-<svg width="480pt" height="155pt"
8
- viewBox="0.00 0.00 480.00 155.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
9
-<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 151)">
10
-<title>finite_state_machine</title>
11
-<polygon fill="white" stroke="transparent" points="-4,4 -4,-151 476,-151 476,4 -4,4"/>
12
-<!-- 0 -->
13
-<g id="node1" class="node">
14
-<title>0</title>
15
-<ellipse fill="none" stroke="black" cx="18" cy="-72" rx="18" ry="18"/>
16
-<text text-anchor="middle" x="18" y="-68.3" font-family="Times,serif" font-size="14.00">0</text>
17
-</g>
18
-<!-- 1 -->
19
-<g id="node2" class="node">
20
-<title>1</title>
21
-<ellipse fill="none" stroke="black" cx="242" cy="-129" rx="18" ry="18"/>
22
-<text text-anchor="middle" x="242" y="-125.3" font-family="Times,serif" font-size="14.00">1</text>
23
-</g>
24
-<!-- 0&#45;&gt;1 -->
25
-<g id="edge10" class="edge">
26
-<title>0&#45;&gt;1</title>
27
-<path fill="none" stroke="black" d="M33.96,-81.13C40.02,-84.56 47.19,-88.28 54,-91 101.87,-110.09 115.34,-111.57 166,-121 181.7,-123.92 199.45,-125.87 213.75,-127.12"/>
28
-<polygon fill="black" stroke="black" points="213.66,-130.62 223.91,-127.94 214.23,-123.65 213.66,-130.62"/>
29
-<text text-anchor="middle" x="130" y="-120.8" font-family="Times,serif" font-size="14.00">(7/7)</text>
30
-</g>
31
-<!-- 2 -->
32
-<g id="node3" class="node">
33
-<title>2</title>
34
-<ellipse fill="none" stroke="black" cx="242" cy="-18" rx="18" ry="18"/>
35
-<text text-anchor="middle" x="242" y="-14.3" font-family="Times,serif" font-size="14.00">2</text>
36
-</g>
37
-<!-- 0&#45;&gt;2 -->
38
-<g id="edge8" class="edge">
39
-<title>0&#45;&gt;2</title>
40
-<path fill="none" stroke="black" d="M33.94,-63.58C51.89,-53.86 83.2,-38.17 112,-30 135.28,-23.39 141.91,-25.36 166,-23 181.83,-21.45 199.6,-20.24 213.86,-19.4"/>
41
-<polygon fill="black" stroke="black" points="214.21,-22.89 224,-18.83 213.82,-15.9 214.21,-22.89"/>
42
-<text text-anchor="middle" x="130" y="-33.8" font-family="Times,serif" font-size="14.00">(0/8)</text>
43
-</g>
44
-<!-- 3 -->
45
-<g id="node4" class="node">
46
-<title>3</title>
47
-<ellipse fill="none" stroke="black" cx="130" cy="-72" rx="18" ry="18"/>
48
-<text text-anchor="middle" x="130" y="-68.3" font-family="Times,serif" font-size="14.00">3</text>
49
-</g>
50
-<!-- 0&#45;&gt;3 -->
51
-<g id="edge9" class="edge">
52
-<title>0&#45;&gt;3</title>
53
-<path fill="none" stroke="black" d="M36.19,-72C53.79,-72 81.39,-72 101.93,-72"/>
54
-<polygon fill="black" stroke="black" points="101.93,-75.5 111.93,-72 101.93,-68.5 101.93,-75.5"/>
55
-<text text-anchor="middle" x="74" y="-75.8" font-family="Times,serif" font-size="14.00">(10/10)</text>
56
-</g>
57
-<!-- 4 -->
58
-<g id="node5" class="node">
59
-<title>4</title>
60
-<ellipse fill="none" stroke="black" cx="348" cy="-77" rx="18" ry="18"/>
61
-<text text-anchor="middle" x="348" y="-73.3" font-family="Times,serif" font-size="14.00">4</text>
62
-</g>
63
-<!-- 1&#45;&gt;4 -->
64
-<g id="edge2" class="edge">
65
-<title>1&#45;&gt;4</title>
66
-<path fill="none" stroke="black" d="M257.28,-118.76C263.49,-114.54 270.94,-109.76 278,-106 291.89,-98.6 308.08,-91.71 321.29,-86.5"/>
67
-<polygon fill="black" stroke="black" points="322.65,-89.73 330.72,-82.87 320.13,-83.2 322.65,-89.73"/>
68
-<text text-anchor="middle" x="295" y="-109.8" font-family="Times,serif" font-size="14.00">(0/1)</text>
69
-</g>
70
-<!-- 5 -->
71
-<g id="node6" class="node">
72
-<title>5</title>
73
-<ellipse fill="none" stroke="black" cx="454" cy="-108" rx="18" ry="18"/>
74
-<text text-anchor="middle" x="454" y="-104.3" font-family="Times,serif" font-size="14.00">5</text>
75
-</g>
76
-<!-- 1&#45;&gt;5 -->
77
-<g id="edge3" class="edge">
78
-<title>1&#45;&gt;5</title>
79
-<path fill="none" stroke="black" d="M260.48,-128.57C292.09,-127.6 360.76,-124.62 418,-116 420.74,-115.59 423.58,-115.08 426.4,-114.52"/>
80
-<polygon fill="black" stroke="black" points="427.34,-117.89 436.36,-112.34 425.85,-111.06 427.34,-117.89"/>
81
-<text text-anchor="middle" x="348" y="-128.8" font-family="Times,serif" font-size="14.00">(0/21)</text>
82
-</g>
83
-<!-- 2&#45;&gt;4 -->
84
-<g id="edge1" class="edge">
85
-<title>2&#45;&gt;4</title>
86
-<path fill="none" stroke="black" d="M259.78,-21.94C274.34,-25.84 295.58,-32.72 312,-43 317.84,-46.66 323.51,-51.43 328.52,-56.23"/>
87
-<polygon fill="black" stroke="black" points="326.29,-58.95 335.78,-63.65 331.29,-54.05 326.29,-58.95"/>
88
-<text text-anchor="middle" x="295" y="-46.8" font-family="Times,serif" font-size="14.00">(0/12)</text>
89
-</g>
90
-<!-- 3&#45;&gt;1 -->
91
-<g id="edge7" class="edge">
92
-<title>3&#45;&gt;1</title>
93
-<path fill="none" stroke="black" d="M146.86,-78.34C162.28,-84.7 186.22,-95.1 206,-106 210.05,-108.23 214.25,-110.77 218.27,-113.33"/>
94
-<polygon fill="black" stroke="black" points="216.39,-116.29 226.67,-118.86 220.24,-110.44 216.39,-116.29"/>
95
-<text text-anchor="middle" x="186" y="-109.8" font-family="Times,serif" font-size="14.00">(10/11)</text>
96
-</g>
97
-<!-- 3&#45;&gt;2 -->
98
-<g id="edge6" class="edge">
99
-<title>3&#45;&gt;2</title>
100
-<path fill="none" stroke="black" d="M143.45,-59.74C149.79,-54.03 157.86,-47.52 166,-43 181.06,-34.64 199.39,-28.46 214.15,-24.34"/>
101
-<polygon fill="black" stroke="black" points="215.4,-27.64 224.18,-21.71 213.62,-20.87 215.4,-27.64"/>
102
-<text text-anchor="middle" x="186" y="-46.8" font-family="Times,serif" font-size="14.00">(0/2)</text>
103
-</g>
104
-<!-- 3&#45;&gt;4 -->
105
-<g id="edge5" class="edge">
106
-<title>3&#45;&gt;4</title>
107
-<path fill="none" stroke="black" d="M148.31,-72.4C185.77,-73.27 274.58,-75.32 319.69,-76.37"/>
108
-<polygon fill="black" stroke="black" points="319.83,-79.87 329.91,-76.6 319.99,-72.87 319.83,-79.87"/>
109
-<text text-anchor="middle" x="242" y="-77.8" font-family="Times,serif" font-size="14.00">(0/5)</text>
110
-</g>
111
-<!-- 4&#45;&gt;5 -->
112
-<g id="edge4" class="edge">
113
-<title>4&#45;&gt;5</title>
114
-<path fill="none" stroke="black" d="M365.71,-81.98C382.16,-86.88 407.53,-94.45 426.69,-100.16"/>
115
-<polygon fill="black" stroke="black" points="425.75,-103.53 436.33,-103.03 427.75,-96.82 425.75,-103.53"/>
116
-<text text-anchor="middle" x="401" y="-100.8" font-family="Times,serif" font-size="14.00">(0/14)</text>
117
-</g>
118
-</g>
119
-</svg>

+ 0
- 119
graphs/graph1output_from_0_to_4.svg View File

@@ -1,119 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
3
- "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
-<!-- Generated by graphviz version 2.43.0 (0)
5
- -->
6
-<!-- Title: finite_state_machine Pages: 1 -->
7
-<svg width="474pt" height="155pt"
8
- viewBox="0.00 0.00 474.00 155.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
9
-<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 151)">
10
-<title>finite_state_machine</title>
11
-<polygon fill="white" stroke="transparent" points="-4,4 -4,-151 470,-151 470,4 -4,4"/>
12
-<!-- 0 -->
13
-<g id="node1" class="node">
14
-<title>0</title>
15
-<ellipse fill="none" stroke="black" cx="18" cy="-72" rx="18" ry="18"/>
16
-<text text-anchor="middle" x="18" y="-68.3" font-family="Times,serif" font-size="14.00">0</text>
17
-</g>
18
-<!-- 1 -->
19
-<g id="node2" class="node">
20
-<title>1</title>
21
-<ellipse fill="none" stroke="black" cx="230" cy="-129" rx="18" ry="18"/>
22
-<text text-anchor="middle" x="230" y="-125.3" font-family="Times,serif" font-size="14.00">1</text>
23
-</g>
24
-<!-- 0&#45;&gt;1 -->
25
-<g id="edge5" class="edge">
26
-<title>0&#45;&gt;1</title>
27
-<path fill="none" stroke="black" d="M33.98,-81.08C40.04,-84.5 47.21,-88.24 54,-91 99.35,-109.46 111.97,-111.48 160,-121 173.68,-123.71 189.08,-125.6 201.85,-126.87"/>
28
-<polygon fill="black" stroke="black" points="201.59,-130.36 211.87,-127.78 202.23,-123.39 201.59,-130.36"/>
29
-<text text-anchor="middle" x="124" y="-120.8" font-family="Times,serif" font-size="14.00">(1/7)</text>
30
-</g>
31
-<!-- 2 -->
32
-<g id="node3" class="node">
33
-<title>2</title>
34
-<ellipse fill="none" stroke="black" cx="230" cy="-18" rx="18" ry="18"/>
35
-<text text-anchor="middle" x="230" y="-14.3" font-family="Times,serif" font-size="14.00">2</text>
36
-</g>
37
-<!-- 0&#45;&gt;2 -->
38
-<g id="edge4" class="edge">
39
-<title>0&#45;&gt;2</title>
40
-<path fill="none" stroke="black" d="M33.76,-62.87C50.57,-52.95 79.19,-37.52 106,-30 138.03,-21.01 176.38,-18.51 201.65,-17.93"/>
41
-<polygon fill="black" stroke="black" points="201.99,-21.43 211.94,-17.79 201.9,-14.43 201.99,-21.43"/>
42
-<text text-anchor="middle" x="124" y="-33.8" font-family="Times,serif" font-size="14.00">(8/8)</text>
43
-</g>
44
-<!-- 3 -->
45
-<g id="node4" class="node">
46
-<title>3</title>
47
-<ellipse fill="none" stroke="black" cx="124" cy="-72" rx="18" ry="18"/>
48
-<text text-anchor="middle" x="124" y="-68.3" font-family="Times,serif" font-size="14.00">3</text>
49
-</g>
50
-<!-- 0&#45;&gt;3 -->
51
-<g id="edge6" class="edge">
52
-<title>0&#45;&gt;3</title>
53
-<path fill="none" stroke="black" d="M36.17,-72C52.36,-72 76.87,-72 95.73,-72"/>
54
-<polygon fill="black" stroke="black" points="95.8,-75.5 105.8,-72 95.8,-68.5 95.8,-75.5"/>
55
-<text text-anchor="middle" x="71" y="-75.8" font-family="Times,serif" font-size="14.00">(7/10)</text>
56
-</g>
57
-<!-- 4 -->
58
-<g id="node5" class="node">
59
-<title>4</title>
60
-<ellipse fill="none" stroke="black" cx="342" cy="-77" rx="18" ry="18"/>
61
-<text text-anchor="middle" x="342" y="-73.3" font-family="Times,serif" font-size="14.00">4</text>
62
-</g>
63
-<!-- 1&#45;&gt;4 -->
64
-<g id="edge3" class="edge">
65
-<title>1&#45;&gt;4</title>
66
-<path fill="none" stroke="black" d="M245.23,-118.66C251.43,-114.42 258.89,-109.66 266,-106 281.73,-97.9 300.27,-90.72 314.98,-85.52"/>
67
-<polygon fill="black" stroke="black" points="316.16,-88.82 324.47,-82.26 313.88,-82.2 316.16,-88.82"/>
68
-<text text-anchor="middle" x="286" y="-109.8" font-family="Times,serif" font-size="14.00">(1/1)</text>
69
-</g>
70
-<!-- 5 -->
71
-<g id="node6" class="node">
72
-<title>5</title>
73
-<ellipse fill="none" stroke="black" cx="448" cy="-108" rx="18" ry="18"/>
74
-<text text-anchor="middle" x="448" y="-104.3" font-family="Times,serif" font-size="14.00">5</text>
75
-</g>
76
-<!-- 1&#45;&gt;5 -->
77
-<g id="edge2" class="edge">
78
-<title>1&#45;&gt;5</title>
79
-<path fill="none" stroke="black" d="M248.06,-128.64C280.27,-127.78 352.17,-124.93 412,-116 414.74,-115.59 417.58,-115.08 420.4,-114.52"/>
80
-<polygon fill="black" stroke="black" points="421.34,-117.9 430.36,-112.35 419.85,-111.06 421.34,-117.9"/>
81
-<text text-anchor="middle" x="342" y="-128.8" font-family="Times,serif" font-size="14.00">(0/21)</text>
82
-</g>
83
-<!-- 2&#45;&gt;4 -->
84
-<g id="edge10" class="edge">
85
-<title>2&#45;&gt;4</title>
86
-<path fill="none" stroke="black" d="M247.71,-21.3C263.55,-24.94 287.59,-31.8 306,-43 311.89,-46.58 317.57,-51.32 322.58,-56.12"/>
87
-<polygon fill="black" stroke="black" points="320.35,-58.84 329.84,-63.56 325.36,-53.96 320.35,-58.84"/>
88
-<text text-anchor="middle" x="286" y="-46.8" font-family="Times,serif" font-size="14.00">(10/12)</text>
89
-</g>
90
-<!-- 3&#45;&gt;1 -->
91
-<g id="edge7" class="edge">
92
-<title>3&#45;&gt;1</title>
93
-<path fill="none" stroke="black" d="M140.63,-79.03C154.81,-85.56 176.15,-95.79 194,-106 198.01,-108.3 202.19,-110.87 206.21,-113.44"/>
94
-<polygon fill="black" stroke="black" points="204.33,-116.4 214.61,-118.97 208.17,-110.55 204.33,-116.4"/>
95
-<text text-anchor="middle" x="177" y="-109.8" font-family="Times,serif" font-size="14.00">(0/11)</text>
96
-</g>
97
-<!-- 3&#45;&gt;2 -->
98
-<g id="edge9" class="edge">
99
-<title>3&#45;&gt;2</title>
100
-<path fill="none" stroke="black" d="M137.5,-59.84C143.85,-54.15 151.92,-47.62 160,-43 173.26,-35.41 189.24,-29.44 202.48,-25.25"/>
101
-<polygon fill="black" stroke="black" points="203.84,-28.49 212.41,-22.26 201.83,-21.79 203.84,-28.49"/>
102
-<text text-anchor="middle" x="177" y="-46.8" font-family="Times,serif" font-size="14.00">(2/2)</text>
103
-</g>
104
-<!-- 3&#45;&gt;4 -->
105
-<g id="edge8" class="edge">
106
-<title>3&#45;&gt;4</title>
107
-<path fill="none" stroke="black" d="M142.31,-72.4C179.77,-73.27 268.58,-75.32 313.69,-76.37"/>
108
-<polygon fill="black" stroke="black" points="313.83,-79.87 323.91,-76.6 313.99,-72.87 313.83,-79.87"/>
109
-<text text-anchor="middle" x="230" y="-77.8" font-family="Times,serif" font-size="14.00">(5/5)</text>
110
-</g>
111
-<!-- 4&#45;&gt;5 -->
112
-<g id="edge1" class="edge">
113
-<title>4&#45;&gt;5</title>
114
-<path fill="none" stroke="black" d="M359.71,-81.98C376.16,-86.88 401.53,-94.45 420.69,-100.16"/>
115
-<polygon fill="black" stroke="black" points="419.75,-103.53 430.33,-103.03 421.75,-96.82 419.75,-103.53"/>
116
-<text text-anchor="middle" x="395" y="-100.8" font-family="Times,serif" font-size="14.00">(0/14)</text>
117
-</g>
118
-</g>
119
-</svg>

+ 0
- 119
graphs/graph1output_from_0_to_5.svg View File

@@ -1,119 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
3
- "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
-<!-- Generated by graphviz version 2.40.1 (20161225.0304)
5
- -->
6
-<!-- Title: finite_state_machine Pages: 1 -->
7
-<svg width="484pt" height="155pt"
8
- viewBox="0.00 0.00 484.00 155.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
9
-<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 151)">
10
-<title>finite_state_machine</title>
11
-<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-151 480,-151 480,4 -4,4"/>
12
-<!-- 0 -->
13
-<g id="node1" class="node">
14
-<title>0</title>
15
-<ellipse fill="none" stroke="#000000" cx="18" cy="-72" rx="18" ry="18"/>
16
-<text text-anchor="middle" x="18" y="-68.3" font-family="Times,serif" font-size="14.00" fill="#000000">0</text>
17
-</g>
18
-<!-- 1 -->
19
-<g id="node2" class="node">
20
-<title>1</title>
21
-<ellipse fill="none" stroke="#000000" cx="236" cy="-129" rx="18" ry="18"/>
22
-<text text-anchor="middle" x="236" y="-125.3" font-family="Times,serif" font-size="14.00" fill="#000000">1</text>
23
-</g>
24
-<!-- 0&#45;&gt;1 -->
25
-<g id="edge4" class="edge">
26
-<title>0&#45;&gt;1</title>
27
-<path fill="none" stroke="#000000" d="M33.7664,-81.3031C39.933,-84.6783 47.1574,-88.3171 54,-91 101.9765,-109.8111 115.3731,-111.3814 166,-121 179.6129,-123.5863 194.885,-125.4502 207.6823,-126.7246"/>
28
-<polygon fill="#000000" stroke="#000000" points="207.4787,-130.2206 217.7593,-127.6593 208.1253,-123.2506 207.4787,-130.2206"/>
29
-<text text-anchor="middle" x="130" y="-120.8" font-family="Times,serif" font-size="14.00" fill="#000000">(7/7)</text>
30
-</g>
31
-<!-- 2 -->
32
-<g id="node3" class="node">
33
-<title>2</title>
34
-<ellipse fill="none" stroke="#000000" cx="236" cy="-18" rx="18" ry="18"/>
35
-<text text-anchor="middle" x="236" y="-14.3" font-family="Times,serif" font-size="14.00" fill="#000000">2</text>
36
-</g>
37
-<!-- 0&#45;&gt;2 -->
38
-<g id="edge3" class="edge">
39
-<title>0&#45;&gt;2</title>
40
-<path fill="none" stroke="#000000" d="M33.7199,-63.0658C51.9316,-53.1756 83.1404,-37.6259 112,-30 144.0194,-21.5392 182.0987,-18.9066 207.5327,-18.1571"/>
41
-<polygon fill="#000000" stroke="#000000" points="207.6821,-21.6548 217.6042,-17.9397 207.531,-14.6565 207.6821,-21.6548"/>
42
-<text text-anchor="middle" x="130" y="-33.8" font-family="Times,serif" font-size="14.00" fill="#000000">(8/8)</text>
43
-</g>
44
-<!-- 3 -->
45
-<g id="node4" class="node">
46
-<title>3</title>
47
-<ellipse fill="none" stroke="#000000" cx="130" cy="-72" rx="18" ry="18"/>
48
-<text text-anchor="middle" x="130" y="-68.3" font-family="Times,serif" font-size="14.00" fill="#000000">3</text>
49
-</g>
50
-<!-- 0&#45;&gt;3 -->
51
-<g id="edge5" class="edge">
52
-<title>0&#45;&gt;3</title>
53
-<path fill="none" stroke="#000000" d="M36.4945,-72C54.2718,-72 81.3816,-72 101.8413,-72"/>
54
-<polygon fill="#000000" stroke="#000000" points="101.8497,-75.5001 111.8496,-72 101.8496,-68.5001 101.8497,-75.5001"/>
55
-<text text-anchor="middle" x="74" y="-75.8" font-family="Times,serif" font-size="14.00" fill="#000000">(10/10)</text>
56
-</g>
57
-<!-- 4 -->
58
-<g id="node5" class="node">
59
-<title>4</title>
60
-<ellipse fill="none" stroke="#000000" cx="344" cy="-77" rx="18" ry="18"/>
61
-<text text-anchor="middle" x="344" y="-73.3" font-family="Times,serif" font-size="14.00" fill="#000000">4</text>
62
-</g>
63
-<!-- 1&#45;&gt;4 -->
64
-<g id="edge9" class="edge">
65
-<title>1&#45;&gt;4</title>
66
-<path fill="none" stroke="#000000" d="M251.0447,-118.5048C257.3595,-114.335 264.8794,-109.6684 272,-106 286.5561,-98.5011 303.5148,-91.5875 317.3161,-86.393"/>
67
-<polygon fill="#000000" stroke="#000000" points="318.5513,-89.668 326.728,-82.9307 316.1345,-83.0984 318.5513,-89.668"/>
68
-<text text-anchor="middle" x="289" y="-109.8" font-family="Times,serif" font-size="14.00" fill="#000000">(0/1)</text>
69
-</g>
70
-<!-- 5 -->
71
-<g id="node6" class="node">
72
-<title>5</title>
73
-<ellipse fill="none" stroke="#000000" cx="458" cy="-108" rx="18" ry="18"/>
74
-<text text-anchor="middle" x="458" y="-104.3" font-family="Times,serif" font-size="14.00" fill="#000000">5</text>
75
-</g>
76
-<!-- 1&#45;&gt;5 -->
77
-<g id="edge10" class="edge">
78
-<title>1&#45;&gt;5</title>
79
-<path fill="none" stroke="#000000" d="M254.0505,-128.6299C287.3912,-127.749 360.8144,-124.8861 422,-116 424.7562,-115.5997 427.6151,-115.1045 430.4623,-114.5581"/>
80
-<polygon fill="#000000" stroke="#000000" points="431.4581,-117.9251 440.5186,-112.4335 430.0111,-111.0763 431.4581,-117.9251"/>
81
-<text text-anchor="middle" x="344" y="-128.8" font-family="Times,serif" font-size="14.00" fill="#000000">(11/21)</text>
82
-</g>
83
-<!-- 2&#45;&gt;4 -->
84
-<g id="edge2" class="edge">
85
-<title>2&#45;&gt;4</title>
86
-<path fill="none" stroke="#000000" d="M253.508,-22.2205C268.1893,-26.2241 289.3623,-33.1067 306,-43 312.3392,-46.7695 318.5769,-51.6864 324.1079,-56.6048"/>
87
-<polygon fill="#000000" stroke="#000000" points="321.951,-59.3808 331.6351,-63.6782 326.7446,-54.2796 321.951,-59.3808"/>
88
-<text text-anchor="middle" x="289" y="-46.8" font-family="Times,serif" font-size="14.00" fill="#000000">(9/12)</text>
89
-</g>
90
-<!-- 3&#45;&gt;1 -->
91
-<g id="edge8" class="edge">
92
-<title>3&#45;&gt;1</title>
93
-<path fill="none" stroke="#000000" d="M146.6839,-79.438C161.0433,-85.9962 182.1987,-96.0348 200,-106 204.0407,-108.262 208.2519,-110.7888 212.31,-113.3166"/>
94
-<polygon fill="#000000" stroke="#000000" points="210.5111,-116.3206 220.8237,-118.7498 214.2768,-110.4198 210.5111,-116.3206"/>
95
-<text text-anchor="middle" x="183" y="-109.8" font-family="Times,serif" font-size="14.00" fill="#000000">(4/11)</text>
96
-</g>
97
-<!-- 3&#45;&gt;2 -->
98
-<g id="edge7" class="edge">
99
-<title>3&#45;&gt;2</title>
100
-<path fill="none" stroke="#000000" d="M143.2363,-59.5488C149.7245,-53.9303 157.8776,-47.5494 166,-43 179.3681,-35.5124 195.3939,-29.5925 208.7364,-25.3968"/>
101
-<polygon fill="#000000" stroke="#000000" points="209.7509,-28.7466 218.328,-22.527 207.7443,-22.0404 209.7509,-28.7466"/>
102
-<text text-anchor="middle" x="183" y="-46.8" font-family="Times,serif" font-size="14.00" fill="#000000">(1/2)</text>
103
-</g>
104
-<!-- 3&#45;&gt;4 -->
105
-<g id="edge6" class="edge">
106
-<title>3&#45;&gt;4</title>
107
-<path fill="none" stroke="#000000" d="M148.2455,-72.4263C185.5965,-73.299 271.0024,-75.2944 315.6404,-76.3374"/>
108
-<polygon fill="#000000" stroke="#000000" points="315.7216,-79.8401 325.8007,-76.5748 315.8852,-72.8421 315.7216,-79.8401"/>
109
-<text text-anchor="middle" x="236" y="-77.8" font-family="Times,serif" font-size="14.00" fill="#000000">(5/5)</text>
110
-</g>
111
-<!-- 4&#45;&gt;5 -->
112
-<g id="edge1" class="edge">
113
-<title>4&#45;&gt;5</title>
114
-<path fill="none" stroke="#000000" d="M361.8125,-81.8438C380.2175,-86.8486 409.1877,-94.7265 430.5287,-100.5297"/>
115
-<polygon fill="#000000" stroke="#000000" points="429.7446,-103.9435 440.3126,-103.1903 431.5814,-97.1888 429.7446,-103.9435"/>
116
-<text text-anchor="middle" x="402" y="-100.8" font-family="Times,serif" font-size="14.00" fill="#000000">(14/14)</text>
117
-</g>
118
-</g>
119
-</svg>

graphs/tests/graph1 → graphs/int/graph1 View File


graphs/tests/graph1update1 → graphs/int/graph1update1 View File


graphs/tests/graph1update2 → graphs/int/graph1update2 View File


graphs/tests/graph1update3 → graphs/int/graph1update3 View File


graphs/tests/graph1update4 → graphs/int/graph1update4 View File


graphs/graph2 → graphs/int/graph2 View File

@@ -22,4 +22,4 @@ e 3 7 1
22 22
 e 6 7 27
23 23
 e 3 6 24
24 24
 e 0 6 2
25
-e 4 2 2
25
+e 4 2 2

graphs/tests/resultUpdate1 → graphs/int/resultUpdate1 View File


graphs/tests/resultUpdate2 → graphs/int/resultUpdate2 View File


graphs/tests/resultUpdate3 → graphs/int/resultUpdate3 View File


graphs/tests/resultUpdate4 → graphs/int/resultUpdate4 View File


+ 29
- 0
src/FordFulkersonCost.ml View File

@@ -0,0 +1,29 @@
1
+open Flotcost
2
+open Gfile
3
+open Graph
4
+
5
+let () = (* Check the number of command-line arguments *)
6
+  if Array.length Sys.argv <> 6 then
7
+    begin
8
+      Printf.printf "\nUsage: %s infile source sink outfile outfile\n\n%!" Sys.argv.(0) ;
9
+      exit 0
10
+    end ;
11
+
12
+
13
+  (* Arguments are : infile(1) source-id(2) sink-id(3) outfile(4) *)
14
+
15
+  let infile = Sys.argv.(1)
16
+  and outfile = Sys.argv.(4)
17
+  and outfile_max = Sys.argv.(5)
18
+
19
+  (* These command-line arguments are not used for the moment. *)
20
+  and source = int_of_string Sys.argv.(2)
21
+  and sink = int_of_string Sys.argv.(3)
22
+  in
23
+
24
+  (* Open file *)
25
+  let graph = read_flot_graph_from_string_graph (from_file infile) in
26
+
27
+  (* NB : Constructeurs, Setteurs, et Getteurs ne seront pas testés *)
28
+  export outfile (export_string_graph_from_flot_graph graph);
29
+  export outfile_max (export_string_graph_from_flot_graph (ford_fulkerson graph source sink))

+ 119
- 0
src/bellmanford.ml View File

@@ -0,0 +1,119 @@
1
+open Graph
2
+open Path
3
+
4
+type 'a label_BF = {
5
+  node: id;
6
+  pere: id;
7
+  label: 'a option
8
+}
9
+
10
+let get_some = function
11
+  | Some a -> a 
12
+  | None -> raise (Failure "None")
13
+
14
+let maj_label_BF id new_pere new_label l = List.map (fun lab_BF -> if lab_BF.node = id then {node = id; pere = new_pere; label = Some new_label} else lab_BF) l
15
+
16
+let rec get_label_BF id = function
17
+  | [] -> raise (Failure "id doesn't exist")
18
+  | x :: next -> if x.node = id then x.label else get_label_BF id next
19
+
20
+let rec get_pere id = function
21
+  | [] -> raise (Failure "id doesn't exist")
22
+  | x :: next -> if x.node = id then x.pere else get_pere id next
23
+
24
+let init_tb_label_BF gr src label_nul = 
25
+  let liste = n_fold gr (fun l id -> {node = id; pere = -1; label = None} :: l) [] in
26
+  maj_label_BF src (-1) label_nul liste
27
+
28
+let rec print_tb_label_BF tos = function
29
+  | [] -> ()
30
+  | x :: next -> 
31
+    if x.label = None then (
32
+      Printf.printf "(Node->%d; Pere->%d; Label->%s)\n" x.node x.pere "None";
33
+      print_tb_label_BF tos next
34
+    ) else (
35
+      Printf.printf "(Node->%d; Pere->%d; Label->%s)\n" x.node x.pere (tos (get_some x.label));
36
+      print_tb_label_BF tos next
37
+    )
38
+
39
+let extract = function
40
+  | [] -> raise (Failure "File vide")
41
+  | x :: next -> (x, next)
42
+
43
+let rec exist y = function 
44
+  | [] -> false 
45
+  | x :: next -> if x = y then true else (exist y next)
46
+
47
+let insert y file = if exist y file then file else List.append file [y]
48
+
49
+(*let rec bellmanFord_iterations graph src k n tb file cmp sum = 
50
+  if (k = n) || file = [] then (
51
+    Printf.printf "Sortie\n";
52
+    tb
53
+  ) else (
54
+    Printf.printf "On passe pour k=%d\n" k;
55
+    let sum_costx_and_costxy x lbl_xy tb = sum (get_some (get_label_BF x tb)) lbl_xy in
56
+    let test_costs x y lbl_xy tb = if get_label_BF y tb = None then true else cmp (get_some (get_label_BF y tb)) (sum_costx_and_costxy x lbl_xy tb) in
57
+    let perform_test_and_maj x y lbl_xy tb file = 
58
+      Printf.printf "perform_test_and_maj entre %d et %d\n" x y;
59
+      if test_costs x y lbl_xy tb then ((maj_label_BF y x (sum_costx_and_costxy x lbl_xy tb) tb), (insert y file)) else (tb, file)
60
+    in
61
+    let (x, rest_file) = extract file in
62
+    let (new_tb, new_file) = List.fold_left (fun (tb1, file1) (y, lbl_xy) -> perform_test_and_maj x y lbl_xy tb1 file1) (tb, rest_file) (out_arcs graph x) in
63
+    print_tb_label_BF (fun x -> string_of_int x) new_tb;
64
+    bellmanFord_iterations graph src (k + 1) n new_tb new_file cmp sum
65
+  )
66
+
67
+  let bellmanFord graph src label_nul cmp sum = 
68
+  let tb = init_tb_label_BF graph src label_nul in
69
+  let n = n_fold graph (fun x id -> x + 1) 0 in
70
+  bellmanFord_iterations graph src 0 n tb [src] cmp sum*)
71
+
72
+let rec bellmanFord_iterations graph src k n tb continue cmp sum = 
73
+  if (k = n) then 
74
+    None
75
+  else (
76
+    if continue == false then
77
+      Some tb
78
+    else (
79
+      let sum_costy_and_costxy y lbl_xy tb = sum (get_some (get_label_BF y tb)) (get_some lbl_xy) in
80
+      let test_costs x y lbl_xy tb = 
81
+        if get_label_BF y tb = None then 
82
+          false 
83
+        else (
84
+          if get_label_BF x tb = None then 
85
+            true 
86
+          else 
87
+            cmp (get_some (get_label_BF x tb)) (sum_costy_and_costxy y lbl_xy tb)
88
+        ) 
89
+      in
90
+      let perform_test_and_maj x y lbl_xy tb continue = 
91
+        if test_costs x y lbl_xy tb then ((maj_label_BF x y (sum_costy_and_costxy y lbl_xy tb) tb), true) else (tb, continue)
92
+      in
93
+      let (new_tb, new_continue) = n_fold graph (fun (tb1, continue1) x -> if x == src then (tb1, continue1) else n_fold graph (fun (tb2, continue2) y -> if find_arc graph y x == None then (tb2, continue2) else perform_test_and_maj x y (find_arc graph y x) tb2 continue2) (tb1, continue1)) (tb, false) in
94
+      bellmanFord_iterations graph src (k + 1) n new_tb new_continue cmp sum
95
+    )
96
+  )
97
+
98
+let bellmanFord graph src label_nul cmp sum = 
99
+  let tb = init_tb_label_BF graph src label_nul in
100
+  let n = n_fold graph (fun x id -> x + 1) 0 in
101
+  bellmanFord_iterations graph src 0 n tb true cmp sum
102
+
103
+let rec create_path graph src dest path tb = 
104
+  if src = dest then
105
+    path
106
+  else (
107
+    let pere = get_pere dest tb in
108
+    if pere = (-1) then 
109
+      empty_path
110
+    else
111
+      create_path graph src pere (new_arc_in_path path pere dest (get_some (find_arc graph pere dest))) tb
112
+  )
113
+
114
+let shortest_path graph src dest label_nul cmp sum = 
115
+  let res = bellmanFord graph src label_nul cmp sum in
116
+  if res = None then
117
+    raise (Failure "Negative cost cycle detected")
118
+  else
119
+    create_path graph src dest empty_path (get_some res)

+ 10
- 0
src/bellmanford.mli View File

@@ -0,0 +1,10 @@
1
+open Graph
2
+open Path
3
+
4
+(* function that return the shortest path in the graph between two nodes (id) *)
5
+(* Required to ensure the polymorphism : 
6
+      - a label nul (ex : 0 for integers)
7
+      - a comparator (ex : > for integers)
8
+      - a "+" (ex : + for integers)                                            *)
9
+(* If no path is found return None *)
10
+val shortest_path: 'a graph -> id -> id -> 'a -> ('a -> 'a -> bool) -> ('a -> 'a -> 'a) -> 'a path

+ 45
- 0
src/flotcost.ml View File

@@ -0,0 +1,45 @@
1
+open Graph
2
+open Labelflotcost
3
+open Tools
4
+open Gfile
5
+open Path
6
+open Bellmanford
7
+
8
+type flotcost_graph = label_flot_cost graph
9
+
10
+(* PRIVATE : Fonction pour calculer un graphe d'écart *)
11
+let calculate_ecart gr = 
12
+  let res = clone_nodes gr in 
13
+  let calculate_ecart_un_arc gr id1 id2 lbl = 
14
+    if get_current_flot lbl = 0 then
15
+      new_arc gr id1 id2 (label_ecart lbl)
16
+    else (
17
+      if get_current_flot lbl = get_capacity lbl then
18
+        new_arc gr id2 id1 (label_ecart_reverse lbl)
19
+      else 
20
+        new_arc (new_arc gr id2 id1 (label_ecart_reverse lbl)) id1 id2 (label_ecart lbl)
21
+    )
22
+  in 
23
+  e_fold gr calculate_ecart_un_arc res
24
+
25
+(* PRIVATE : Fonction pour trouver le flot minimal sur le chemin *)
26
+let find_minimum_flot path = get_current_flot (get_minimum_label compare_current_flot path)
27
+
28
+(* Ford Fulkerson algorithm, takes one labelflot graph, one node origin and one node destination *)
29
+(* Return a flot_graph where the current_flot are set to maximise the flot between origin and destination *)
30
+let rec ford_fulkerson gr origin destination = 
31
+  let gr_ecart = calculate_ecart gr in
32
+  let path_found = shortest_path gr_ecart origin destination new_label compare sum in 
33
+  if is_path_empty path_found then
34
+    gr 
35
+  else (
36
+    let min_change = find_minimum_flot path_found in
37
+    let updated_graph = update gr path_found (fun lbl -> add_current_flot lbl min_change) (fun lbl -> reduce_current_flot lbl min_change) in
38
+    ford_fulkerson updated_graph origin destination)
39
+
40
+
41
+(* Fonctions pour récupérer et écrire des graphes dans les fichiers *)
42
+(* NB : Pour lire un graphe de flot, le fichier ne doit contenir qu'un seul int en label (la capacité) *)
43
+let read_flot_graph_from_string_graph graph = gmap graph string_to_label_flot
44
+let export_string_graph_from_flot_graph graph = gmap graph label_flot_to_string
45
+

+ 13
- 0
src/flotcost.mli View File

@@ -0,0 +1,13 @@
1
+open Gfile
2
+open Graph
3
+
4
+type flotcost_graph
5
+
6
+(* Fonctions pour récupérer et écrire des graphes dans les fichiers *)
7
+(* NB : Pour lire un graphe de flot, le fichier ne doit contenir qu'un seul int en label (la capacité) *)
8
+val read_flot_graph_from_string_graph: string graph -> flotcost_graph
9
+val export_string_graph_from_flot_graph:  flotcost_graph -> string graph
10
+
11
+(* Ford Fulkerson algorithm, takes one labelflot graph, one node origin and one node destination *)
12
+(* Return a flot_graph where the current_flot are set to maximise the flot between origin and destination *)
13
+val ford_fulkerson: flotcost_graph -> id -> id -> flotcost_graph 

+ 2
- 1
src/labelflot.ml View File

@@ -37,4 +37,5 @@ let label_flot_valid label = (0 <= label.current_flot && label.current_flot <= l
37 37
 (* Convert a label_flot into a string ((1, 2) -> "(1/2)") *)
38 38
 let label_flot_to_string label = "(" ^ string_of_int label.current_flot ^ "/" ^ string_of_int label.capacity ^ ")"
39 39
 
40
-let string_to_label_flot label = new_label_cap (int_of_string label)
40
+(* Convert a string (1/2) en label flot (1, 2) *)
41
+let string_to_label_flot label = Scanf.sscanf label "(%d/%d)" (fun flot cap -> {current_flot = flot; capacity = cap})

+ 1
- 0
src/labelflot.mli View File

@@ -35,4 +35,5 @@ val label_flot_valid: label_flot -> bool
35 35
 (* Convert a label_flot into a string ((1, 2) -> "(1/2)") *)
36 36
 val label_flot_to_string: label_flot -> string
37 37
 
38
+(* Convert a string (1/2) en label flot (1, 2) *)
38 39
 val string_to_label_flot: string -> label_flot 

+ 55
- 0
src/labelflotcost.ml View File

@@ -0,0 +1,55 @@
1
+(* Type utilisé pour le label d'un graphe de flots *)
2
+type label_flot_cost = {
3
+  current_flot: int;
4
+  capacity: int;
5
+  cost: int
6
+}
7
+
8
+(**************  CONSTRUCTORS  **************)
9
+
10
+(* The label null (0; 0) *)
11
+let new_label = {current_flot = 0; capacity = 0; cost = 0}
12
+(* label with capacity defined *)
13
+let new_label_cap cap = {current_flot = 0; capacity = cap; cost = 0}
14
+(* label with capacity and cost defined *)
15
+let new_label_cap_cost cap cst = {current_flot = 0; capacity = cap; cost = cst}
16
+
17
+(**************  OPERATIONS (ACCORDING TO COST) *****************)
18
+
19
+(* compare the cost of the two given labels (>) *)
20
+let compare l1 l2 = l1.cost > l2.cost
21
+(* sum the cost of the two given labels *)
22
+let sum l1 l2 = {l1 with cost = l1.cost + l2.cost}
23
+
24
+(**************  GETTERS  *****************)
25
+
26
+let get_current_flot label = label.current_flot
27
+let get_capacity label = label.capacity
28
+let get_cost label = label.cost
29
+
30
+(**************  SETTERS  *****************)
31
+
32
+let set_current_flot label fl = { label with current_flot = fl }
33
+let set_capacity label cap = { label with capacity = cap }
34
+let add_current_flot label fl = { label with current_flot = (get_current_flot label) + fl }
35
+let reduce_current_flot label fl = { label with current_flot = (get_current_flot label) - fl }
36
+let set_cost label cst = { label with cost = cst }
37
+
38
+(**************  SOME OTHER FUNCTIONS ***************)
39
+
40
+(* Compare two label_flot return true if the current_flot of the first argument is lower than the current_flot of the second one *)
41
+let compare_current_flot lbl1 lbl2 = (lbl1.current_flot < lbl2.current_flot)
42
+
43
+(* Return the ecart to the capacity ((1, 6) -> (5, 6)) *)
44
+let label_ecart label = { label with current_flot = (label.capacity - label.current_flot) }
45
+
46
+(* Return the same label with oposite cost *)
47
+let label_ecart_reverse label = {label with cost = (- label.cost)}
48
+
49
+(* Check if a given label_flot is valid (0 <= current_flot <= capacity) *)
50
+let label_flot_valid label = (0 <= label.current_flot && label.current_flot <= label.capacity)
51
+
52
+(* Convert a label_flot into a string ((1, 2) -> "(1/2)") *)
53
+let label_flot_to_string label = "(" ^ string_of_int label.current_flot ^ "/" ^ string_of_int label.capacity ^ "):"^ string_of_int label.cost 
54
+
55
+let string_to_label_flot label = Scanf.sscanf label "(%d/%d):%d" (fun flot cap cst -> {current_flot = flot; capacity = cap; cost = cst})

+ 52
- 0
src/labelflotcost.mli View File

@@ -0,0 +1,52 @@
1
+
2
+(* Types utilisés pour le label d'un graphe de flots avec cout*)
3
+type label_flot_cost
4
+
5
+(**************  CONSTRUCTORS  **************)
6
+
7
+(* The label null (0; 0; 0) *)
8
+val new_label: label_flot_cost
9
+(* label with capacity defined *)
10
+val new_label_cap: int -> label_flot_cost
11
+(* label with capacity and cost defined *)
12
+val new_label_cap_cost: int -> int -> label_flot_cost
13
+
14
+(**************  OPERATIONS (ACCORDING TO COST) *****************)
15
+
16
+(* compare the cost of the two given labels (>) *)
17
+val compare: label_flot_cost -> label_flot_cost -> bool
18
+(* sum the cost of the two given labels *)
19
+val sum: label_flot_cost -> label_flot_cost -> label_flot_cost
20
+
21
+(**************  GETTERS  *****************)
22
+
23
+val get_current_flot: label_flot_cost -> int
24
+val get_capacity: label_flot_cost -> int
25
+val get_cost: label_flot_cost -> int
26
+
27
+(**************  SETTERS  *****************)
28
+
29
+val set_current_flot: label_flot_cost -> int -> label_flot_cost
30
+val add_current_flot: label_flot_cost -> int -> label_flot_cost
31
+val reduce_current_flot: label_flot_cost -> int -> label_flot_cost
32
+val set_capacity: label_flot_cost -> int -> label_flot_cost
33
+val set_cost: label_flot_cost -> int -> label_flot_cost
34
+
35
+(**************  SOME OTHER FUNCTIONS ***************)
36
+
37
+(* Compare two label_flot return true if the current_flot of the first argument is lower than the current_flot of the second one *)
38
+val compare_current_flot: label_flot_cost -> label_flot_cost -> bool
39
+
40
+(* Return the ecart to the capacity ((1, 6, x) -> (5, 6, x)) *)
41
+val label_ecart: label_flot_cost -> label_flot_cost
42
+
43
+(* Return the same label with oposite cost *)
44
+val label_ecart_reverse: label_flot_cost -> label_flot_cost
45
+
46
+(* Check if a given label_flot is valid (0 <= current_flot <= capacity) *)
47
+val label_flot_valid: label_flot_cost -> bool
48
+
49
+(* Convert a label_flot into a string ((1, 2, 3) -> "(1/2):3") *)
50
+val label_flot_to_string: label_flot_cost -> string
51
+
52
+val string_to_label_flot: string -> label_flot_cost

+ 0
- 0
src/labelflotcosttest.ml View File


+ 3
- 3
src/tools.ml View File

@@ -53,9 +53,9 @@ let findWay g id1 id2 =
53 53
   let s = [id1] in(*file de l'algo, qui commence avec le noeud de départ*)
54 54
   let (isFound,res,a) = loop_findWay g id2 id1 s in
55 55
   res
56
-  (* if not isFound then (Printf.printf "Rien trouvé\n"; 
57
-                       res)
58
-  else (Printf.printf "Trouvé un truc\n"; res) *)
56
+(* if not isFound then (Printf.printf "Rien trouvé\n"; 
57
+                     res)
58
+   else (Printf.printf "Trouvé un truc\n"; res) *)
59 59
 
60 60
 let rec isValid g f = e_fold g (fun acu id1 id2 info -> if (f info) then (true && acu) else false) true 
61 61
 

+ 1
- 1
src/toolstest.ml View File

@@ -7,7 +7,7 @@ open Path
7 7
 
8 8
 let () = 
9 9
   (* Open file *)
10
-  let graph = from_file "graphs/tests/graph1" in
10
+  let graph = from_file "graphs/int/graph1" in
11 11
 
12 12
   (* NB : Constructeurs, Setteurs, et Getteurs ne seront pas testés *)
13 13
   let () = 

Loading…
Cancel
Save