NetworkX

Previous topic

networkx.read_pajek

Next topic

networkx.parse_pajek

networkx.write_pajek

write_pajek(G, path)

Write in Pajek format to path.

Parameters:

G : graph

A networkx graph

path : file or string

File or filename to write. Filenames ending in .gz or .bz2 will be compressed.

Examples

>>> G=nx.path_graph(4)
>>> nx.write_pajek(G, "test.net")