**A Multilevel Approach Applied to Sat-Encoded Problems**

Noureddine Bouhmala *Vestfold University College Norway*

#### **1. Introduction**

166 VLSI Design

Tan, S.C., Rao, M.V.C., Lim C.P, "An adaptive fuzzy min-max conflict-resolving classifier,"

Dagher. I, Georgiopoulos. M, Heileman. G.L., Bebis, G, "An ordering algorithm for pattern

performance," *IEEE Trans Neural Networks*, vol. 10, 1999, pp. 768-778. Jianhua Li, Laleh Behjat, "A Connectivity Based Clustering Algorithm with Applications to

Steven M Rubin, "Computer Aids for VLSI Design", Second Edition, Willy Publications. Sabin H Gerez, "Algorithms for VLSI design automation", University of Tacut, department of electrical engineering, Netherlands, John Wiley & Sons, 1999, pp. 1-15.

*Applications, WSC9*, 20 September – 8 October 2004.

*Briefs*, Vol.53, No.5, May 2006.

*in Proceedings of the 9th Online World Conference on Soft Computing in Industrial* 

presentation in fuzzy ARTMAP that tends to improve generalization

VLSI Circuit Partitioning", *IEEE Transactions on Circuits and Systems-II.Express* 

#### **1.1 The satisfiability problem**

The satisfiability problem (SAT) which is known to be NP-complete (7) plays a central role problem in many applications in the fields of VLSI Computer-Aided design, Computing Theory, and Artificial Intelligence. Generally, a SAT problem is defined as follows. A propositional formula Φ = �*<sup>m</sup> <sup>j</sup>*=<sup>1</sup> *Cj* with *m* clauses and *n* Boolean variables is given. Each Boolean variable, *xi*, *i* ∈ {1, . . . , *n*}, takes one of the two values, *True* or *False*. A clause , in turn, is a disjunction of literals and a literal is a variable or its negation. Each clause *Cj* has the form:

$$\mathbf{C}\_{\mathbf{j}} = \left(\bigvee\_{k \in I\_{\mathbf{j}}} \mathbf{x}\_k\right) \vee \left(\bigvee\_{l \in I\_{\mathbf{j}}} \bar{\mathbf{x}}\_l\right) \wedge$$

where *Ij*, ¯*Ij* ⊆ {1, .....*n*}, *<sup>I</sup>* <sup>∩</sup> ¯*Ij* <sup>=</sup> <sup>∅</sup>, and *<sup>x</sup>*¯*<sup>i</sup>* denotes the negation of *xi*. The task is to determine whether there exists an assignment of values to the variables under which Φ evaluates to *True*. Such an assignment, if it exists, is called a satisfying assignment for Φ, and Φ is called satisfiable. Otherwise, Φ is said to be unsatisfiable. Since we have two choices for each of the *<sup>n</sup>* Boolean variables, the size of the search space *<sup>S</sup>* becomes <sup>|</sup>*S*<sup>|</sup> <sup>=</sup> <sup>2</sup>*n*. That is, the size of the search space grows exponentially with the number of variables. Since most known combinatorial optimization problems can be reduced to SAT (8), the design of special methods for SAT can lead to general approaches for solving combinatorial optimization problems. Most SAT solvers use a Conjunctive Normal Form (CNF) representation of the formula Φ. In CNF, the formula is represented as a conjunction of clauses, with each clause being a disjunction of literals. For example, *P* ∨ *Q* is a clause containing the two literals *P* and *Q*. The clause *P* ∨ *Q* is satisfied if either *P* is *True* or *Q* is *True*. When each clause in Φ contains exactly *k* literals, the resulting SAT problem is called *k*-SAT.

The rest of the paper is organized as follows. Section 2 provides an overview of algorithms used for solving the satisfiability problem. Section 3 reviews some of the multilevel techniques that have been applied to other combinatorial optimization problems. Section 4 gives a general description of memetic algorithms. Section 5 introduces the multilevel memetic algorithm. Section 6 presents the results obtained from testing the multilevel memetic algorithm on large industrial instances. Finally, in Section 7 we present a summary and some guidelines for future work.

Sat-Encoded Problems 3

A Multilevel Approach Applied to Sat-Encoded Problems 169

hierarchy of problems each representing the original problem but with fewer degrees of freedom. The coarsest level can then be used to compute an initial solution. The solution found at the coarsest level is uncoarsened (extended to give an initial solution for the next level) and then improved using a chosen optimization algorithm. A common feature that characterizes multilevel algorithms, is that any solution in any of the coarsened problems is a legitimate solution to the original one. Optimization algorithms using the multilevel paradigm draw their strength from coupling the refinement process across different levels. Multilevel techniques were first introduced when dealing with the graph partitioning problem (GGP) (1) (14) (16) (22) (23) (44) and have proved to be effective in producing high quality solutions at a lower cost than single level techniques. The traveling salesman problem (TSP) was the second combinatorial optimization problem to which the multilevel paradigm was applied (45) (46) and has clearly shown a clear improvement in the asymptotic convergence of the solution quality. When the multilevel paradigm was applied to the graph coloring problem (42), the results do not seem to be in line with the general trend observed in GCP and TSP as its ability to enhance the convergence behavior of the local search algorithms was rather restricted to some class of problems. Graph drawing is another area where multilevel techniques gave a better global quality to the drawing and the author suggests its use to both

An important prerequisite for the multilevel paradigm is the use of an optimization search strategy in order to carry out the refinement during each level. In this work, we propose a memetic algorithm (MA) that we use for the refinement phase. Algorithm 2 provides a

MAs represent the set of hybrid algorithms that combine genetic algorithms and local search. In general the genetic algorithm improves the solution while the local search fine tunes the solution. They are adaptive based search optimizations algorithms that take their inspiration from genetics and evolution process (31). Memetic algorithms simultaneously examine and manipulate a set of possible solution. Given a specific problem to solve, the input to MAs is an initial population of solutions called individuals or chromosomes. A gene is part of a chromosome, which is the smallest unit of genetic information. Every gene is able to assume different values called allele. All genes of an organism form a genomem which

**While** Not reached the desired number of levels *Plevel*+1:= Coarsen (*Plevel*);

**Algorithm 1:** The Multilevel Generic Algorithm

*S*(*Plevel*) =Initial Solution (*Plevel*) ;

*Sfinal*(*Plevel*−1) := Refine (*Sstart*(*Plevel*−1));

/\* Initial Solution is computed at the lowest level \*/;

**While** (*level* > <sup>0</sup>) *Sstart*(*Plevel*−1): = Uncoarsen (*Sfinal*(*Plevel*));

accelerate and enhance force drawing placement algorithms (43).

**input** : Problem *P*<sup>0</sup> **output**: Solution *Sfinal*(*P*0)

level := 0;

level := level + 1;

level := level - 1;

**4. Memetic Algorithms (MAs)**

canonical memetic algorithm.

**begin**

**end**

### **2. SAT solvers**

One of the earliest local search algorithms for solving SAT is GSAT (36)(3)(38). Basically, GSAT begins with a random generated assignment of values to variables, and then uses the steepest descent heuristic to find the new variable-value assignment which best decreases the number of unsatisfied clauses. After a fixed number of moves, the search is restarted from a new random assignment. The search continues until a solution is found or a fixed number of restarts have been performed. Another widely used variant of GSAT is the Walksat algorithm and its variants in (37)(30)(17)(26)(27)(18). It first picks randomly an unsatisfied clause, and then, in a second step, one of the variables with the lowest *break count*, appearing in the selected clause, is randomly.

Other algorithms (11)(15) (9) (10) used history-based variable selection strategies in order to avoid flipping the same variable selected.In parallel to the development of more sophisticated versions of randomized improvement techniques, other methods based on the idea of modifying the evaluation function (47)(19)(40)(34)(35) in order to prevent the search from getting stuck in non attractive areas of the underlying search space have become increasingly popular in SAT solving. A new approach to clause weighting known as Divide and Distribute Fixed Weights (DDFW) (20) exploits the transfer of weights from neighboring satisfied clauses to unsatisfied clauses in order to break out from local minima. Recently, a strategy based on assigning weights to variables (33) instead of clauses greatly enhances the performance of the Walksat algorithm, leading to the best known results on some benchmarks.

Evolutionary algorithms are heuristic algorithms that have been applied to SAT and many other NP-complete problems. Unlike local search methods that work on a current single solution, evolutionary approaches evolve a set of solutions. GASAT (21)(24) is considered to be the best known genetic algorithm for SAT. GASAT is a hybrid algorithm that combines a specific crossover and a tabu search procedure. Experiments have shown that GASAT provides very competitive results compared with state-of-art SAT algorithms. Gottlieb at al. proposed several evolutionary algorithms for SAT (13). Results presented in that paper show that evolutionary algorithms compare favorably to Walksat. Finally, Boughaci et al. introduced a new selection strategy (5) based on both fitness and diversity to choose individuals to participate in the reproduction phase of a genetic algorithm. Experiments showed that the resulting genetic algorithm was able to find solutions of a higher quality than the scatter evolutionary algorithm (4).

Lacking the theoretical guidelines while being stochastic in nature, the deployment of several meta-heuristics involves extensive experiments to find the optimal noise or walk probability settings. To avoid manual parameter tuning, new methods have been designed to automatically adapt parameter settings during the search (25)(32), and results have shown their effectiveness for a wide range of problems.

### **3. Multilevel techniques**

The multilevel paradigm is a simple technique which at its core involves recursive coarsening to produce smaller and smaller problems that are easier to solve than the original one. The pseudo-code of the multilevel generic algorithm is shown in Algorithm 1.

The multilevel paradigm consists of four phases: coarsening, initial solution, uncoarsening and refinement. The coarsening phase aims at merging the variables associated with the problem to form clusters. The clusters are used in a recursive manner to construct a


One of the earliest local search algorithms for solving SAT is GSAT (36)(3)(38). Basically, GSAT begins with a random generated assignment of values to variables, and then uses the steepest descent heuristic to find the new variable-value assignment which best decreases the number of unsatisfied clauses. After a fixed number of moves, the search is restarted from a new random assignment. The search continues until a solution is found or a fixed number of restarts have been performed. Another widely used variant of GSAT is the Walksat algorithm and its variants in (37)(30)(17)(26)(27)(18). It first picks randomly an unsatisfied clause, and then, in a second step, one of the variables with the lowest *break count*, appearing

Other algorithms (11)(15) (9) (10) used history-based variable selection strategies in order to avoid flipping the same variable selected.In parallel to the development of more sophisticated versions of randomized improvement techniques, other methods based on the idea of modifying the evaluation function (47)(19)(40)(34)(35) in order to prevent the search from getting stuck in non attractive areas of the underlying search space have become increasingly popular in SAT solving. A new approach to clause weighting known as Divide and Distribute Fixed Weights (DDFW) (20) exploits the transfer of weights from neighboring satisfied clauses to unsatisfied clauses in order to break out from local minima. Recently, a strategy based on assigning weights to variables (33) instead of clauses greatly enhances the performance of the

Evolutionary algorithms are heuristic algorithms that have been applied to SAT and many other NP-complete problems. Unlike local search methods that work on a current single solution, evolutionary approaches evolve a set of solutions. GASAT (21)(24) is considered to be the best known genetic algorithm for SAT. GASAT is a hybrid algorithm that combines a specific crossover and a tabu search procedure. Experiments have shown that GASAT provides very competitive results compared with state-of-art SAT algorithms. Gottlieb at al. proposed several evolutionary algorithms for SAT (13). Results presented in that paper show that evolutionary algorithms compare favorably to Walksat. Finally, Boughaci et al. introduced a new selection strategy (5) based on both fitness and diversity to choose individuals to participate in the reproduction phase of a genetic algorithm. Experiments showed that the resulting genetic algorithm was able to find solutions of a higher quality

Lacking the theoretical guidelines while being stochastic in nature, the deployment of several meta-heuristics involves extensive experiments to find the optimal noise or walk probability settings. To avoid manual parameter tuning, new methods have been designed to automatically adapt parameter settings during the search (25)(32), and results have shown

The multilevel paradigm is a simple technique which at its core involves recursive coarsening to produce smaller and smaller problems that are easier to solve than the original one. The

The multilevel paradigm consists of four phases: coarsening, initial solution, uncoarsening and refinement. The coarsening phase aims at merging the variables associated with the problem to form clusters. The clusters are used in a recursive manner to construct a

pseudo-code of the multilevel generic algorithm is shown in Algorithm 1.

Walksat algorithm, leading to the best known results on some benchmarks.

**2. SAT solvers**

in the selected clause, is randomly.

than the scatter evolutionary algorithm (4).

their effectiveness for a wide range of problems.

**3. Multilevel techniques**

**input** : Problem *P*<sup>0</sup> **output**: Solution *Sfinal*(*P*0) **begin** level := 0; **While** Not reached the desired number of levels *Plevel*+1:= Coarsen (*Plevel*); level := level + 1; /\* Initial Solution is computed at the lowest level \*/; *S*(*Plevel*) =Initial Solution (*Plevel*) ; **While** (*level* > <sup>0</sup>) *Sstart*(*Plevel*−1): = Uncoarsen (*Sfinal*(*Plevel*)); *Sfinal*(*Plevel*−1) := Refine (*Sstart*(*Plevel*−1)); level := level - 1; **end**

hierarchy of problems each representing the original problem but with fewer degrees of freedom. The coarsest level can then be used to compute an initial solution. The solution found at the coarsest level is uncoarsened (extended to give an initial solution for the next level) and then improved using a chosen optimization algorithm. A common feature that characterizes multilevel algorithms, is that any solution in any of the coarsened problems is a legitimate solution to the original one. Optimization algorithms using the multilevel paradigm draw their strength from coupling the refinement process across different levels. Multilevel techniques were first introduced when dealing with the graph partitioning problem (GGP) (1) (14) (16) (22) (23) (44) and have proved to be effective in producing high quality solutions at a lower cost than single level techniques. The traveling salesman problem (TSP) was the second combinatorial optimization problem to which the multilevel paradigm was applied (45) (46) and has clearly shown a clear improvement in the asymptotic convergence of the solution quality. When the multilevel paradigm was applied to the graph coloring problem (42), the results do not seem to be in line with the general trend observed in GCP and TSP as its ability to enhance the convergence behavior of the local search algorithms was rather restricted to some class of problems. Graph drawing is another area where multilevel techniques gave a better global quality to the drawing and the author suggests its use to both accelerate and enhance force drawing placement algorithms (43).
