Skip to main content
`Ctrl`+`K`

# SparseGraph6

Functions for reading and writing graphs in the graph6 or sparse6 file formats.

According to the author of these formats,

> graph6 and sparse6 are formats for storing undirected graphs in a compact manner, using only printable ASCII characters. Files in these formats have text type and contain one line per graph.

> graph6 is suitable for small graphs, or large dense graphs. sparse6 is more space-efficient for large sparse graphs.

> —graph6 and sparse6 homepage

## Graph6

Functions for reading and writing graphs in the graph6 format.

The graph6 file format is suitable for small graphs or large dense graphs. For large sparse graphs, use the sparse6 format.

For more information, see the graph6 homepage.

`from_graph6_bytes`(bytes_in) | Read a simple undirected graph in graph6 format from bytes.
`read_graph6`(path) | Read simple undirected graphs in graph6 format from path.
`to_graph6_bytes`(G[, nodes, header]) | Convert a simple undirected graph to bytes in graph6 format.
`write_graph6`(G, path[, nodes, header]) | Write a simple undirected graph to a path in graph6 format.

## Sparse6

Functions for reading and writing graphs in the sparse6 format.

The sparse6 file format is a space-efficient format for large sparse graphs. For small graphs or large dense graphs, use the graph6 file format.

For more information, see the sparse6 homepage.

`from_sparse6_bytes`(string) | Read an undirected graph in sparse6 format from string.
`read_sparse6`(path) | Read an undirected graph in sparse6 format from path.
`to_sparse6_bytes`(G[, nodes, header]) | Convert an undirected graph to bytes in sparse6 format.
`write_sparse6`(G, path[, nodes, header]) | Write graph G to given path in sparse6 format.