summaryrefslogtreecommitdiffstats
path: root/algorithms.py
diff options
context:
space:
mode:
authorGustav Sörnäs <gusso230@student.liu.se>2020-11-06 10:54:18 +0100
committerGustav Sörnäs <gusso230@student.liu.se>2020-11-06 10:54:18 +0100
commit606c3eebe19114bcd2d07546a7c7d800ca84973f (patch)
treeadea85a0a826a226fbec9bc0d908b56838a8fa16 /algorithms.py
parentd2791410cc886ef9f1fbed7b9525477963b8b994 (diff)
downloadtdde25-606c3eebe19114bcd2d07546a7c7d800ca84973f.tar.gz
more comments
Diffstat (limited to 'algorithms.py')
-rw-r--r--algorithms.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/algorithms.py b/algorithms.py
index 9d83b26..6e01287 100644
--- a/algorithms.py
+++ b/algorithms.py
@@ -33,8 +33,9 @@ def get_closest_node_id(nodes, source_node):
def find_shortest_path(nodes, source_id, target_id):
""" Return the shortest path using Dijkstra's algortihm. """
- # queue contains multiple (path_length, (node_0, node_1, ... node_n))-tuples
+ # queue contains multiple (walk_dist, (node_0, node_1, ... node_n))-tuples
# where (node_0, node_1, ... node_n) is a walk to node_n
+ # and walk_dist is the total length of the walk in meters
queue = [(0, (source_id,))]
visited = set()