All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Files | Functions
NAUTY Format

Detailed Description

Tool to read graphs from Nauty format data.

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. More...
 

Function Documentation

std::istream& lemon::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;
*

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
*