Warning

This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.

networkx.readwrite.graph6.from_graph6_bytes

from_graph6_bytes(string)[source]

Read a simple undirected graph in graph6 format from string.

Parameters:

string (string) – Data in graph6 format, without a trailing newline.

Returns:

G

Return type:

Graph

Raises:
  • NetworkXError – If the string is unable to be parsed in graph6 format
  • ValueError – If any character c in the input string does not satisfy 63 <= ord(c) < 127.

Examples

>>> G = nx.from_graph6_bytes(b'A_')
>>> sorted(G.edges())
[(0, 1)]

References

[1]Graph6 specification <http://users.cecs.anu.edu.au/~bdm/data/formats.html>