Conditions | 4 |
Total Lines | 14 |
Lines | 14 |
Ratio | 100 % |
Changes | 0 |
1 | import unittest |
||
27 | def test_cc(self): |
||
28 | G = create_digraph_4_strongly_connected_components() |
||
29 | |||
30 | cc = StronglyConnectedComponents(G) |
||
31 | print('strongly connected component count: ' + str(cc.count())) |
||
32 | |||
33 | self.assertEqual(5, cc.count()) |
||
34 | |||
35 | for v in range(G.vertex_count()): |
||
36 | print('id[' + str(v) + ']: ' + str(cc.id(v))) |
||
37 | for v in range(G.vertex_count()): |
||
38 | r = randint(0, G.vertex_count() - 1) |
||
39 | if cc.connected(v, r): |
||
40 | print(str(v) + ' is connected to ' + str(r)) |
||
41 | |||
45 |