a quantum genetic algorithm with hill climbing ... - Semantic Scholar

2 downloads 0 Views 174KB Size Report
[4] and hybrid methods of EA and SLS [5]. A Genetic Algorithm GA ..... Test. Number of variables. Number of clauses. GSAT. QHILL. SAT aim-no-1. 50. 80. 79. 79.
Journal of Theoretical and Applied Information Technology © 2005 - 2008 JATIT. All rights reserved. www.jatit.org

A QUANTUM GENETIC ALGORITHM WITH HILL CLIMBING ALGORITHM FOR MAX 3-SAT PROBLEMS ABDESSLEM LAYEB, DJAMEL EDDINE SAIDOUNI MISC laboratory, Department of computer science, University Mentouri of Constantine Algeria E-mail: [email protected] , [email protected]

ABSTRACT In this paper we present a new iterative method to solve the maximum satisfiability problem (MAX SAT). This one aims to find the best assignment for a set of Boolean variables that gives the maximum of verified clauses in a Boolean formula. Unfortunately, It is shown that the MAX SAT problem is NP complete if the number of variable per clause is higher than 3. Our approach called QHILLSAT is a combination of a Quantum Genetic Algorithm QGA and a Hill Climbing Algorithm. The main features of this algorithm consist in the quantum structure used to represent MAX SAT solutions and the quantum operators defining the overall evolutionary dynamic of the genetic algorithm. The Hill Climbing Search procedure is used in order to increase the efficiency of the exploration process. Experiments on wide range of data sets have shown the effectiveness of the proposed framework and its ability to achieve good quality solutions. Keywords: Quantum Computing, Quantum Genetic Algorithm, Hill Climbing, Maximum Satisfiability problem

1. INTRODUCTION The satisfiability problem SAT is a problem in propositional logic. A SAT problem consists to determine the satisfiability of a given logical formula. The Maximum Satisfiability problem (MAX-SAT) is known problem of SAT problems. The problem consists in finding an assignment that satisfies the maximum number of clauses. Unfortunately, the MAX SAT problem has been shown to be NP-complete problem [1]. This complex problem has several applications in different area such model checking, graph coloring, task planning, and so on. One type of SAT problems is 3-SAT problem where all Boolean expressions are written in CNF with 3 variables per clause. The following Boolean formula is in 3-CNF expression form. (x1 OR x2 OR x3) AND (not(x1) OR x2OR x3) AND (x1 OR not(x2) OR x3) Where each x is a variable or a negation of a variable, and each variable can appear several times in the logic expression. To deal with this problem, many algorithms were proposed. In fact, there are two main classes of algorithms for solving instances of SAT in practice: Complete

and Incomplete methods. The complete algorithms are able to verify the satisfiability or the unsatisfiablilty of the SAT problem, although they have an exponential complexity [2]. On the other hand, the incomplete methods find an optimal solution in good time, but they don’t guarantee to give the exact solution of the problem. This class of methods contains Evolutionary Algorithms (EA) [3], Stochastic Local Search (SLS) methods [4] and hybrid methods of EA and SLS [5]. A Genetic Algorithm GA is a stochastic iterative procedure which maintains a population of individuals. GA adapts nature optimizing principles like mechanics of natural selection and natural genetics. Each individual represents a feasible solution in the problem search space. Basically, a genetic algorithm consists of three essential operations: selection, crossover, and mutation. The selection evaluates the fitness of each individual and keeps the best ones among them. The others are removed from the current population. The crossover merges two individuals to provide new ones. The operator of mutation allows moving each solution to one of its neighbours in order to maintain a good diversity during the process of optimization. GA allows guided search that samples the search space. To

1033

Journal of Theoretical and Applied Information Technology © 2005 - 2008 JATIT. All rights reserved. www.jatit.org

solve the satisfiability problems genetic algorithms are generally enhanced by a local search procedure in order to increase their performance to solve such problems. Although they have been shown to be appropriate for solving MAX-SAT problems [3], their computational cost seems to be a dissuasive factor for their use on large instances. To overcome this drawback and in order to get better speed and quality convergence, their implicit parallelism is exploited [6]. As a new research field, Quantum Computing (QC) deals with investigations on quantum mechanical computers and quantum algorithms [7]. QC relies on the principles of quantum mechanics like qubit representation and superposition of states. QC is capable of processing huge numbers of quantum states simultaneously in parallel. Recently, a growing theoretical and practical interest is devoted to researches on merging evolutionary computation and quantum computing [8, 9]. The aim is to get benefit from quantum computing capabilities to enhance both efficiency and speed of classical evolutionary algorithms. This has led to the design of Quantum inspired Genetic Algorithms (QGA) that have been proven to be better than conventional Genetic Algorithms. Within this issue, we propose in this article, a new framework named QHILLSAT to cope with the MAX 3-SAT problem. QHILLSAT is an iterative stochastic approach based on a hybrid algorithm of Quantum Genetic and Hill Climbing algorithms. A quantum representation is used to encode chromosomes. The advantage of this representation is the possibility to represent all possible solutions of MAX SAT using only one chromosome with a certain probability. The other feature of the method is the application of quantum operators like measure, interference and quantum mutation. QHILLSAT Improved by the use of local search procedure. We have used the Hill Climbing features [10] to increase the capacity of search in neighbours of the solution. The experiments carried out on QHILLSAT showed the feasibility and the effectiveness of our approach. Consequently, the remainder of the paper is organized as follows: Section 2 presents the problem formulation. A brief introduction to quantum computing is presented in Section 3. The proposed approach is described in Section 4. Section 5 illustrates some experimental results. Then, we terminate by giving conclusion and some perspectives.

2. PROBLEM FORMULATION Given a Boolean formula F expressed in CNF (Conjunctive Normal Form), let have n Boolean variables x1, x2... xn, and m clauses. The problem of MAX SAT can be formulated as follow: • An assignment to those variables is a vector v = (v1, v2… vn) ∈ {0,1}n. • A clause Ci of length k is a disjunction of k literals, Ci =( x1 OR x2 OR… OR xk) • Each literal is a variable or a negation of a variable • Each variable can appear multiple times in the expression. For some constant k, the k-SAT problem requests if there is a satisfying assignment that makes a formula F = C1 ∧ C2 ∧ … ∧ Cm true. The problem of MAX SAT can be defined by specifying implicitly a pair (Ω, SC ) where Ω is the set of all potentials solution ({0, 1}n) and SC is a mapping Ω → N called score of the assignment that is the number of true clauses. Each solution is viewed as binary vector. Consequently, the problem consists to define the best binary vector that maximizes the number of satisfied clauses in the Boolean formula Clearly, there are 2n potential satisfying assignments for this problem. It has been proven that the k-SAT problem is NP-complete for any k ≥ 3. In this paper we deal with the 3-SAT problem. It is obviously that Max 3-SAT problem is a combinatorial optimization problem. It appears to be impossible to obtain exact solutions in polynomial time. The main reason is that the required computation grows exponentially with the size of the problem. Therefore, it is often wanted to find near optimal solutions to these problems. Efficient heuristic algorithms offer a good alternative to accomplish this goal. Exploitation of the optimization philosophy and the parallel great ability of quantum computing is an attractive way to probe complex problems like the MAX 3-SAT problem. Within this perspective, we are interested in applying quantum computing principles improved by stochastic local search method to solve this problem.

3. AN OVERVIEW OF QUANTUM COMPUTING Quantum Computing QC is an emergent field calling upon several specialties: physics, engineering, chemistry, computer science and

1034

Journal of Theoretical and Applied Information Technology © 2005 - 2008 JATIT. All rights reserved. www.jatit.org

mathematics. QC uses the specificities of quantum mechanics for the processing and the transformation of information. The aim of this integration of knowledge is the realization of a quantum computer in order to carry out certain calculations much more quickly than with a traditional computer. This acceleration is made possible while benefiting from the quantum phenomena such as the superposition of states, the entanglement and the interference. A particle according to principles of quantum mechanics can be in a superposition of states. By taking account of this idea, one can define a quantum bit or the qubit which can take value 0, 1 or a superposition of the two at the same time. Its state can be given by [9]: Ψ = α |0〉+b|1〉

the quantum operators it uses to evolve the entire population through generations [8, 9, 11].

4. THE PROPOSED ALGORITHM The goal of our approach called QHILLSAT is to find the best assignment of Boolean Variables that gives the maximum number of satisfied clauses in Boolean Formula In order to show how QC concepts have been tailored to the problem at hand, a formulation of the problem in term of quantum representation was derived and a quantum genetic dynamics borrowing quantum operations was defined (Figure 1). Then, we describe how these defined concepts have been integrated in a genetic algorithm.

(1)

MAX -SAT Problem

Where |0〉 and |1〉 represent the classical bit values 0 and 1 respectively; α and b are complex numbers such that (2) |α|2 + |b|2 = 1 The probability that the qubit collapses towards 1 (0) is |α|2 (|b|2).This idea of superposition makes it possible to represent an exponential set of states with a small number of qubits. According to the quantum laws like interference, the linearity of quantum operations and entanglement make the quantum computing more powerful than the classical machines. Each quantum operation will deal with all the states present within the superposition in parallel. For in-depth theoretical insights on quantum information theory, one can refer to [7]. A quantum algorithm consists in applying of a succession of quantum operations on quantum systems. Quantum operations are performed using quantum gates and quantum circuits. Yet, a powerful quantum machine is still under construction. By the time when a powerful quantum machine would be constructed, researches are conducted to get benefit from the quantum computing field. Since the late 1990s, merging quantum computation and evolutionary computation has been proven to be a productive issue when probing complex problems. Like any other EA, a Quantum Genetic Algorithm QGA relies on the representation of the individual, the evaluation function and the population dynamics. The particularity of QGA stems from the quantum representation they adopt which allows representing the superposition of all potential solutions for a given problem. It also stems from

Quantum representation

Quantum genetic dynamics + Hill Climbing

Stop

Solution

Figure.1 QHILLSAT Core for MAX -SAT problem

4.1 Quantum representation of representation of MAX 3-SAT Throughout this paper, N will represent the number of Boolean variables and M will denote the number of clauses in formula F. In order to easily apply quantum principles on Max 3-SAT problem, a quantum representation of the solutions is defined. The Boolean assignment is represented as binary vector of size N. In terms of quantum computing, each solution is represented as a quantum register of size N as shown in figure 1. The register contains superposition of all possible solutions. Each column ⎛⎜ ai ⎞⎟ represents a single ⎜b ⎟ i ⎝



qubit and corresponds to the binary digit 1 or 0. The probability amplitudes ai and bi are real values 2 2 satisfying a i + b i = 1 . For each qubit, a binary value is computed according to its probabilities ai

2

2

and bi .

ai

2

and bi

2

are interpreted as

the probabilities to have respectively 0 or 1. Consequently, all feasible solution can be represented by a Quantum Vector QV (figure 2)

1035

Journal of Theoretical and Applied Information Technology © 2005 - 2008 JATIT. All rights reserved. www.jatit.org

Figure. 3. Quantum interference

that contains the superposition of all possible solutions. This quantum vector can be viewed as a probabilistic representation of all the MAX 3-SAT solutions. When embedded within an evolutionary framework, it plays the role of the chromosome. Only one chromosome is needed to represent the entire population. ⎛ a ⎜ ⎜ b ⎝

1

a

1

b

2 2

...

a

m

b

m

Table 1. Lookup table of the rotation angle a b Reference bit value Angle >0 >0 1 +δθ >0 >0 0 -δθ >0 0

Suggest Documents