20 lines
512 B
Python
20 lines
512 B
Python
"""
|
|
This module holds the logic for the solving
|
|
"""
|
|
|
|
|
|
class Dijkstra():
|
|
def __init__(self, graph: dict):
|
|
"""
|
|
table: matrix with vertex as key, price and prev vertex as value
|
|
OL: open list, to keep track of finished vertecis
|
|
"""
|
|
self.graph = graph
|
|
self.table = {}
|
|
self.OL = []
|
|
|
|
def algorithm(self):
|
|
print("Performing Dijkstra on the following graph...")
|
|
for vertex in self.graph:
|
|
print(f"{vertex}: {self.graph[vertex]}")
|