Package com.jgalgo

Interface MinimumSpanningTree


  • public interface MinimumSpanningTree
    Minimum spanning tree algorithm.

    A spanning tree is an edge sub set of the graph edges which form a tree and connect (span) all the vertices of the graph. A minimum spanning tree (MST) is a spanning tree with the minimum edge weights sum over all spanning trees.

    Author:
    Barak Ugav
    See Also:
    Wikipedia, MinimumDirectedSpanningTree
    • Method Detail

      • computeMinimumSpanningTree

        MinimumSpanningTree.Result computeMinimumSpanningTree​(Graph g,
                                                              WeightFunction w)
        Compute the minimum spanning tree (MST) of a given graph.
        Parameters:
        g - a graph
        w - an edge weight function
        Returns:
        a result object containing all the edges of the computed spanning tree, which there are \(n-1\) of them (or less, forming a forest if the graph is not connected)