Added method return type and resolved merge conflics

This commit is contained in:
Joelkurien 2024-10-26 03:18:39 +11:00
commit 5a87d4fe9e

View File

@ -1,9 +1,10 @@
import heapq
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/
# 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 = []
@ -46,8 +47,8 @@ class JohnsonGraph:
distances[v] = distances[u] + w
return distances
#perform the johnson algorithm to handle the negative weights that
# perform the johnson algorithm to handle the negative weights that
# could not be handled by either the dijkstra
#or the bellman ford algorithm efficiently
def johnson_algo(self) -> dict: