Ejemplo n.º 1
0
 def test_floyd_warshall(self):
     g = Graph.build(self.input_matrix)
     assert floyd_warshall(g.adjacency_matrix) == self.expected
Ejemplo n.º 2
0
 def test_dijkstra_shortest_path(self):
     g = Graph.build(self.matrix)
     assert dijkstra_shortest_path(
         g, 0) == [0.0, 4.0, 12.0, 19.0, 21.0, 11.0, 9.0, 8.0, 15.0]