3.5. Evolutionary algorithm (MA)

The evolutionary algorithm proposed in this chapter and described in Algorithm 2 combines a genetic algorithms and local search. The algorithm maintains a population of solutions for the problem at hand (i.e., a pool having several solutions simultaneously). Each of these solutions is called an individual. Each generation consists of updating a population of individuals, hopefully leading to better solutions. The individuals from the set of solutions, which is called population, will evolve from generation to generation by repeated application of genetic operators and a local search scheme. Over many generations, the population becomes uniform and converges to optimal or near-optimal solutions.

## Algorithm 2. Evolutionary algorithm

## begin

clusters. P<sup>0</sup> corresponds to the original problem. The random-coarsening procedure is used to randomly merge the literals in pairs leading to a coarser problem (level) with five clusters. This process is repeated leading to the coarsest problem (P3) with three clusters. An initial population is generated where the clusters are randomly assigned the value of true or false. The figure shows an initial solution where one cluster is assigned the value of true and the remaining two clusters are assigned the value false. Thereafter, the computed initial solution is then improved with the evolutionary algorithm referred to as MA. As soon as the convergence criteria are reached at P2, the uncoarsening phase takes the whole population from that level and then extends it so that it serves as an initial population for the parent level P<sup>1</sup> and then proceeds with a new round of MA. This iteration process ends when MA reaches the stop criteria that is

Figure 1. The various phases of the multilevel evolutionary algorithm.

206 Machine Learning - Advanced Techniques and Emerging Applications

The coarsening phase stops when the problem size reaches a threshold. A random procedure is used to generate an initial solution at the coarsest level. The clusters of every individual in the population are assigned the value of true or false in a random manner (line 7 of Algorithm 1).

met at P0.

3.3. Initial solution

Generate initial population ;

Evaluate the fitness of each individual in the population ;

while (Not Convergence reached) do

Select individuals according to a scheme to reproduce ;

Breed if necessary each selected pairs of individuals through crossover;

Apply mutation if necessary to each offspring ;

Apply local search to each chromosome ;

Evaluate the fitness of the intermediate population ;

Replace the parent population with a new generation

#### end

• Fitness function: it is a numerical value that expresses the performance of an individual (solution) so that different individuals can be compared. The fitness function is defined as the number of unsatisfied clauses.


• Crossover probability = 0.85 • Mutation probability = 0.1

Table 1. Benchmark set of the SAT competition Beijing.

• Stopping criteria for the coarsening phase: the coarsening stops as soon as the size of the smallest problem reaches 100 variables (clusters). At this level, MA generates an initial

Instance Number of variables Number of clauses

A Multilevel Evolutionary Algorithm Applied to the Maximum Satisfiability Problems

http://dx.doi.org/10.5772/intechopen.72843

209

2bitadd10:cnf 590 1422 2bitadd11:cnf 649 1562 2bitadd12:cnf 708 1702 2bitcomp5:cnf 125 310 2bitmax6:cnf 252 766 2bitadd31:cnf 8432 31,310 2bitadd32:cnf 8704 32,316 3block.cnf 283 9690 4blocks.cnf 758 47,820 4blocksb.cnf 410 24,758 e0ddr2-10-by-5-1.cnf 19,500 103,887 e0ddr2-10-by-5-4.cnf 1728 104,527 enddr2-10-by-5-1.cnf 20,700 111,567 enddr2-10-by-5-8.cnf 21,000 113,729 ewddr2-10-by-5-1.cnf 21,800 118,607 ewddr2-10-by-5-8.cnf 22,500 123,329

• Convergence: if the fitness of the best individual does not improve during 10 consecutive generations, MA is assumed to have reached convergence and moves to a higher level.

The time development of the multilevel evolutionary algorithm against its single variant in solving the instances is shown in Figures 2–8. The plots show the 100 runs of both algorithms with a cutoff at 15 min as well as the mean of these runs. The search occurs in two phases. In the first phase, the best solution improves rapidly at first, and then flattens off as the search reaches the plateau region, marking the start of the second phase. The plateau region corresponds to a region in the search space where moves does not alter the best assignment, and

• Population size = 50

population.

5.1. Observed trends

5. Results
