min spanning tree and shorest path