Skip to content

Commit 8fc6818

Browse files
committed
Merge branch 'joel_graph' of https://github.com/joelkurien/Python into joel_graph
2 parents 6269fd6 + b911a55 commit 8fc6818

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎graphs/johnson_graph.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def add_edge(self, u: str, v: str, w: int) -> None:
3131
# perform a dijkstra algorithm on a directed graph
3232
def dijkstra(self, s: str) -> dict:
3333
"""
34-
Computes the shortest path from vertex `s`
34+
Computes the shortest path from vertex `s`
3535
to all other vertices using Dijkstra's algorithm.
3636
"""
3737
distances = {vertex: sys.maxsize - 1 for vertex in self.graph}
@@ -52,7 +52,7 @@ def dijkstra(self, s: str) -> dict:
5252
# carry out the bellman ford algorithm for a node and estimate its distance vector
5353
def bellman_ford(self, s: str) -> dict:
5454
"""
55-
Computes the shortest path from vertex `s`
55+
Computes the shortest path from vertex `s`
5656
to all other vertices using the Bellman-Ford algorithm.
5757
"""
5858
distances = {vertex: sys.maxsize - 1 for vertex in self.graph}
@@ -70,7 +70,7 @@ def bellman_ford(self, s: str) -> dict:
7070
# or the bellman ford algorithm efficiently
7171
def johnson_algo(self) -> list[dict]:
7272
"""
73-
Computes the shortest paths between
73+
Computes the shortest paths between
7474
all pairs of vertices using Johnson's algorithm.
7575
"""
7676
self.add_vertices("#")

0 commit comments

Comments
 (0)