Reputation: 159
does anyone knows a link to examples of solvable 3SAT problems, with also the solution to the problem?
Thanks
Upvotes: 0
Views: 1687
Reputation: 993
To get a solveable problem with one solution, first build a solution and then build a problem on it:
Choose any variables
a, b, c, d, e, f
Choose any values for those variables (at this point, we already have the solution)
a = true, b = false, c = true, d = true, e = false, f = false
Create a clause of 1, 2 or 3 literals, with at least one satisfied literal
(¬c or d or e)
Repeat step 3 as many time you want
(¬c or d or e)
and (a or ¬b or ¬d)
and (b or e or ¬f)
and (¬b or c or ¬f)
and (c)
and (a or d)
You have a solveable problem with a solution. This algorithm is exhaustive: You can get all the solveable problems.
Bonus To get an unsolveable problem:
a, b, c, d, e, f
Choose 3 variables among them
b, d, f
Create the 8 following clauses
(b or d or f)
and (b or d or ¬f)
and (b or ¬d or f)
and (b or ¬d or ¬f)
and (¬b or d or f)
and (¬b or d or ¬f)
and (¬b or ¬d or f)
and (¬b or ¬d or ¬f)
Add any additional clauses
...
and (¬c or d or e)
and (a or ¬b or ¬d)
and (b or e or ¬f)
and (¬b or c or ¬f)
and (c)
and (a or d)
You have an unsolveable problem. This algorithm is not exhaustive: You won't get all the unsolveable problems
Upvotes: 1
Reputation: 159
this is what I did:
download 3 SAT examples, for for example this site: https://www.cs.ubc.ca/~hoos/SATLIB/benchm.html in the download items, UF means it is satisfiable, uuf it means it is unsatisfiable.
Then I add these examples to https://msoos.github.io/cryptominisat_web/, which is a version of MiniSAT (SAT solver) in the browser.
Click the play button, and MiniSAT calculates the solution.
Upvotes: 1
Reputation: 786
You can construct a trivial solveable 3Sat instance, which is solveable in polynomial time. There are several ways to construct trivial solveable 3Sat problems:
I don't know a non trivial 3Sat example, which is big and solveable. Ones a year the Sat Competition is held. You can look into the benchmarks, whether there is a 3Sat benchmark.
Upvotes: 2