Example #1
0
 def test_solveAstar(self):
     g = self.g
     g = graph.graph_from_text(g.text)
     a = astar.AStar(g)
     start = astar.getNode(g.nodes(), 0)
     end = astar.getNode(g.nodes(), 3)
     res = a.start(start, end)
     assert res is not None
     assert res != []
     assert res == [3, 2, 0]
Example #2
0
 def test_solveDijkstra(self):
     g = self.g
     g = graph.graph_from_text(g.text)
     d = dijkstra.Dijkstra(g)
     res = d.start(0)
     assert res == {0: 0, 1: 10, 2: 15, 3: 18}