NetworkX

Previous topic

networkx.write_multiline_adjlist

Next topic

networkx.read_edgelist

Edge ListΒΆ

Read and write NetworkX graphs as edge lists.

You can read or write three formats of edge lists with these functions.

Node pairs:

1 2 # no data

Dictionary as data:

1 2 {'weight':7, 'color':'green'} 

Arbitrary data:

1 2 7 green

See the read_edgelist() function for details and examples.

read_edgelist(path[, comments, delimiter, ...]) Read a graph from a list of edges.
write_edgelist(G, path[, comments, ...]) Write graph as a list of edges.
read_weighted_edgelist(path[, comments, ...]) Read list of edges with numeric weights.
write_weighted_edgelist(G, path[, comments, ...]) Write graph G as a list of edges with numeric weights.