abLEMON 1.9.0-101-gccb8629
A maintained fork of LEMON
Loading...
Searching...
No Matches
NAUTY Format

Read Nauty format. More...

Files

file  nauty_reader.h
 Nauty file reader.

Functions

template< typename Graph >
std::istream & readNautyGraph (Graph &graph, std::istream &is=std::cin)
 Nauty file reader.

Detailed Description

Tool to read graphs from Nauty format data.

Function Documentation

◆ readNautyGraph()

template< typename Graph >
std::istream & readNautyGraph ( Graph & graph,
std::istream & is = std::cin )

The geng program is in the gtools suite of the nauty package. This tool can generate all non-isomorphic undirected graphs of several classes with given node number (e.g. general, connected, biconnected, triangle-free, 4-cycle-free, bipartite and graphs with given edge number and degree constraints). This function reads a nauty graph6 format line from the given stream and builds it in the given graph.

The site of nauty package: http://cs.anu.edu.au/~bdm/nauty/

For example, the number of all non-isomorphic planar graphs can be computed with the following code.

int num = 0;
SmartGraph graph;
while( readNautyGraph( graph , std::cin ) ) {
PlanarityChecking< SmartGraph > pc( graph );
if( pc.run() )
++num;
}
std::cout << "Number of planar graphs: " << num << std::endl;
A smart undirected graph class.
Definition smart_graph.h:631
std::istream & readNautyGraph( Graph & graph , std::istream & is=std::cin )
Nauty file reader.
Definition nauty_reader.h:67

The nauty files are quite huge, therefore instead of the direct file generation pipelining is recommended. For example,

./geng -c 10 | ./num_of_planar_graphs