prim :: (Ord a) => WeightedGraph a Int -> a -> WeightedGraph a Int