def add_edge(self, edge, wt=<NUM_LIT:1>, label='<STR_LIT>', attrs=[]):
u, v = edge<EOL>if (v not in self.node_neighbors[u] and u not in self.node_neighbors[v]):<EOL><INDENT>self.node_neighbors[u].append(v)<EOL>if (u != v):<EOL><INDENT>self.node_neighbors[v].append(u)<EOL><DEDENT>self.add_edge_attributes((u,v), attrs)        <EOL>self.set_edge_properties((u, v), label=label, weight=wt)<EOL><DEDENT>else:<EOL><INDENT>raise AdditionError("<STR_LIT>" % (u, v))<EOL><DEDENT>
Add an 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.