Parse GML graph from a string or iterable.
Parameters: | lines : string or iterable
|
---|---|
Returns: | G : Graph or DiGraph |
Raises: | ImportError :
|
Notes
This doesn’t implement the complete GML specification for nested attributes for graphs, edges, and nodes.
Requires pyparsing: http://pyparsing.wikispaces.com/
References
GML specification: http://www.infosun.fim.uni-passau.de/Graphlet/GML/gml-tr.html
Examples
>>> G=nx.path_graph(4)
>>> nx.write_gml(G,'test.gml')
>>> fh=open('test.gml')
>>> H=nx.read_gml(fh)