Questions tagged [2-satisfiability]

The Boolean 2-satisifiability problem asks whether there is a solution to a given collection of paired constraints on Boolean variables. 2SAT, as it is commonly known, is solvable in polynomial time.

The Boolean 2-satisifiability problem asks whether there is a solution to a given collection of paired constraints on Boolean variables. 2SAT, as it is commonly known, is solvable in polynomial time.

21 questions
0
votes
1 answer

How to solve a 2-SAT instance with 60 boolean variables and 99 clauses using Z3Py

I am using the following code: X = BoolVector('x', 60) M = [[21, 34],[-49, -12],[7, 18], [-5, -1],[28, 17], [3, 55],[36, 33], [-6, -50],[44, -41], [-55, 3],[14, -54],[-30, 13], [-13, 60],[54, -16],[-48, 41], [3, 6],[49,…
Juan Ospina
  • 1,317
  • 1
  • 7
  • 15
0
votes
2 answers

2-SATisfiabilty problem test cases

I have written a SAT solver for 2-satisfiability problem,someone please provide me a test case with say 10000 literals which has only one satisfiable assignment i.e only one solution The format can be:(for 3 literals) 2 // No of clauses…
avd
  • 13,993
  • 32
  • 78
  • 99
0
votes
2 answers

Solving 2Sat CNF form using brute force

I'm currently studying the 2SAT problem for an exam and I don't really understand how to check if a solution exists using the brute force. I know this seems a bit strange but I understand how to implement the implication graph a bit better but I'm…
John Smith
  • 635
  • 1
  • 10
  • 19
-1
votes
1 answer

Implementing an efficient 2-SAT solving algorithm

I was reading about the 2-SAT problem on Wikipedia and I was wondering what the O(n) algorithm looks like in Python. So far I've only found implementations that either are in other programming languages or that just determine whether an expression…
niico
  • 57
  • 4
-1
votes
1 answer

Generation solutions to 2-SAT from an existing one

The polynomial time algorithm of 2-SAT involving SCC tells us whether a solution exists or not and also helps us in generating a solution to the problem . But there can be more than one solution . I wanted to know is it possible to generate other…
Alphanerd
  • 11
  • 1
  • 3
-1
votes
1 answer

Can i reduce memory use in this c++ code?

#include using namespace std; int n; vector used; vector order, comp; void dfs1 (int v,const vector>& g) { used[v] = true; for (size_t i=0; i
Rikudo
  • 63
  • 7
1
2