summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--algorithms.py3
-rw-r--r--store.py1
2 files changed, 1 insertions, 3 deletions
diff --git a/algorithms.py b/algorithms.py
index f8d2e50..9f3fd78 100644
--- a/algorithms.py
+++ b/algorithms.py
@@ -77,7 +77,7 @@ 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):
+ if min_node is None or length < min_value:
min_node = node
min_value = length
@@ -114,6 +114,5 @@ def find_shortest_path(nodes, source_id, target_id):
new_dist = walk_dist + length_haversine(nodes[walk_end], neighbour)
new_walk = walk + (neighbour.id,)
heapq.heappush(queue, (new_dist, new_walk))
-
# no path found
return None
diff --git a/store.py b/store.py
index 34c0f0b..2930e19 100644
--- a/store.py
+++ b/store.py
@@ -128,7 +128,6 @@ def make_forest(nodes):
# becomes the root of each node since it will be the same for all nodes
# in the same tree due our use of union-find.
forest = defaultdict(dict)
-
for node_id, node in nodes.items():
forest[node.find_root().id][node_id] = node