GithubHelp home page GithubHelp logo

3sat-ga-java's Introduction

Genetic Algorithm Java Implementation for 3-SAT Problem

The sections related to the definition of the 3-SAT problem are taken from this paper.

Boolean 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:

  1. 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.
  2. https://github.com/JaredLGillespie/3SAT-GA-WOC

3sat-ga-java's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.