Added four functions to Prim's algortihm.