| Total Complexity | 4 |
| Total Lines | 10 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import unittest |
||
| 7 | class DepthFirstSearchUnitTest(unittest.TestCase): |
||
| 8 | def test_dfs(self): |
||
| 9 | g = create_graph() |
||
| 10 | s = 0 |
||
| 11 | dfs = DepthFirstSearch(g, s) |
||
| 12 | |||
| 13 | for v in range(1, g.vertex_count()): |
||
| 14 | if dfs.hasPathTo(v): |
||
| 15 | print(str(s) + ' is connected to ' + str(v)) |
||
| 16 | print('path is ' + ' => '.join([str(i) for i in dfs.pathTo(v)])) |
||
| 17 | |||
| 21 |