Read an undirected graph in sparse6 format from path.
Parameters: | path : file or string
|
---|---|
Returns: | G : Graph/Multigraph or list of Graphs/MultiGraphs
|
Raises: | NetworkXError :
|
See also
References
Sparse6 specification: http://cs.anu.edu.au/~bdm/data/formats.txt
Examples
>>> nx.write_sparse6(nx.Graph([(0,1),(0,1),(0,1)]), 'test.s6')
>>> G = nx.read_sparse6('test.s6')
>>> sorted(G.edges())
[(0, 1)]