title: Prim's Algorithm input parameter (values) in Python
body: <p>I have looked at the following prim's algorithm (in order to create a minimum spanning tree) and I am unsure as to what the input value s in the following code is, I think the G of course would be the graph sent (adjacency matrix or list graphs) and I think the value s is where the start should be? Also if it is the start then in what way would you send a starting value to the following algorithm?:</p>
  
  <pre><code>from heapq import heappop, heappush
  
  def prim(self, G, s): 
      P, Q = {}, [(0, None, s)] 
      while Q: 
          _, p, u = heappop(Q) 
          if u in P: continue 
          P[u] = p 
          for v, w in G[u].items(): 
              heappush(Q, (w, u, v)) 
      return P 
  </code></pre>
  
  <p>Any help will be much appreciated, thank you!</p>