From f80afa35a855b88ca7f21c09075fbc1cdf875cb3 Mon Sep 17 00:00:00 2001 From: Joelkurien Date: Sat, 26 Oct 2024 03:23:20 +1100 Subject: [PATCH] Added type annotation for variables --- graphs/johnson_graph.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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: