sbromberger / LightGraphs.jl

An optimized graphs package for the Julia programming language
Other
671 stars 184 forks source link

Kruskal's algorithm #766

Closed TransGirlCodes closed 6 years ago

TransGirlCodes commented 6 years ago

Can LightGraphs be used to do Kruskal's algorithm or similar to get the minimum spanning tree of a set of vertices?

sbromberger commented 6 years ago

We have kruskal_mst, though the docs seem to have disappeared:

"""
    kruskal_mst(g, distmx=weights(g))

Return a vector of edges representing the minimum spanning tree of a connected, undirected graph `g` with optional
distance matrix `distmx` using [Kruskal's algorithm](https://en.wikipedia.org/wiki/Kruskal%27s_algorithm).
"""
sbromberger commented 6 years ago

@Ward9250 I hope this solved your issue - if not, feel free to respond here and I'll re-open.