Functor providing an implementation of Prim's minimum-spanning-tree algorithm. Parameter W ensures that label on edges are comparable.
W