Data structure implementation of minimum spanning tree algorithm