summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Hansson <steha708@edu.liu.se>2020-12-16 09:25:24 +0100
committerNewbyte <steha708@liu.se>2020-12-16 09:25:24 +0100
commit1354c8317945ace08145128f03a26ee4e02ddd9e (patch)
tree02b6c10e69e08a3fa0c3994c3857341c42949c9b
parentb965cf506f0614263a0a4884621e439b40cab356 (diff)
downloadtdde25-1354c8317945ace08145128f03a26ee4e02ddd9e.tar.gz
Remove redundant changes
-rw-r--r--algorithms.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/algorithms.py b/algorithms.py
index 7ff395c..f8d2e50 100644
--- a/algorithms.py
+++ b/algorithms.py
@@ -77,7 +77,6 @@ def get_closest_node(nodes, source_node):
for node in nodes:
length = length_haversine(source_node, node)
-
if (min_node is None or length < min_value):
min_node = node
min_value = length
@@ -103,13 +102,10 @@ def find_shortest_path(nodes, source_id, target_id):
if walk_end in visited:
# there exists a shorter walk to walk_end
continue
-
# otherwise this is the shortest walk to walk_end
visited.add(walk_end)
# consider all our neighbours
- end_node = nodes[walk_end]
-
- for neighbour in end_node.neighbours:
+ for neighbour in nodes[walk_end].neighbours:
if neighbour in visited:
# there exists a shorter walk to neighbour
continue