Skip to content

Commit 091cb7d

Browse files
committed
Fix boruvka_mst
1 parent 426f776 commit 091cb7d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/abstractnamedgraph.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ function boruvka_mst(
221221
distmx::AbstractMatrix{<:Real}=weights(g);
222222
minimize=true,
223223
)
224-
parent_mst = boruvka_mst(parent_graph(g), distmx; minimize)
225-
return parent_edges_to_edges(g, parent_mst)
224+
parent_mst, weights = boruvka_mst(parent_graph(g), distmx; minimize)
225+
return parent_edges_to_edges(g, parent_mst), weights
226226
end
227227

228228
function kruskal_mst(

test/test_namedgraph.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,9 @@ end
221221
@test length(ps) == 100
222222
@test ps[(8, 1)] == 7
223223

224-
es = boruvka_mst(g)
224+
es, weights = boruvka_mst(g)
225225
@test length(es) == 99
226+
@test weights == 99
226227
@test es isa Vector{NamedEdge{Tuple{Int,Int}}}
227228

228229
es = kruskal_mst(g)

0 commit comments

Comments
 (0)