From 1354c8317945ace08145128f03a26ee4e02ddd9e Mon Sep 17 00:00:00 2001 From: Stefan Hansson Date: Wed, 16 Dec 2020 09:25:24 +0100 Subject: Remove redundant changes --- algorithms.py | 6 +----- 1 file changed, 1 insertion(+), 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 -- cgit v1.2.1