Skip to content

Commit f80afa3

Browse files
committed
Added type annotation for variables
1 parent 5a87d4f commit f80afa3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

graphs/johnson_graph.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import heapq
2+
from typing import Dict, List
23
import sys
34

45

6+
57
# First implementation of johnson algorithm
68
# Steps followed to implement this algorithm is given in the below link:
79
# https://brilliant.org/wiki/johnsons-algorithm/
810
class JohnsonGraph:
911
def __init__(self) -> None:
10-
self.edges = []
11-
self.graph = {}
12+
self.edges: List[str] = []
13+
self.graph: Dict[str, int] = {}
1214

1315
# add vertices for a graph
1416
def add_vertices(self, u) -> None:

0 commit comments

Comments
 (0)