Skip to content
Snippets Groups Projects
Verified Commit 1afdae7c authored by Claudio Scheer's avatar Claudio Scheer
Browse files

Update tests

parent a0b3d261
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,8 @@ def a_star(graph, start_node, goal_node, heuristic):
graph, start_node, goal_node = get_graph_1()
path = a_star(graph, start_node, goal_node, max_cost)
print(f"Start node: {start_node.id}. Goal node: {goal_node.id}")
print("-" * 5, end="")
print("Solution plan", end="")
print("-" * 5)
for x in path:
print(x.id)
print("-" * 30)
......@@ -7,12 +7,16 @@ def get_graph_1():
node_2 = Node(2)
node_3 = Node(3)
node_4 = Node(4)
node_5 = Node(5)
node_6 = Node(6)
graph.set_bidirectional_neighbor(node_1, node_2, 1)
graph.set_bidirectional_neighbor(node_1, node_3, 1)
graph.set_bidirectional_neighbor(node_2, node_4, 1)
graph.set_bidirectional_neighbor(node_3, node_4, 1)
graph.set_bidirectional_neighbor(node_3, node_5, 1)
graph.set_bidirectional_neighbor(node_5, node_6, 1)
graph.add_nodes([node_1, node_2, node_3, node_4])
graph.add_nodes([node_1, node_2, node_3, node_4, node_5, node_6])
return graph, node_1, node_4
return graph, node_1, node_6
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment