Many researchers have focused on the satisfiability problem and on many of its variants due to its applicability in many areas of artificial intelligence. This NP-complete problem refers to the task of finding a satisfying assignment that makes a Boolean expression evaluate to True. In this work, we introduce a memetic algorithm that makes use of the multilevel paradigm. The multilevel paradigm refers to the process of dividing large and difficult problems into smaller ones, which are hopefully much easier to solve, and then work backward toward the solution of the original problem, using a solution from a previous level as a starting solution at the next level. Results comparing the memetic with and without the multilevel paradigm are presented using problem instances drawn from real industrial hardware designs.
A major challenge in solving large and complex problems is that there is no mathematical basis for efficiently reaching the global solution. Over the past few years, there has been increasing interest in solving these problems using memetic algorithms (MAs). MAs are a special kind of genetic algorithm (GA) with local hill climbing. Unfortunately, the performance of MAs as well as other available optimization techniques deteriorates very rapidly mostly due to two reasons. First, the complexity of the problem usually increases with its size, and second, the solution space of the problem increases exponentially with the problem size. Because of these two issues, optimization search techniques tend to spend most of the time exploring a restricted area of the search space, preventing the search from visiting more promising areas, and thus leading to solutions of poor quality. Designing efficient optimization search techniques requires a tactical balance between diversification and intensification (Blum and Roli, 2003). Diversification refers to the ability to explore many different regions of the search space, whereas intensification refers to the ability to obtain high quality solutions within those regions. While the combination of a population of solutions and genetic operators constitutes the main component of MAs that act as a diversification factor on the search space, the use of local search methods helps to quickly identify better solutions in a localized region of the search space. Lozano and Martinez (2010), discuss the latest design of hybrid approaches in order to find an adequate balance between diversification and intensification.
In this paper, we consider the multilevel paradigm as a means to improve the performance of MAs. The multilevel paradigm is a simple technique, which at its core involves recursive coarsening to create a hierarchy of smaller problems which are hopefully much easier to solve. An initial solution is computed at the coarsest level and then iteratively refined at each level. Uncoarsening is applied to transfer the solution from one level to another. The multilevel paradigm has been proposed as a general solution strategy and with some few exceptions, the multilevel paradigm has not been widely applied to combinatorial optimization problems.
The rest of the paper is organized as follows. Section 2 explains the satisfiability problem. Section 3 provides an overview of algorithms used for solving the satisfiability problem. Section 4 reviews some of the multilevel techniques that have been applied to other combinatorial optimization problems. Section 5 gives a general description of memetic algorithms. Section 6 introduces the multilevel memetic algorithm. Section 7 presents the results obtained from testing the multilevel memetic algorithm on large industrial instances. Finally, in Section 8 we present a summary and some guidelines for future work.
2. The Satisfiability Problem
3. SAT Solvers
3.1. Common Features
The SAT problem has been extensively studied due to its simplicity and applicability. The simplicity of the problem coupled with its intractability makes it an ideal platform for exploring new algorithmic techniques. This has led to the development of several local search algorithms that have many elements in common. Local search algorithms typically start with an initial assignment of truth values to variables, randomly or heuristically generated. Satisfiability can then be formulated as an iterative optimization problem in which the goal is to minimize the number of unsatisfied clauses. Thus, the optimum is obtained when the value of the objective function equals zero, which means that all clauses are satisfied. During each iteration, a new value assignment is selected from the neighborhood of the present one, by performing a move. Most local search algorithms use a 1-flip neighborhood relation, which means that two truth value assignments are considered to be neighbors if they differ in the truth value of only one variable. Performing a move, then, consists of switching the present value assignment with one of the neighboring value assignments. The search terminates if no better neighboring assignment can be found.
3.2. GSAT and its Variants
One of the earliest local search algorithms for solving SAT is GSAT (Selman et al., 1992) Essentially, 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 has been performed. The introduction of an element of randomness (i.e., noise) into a local search method is common practice for improving its effectiveness through diversification (Blum and Roli, 2003). To this end, an extension of GSAT, referred to as random walk (Selman and Kautz, 1993), has been realized with the purpose of escaping from local optima. In a random walk step, a randomly unsatisfied clause is selected. Then, one of the variables appearing in that clause is flipped, thus effectively forcing the selected clause to become satisfied. The main idea is to decide at each search step whether to perform a standard GSAT or a random-walk strategy with a probability called the walk probability.
3.3. WalkSAT and its Variants
Another widely used variant of GSAT is the WalkSAT algorithm, originally introduced in Selman et al. (1994). It first randomly picks 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 selected. The break count of a variable is defined as the number of clauses that would be unsatisfied by flipping the chosen variable. If there exists a variable with a break count equal to zero, this variable is flipped; otherwise, the variable with minimal break count is selected with a certain probability (noise probability). It turns out that the choice of unsatisfied clauses, combined with the randomness in the selection of variables, can enable WalkSAT to avoid local minima and to better explore the search space. Extensive tests have led to the introduction of new variants of the Walksat algorithm referred to as Novelty (McAllester et al., 1997) and R-Novelty (Hoos, 1999). These two variants use a combination of two criteria when choosing a variable to flip from within an unsatisfied clause. Quite often, these two algorithms can get stuck in local minima and fail to get out. To this end, recent variants have been designed (Hoos, 2002; Li and Huang, 2005; Li et al., 2007) using a combination of search intensification and diversification mechanisms leading to good performance on a wide range of SAT instances.
3.4. Weighting Techniques
Other algorithms (Gent and Walsh, 1995; Gent and Walsh, 1993; Glover, 1989; Hansen and Jaumand, 1990) used history-based variable selection strategies in order to avoid flipping the same variable. In parallel to the development of more sophisticated versions of randomized improvement techniques, other methods based on the idea of modifying the evaluation function (Hutter et al., 2002; Schuurmans and Southey, 2000; Schuurmans et al., 2001; Thornton et al., 2004; Wu and Wah, 2000) in order to prevent the search from getting stuck in unattractive areas of the underlying search space, have become increasingly popular in SAT solving. The key idea is to associate the clauses of the given CNF formula with weights. Although these clause weighting algorithms differ in the way clause weights should be updated (probabilistic or deterministic), they all choose to increase the weights of all the unsatisfied clauses as soon as a local minimum is encountered. A new approach to clause weighting known as divide and distribute fixed weights (DDFW; Ishtaiwi et al., 2005) 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 (Prestwish, 2005) instead of clauses greatly enhances the performance of the WalkSAT algorithm, leading to the best known results on some benchmarks.
3.5. Evolutionary Algorithms
Evolutionary algorithms (EAs) 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, which is a hybrid approach that combines a specific crossover and a TABU search procedure (Jin-Kao et al., 2003; Lardeux et al., 2006), is considered to be the best known genetic algorithm for SAT. The experiments have shown that GASAT provides very competitive results compared with state of the art SAT algorithms. Several EAs for SAT have been proposed in Gottleib et al. (2002), and the results presented in that paper show that evolutionary algorithms compare favorably to WalkSAT. Finally, a new selection strategy (Boughaci et al., 2008) based on both fitness and diversity to choose individuals to participate in the reproduction phase of a GA showed that the resulting GA gave solutions of a higher quality compared to scatter EA (Boughaci and Drias, 2005).
3.6. Recent Strategies
Lacking the theoretical guidelines while being stochastic in nature, the deployment of several metaheuristics 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 (Li et al., 2007; Patterson and Kautz, 2001) and results have shown their effectiveness for a wide range of problems. The work conducted in Granmo and Bouhmala (2007) introduced learning automata (LA) as a mechanism for enhancing local search-based SAT solvers, thus laying the foundation for novel LA-based SAT solvers. Finally, a new recent strategy based on an automatic procedure for integrating selected components from various existing solvers has been devised in order to build new efficient algorithms that combine the strengths of multiple algorithms (Khudabukhsh et al., 2009; Hutter et al., 2002).
4. Multilevel Techniques
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 of forming clusters. The clusters are used in a recursive manner to construct a 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 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 (GPP; Barnard and Simon, 1994; Hadany and Harel, 1999; Hendrickson and Leland, 1995; Karypis and Kumar, 1998a, 1998b; Walshaw and Cross, 2000) 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 (Walshaw, 2001a; Walshaw, 2002) and has clearly shown improvement in the asymptotic convergence of the solution quality. When the multilevel paradigm was applied to the graph coloring problem (Walshaw, 2001b), the results did not seem to be in line with the general trend observed in GPP and TSP as its ability to enhance the convergence behavior of the local search algorithms was restricted to a specific 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 (Walshaw, 2003)
5. Memetic Algorithms (MAs)
MAs represent the set of hybrid algorithms that combine GAs and local search. In general, the GA improves the solution, while the local search fine tunes the solution. They are adaptive based search optimization algorithms that take their inspiration from genetics and evolution processes (Moscato, 1989). MAs simultaneously examine and manipulate a set of possible solutions. 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 alleles. All genes of an organism form a genome which affects the appearance of an organism, called the 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 an assessment of its quality. The members of the initial population may be generated randomly 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.
6. 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 an MA which will be used during the refinement phase. In this section, we describe all these components which are necessary for the derivation of an MA 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. Level0 corresponds to the original problem. A random coarsening procedure is used to randomly merge the variables in pairs leading to a coarser problem with five clusters. This process is repeated, leading to the coarsest problem with three 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 of False. At the coarsest level, our MA will generate an initial population and then improve it. As soon as the convergence criterion is reached at Level2, the uncoarsening phase takes the solution from that level and extends it to give an initial solution for Level1 and then proceeds with the refinement. This iteration process ends when the MA reaches the stop criterion that is met at Level0.
The coarsening procedure has been implemented so that each coarse problem Pl+1 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 the one in Hendrickson and Leland (1995). 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 newly formed clusters are used to define a new and smaller problem. The coarsening process is recursively iterated until the size of the problem reaches some desired threshold.
6.2. Initial Solution and Refinement
As soon as the coarsening phase comes to an end, an MA is used at different levels. The next sections describe the main features of the MA used in this work.
6.2.1. Fitness Function
The notion of fitness is fundamental to the application of MAs. 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.
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 the 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 .
6.2.3. Initial Population
An initial solution is generated using a population consisting of 50 individuals. According to our computational experience, larger populations do not bring effective improvements on the quality of the results. At the coarsest level, an MA will randomly generate an initial population of 50 individuals in which each gene's allele is assigned a value of 0 or 1.
The task of the crossover operator is to reach regions of the search space with higher average quality. New solutions are created by combining pairs of individuals in the population and then applying a crossover operator to each chosen pair. Combining pairs of individuals can be viewed as a matching process. The individuals are visited in random order. An unmatched individual ik is matched randomly with an unmatched individual il. Thereafter, the two-point crossover operator is applied using a crossover probability to each matched pair of individuals. The two-point crossover selects two random points within a chromosome and then interchanges the two parent chromosomes between these points to generate two new offspring. Recombination can be defined as a process in which a set of configurations (solutions referred to as parents) undergoes a transformation to create a set of configurations (referred to as offspring). The creation of these descendants involves the location and combination of features extracted from the parents. The reasons behind choosing the two point crossover are the results presented in Vrajitoru (1999), where the difference between the different crossovers is not significant when the problem to be solved is hard. The work conducted in Spears (1995) shows that two-point crossover is more effective when the problem at hand is difficult to solve. In addition, the author proposes an adaptive mechanism in order to have EAs choose which forms of crossover to use and how often to use them, as it solves a problem.
The purpose of mutation, which is the secondary search operator used in this work, is to generate modified individuals by introducing new features in the population. By mutation, the alleles of the produced child have a chance to be modified, which enables further exploration of the search space. The mutation operator takes a single parameter pm, which specifies the probability of performing a possible mutation. Let be a chromosome represented by a binary chain where each of whose genes ci is either 0 or 1. In our mutation operator, each gene ci is mutated through flipping the gene's allele from 0 to 1 or vice versa if the probability test is passed. The mutation probability ensures that, theoretically, every region of the search space is explored. If, on the other hand, mutation is applied to all genes, the evolutionary process will degenerate into a random search with no benefit of information gathered in the preceding generations. The mutation operator prevents the search process from being trapped in a local optimum while adding to the diversity of the population and thereby increasing the likelihood that the algorithm will generate individuals with better fitness values.
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), the next population is determined. 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 probability of selection is calculated for each individual as being , where fi is the fitness of individual i.
6.2.7. Local Search
6.2.8. Convergence Criteria
As soon as the population loses 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 MA is assumed to reach convergence when no further improvement of the best solution (the fittest chromosome) has been made over two consecutive generations.
Having improved the assignment at the evel of Lm+1, the assignment must be projected onto its parent level Lm. The uncoarsening process is trivial; if a cluster is assigned the value of True, then the matched pair of clusters that it represents, Cj and Ck, are also assigned the value of True. The idea of refinement is to use the projected population from Lm+1 onto Lm as the initial population for further improvement using the proposed MA. Even though the population at Lm+1 is at a local minimum, the projected population at level Lm may not be at a local optimum. Since the projected population is already a good solution and contains individuals with high fitness value, the MA will converge quickly within a few generation to a better assignment.
7. Experimental Results
7.1. Boundary Model Checking
The instances used in our experiments arise from model checking (Cook, 1971) which is considered to be one among many real-world problems that are often characterized by large and complex search spaces. Model checking is an automatic procedure for verifying finite-state concurrent systems. Given a model of a design and a specification in temporal logic, it is possible to check whether the model satisfies the specification. Methods for automatic model checking of complex hardware design systems are gaining wide industrial acceptance compared to traditional techniques based on simulation. The most widely used of these methods is called bounded model checking (BMC). In BMC, the design to be validated is represented as a finite state machine, and the specification is formalized by writing temporal logic properties. The reachable states of the design are then traversed in order to verify the properties. The basic idea in BMC is to find bugs or counterexamples of length k.
In practice, longer counterexamples are searched out by incrementing the bound k, and if no counterexample exists after a certain number of iterations, it is possible to conclude that the correctness of the specification holds. The main drawback with model checking real systems is the so-called state-explosion problem: as the size of of the system being verified increases, the total state space of the system increases exponentially. This problem makes exhaustive search exploration intractable. In recent years, there has been growing interest in applying methods based on propositional SAT (Goldberg and Novikov, 2002; Mahajan et al., 2004) in order to improve the scalability of model checking. The BMC problem can be reduced to a propositional SAT problem, and can therefore be solved by SAT solvers. Essentially, there are two phases in BMC. In the first phase, the behavior of the system to be verified is encoded as a propositional formula. In the second phase, that formula is given to a propositional decision algorithm, that is, a satisfiability solver, to either obtain a satisfying assignment or to prove there is none. If the formula is satisfiable, it means that a bug has been located in the design; otherwise, one cannot in general conclude that there is no bug; one must increase the bound, and search for larger bugs.
7.2. Test Suite
We evaluated the performance of the multilevel memetic algorithm on a set of large problem instances taken from real industrial bounded model checking hardware designs. This set is taken from the SATLIB website.1
All the benchmark instances used in this experiment are satisfiable instances. Due to the randomization nature of the algorithms, each problem instance was run 20 times with a cutoff parameter (max-time) set to (300 s). We use |.| to denote the number of elements in a set, for example, |V| is the number of variables, while |C| denotes the number of clauses. Table 1 shows the instances used in the experiment. The tests were carried out on a DELL machine with 800 MHz CPU and 2 GB of memory. The code was written in C and compiled with the GNU C compiler version 4.6. The parameters used in the experiment are listed below:
Crossover probability = 0.85.
Mutation probability = 0.1.
Population size = 50.
Stopping criteria for the coarsening phase: The coarsening stops as soon as the size of the coarsest problem reaches 100 variables (clusters). At this level, the MA generates an initial population.
Convergence during the refinement phase: If no improvement of the fitness function of the best individual has been observed over 10 consecutive generations, the MA is assumed to have reached convergence and moves to a higher level.
|Instance .||Number of variables .||Number of clauses .|
|Instance .||Number of variables .||Number of clauses .|
7.3. Experimental Results
Figures 2,3456789101112 show how the best assignment (fittest chromosome) progresses during the search. The plots immediately show the dramatic improvement obtained using the multilevel paradigm. The performance of the MA is unsatisfactory, which is shown more dramatically for larger problems as the percentage excess over the solution is higher compared to that of MLVMA. The curves show no crossover, implying that MLVMA dominates MA. The plots suggest that problem solving with MLVMA happens in two phases. In the first phase, which corresponds to the early part of the search, MLVMA behaves as a hill-climbing method. In this long phase, up to 85% of the clauses are satisfied. The best assignment improves rapidly at first, and then flattens off at the plateau, marking the start of the second phase.
The plateau spans a region in the search space where flips typically leave the best assignment unchanged, and occurs more specifically once the refinement reaches the finest level. Comparing the multilevel version with the single level version, MLVMA is far better than MA, making it the clear leading algorithm. The key success behind the efficiency of MLVMA relies on the multilevel paradigm. MLVMA uses the multilevel paradigm and draws its strength from coupling the refinement process across different levels. This paradigm offers two main advantages which enable MA to become much more powerful in the multilevel context:
During the refinement phase, MA applies a local a transformation (i.e., a move) within the neighborhood (i.e., the set of solutions that can be reached from the current one) of the current solution to generate a new one. The coarsening process offers a better mechanism for performing diversification (i.e., the ability to visit many and different regions of the search space) and intensification (i.e., the ability to obtain high quality solutions within those regions).
By allowing MA to view a cluster of variables as a single entity, the search becomes guided and restricted to only those configurations in the solution space in which the variables grouped within a cluster are assigned the same value. As the size of the clusters varies from one level to another, the size of the neighborhood becomes adaptive and allows the possibility of exploring different regions in the search space while intensifying the search by exploiting the solutions from previous levels in order to reach better solutions.
Figures 13,14151617 show the convergence behavior expressed as the ratio between the best chromosome of the two algorithms as a function of time. The plots show that the curves are below the value 1 leading to the conclusion that MLVMA is faster than MA. The asymptotic performance offered by MLVMA is impressive, and dramatically improves on MA. In some cases, the difference in performance reaches 30% during the first seconds, and is maintained during the whole search process. However, in other cases, the difference in performance continues to increase as the search progresses. Figure 17 shows the solutions given by the two algorithms expressed as the percentage excess over the solution as a function of the number of clauses. The plot shows that the benefit from using the multilevel paradigm increases with the size of the problem. The difference in quality is within 66% for problems less than 150,000 clauses. For larger problems, the difference can get as high as 77%. This is perhaps not a surprise since there is a much greater potential for large problems, and hence the multilevel paradigm is more likely to be of assistance. The larger the problem, the more coarsening is needed, and consequently, the more refinement at different levels takes place. We turn toward the nonparametric Wilcoxon Rank test in order to test the level of statistical confidence in differences between the mean cost of the two algorithms. The test requires that the absolute values of the differences between the mean costs of the two algorithms are sorted from smallest to largest and these differences are ranked according to absolute magnitude. The sum of the ranks is then formed for the negative and positive differences separately. As the size of the trials increases, the rank sum statistic becomes normal. If the null hypothesis is true, the sum of ranks of the positive differences should be about the same as the sum of the ranks of the negative differences. Using two-tailed p value (<.05), significance performance differences has been observed for all the test problems.
In this work, we have described a new approach for addressing the SAT problem. which combines the multilevel paradigm with a simple MA. Thus, in order to get a comprehensive picture of the new algorithm's performance, we used a set of benchmark instances drawn from BMC. The experiments have shown that MLVMA works quite well with a random coarsening scheme combined with a simple MA used as a refinement algorithm. The random coarsening provided a good global view of the problem, while MA used during the refinement phase provided a good local view. It can be seen from the results that the multilevel paradigm greatly improves the MA and always returns a better solution for the equivalent runtime. The quality of the solution provided by MLVMA can get as high as 77%. A scale-up test shows that the difference in performance between the two algorithms increases with larger problems. Our future work aims at investigating other coarsening schemes and studying other types of crossover in order to improve the efficiency of the multilevel MA.