# anjlab/sat3

Reference Implementation of Romanov's Polynomial Algorithm for Boolean 3-SAT Problem
Java
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
 Failed to load latest commit information. 3-sat-core Jan 25, 2011 3-sat-experiment Jan 21, 2011 src/main Jan 12, 2011 .gitignore Nov 13, 2010 LICENSE.txt Nov 13, 2010 README.md Feb 15, 2011 dictionary.txt Nov 27, 2010 formatter.xml Nov 13, 2010 pom.xml Jan 21, 2011

# 1. What this project is about

This project is reference implementation of Romanov's Polynomial Algorithm for 3-SAT Problem. Algorithm implemented in pure Java with command line interface. Current version is single-threaded implementation.

# 2. How to run experiments

Note: Java 1.6 should be installed on your machine and Java binaries should be in your system PATH.

We support DIMACS CNF file format as input files. Examples can be found here. Input files can contain k-SAT instances, we convert them to 3-SAT on the fly.

Note that k-SAT to 3-SAT reduction leads to an increase in the number of variables and clauses.

As a result we generate two files:

1. [input-file-name]-results.txt - this file contains formula classification result (SAT or UNSAT) and additional info (time measurements and satisfying set if formula is SAT).

See How to read output files wiki page.

2. [input-file-name]-hss-0.png - this file contains graphical representation of basic graph (see Romanov's paper for reference).

Red colored path represents HS route which is joint satisfying set for the formula.

See Solving-article-example.cnf wiki page for sample outputs.

## Step by step instructions to get your first results:

For first try we recommend formulas with variables count < 75 and number of clauses ~ 100 (you can find them in downloaded package). They can be solved within few minutes.

Note that it took about 14 hours for this reference implementation to solve satisfiable 3-SAT instances with variable count = 398 and number of clauses = 1040 (flat50-115 from "Flat" Graph Colouring set).

2. Unzip package to any folder [target_folder]

3. Run console and `cd` to [target_folder]

4. In console run following command:

on windows

`````` solve examples\uf50-01000.cnf
``````

on linux/mac os x (ruby is required)

`````` ./solve examples/uf50-01000.cnf
``````
5. By default output files will be created in the same folder as input file

Refer to Command line tools wiki page for more options.