Lazy Prim's Minimal Spanning Tree Trace

Enter three integers separated by spaces that give the number of vertices, number of directed edges, and a source vertex for a graph, respectively. A random weighted graph with these parameters will be created and the minimal spanning tree for the component of the graph containing the source will be found in accordance with the lazy version of Prim's algorithm.

Note, if the graph generated is not connected (i.e., it has more than one component), the tree identified as the minimal spanning tree will obviously not span the entire graph -- just the component containing the source.