(self, edge, wt = 1, label="", attrs = [])
Add an directed edge to the graph connecting two nodes.
        
        An edge, here, is a pair of nodes like C{(n, m)}.

        @type  edge: tuple
        @param edge: Edge.
        
        @type  wt: number
        @param wt: Edge weight.
        
        @type  label: string
        @param label: Edge label.
        
        @type  attrs: list
        @param attrs: List of node attributes specified as (attribute, value) tuples.
Add an directed edge to the graph connecting two nodes.
        
        An edge, here, is a pair of nodes like C{(n, m)}.
Add an directed edge to the graph connecting two nodes . An edge here is a pair of nodes like C { ( n m ) } .
def add_edge(self, edge, wt = 1, label="", attrs = []):
        """
        Add an directed edge to the graph connecting two nodes.
        
        An edge, here, is a pair of nodes like C{(n, m)}.

        @type  edge: tuple
        @param edge: Edge.
        
        @type  wt: number
        @param wt: Edge weight.
        
        @type  label: string
        @param label: Edge label.
        
        @type  attrs: list
        @param attrs: List of node attributes specified as (attribute, value) tuples.
        """
        u, v = edge
        for n in [u,v]:
            if not n in self.node_neighbors:
                raise AdditionError( "%s is missing from the node_neighbors table" % n )
            if not n in self.node_incidence:
                raise AdditionError( "%s is missing from the node_incidence table" % n )
            
        if v in self.node_neighbors[u] and u in self.node_incidence[v]:
            raise AdditionError("Edge (%s, %s) already in digraph" % (u, v))
        else:
            self.node_neighbors[u].append(v)
            self.node_incidence[v].append(u)
            self.set_edge_weight((u, v), wt)
            self.add_edge_attributes( (u, v), attrs )
            self.set_edge_properties( (u, v), label=label, weight=wt )
def add_edge ( self , edge , wt = 1 , label = "" , attrs = [ ] ) : u , v = edge for n in [ u , v ] : if not n in self . node_neighbors : raise AdditionError ( "%s is missing from the node_neighbors table" % n ) if not n in self . node_incidence : raise AdditionError ( "%s is missing from the node_incidence table" % n ) if v in self . node_neighbors [ u ] and u in self . node_incidence [ v ] : raise AdditionError ( "Edge (%s, %s) already in digraph" % ( u , v ) ) else : self . node_neighbors [ u ] . append ( v ) self . node_incidence [ v ] . append ( u ) self . set_edge_weight ( ( u , v ) , wt ) self . add_edge_attributes ( ( u , v ) , attrs ) self . set_edge_properties ( ( u , v ) , label = label , weight = wt )