Add all the edges in ebunch to the graph. ebunch: Container of 2tuples (u,v). The container must be iterable or an iterator. It is iterated over once. Adding the same edge twice has no effect and does not raise an exception. Reimplemented in networkx::base::DiGraph, networkx::tree::Tree, networkx::xbase::XGraph, and networkx::xbase::XDiGraph. Definition at line 588 of file base.py. 00588 : """Add all the edges in ebunch to the graph. ebunch: Container of 2tuples (u,v). The container must be iterable or an iterator. It is iterated over once. Adding the same edge twice has no effect and does not raise an exception. """ for e in ebunch: (u,v)=e # add nodes if u not in self.adj: self.adj[u]={} if v not in self.adj: self.adj[v]={} # don't create self loops, fail silently, nodes are still added if u==v: continue self.adj[u][v]=None self.adj[v][u]=None # add both uv and vu
