Fixed a bug in the node testing function.
Minimum spanning tree of a weighted graph.