mst: Prim's minimum spannig tree