20 lines
448 B
Python
20 lines
448 B
Python
"""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()
|