Return an iterator over the edges.
Parameters: | nbunch : list, iterable
data : bool
|
---|---|
Returns: | An iterator over edges that are adjacent to any node in nbunch, : or over all edges if nbunch is not specified. : |
Examples
>>> G=nx.path_graph(4)
>>> G.edges()
[(0, 1), (1, 2), (2, 3)]
>>> G.edges(data=True) # default edge data is 1
[(0, 1, 1), (1, 2, 1), (2, 3, 1)]