summaryrefslogtreecommitdiffstats
path: root/algorithms.py
diff options
context:
space:
mode:
authorjullinator <justus.karlsson@hotmail.se>2018-08-30 19:21:53 +0200
committerjullinator <justus.karlsson@hotmail.se>2018-08-30 19:21:53 +0200
commitb35f002e1a453a12d104bbba6cd6ca354d18fcb6 (patch)
tree0bb717527fc3f0f35c535dc1fcc65d84dec0c145 /algorithms.py
parente3b6cb5c1cf67286409ae5f9789f203e6beddff1 (diff)
downloadtdde25-b35f002e1a453a12d104bbba6cd6ca354d18fcb6.tar.gz
leaflet updated
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