from_sparse6_bytes

from_sparse6_bytes(string)[source]

Read an undirected graph in sparse6 format from string.

Parameters
stringstring

Data in sparse6 format

Returns
GGraph
Raises
NetworkXError

If the string is unable to be parsed in sparse6 format

References

1

Sparse6 specification <http://users.cecs.anu.edu.au/~bdm/data/formats.html>

Examples

>>> G = nx.from_sparse6_bytes(b":A_")
>>> sorted(G.edges())
[(0, 1), (0, 1), (0, 1)]