I need the edge end points from a graph. I have installed networkx. I have some idea how to proceed.
networkx.Graph.edges_iter() returns all the edges in the graph
[e for e in G.edges_iter()]
[(0, 1), (1, 2), (2, 3)]
What I want is a list [0,1,1,2,2,3]
How do I get this from the above data?
You may not need
list(...)because its already iterable.And you may also try
itertools.chain(G.edges_iter())directly