summaryrefslogtreecommitdiffstats
path: root/server.py
diff options
context:
space:
mode:
authorGustav Sörnäs <gusso230@student.liu.se>2020-11-12 14:14:27 +0100
committerGustav Sörnäs <gusso230@student.liu.se>2020-11-20 13:39:20 +0100
commita178b3088fa8e90a080926c79d608497e4b56448 (patch)
treeaab6b3bba61c829b2c59c79d4eb83d461e6431dd /server.py
parent0ebe417a8c9edd12d9e87f3843006eba510c97f9 (diff)
downloadtdde25-a178b3088fa8e90a080926c79d608497e4b56448.tar.gz
count and store iterations in search algorithm
Diffstat (limited to 'server.py')
-rw-r--r--server.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/server.py b/server.py
index f86cc60..d2bc8cc 100644
--- a/server.py
+++ b/server.py
@@ -29,7 +29,7 @@ def shortest_path(body):
source_id = algorithms.get_closest_node_id(nodes, store.Node(-1, body['lat1'], body['lng1']))
target_id = algorithms.get_closest_node_id(nodes, store.Node(-1, body['lat2'], body['lng2']))
- path = algorithms.find_shortest_path(nodes, source_id, target_id)
+ path, iterations = algorithms.find_shortest_path(nodes, source_id, target_id)
edges = []
for i in range(len(path)-1):
edges.append({"path": [[nodes[path[i]].lat, nodes[path[i]].lng],