Skip to content

Commit 5a87d4f

Browse files
committed
Added method return type and resolved merge conflics
2 parents a1ff5c9 + e3db05b commit 5a87d4f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

graphs/johnson_graph.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import heapq
22
import sys
33

4-
#First implementation of johnson algorithm
5-
#Steps followed to implement this algorithm is given in the below link:
6-
#https://brilliant.org/wiki/johnsons-algorithm/
4+
5+
# First implementation of johnson algorithm
6+
# Steps followed to implement this algorithm is given in the below link:
7+
# https://brilliant.org/wiki/johnsons-algorithm/
78
class JohnsonGraph:
89
def __init__(self) -> None:
910
self.edges = []
@@ -46,8 +47,8 @@ def bellman_ford(self, s) -> dict:
4647
distances[v] = distances[u] + w
4748

4849
return distances
49-
50-
#perform the johnson algorithm to handle the negative weights that
50+
51+
# perform the johnson algorithm to handle the negative weights that
5152
# could not be handled by either the dijkstra
5253
#or the bellman ford algorithm efficiently
5354
def johnson_algo(self) -> dict:

0 commit comments

Comments
 (0)