**4. Memetic Algorithms (MAs)**

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 canonical memetic algorithm.

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

Sat-Encoded Problems 5

A Multilevel Approach Applied to Sat-Encoded Problems 171

LEVEL−0 LEVEL−1 LEVEL−2

T

UNCOARSENING UNCOARSENING + + REFINEMENT REFINEMENT

it. As soon as the convergence criteria is reached at *Level*2, the uncoarsening phase takes the solution from that level and extends it to give an initial solution for *Level*<sup>1</sup> and then proceed with the refinement. This iteration process ends when MA reaches the stop criteria that is met

The coarsening procedure has been implemented so that each coarse problem *Pl*<sup>+</sup><sup>1</sup> is created from its parent problem *Pl* by merging variables and representing each merged pair *vi* and *vj* with a child variable that we call a cluster in *Pl*+1. The coarsening scheme uses a simple randomized algorithm similar to (16). The variables are visited in a random order. If a variable *vi* has not been merged yet, then we randomly select one randomly unmerged variable *vj*, and a cluster consisting of these two variables is created. Unmatched variables are simply copied to the next level. The new formed clusters are used to define a new and smaller problem and recursively iterate the coarsening process until the size of the problem reaches some desired

As soon as the coarsening phase is ended, a memetic algorithm is used at different levels. The next subsections describes the main features of the memetic algorithm used in this work.

The notion of fitness is fundamental to the application of memetic algorithms. It is a numerical value that expresses the performance of an individual (solution) so that different individuals can be compared. The fitness of a chromosome (individual) is equal to the number of clauses

that are unsatisfied by the truth assignment represented by the chromosome.

F

F

T

COARSENING

F

T T

T

F F

T

at *Level*0.

threshold.

**5.2 Initial solution & refinement**

**5.2.1 Fitness function**

**5.1 Coarsening**

T

F

COARSENING

Fig. 1. The various phases of the multilevel memetic algorithm.

F

T

F

F

T

F

T

REFINEMENT

T

INITIAL SOLUTION

### **Algorithm 2:** A Canonical Memetic Algorithm

#### **begin**


affects the appearance of an organism called phenotype. The chromosomes are encoded using a chosen representation and each can be thought of as a point in the search space of candidate solutions. Each individual is assigned a score (fitness) value that allows assessing its quality. The members of the initial population may be randomly generated or by using sophisticated mechanisms by means of which an initial population of high quality chromosomes is produced.

The reproduction operator selects (randomly or based on the individual's fitness) chromosomes from the population to be parents and enters them in a mating pool. Parent individuals are drawn from the mating pool and combined so that information is exchanged and passed to offspring depending on the probability of the crossover operator. The new population is then subjected to mutation and entered into an intermediate population. The mutation operator acts as an element of diversity into the population and is generally applied with a low probability to avoid disrupting crossover results. The individuals from the intermediate population are then enhanced with a local search and evaluated.

Finally, a selection scheme is used to update the population giving rise to a new generation. The individuals from the set of solutions which is called population will evolve from generation to generation by repeated applications of an evaluation procedure that is based on genetic operators and a local search scheme. Over many generations, the population becomes increasingly uniform until it ultimately converges to optimal or near-optimal solutions.

#### **5. The Multilevel Memetic Algorithm (MLVMA)**

The implementation of a multilevel algorithm for the SAT problem requires four basic components: a coarsening algorithm, an initialization algorithm, an extension algorithm (which takes the solution on one problem and extends it to the parent problem), and a memetic algorithm which will be used during the refinement phase. In this section we describe all these components which are necessary for the derivation of a memetic algorithm operating in a multilevel context. This process, is graphically illustrated in Figure 1 using an example with 10 variables. The coarsening phase uses two levels to coarsen the problem down to three clusters. *Level*<sup>0</sup> corresponds to the original problem. A random coarsening procedure is used to merge randomly the variables in pairs leading to a coarser problem with 5 clusters. This process is repeated leading to the coarsest problem with 3 clusters. An initial solution is generated where the first cluster is assigned the value of true and the remaining two clusters are assigned the value false. At the coarsest level, our MA wil generate an initial population and then improves

Fig. 1. The various phases of the multilevel memetic algorithm.

it. As soon as the convergence criteria is reached at *Level*2, the uncoarsening phase takes the solution from that level and extends it to give an initial solution for *Level*<sup>1</sup> and then proceed with the refinement. This iteration process ends when MA reaches the stop criteria that is met at *Level*0.

#### **5.1 Coarsening**

4 VLSI Design

**While** (Not Convergence reached) Select individuals according to a scheme to reproduce

affects the appearance of an organism called phenotype. The chromosomes are encoded using a chosen representation and each can be thought of as a point in the search space of candidate solutions. Each individual is assigned a score (fitness) value that allows assessing its quality. The members of the initial population may be randomly generated or by using sophisticated mechanisms by means of which an initial population of high quality

The reproduction operator selects (randomly or based on the individual's fitness) chromosomes from the population to be parents and enters them in a mating pool. Parent individuals are drawn from the mating pool and combined so that information is exchanged and passed to offspring depending on the probability of the crossover operator. The new population is then subjected to mutation and entered into an intermediate population. The mutation operator acts as an element of diversity into the population and is generally applied with a low probability to avoid disrupting crossover results. The individuals from the

Finally, a selection scheme is used to update the population giving rise to a new generation. The individuals from the set of solutions which is called population will evolve from generation to generation by repeated applications of an evaluation procedure that is based on genetic operators and a local search scheme. Over many generations, the population becomes increasingly uniform until it ultimately converges to optimal or near-optimal solutions.

The implementation of a multilevel algorithm for the SAT problem requires four basic components: a coarsening algorithm, an initialization algorithm, an extension algorithm (which takes the solution on one problem and extends it to the parent problem), and a memetic algorithm which will be used during the refinement phase. In this section we describe all these components which are necessary for the derivation of a memetic algorithm operating in a multilevel context. This process, is graphically illustrated in Figure 1 using an example with 10 variables. The coarsening phase uses two levels to coarsen the problem down to three clusters. *Level*<sup>0</sup> corresponds to the original problem. A random coarsening procedure is used to merge randomly the variables in pairs leading to a coarser problem with 5 clusters. This process is repeated leading to the coarsest problem with 3 clusters. An initial solution is generated where the first cluster is assigned the value of true and the remaining two clusters are assigned the value false. At the coarsest level, our MA wil generate an initial population and then improves

intermediate population are then enhanced with a local search and evaluated.

**Algorithm 2:** A Canonical Memetic Algorithm

Evaluate the fitness of each individual in the population ;

Apply mutation if necessary to each offspring ; Apply local search to each chromosome ;

**5. The Multilevel Memetic Algorithm (MLVMA)**

Evaluate the fitness of the intermediate population ; Replace the parent population with a new generation; ;

Breed if necessary each selected pairs of individuals through crossover;

Generate initial population ;

chromosomes is produced.

**begin**

;

**end**

The coarsening procedure has been implemented so that each coarse problem *Pl*<sup>+</sup><sup>1</sup> is created from its parent problem *Pl* by merging variables and representing each merged pair *vi* and *vj* with a child variable that we call a cluster in *Pl*+1. The coarsening scheme uses a simple randomized algorithm similar to (16). The variables are visited in a random order. If a variable *vi* has not been merged yet, then we randomly select one randomly unmerged variable *vj*, and a cluster consisting of these two variables is created. Unmatched variables are simply copied to the next level. The new formed clusters are used to define a new and smaller problem and recursively iterate the coarsening process until the size of the problem reaches some desired threshold.

#### **5.2 Initial solution & refinement**

As soon as the coarsening phase is ended, a memetic algorithm is used at different levels. The next subsections describes the main features of the memetic algorithm used in this work.

#### **5.2.1 Fitness function**

The notion of fitness is fundamental to the application of memetic algorithms. It is a numerical value that expresses the performance of an individual (solution) so that different individuals can be compared. The fitness of a chromosome (individual) is equal to the number of clauses that are unsatisfied by the truth assignment represented by the chromosome.

Sat-Encoded Problems 7

A Multilevel Approach Applied to Sat-Encoded Problems 173

process form being trapped into local optimum while adding to the diversity of the population and thereby increasing the likelihood that the algorithm will generate individuals with better

The selection operator acts on individuals in the current population. During this phase, the search for the global solution gets a clearer direction, whereby the optimization process is gradually focused on the relevant areas of the search space. Based on each individual quality (fitness), it determines the next population. In the roulette method, the selection is stochastic and biased toward the best individuals. The first step is to calculate the cumulative fitness of the whole population through the sum of the fitness of all individuals. After that, the

PossFlips ← a randomly selected variable with the largest decrease (or smallest increase)

Finally, the last component of our MA is the use of local improvers. By introducing local search at this level, the search within promising areas is intensified. This local search should be able to quickly improve the quality of a solution produced by the crossover operator, without diversifying it into other areas of the search space. In the context of optimization, this rises a number of questions regarding how best to take advantage of both aspects of the whole algorithm. With regard to local search there are issues of which individuals will undergo local improvement and to what degree of intensity. However care should be made in order to balance the evolution component (exploration) against exploitation (local search component). Bearing this thought in mind, the strategy adopted in this regard is to let each chromosome go through a low rate intensity local improvement. Algorithm 3 shows the local search algorithm used. This heuristic is used for one iteration during which it seeks for the variable-value assignment with the largest decrease or the smallest increase in the number of unsatisfied

clauses. Random tie breaking strategy is used between variables with identical score.

As soon as the population tends to loose its diversity, premature convergence occurs and all individuals in the population tend to be identical with almost the same fitness value. During each level, the proposed memetic algorithm is assumed to reach convergence when no further improvement of the best solution (the fittest chromosome) has not been made during two

<sup>1</sup> *f i*, where

probability of selection is calculated for each individual as being *PSelectioni* <sup>=</sup> *fi*/ <sup>∑</sup>*<sup>N</sup>*

fitness values.

**5.2.6 Selection**

*fi* is the fitness of individual i.

**output**: A possibly improved *Chromosomei* ;

*Chromosomei* ← *Chromosomei* with v flipped ; **If** *Chromosomei* satisfies Φ return *Chromosomei*;

**5.2.7 Local search**

**begin**

**end**

**Algorithm 3:** local-search **input** : *Chromosomei*

> in unsatisfied clauses;; v ← Pick (PossFlips);;

**5.2.8 Convergence criteria**

consecutive generations.

#### **5.2.2 Representation**

A representation is a mapping from the state space of possible solutions to a state of encoded solutions within a particular data structure. The chromosomes (individuals) which are assignments of values to the variables are encoded as strings of bits, the length of which is the number of variables (or clusters if MA is operating on a coarse level). The values *True* and *False* are represented by 1 and 0 respectively. In this representation , an individual X corresponds to a truth assignment and the search space is the set *<sup>S</sup>* <sup>=</sup> {0, 1}*n*.
