From c5b378ffe7c38ca483b1b592731379824dae75de Mon Sep 17 00:00:00 2001 From: Aurora Date: Mon, 12 Sep 2022 18:34:15 +0200 Subject: [PATCH] from SimpleWeightedEdge to Edge --- src/spanningtrees/kruskal.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spanningtrees/kruskal.jl b/src/spanningtrees/kruskal.jl index 12111fa59..cc6518b40 100644 --- a/src/spanningtrees/kruskal.jl +++ b/src/spanningtrees/kruskal.jl @@ -14,7 +14,7 @@ function kruskal_mst end connected_vs = IntDisjointSets(nv(g)) - mst = Vector{edgetype(g)}() + mst = Vector{Edge{U}}() sizehint!(mst, nv(g) - 1) weights = Vector{T}() @@ -27,7 +27,7 @@ function kruskal_mst end for e in edge_list[sortperm(weights; rev=!minimize)] if !in_same_set(connected_vs, src(e), dst(e)) union!(connected_vs, src(e), dst(e)) - push!(mst, e) + push!(mst, Edge(src(e), dst(e))) (length(mst) >= nv(g) - 1) && break end end