Skip to content

Commit aba7767

Browse files
Added Borůvka's algorithm, a graph algorithm that finds the minimum spanning tree. Code Changes.
1 parent e9af60a commit aba7767

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

graphs/boruvka.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ def boruvka(self) -> None:
114114
we're observing to it"""
115115

116116
if (
117-
minimum_weight_edge[u_component] == -1
118-
or minimum_weight_edge[u_component][2] > w
117+
minimum_weight_edge[u_component] == -1
118+
or minimum_weight_edge[u_component][2] > w
119119
):
120120
minimum_weight_edge[u_component] = [u, v, w]
121121
if (
122-
minimum_weight_edge[v_component] == -1
123-
or minimum_weight_edge[v_component][2] > w
122+
minimum_weight_edge[v_component] == -1
123+
or minimum_weight_edge[v_component][2] > w
124124
):
125125
minimum_weight_edge[v_component] = [u, v, w]
126126

0 commit comments

Comments
 (0)