NetworkX

Previous topic

networkx.readwrite.gexf.relabel_gexf_graph

Next topic

networkx.readwrite.gexf.write_gexf

networkx.readwrite.gexf.read_gexf

networkx.readwrite.gexf.read_gexf(path, node_type=<type 'str'>, relabel=False)

Read graph in GEXF format from path.

“GEXF (Graph Exchange XML Format) is a language for describing complex networks structures, their associated data and dynamics” [R126].

Parameters :

path : file or string

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

node_type: Python type (default: str) :

Convert node ids to this type

relabel : bool (default: False)

If True relabel the nodes to use the GEXF node “label” attribute instead of the node “id” attribute as the NetworkX node label.

Returns :

graph: NetworkX graph :

If no parallel edges are found a Graph or DiGraph is returned. Otherwise a MultiGraph or MultiDiGraph is returned.

Notes

This implementation does not support mixed graphs (directed and unidirected edges together).

References

[R126](1, 2) GEXF graph format, http://gexf.net/format/