Skip to content

Commit c01ccb9

Browse files
Added Borůvka's algorithm, a graph algorithm that finds the minimum spanning tree. Solved Test Cases Errors.
1 parent ac6a863 commit c01ccb9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

graphs/boruvka.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,14 @@ def boruvka(self) -> None:
112112
of the edge we're observing to it"""
113113

114114
if (
115-
minimum_weight_edge[u_component] == -1
116-
or minimum_weight_edge[u_component][2] > w
117-
):
115+
minimum_weight_edge[u_component] == -1
116+
or minimum_weight_edge[u_component][2] > w
117+
):
118118
minimum_weight_edge[u_component] = [u, v, w]
119119
if (
120-
minimum_weight_edge[v_component] == -1
121-
or minimum_weight_edge[v_component][2] > w
122-
):
120+
minimum_weight_edge[v_component] == -1
121+
or minimum_weight_edge[v_component][2] > w
122+
):
123123
minimum_weight_edge[v_component] = [u, v, w]
124124

125125
for node in range(self.m_v):

0 commit comments

Comments
 (0)