0% found this document useful (0 votes)
22 views

3-SAT Notes

Uploaded by

f20212655
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

3-SAT Notes

Uploaded by

f20212655
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

3-SAT Boolean satisfiability

- Devansh Sadhanandhan(2021A7PS2655G)

Introduction

The 3-SAT problem is a classic computational challenge where you are


given a Boolean formula in conjunctive normal form(CNF) with exactly
three literals per clause. Determining whether there exists an assignment of
truth values to variables that satisfies all clauses is NP-complete. Since
finding an exact solution is computationally infeasible for large instances,
approximation algorithms are employed to find assignments that satisfy as
many clauses as possible.

Below is a curated list of relevant literature and approaches for


approximation algorithms tackling the 3-SAT problem.

Existing Approaches -
1. Randomized Assignment Algorithm

Reference:

● A Simple Randomized Algorithm for MAX SAT and MAX 2SAT by M.


L. Furer, 1997.

Approach:

● Assign each variable a truth value randomly (either true or false


with equal probability).
● This method guarantees an expected satisfaction of at least
78\frac{7}{8}87​of the clauses in any 3-SAT instance.

Notes:

● Simplicity: The algorithm is straightforward to implement.


● Expected Performance: Since each clause has three literals, the
probability that a clause is not satisfied is
(12)3=18\left(\frac{1}{2}\right)^3 = \frac{1}{8}(21​)3=81​.
● Applicability: Useful as a baseline for comparing other algorithms.

2. Johnson's Algorithm

Reference:

● Approximation Algorithms for Combinatorial Problems by D. S.


Johnson, 1974.

Approach:

● For each variable, count its occurrences in both positive and negative
literals across all clauses.
● Assign the variable a truth value that satisfies the majority of its
occurrences.

Notes:

● Deterministic: Unlike the randomized algorithm, Johnson's method


provides a consistent output for the same input.
● Performance: Often performs better than random assignment,
especially when variables have uneven positive and negative
occurrences.
● Limitation: May not significantly outperform random assignment in
balanced instances.

3. Local Search Algorithms (GSAT and WalkSAT)

Reference:

● A New Method for Solving Hard Satisfiability Problems by B. Selman,


H. Levesque, and D. Mitchell, 1992.

Approach:
● Start with a random assignment.
● Iteratively flip the value of the variable that results in the greatest
increase (or smallest decrease) in the number of satisfied clauses.
● WalkSAT adds randomness to escape local optima by occasionally
flipping a random variable in an unsatisfied clause.

Notes:

● Heuristic Method: Does not guarantee an optimal solution but often


finds good solutions quickly.
● Practicality: Effective for large instances where exact methods are
infeasible.
● Variations: Parameters like the probability of random flips can be
tuned for better performance.

4. Greedy Algorithms

Approach:

● Select variables based on certain heuristics, such as the one that


satisfies the maximum number of currently unsatisfied clauses.
● Repeat the process until no improvement is possible.

Notes:

● Simplicity: Easier to implement compared to advanced algorithms.


● Performance: May not perform well on all instances; gets stuck in
local optima.
● Use Case: Useful as a starting point or for instances with specific
structures.

5. Håstad's Inapproximability Results(not algorithm but important)

Reference:
● Some Optimal Inapproximability Results by J. Håstad, 2001.

Approach:

● Proves that it is NP-hard to approximate Max-3-SAT beyond a certain


threshold.
● Establishes tight bounds on the approximability of the problem.

Notes:

● Theoretical Importance: Sets limits on what approximation ratios


are achievable.
● Implication: Encourages focusing on heuristic or probabilistic
algorithms within the established bounds.
● Application: Guides researchers in setting realistic goals for
algorithm performance.

6. Semidefinite Programming (SDP) Based Algorithms (understanding in


progress)

Reference:

● Improved Approximation Algorithms for MAX k-SAT, MAX CUT, and


MAX NAE-SAT by M. X. Goemans and D. P. Williamson, 1995.

Approach:

● Formulate the problem as a semidefinite program to relax the


Boolean constraints.
● Use randomized rounding techniques to convert the fractional
solution back to an integral one.

Notes:

● Advanced Technique: Requires understanding of convex


optimization and semidefinite programming.
● Performance: Can achieve better approximation ratios for certain
variants like MAX-2-SAT.
● Implementation: Not straightforward in Octave; may require
specialized optimization toolboxes.

Using graycode order of assignments to study the


distribution of the number of clauses satisfied for
each assignment (Implementation in progress) -
1. Generating Random 3-SAT Instances
Process:

● Specify the number of variables n_vars and the number of clauses


n_clauses.
● For each clause:
○ Randomly select three distinct variables.
○ Randomly decide the sign (positive or negative) of each literal.

2. Generating Gray Code Assignments


Understanding Gray Code:

Gray code is an ordering of binary numbers such that two successive


numbers differ in only one bit. This property is useful for minimizing
changes between successive assignments.

How to Generate Gray Code Assignments:

● For n variables, there are 2n2^n2n possible assignments.


● Gray codes can be generated recursively or iteratively.
● In the context of assignments, each code represents a unique
combination of truth values for the variables.

3. Evaluating Clauses for Each Assignment


Process:

● For each assignment, evaluate all clauses.


● Count the number of satisfied clauses.
● Store the results for analysis.

4. Putting It All Together


Process:

● Generate Gray codes for all possible assignments.


● For each assignment:
○ Evaluate the number of satisfied clauses.
● Collect the results and analyze the distribution.

Notes:

● Variable n_vars: Be cautious with n_vars larger than 20, as the


number of assignments 2^(n_vars)​becomes computationally
intensive.
● Histogram: Visualizes the distribution of the number of satisfied
clauses.

5. Handling Larger Instances


Challenges:

● For larger n_vars, the total number of assignments becomes huge.


● Enumerating all assignments may not be feasible.

Solutions:

● Sample Assignments:
○ Instead of all assignments, sample a subset randomly.
○ Adjust the analysis accordingly.
● Parallel Computing:
○ Utilize parallel computing to distribute the workload.
○ Requires additional setup and resources.

Scalability:

● For large n_vars, consider Monte Carlo simulations.


● Analyze a random sample of assignments in Gray code order

You might also like