Class Graph6Sparse6Exporter<V,​E>

java.lang.Object
org.jgrapht.nio.graph6.Graph6Sparse6Exporter<V,​E>
Type Parameters:
V - graph vertex type
E - graph edge type
All Implemented Interfaces:
GraphExporter<V,​E>

public class Graph6Sparse6Exporter<V,​E>
extends java.lang.Object
implements GraphExporter<V,​E>
Exporter which exports graphs in graph6 or sparse6 format. A description of the format can be found here. graph6 and sparse6 are formats for storing undirected graphs in a compact manner, using only printable ASCII characters. Files in these formats have text format 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. Typically, files storing graph6 graphs have the 'g6' extension. Similarly, files storing sparse6 graphs have a 's6' file extension. sparse6 graphs support loops and multiple edges, graph6 graphs do not.

In particular, the length of a Graph6 string representation of a graph depends only on the number of vertices. However, this also means that graphs with few edges take as much space as graphs with many edges. On the other hand, Sparse6 is a variable length format which can use dramatically less space for sparse graphs but can have a much larger storage size for dense graphs.

Author:
Joris Kinable