Skip to main content
`Ctrl`+`K`

# from_sparse6_bytes

from_sparse6_bytes(string)

  Read an undirected graph in sparse6 format from string.

  Parameters:
    string string

      Data in sparse6 format

  Returns:
    G Graph
  Raises:
    NetworkXError

      If the string is unable to be parsed in sparse6 format

  See also

  `read_sparse6`, `write_sparse6`

  References

  [1]

  Sparse6 specification <https://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)]