NetworkX

Previous topic

networkx.readwrite.gpickle.read_gpickle

Next topic

GraphML

networkx.readwrite.gpickle.write_gpickle

networkx.readwrite.gpickle.write_gpickle(G, path)

Write graph in Python pickle format.

Pickles are a serialized byte stream of a Python object [R194]. This format will preserve Python objects used as nodes or edges.

Parameters :

G : graph

A NetworkX graph

path : file or string

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

References

[R194](1, 2) http://docs.python.org/library/pickle.html

Examples

>>> G=nx.path_graph(4)
>>> nx.write_gpickle(G,"test.gpickle")