Minimum Spanning Tree with Prim's algorithm