commit 3e5ecb39ffa933018b1043b54d602ff1378b03d1 Author: flyingscorpio@arch-desktop Date: Sun Dec 5 20:27:39 2021 +0100 First commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c9b568f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.pyc +*.swp diff --git a/README.md b/README.md new file mode 100644 index 0000000..1f134b8 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Dijkstra's Shortest Path Algorithm + +This is an implementation of Dijkstra's Shortest Path Algorithm in python diff --git a/algorithm.py b/algorithm.py new file mode 100644 index 0000000..a0ac355 --- /dev/null +++ b/algorithm.py @@ -0,0 +1,20 @@ +"""Dijkstra's Shortest Path Algorithm""" + + +def main() -> None: + """Implementation of the Shortest Path algorithm""" + + neighbors = { + "a": [("b", 6), ("d", 1)], + "b": [("a", 6), ("c", 5), ("e", 2)], + "c": [("b", 5), ("e", 5)], + "d": [("a", 1), ("b", 2), ("e", 1)], + "e": [("b", 2), ("c", 5), ("d", 1)], + } + + visited = [] + unvisted = ["a", "b", "c", "d", "e"] + + +if __name__ == "__main__": + main()