Resolved issues regarding ruff testing and merge conflicts

This commit is contained in:
Joelkurien 2024-10-26 03:10:30 +11:00
commit 346a955946
2 changed files with 24 additions and 23 deletions

View File

@ -503,6 +503,7 @@
* [Graphs Floyd Warshall](graphs/graphs_floyd_warshall.py) * [Graphs Floyd Warshall](graphs/graphs_floyd_warshall.py)
* [Greedy Best First](graphs/greedy_best_first.py) * [Greedy Best First](graphs/greedy_best_first.py)
* [Greedy Min Vertex Cover](graphs/greedy_min_vertex_cover.py) * [Greedy Min Vertex Cover](graphs/greedy_min_vertex_cover.py)
* [Johnson Graph](graphs/johnson_graph.py)
* [Kahns Algorithm Long](graphs/kahns_algorithm_long.py) * [Kahns Algorithm Long](graphs/kahns_algorithm_long.py)
* [Kahns Algorithm Topo](graphs/kahns_algorithm_topo.py) * [Kahns Algorithm Topo](graphs/kahns_algorithm_topo.py)
* [Karger](graphs/karger.py) * [Karger](graphs/karger.py)

View File

@ -52,7 +52,6 @@ class JohnsonGraph:
# could not be handled by either the dijkstra # could not be handled by either the dijkstra
#or the bellman ford algorithm efficiently #or the bellman ford algorithm efficiently
def johnson_algo(self): def johnson_algo(self):
self.add_vertices("#") self.add_vertices("#")
for v in self.graph: for v in self.graph:
if v != "#": if v != "#":
@ -79,6 +78,7 @@ class JohnsonGraph:
distances.append(new_dist) distances.append(new_dist)
return distances return distances
g = JohnsonGraph() g = JohnsonGraph()
# this a complete connected graph # this a complete connected graph
g.add_vertices("A") g.add_vertices("A")