BOB is a solver for constructing linear layouts of graphs, such as stack (book embeddings), queue, mixed, twist, rique, or track layouts. The tool provides two modes:
- a SAT-based solver for building optimal layouts; it can process graphs with hundreds of vertices within several minutes;
- a collection of fully combinatorial solvers that implement particular methods for linear graph layouts.
Visit https://spupyrev.github.io/linearlayouts.html for a survey of existing results regarding upper and lower bounds on stack number, queue number and track number of various classes of graphs. If you use BOB in your research, please cite it as follows:
@misc{bob,
author = {Pupyrev, Sergey},
title = {A {SAT}-based solver for constructing optimal linear layouts of graphs},
howpublished = {\url{https://github.com/spupyrev/bob}},
year = {2017},
note = {Accessed: today's date}
}
-
Build the executable by running:
make -
Solve a layout instance:
./build/bob -i=graphs/graph.dot -stacks=3The embedded SAT solver tests embeddability and prints the resulting layout. The tool accepts graphs in the DOT and GML formats. For the list of supported options use:
./build/bob -help
Run the lightweight solver tests with:
make test
To use an external solver instead, export the model in DIMACS format:
./build/bob -i=graphs/graph.dot -o=graph.dimacs -stacks=3
treengeling graph.dimacs > result.dimacs
./build/bob -i=graphs/graph.dot -result=result.dimacs -stacks=3
| Type | Option | Description | Reference |
|---|---|---|---|
| Stack | -stacks=k |
Each page forbids crossings | Book embedding |
| Queue | -queues=k |
Each page forbids nestings | Queue number |
| Mixed | -stacks=s -queues=q |
Uses both stack and queue pages | The mixed page number of graphs |
| Twist | -twists=k |
Allows at most k pairwise crossing edges |
— |
| Rique | -riques=k |
Uses restricted-input deque pages | The Rique-Number of Graphs |
Test whether an input graph can be embedded in 2 stacks
./build/bob -i=graphs/graph.dot -stacks=2
Test whether an input graph can be embedded in 2 queues
./build/bob -i=graphs/graph.dot -queues=2
Test whether an input graph admits a 6-track layout and print resulting layout
./build/bob -i=graphs/weakly_6tracks.gml -tracks=6
The planar queue-layout solver implements the product structure algorithm Planar Graphs Have Bounded Queue-Number (JACM, 2020), and its improvement for the 33-queue layout. Build with make planar_queues, then choose 49 or 33 queues:
./build/planar_queues -i=graphs/planar20.edges -queues=<49|33> -o=graph.layout
The planar stack-layout solver implements Yannakakis's four-page algorithm Embedding Planar Graphs in Four Pages (JCSS, 1989). Build with make planar_stacks, then construct a layout using at most four stacks:
./build/planar_stacks -i=graphs/planar30.dot -o=graph.layout
The example DOT graph has 30 vertices and 84 edges. It supplies no embedding; the solver computes one using the planarity algorithm before constructing the layout.
BOB is released under the MIT License.