write_graph6¶
-
write_graph6
(G, path, nodes=None, header=True)[source]¶ Write a simple undirected graph to path in graph6 format.
Parameters: Raises: NetworkXError
– If the graph is directed or has parallel edgesExamples
>>> G = nx.Graph([(0, 1)]) >>> nx.write_graph6(G, 'test.g6')
See also
Notes
The format does not support edge or node labels, parallel edges or self loops. If self loops are present they are silently ignored.
References
Graph6 specification: http://cs.anu.edu.au/~bdm/data/formats.txt for details.