Added type annotation for variables

This commit is contained in:
Joelkurien 2024-10-26 03:23:20 +11:00
parent 5a87d4fe9e
commit f80afa35a8

View File

@ -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: