minimum Spanning Tree
Computes the Minimum Spanning Tree (MST) of the graph using Prim's algorithm.
Assumes the graph is undirected, i.e. that each edge exists in both directions (e.g. added with connect()). Does not work on Grids with deleted nodes.
Return
A pair containing the total weight of the MST and a graph whose edges represents the MST.
Throws
If the graph is empty or not fully connected.