Python implementation of Prim's algorithm which gives us a "minimum-spanning-tree"