First commit

This commit is contained in:
flyingscorpio@arch-desktop 2021-12-05 20:27:39 +01:00
commit 3e5ecb39ff
3 changed files with 25 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*.pyc
*.swp

3
README.md Normal file
View file

@ -0,0 +1,3 @@
# Dijkstra's Shortest Path Algorithm
This is an implementation of Dijkstra's Shortest Path Algorithm in python

20
algorithm.py Normal file
View file

@ -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()