summaryrefslogtreecommitdiffstats
path: root/algorithms.py
diff options
context:
space:
mode:
Diffstat (limited to 'algorithms.py')
-rw-r--r--algorithms.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/algorithms.py b/algorithms.py
index f39910c..1a62118 100644
--- a/algorithms.py
+++ b/algorithms.py
@@ -11,4 +11,13 @@ def length_haversine(p1, p2):
a = math.sin(dlat / 2) ** 2 + math.cos(lat1) * math.cos(lat2) * math.sin(dlng / 2) ** 2
c = 2 * math.asin(math.sqrt(a))
- return 6372797.560856 * c # return the distance in meters \ No newline at end of file
+ return 6372797.560856 * c # return the distance in meters
+
+def get_closest_node_id(nodes, source_node):
+ """ Search through all nodes and return the id of the node
+ that is closest to 'source_node'. """
+ pass
+
+def find_shortest_path(nodes, source_id, target_id):
+ """ Return the shortest path using Dijkstra's algortihm. """
+ return [] \ No newline at end of file