Genetic Algorithm Java Implementation for 3-SAT Problem
this paper.
The sections related to the definition of the 3-SAT problem are taken fromBoolean Satisfiability Problem
The Boolean satisfiability problem (SAT) is the problem of determining if there exists an interpretation that satisfies a given Boolean formula. In other words, it asks whether the variables of a given Boolean formula can be consistently replaced by the values TRUE or FALSE in such a way that the formula evaluates to TRUE. If this is the case, the formula is called satisfiable. On the other hand, if no such assignment exists, the function expressed by the formula is FALSE for all possible variable assignments and the formula is unsatisfiable.
3-Satisfiability Problem
The 3-SAT problem means a satisfiability problem, it is problem to find whether a given Boolean formula is satisfiable or not. Here, some related notions are introduced firstly and then we will introduce the 3-SAT in detail:
Boolean Variables
The value either True (also can be represented by 1) or False (also can be represented by 0). Let Xn= x1,… ,xn be a collection of Boolean variables.
Literal
Literal represented by a Boolean variable (xi) or it’s negation formal(¬xi), i ∈[1,n].
Clause
A Clause means a disjunction of the some literals. Here, we suppose the number of literals is k, so, it can be expressed by the form of l1 ⋁ l2 ⋁ ... ⋁ lk and l1,l2,…,lk literals corresponding to different variables.
3-SAT Problem Representation
A SAT formula F (in conjunction normal form) in the form of C1 ∧ … ∧ Cm, which every Cj (j∈[1,m]) is a clause. And if each Cj is a k-clause, the function is a k-SAT formula. When k≤3, then the F is a 3-SAT formula. The problem to find there if have a solution to make such 3-SAT formula is true is called the 3-SAT problem.
For clarity, we use an example to illustrate the problem. The 3-SAT formula can be presented as:
F=(x1 ∨ ¬x2 ∨ x4) ∧ (¬x2 ∨ x3 ∨ x4 ) ∧ (¬x3 ∨ ¬x4 ∨ x5) where the number of Boolean variables n=5, and the number of clause m=3. A solution x_1=false,x_2=true,x_3=true,x_4=true,x_5=true can satisfy all the clauses and make F=true.
References:
- Li, B., & Zhang, Y. A. (2016, August). A hybrid genetic algorithm to solve 3-SAT problem. In 2016 12th International Conference on Natural Computation, Fuzzy Systems and Knowledge Discovery (ICNC-FSKD) (pp. 476-480). IEEE.
- https://github.com/JaredLGillespie/3SAT-GA-WOC