diff --git a/graphs/johnson_graph.py b/graphs/johnson_graph.py index cdd00c0ef..33fd8fb08 100644 --- a/graphs/johnson_graph.py +++ b/graphs/johnson_graph.py @@ -1,14 +1,16 @@ import heapq +from typing import Dict, List import sys + # First implementation of johnson algorithm # Steps followed to implement this algorithm is given in the below link: # https://brilliant.org/wiki/johnsons-algorithm/ class JohnsonGraph: def __init__(self) -> None: - self.edges = [] - self.graph = {} + self.edges: List[str] = [] + self.graph: Dict[str, int] = {} # add vertices for a graph def add_vertices(self, u) -> None: