https://github.com/gregable/pq-trees
General implementation of the PQ Tree algorithm.
https://github.com/gregable/pq-trees
Last synced: 8 months ago
JSON representation
General implementation of the PQ Tree algorithm.
- Host: GitHub
- URL: https://github.com/gregable/pq-trees
- Owner: Gregable
- Created: 2008-09-20T18:42:17.000Z (over 17 years ago)
- Default Branch: master
- Last Pushed: 2011-03-06T20:39:22.000Z (over 15 years ago)
- Last Synced: 2025-07-17T09:52:56.547Z (11 months ago)
- Language: C++
- Homepage: http://gregable.com/2008/11/pq-tree-algorithm-and-consecutive-ones.html
- Size: 353 KB
- Stars: 29
- Watchers: 5
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
A C++ implementation of Booth & Lueker's PQ-Tree algorithm.
Kellog S. Booth, George S. Lueker, Testing for the consecutive ones property,
interval graphs, and graph planarity using PQ-tree algorithms, Journal of
Computer and Systems Sciences, 13(3) (1976) 335-379.
IMPORTANT NOTE: This code currently is known to be buggy on some rare inputs. A believed to be correct, but harder to use version of this code can be found as a library within BiVoC: https://bioinformatics.cs.vt.edu/~murali/papers/bivoc/
Description of files:
The main file for this library is pqtree.h. It contains an API that can be
used by client code for dealing with PQ-Trees. There are two binaries:
fuzztest and pqtest.
pqtest runs the pqtree code for one example set of reductions on a single tree, printing the state of the tree at every step. This illustrates how the pqtree is built.
fuzztest generates a large random set of possible reductions and runs them
against the library making sure that it never returns false or segfaults.
Usage:
Primarily, this is intended to be used as a library, not a binary. But you can
still compile and run the binaries |pqtest| and |fuzztest|. My personal
recommendation would be to compile with scons, http://scons.org/. To do so,
run:
$ scons
$ ./fuzztest
$ ./pqtest
Alternatively, I also handily include the tried and true MakeFile, so if you
don't have scons on your system and don't feel like installing it, instead just
run:
$ make
$ ./fuzztest
$ ./pqtest