def add_edge(self, source, target):
    """Returns a new edge connecting source and target vertices.

    Args:
      source: The source Vertex.
      target: The target Vertex.

    Returns:
      A new Edge linking source to target.
    """
    edge = Edge(len(self.edges))
    self.edges.append(edge)
    source.out_edges.append(edge.idx)
    target.in_edges.append(edge.idx)
    edge.source = source.idx
    edge.target = target.idx
    return edge
def add_edge ( self , source , target ) : edge = Edge ( len ( self . edges ) ) self . edges . append ( edge ) source . out_edges . append ( edge . idx ) target . in_edges . append ( edge . idx ) edge . source = source . idx edge . target = target . idx return edge
Returns a new edge connecting source and target vertices.

    Args:
      source: The source Vertex.
      target: The target Vertex.

    Returns:
      A new Edge linking source to target.