Code Duplication    Length = 26-27 lines in 2 locations

tests/algorithms/graphs/util.py 2 locations

@@ 144-170 (lines=27) @@
141
    return g
142
143
144
def create_digraph_4_strongly_connected_components():
145
    graph = Digraph(13)
146
    graph.add_edge(4, 2)
147
    graph.add_edge(2, 3)
148
    graph.add_edge(3, 2)
149
    graph.add_edge(6, 0)
150
    graph.add_edge(0, 1)
151
    graph.add_edge(2, 0)
152
    graph.add_edge(11, 12)
153
    graph.add_edge(12, 9)
154
    graph.add_edge(9, 10)
155
    graph.add_edge(9, 11)
156
    graph.add_edge(8, 9)
157
    graph.add_edge(10, 12)
158
    graph.add_edge(11, 4)
159
    graph.add_edge(4, 3)
160
    graph.add_edge(3, 5)
161
    graph.add_edge(7, 8)
162
    graph.add_edge(8, 7)
163
    graph.add_edge(5, 4)
164
    graph.add_edge(0, 5)
165
    graph.add_edge(6, 4)
166
    graph.add_edge(6, 9)
167
    graph.add_edge(7, 6)
168
169
    return graph
170
171
172
def create_flow_network():
173
    g = FlowNetwork(8)
@@ 37-62 (lines=26) @@
34
    return g
35
36
37
def create_digraph():
38
    g = Digraph(13)
39
    g.add_edge(4, 2)
40
    g.add_edge(2, 3)
41
    g.add_edge(3, 2)
42
    g.add_edge(6, 0)
43
    g.add_edge(0, 1)
44
    g.add_edge(2, 0)
45
    g.add_edge(11, 12)
46
    g.add_edge(12, 9)
47
    g.add_edge(9, 10)
48
    g.add_edge(9, 11)
49
    g.add_edge(7, 9)
50
    g.add_edge(10, 12)
51
    g.add_edge(11, 4)
52
    g.add_edge(4, 3)
53
    g.add_edge(3, 5)
54
    g.add_edge(6, 8)
55
    g.add_edge(8, 6)
56
    g.add_edge(5, 4)
57
    g.add_edge(0, 5)
58
    g.add_edge(6, 4)
59
    g.add_edge(6, 9)
60
    g.add_edge(7, 6)
61
62
    return g
63
64
65
def create_dag():