%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
Back to Index
MinSAT & WalkSATMinSAT is a research topic not broadly studied. It is an interesting problem because is the minimization of SAT and is a NP-Hard problem. More important it has great impact in the work done to build WalkMINQBF because it helps in the creation of a subformula that will help in getting an UNSAT answer for the QBF Solver we built.
Learning about minsat was not an easy task. Since there are not many papers about it the most logic way of understanding the problem was reading about MaxSAT. MaxSAT gave us some ideas about how to build a MinSAT solver.
Complete MinsatBefore attempting to build a minsat solver that was quick and useful for our purposes I built a complete minsat solver that uses enumeration to try all the existent solutions searching for the minsat optimal value. As expected this solver was easy to build and of course only gave me some better understanding of the minsat problem because after adding more than 15 variables it becomes a very slow solution. (Sometimes, I also used it as a tool to verify the job done by the incomplete algorithm done for the WalkMINQBF algorithm)
Complete MinSAT Code (ZIP) Building WalkMINSATWe decided to use WalkSAT as a template to build an efficient MINSAT solver. WalkSAT was studied and used as an easy way to create a stochastic local search method needed to build WalkMINQBF. The data structures and the way it iterates through the clauses and variables were ideal to create a quick and incomplete MINSAT solver without worrying about the design of the data structures to hold the information.
WalkSAT is a very efficient code that uses a lot of programming tricks to be fast. After understanding some of the arrays and variables used to create a SAT solution we modified the behavior so the solver instead of searching to maximize the number of SAT clauses it began to minimize them. After changing the meaning of what a good answer is (instead of looking for the maximum number of SAT clauses we look for the minimum) we added some new heuristics to the code.
The most important data structures and functions from the original walkSAT are described below. Then I will explain the main modifications done to convert the walkSAT code into walkMINSAT.
To explain each data structure we will use the following figure so we can easily understand the components that WalkSAT uses to solve a SAT formula.
In the figure we can see the following data structures that are filled when a sat formula is parsed.
Using the above data structures, the algorithm is capable of iterate through the clauses where the value of the variables have been modified instead of searching in the complete set of clauses. It is a very clever way to prove the satisfiability of the problem without having to run through the m number of clauses.
The following figure will show some dynamic data structures used by the heuristics to decide which is the best way of moving through the search space.
Breakcount and Makecount are used to decide which the best variable to flip is. In general they provide very useful information to make good decisions about how to flip variables. They are used by the heuristics to decide which is the best variable to flip.
Additionally to the data structures from above, WalkSAT relies on two special arrays that help to make the algorithm faster. The False and WhereFalse arrays are used to quickly modify the information hold about the clauses that are modified when a flip is done. They are very useful to avoid the need of iterating through all the clauses to make the modifications to the makecount and breakcount of the variables.
To solve the MINSAT problem we added the following data structures based on the idea and spirit of the false array of the WalkSAT algorithm:
As we can see from all the data structures explained we can see that the algorithm has a complete control of the clauses and the relation between them and the variables. One of the main advantages of the WalkSAT algorithm is the capacity to update the information of the clauses without iterating through all the clauses so we used the same structure but using the true literals instead of the false information.
The algorithm that the minsat method uses (as described on the paper written by Yannet Interian, Gabriel Corvera and Bart Selman) is the following:
The algorithm will try to follow the same idea of the WalkSAT algorithm. It begins with a random assignment to the variables of the formula then it will chose one to flip using a given heuristic defined on the algorithm as ChooseVar if it finds a better assignment (one with less satisfied clauses) it will save it and continue trying to find a better assignment until the number of steps ends.
After creting the structures we have to decide how to choose the variable to flip. Those heuristics were easily added because WalkSAT has a very easy way to add heuristics. So we decided to begin to test some ideas of how to minimize random SAT problems in an efficient and quick way. As stated by the paper we began using a heuristic named WORST similar to one found in WalkSAT until we created the Mixed_Balance which is based on the creation of a score called Balance.
The heuristics created to use and test MinSAT are:
We know that minimizing the universal part of the formula we will get sub-formulas with higher density that at the same time will have more chances of been UNSAT. The balance score used by mixed_balance and balance is useful to determine which clauses and variables will help to get a higher density and then get more UNSAT sub-formulas.
After testing each heuristic with different parameters we decided to use the mixed_balance heuristic for the WalkMINQBF algorithm because it has the properties we needed:
Some tests run on the different heuristics also show why the Mixed Balance heuristics was selected over the others. The following chart shows the number of QBF formulas each heuristic helped to solve once integrated with the QBF solver.
The main difference between the three heuristics was that the Mixed_Balance takes into consideration the properties of the variables and clauses and not just selects the variables at random as Random or Worst does.
As the chart shows, Mixed_Balance is quicker on solving the QBF problems and also it does it better than the other 2 heuristics.
Additionally, the mixed_balance was the only heuristic that gave us UNSAT sub-formulas closer to ratios between 3.8 and 4.0 meaning that those sub-formulas are better because there are more likely UNSAT.
To define quickly the best balance score of a formula when a change was going to be done, we defined the function d_balance. With this function we calculate the difference in the balance score of the formula so we can understand how the formula will move on through finding the minsat assignment when choosing certain variable to be flipped.
The implementation of d_balance only visits the modified variables on the modified clauses to calculate the value instead of looking at all the clauses. Complete WalkMINSAT and more HeuristicsThe WalkMINQBF algorithm does not needs a complete Minsat algorithm because it needs several solutions approximated to the minimal value so it can try to prove UNSAT on each. After working with WalkMINQBF I decided to complete the MINSAT Solver using the same ideas that are described for MAXSAT in the paper written by Borchers.
Borchers uses WalkSAT to get a good approximation of a solution that satisfies the MAXSAT problem (get the maximum number of satisfied clauses). After running the local search it tries to search through all the solutions to find the optimum solution using the value got from WalkSAT as a way to cut the tree.
As I already have the MinSAT local search done the only part I added to the algorithm was the complete branch and bound algorithm. The whole idea was to use the value obtained from the MinSAT local search to cut the search tree. As happens with a complete MAXSAT solver, the complete MinSAT solver is not very efficient, but when solving small problems it shows that the local search answer is very accurate. I played with some other heuristics described below to try the efficiency of some of them and I got different results from creating new heuristics and running them in a complete search.
| |||||||||||||||||||||||||||||||||||||||||||||||
©2005 GaloGS |
|||||||||||||||||||||||||||||||||||||||||||||||