a minimum spanning tree implemented in C++ using a minpriority queue