generate_sparse6¶
-
generate_sparse6
(G, nodes=None, header=True)[source]¶ Generate sparse6 format string from an undirected graph.
Parameters: Returns: s – String in sparse6 format
Return type: Raises: NetworkXError
– If the graph is directedExamples
>>> G = nx.MultiGraph([(0, 1), (0, 1), (0, 1)]) >>> nx.generate_sparse6(G) '>>sparse6<<:A_'
See also
Notes
The format does not support edge or node labels.
References
Sparse6 specification: http://cs.anu.edu.au/~bdm/data/formats.txt for details.