Conditions | 4 |
Total Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | import unittest |
||
8 | def test_shortest_path(self): |
||
9 | g = create_edge_weighted_digraph() |
||
10 | s = 0 |
||
11 | dijkstra = DijkstraShortestPath(g, s) |
||
12 | for v in range(1, g.vertex_count()): |
||
13 | if dijkstra.hasPathTo(v): |
||
14 | print(str(s) + ' is connected to ' + str(v)) |
||
15 | print('shortest path is ' + ' .. '.join([str(i) for i in dijkstra.shortestPathTo(v)])) |
||
16 | print('path length is ' + str(dijkstra.path_length_to(v))) |
||
17 | |||
20 | unittest.main() |