docs: def minimum_spanning_tree_prim(self, source, display = None,
                                     q = PriorityQueue()):
          '''
          API: minimum_spanning_tree_prim(self, source, display = None,
                                          q = PriorityQueue())
          Description:
          Determines a minimum spanning tree of all nodes reachable
          from source using Prim's Algorithm.
          Input:
              source: Name of source node.
              display: Display method.
              q: Data structure that holds nodes to be processed in a queue.
          Post:
              'color', 'distance', 'component' attribute of nodes and edges may
              change.
          Return:
              Returns predecessor tree in dictionary format.
          '''
          if display == None:
              display = self.attr['display']
          else:
              self.set_display_mode(display)
          if isinstance(q, PriorityQueue):
              addToQ = q.push
              removeFromQ = q.pop
              peek = q.peek
              isEmpty = q.isEmpty
          neighbors = self.get_neighbors
          pred = {}
          addToQ(source)
          done = False
          while not isEmpty() and not done:
              current = removeFromQ()
              self.set_node_attr(current, 'color', 'blue')
              if current != source:
                  self.set_edge_attr(pred[current], current, 'color', 'green')
              self.display()
              for n in neighbors(current):
                  if self.get_node_attr(n, 'color') != 'green':
                      self.set_edge_attr(current, n, 'color', 'yellow')
                      self.display()
                      new_estimate = self.get_edge_attr(current, n, 'cost')
                      if not n in pred or new_estimate < peek(n)[0]:
                          pred[n] = current
                          self.set_node_attr(n, 'color', 'red')
                          self.set_node_attr(n, 'label', new_estimate)
                          addToQ(n, new_estimate)
                          self.display()
                          self.set_node_attr(n, 'color', 'black')
                      self.set_edge_attr(current, n, 'color', 'black')
              self.set_node_attr(current, 'color', 'green')
              self.display()
          return pred