title: Fastest way to run prim's on a growing range of coordinates
body: <p>I was hoping someone could give me a general method for computing the MST for a problem that works from input that is formatted as such:</p>
  
  <pre><code>&lt;number of vertices&gt;
  &lt;x&gt; &lt;y&gt;
  &lt;x&gt; &lt;y&gt;
  ...
  </code></pre>
  
  <p>I understand how to implement prim's algorithm, but I was looking for a method that (using prim's algorithm) will require the least amount of memory/time to execute.  Should I store everything in an adjacency matrix?  If the number of vertices grows to say, 10,000, what is the optimal way to solve this problem (assuming prim's is used)?</p>