code: def new_edge(self, node_a, node_b, cost=1):
          
  
          # Verify that both nodes exist in the graph
          try:
              self.nodes[node_a]
          except KeyError:
              raise NonexistentNodeError(node_a)
          try:
              self.nodes[node_b]
          except KeyError:
              raise NonexistentNodeError(node_b)
  
          # Create the new edge
          edge_id = self.generate_edge_id()
  
          edge = {'id': edge_id,
                  'vertices': (node_a, node_b),
                  'cost': cost,
                  'data': {}
          }
  
          self.edges[edge_id] = edge
          self.nodes[node_a]['edges'].append(edge_id)
  
          self._num_edges += 1
  
          return edge_id
docs: Adds a new edge from node_a to node_b that has a cost.
          Returns the edge id of the new edge.