minimum Spanning Tree
Computes the Minimum Spanning Tree (MST) of the graph using Prim's algorithm.
If the graph is unweighted, it is first converted to a weighted graph with default edge weights.
Return
A pair containing the total weight of the MST and the graph representing the MST.
Throws
Illegal State Exception
If the graph is empty or not fully connected.