graph: Adjust calculation to match exercise
This commit is contained in:
19
dijsktra.py
Normal file
19
dijsktra.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""
|
||||
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]}")
|
||||
Reference in New Issue
Block a user