Local Search Against Local Search - CiteSeerX

2 downloads 0 Views 109KB Size Report
Olivier Bailleux and Jacqueline Chabrier1. Abstract. We use a stochastic local search based method to build SAT instances that are di cult for a given stochastic.
Local Search Against Local Search Published at ECAI'96 Workshop on Advances in Propositional Deduction, Budapest, Hungary, August 1996

Olivier Bailleux and Jacqueline Chabrier1 Abstract. We use a stochastic local search based method to build SAT instances that are dicult for a given stochastic local search algorithm2. This principle can be extended to the production of SAT instances with other unusual features.

1 Introduction The boolean satis ability problem (SAT) consists in determining whether a boolean formulae is true for some assignment of its variables. Because SAT is a central problem in complexity theory [8], its resolution is the subject of a special attention in the IA community. Two kinds of instances are mostly used for testing the solving algorithms for SAT : random instances [7][6] and structured instances, i.e. instances which can be speci ed in a more concise way than a sequence of clauses. We propose a new method to build unusual SAT instances. This approach consists in partially exploring a set of SAT instances with a stochastic local search algorithm. We can obtain instances with speci c features such as instances with few solutions or instances that are dicult for a given solving algorithm.

2 Principle 2.1 Stochastic local search The principle of stochastic local search methods consists in partially exploring a search landscape [2][1], that is a triplet hE; r; hi where :   

is the set of con gurations of a search problem (resp. an optimization problem) instance I , r is a neighborhood relation on E , h is a tness function that assigns a numerical value (usually an integer) to each con guration in E . The tness of a con guration x is minimal (or maximal, according to the current convention) i x is a solution (resp. an optimal solution) of I . E

CRID - Universite de Bourgogne, Faculte des Sciences Mirande, BP 138, 21004 Dijon CEDEX, France. ob, jc @crid.ubourgogne.fr 2 This work is partially supported by the PRC-IA 'Aspects algorithmiques de la resolution des problemes exprimes a l'aide de contraintes'.

1

f

g

Roughly speaking, a local search process follows a sequence of con gurations under the constraint that at a given time, only the neighbors of the current con guration are reachable. The main feature of a local search algorithm is the strategy used to select each new con guration in the neighborhood of the current con guation. We will call Stochastic Going Down (SGD) the following stochastic local search algorithm :  The initial con guration is drawn uniformly from E .  At each step, a new con guration is drawn uniformly from the set of reachable con gurations. If this con guration either improves the tness function or doesn't change its value, it becomes the new current con guration, else the old current con guration is kept.  The search is stopped either if the current con guration is a solution or if the number of achieved steps is equal to a given constant maxflips. We will call Greedy Search (GS) the same algorithm as SGD, except that each new con guration is drawn uniformly from the set of reachable con gurations that minimize (or maximize, in a maximization context) the tness function. GSAT [10][9] is a Greedy Search algorithm for the SAT problem. It uses the following landscape :  Each con guration is a binary string where each bit stands for the value of a variable.  A con guration is in the neighborhood of another one i these two con gurations di er by exactly one bit.  The tness of a con guration x is the number of clauses that are violated by x. GSAT and its variants outperform the most ecient complete search procedures on some hard satis able instances [5][3][4]. In the following, we call SGD-SAT the SGD algorithm working with the landscape used by GSAT.

2.2 Making unusual SAT instances

We propose to use the power of the stochastic local search for searching SAT instances that are especially hard for a given stochastic local search algorithm like as SGD. To this end, we use a variant of the SGD algorithm on a landscape whose con gurations are 3SAT3 instances with a given number of clauses and variables. The other features of this landscape are the following : 3

Restriction of SAT with exactly 3 literals per clause.

30v 30c Before Min Max After Min Max 30v 60c Before Min Max After Min Max

SGD

100% 100% 3 5% 12% :

SGD

100% 100% 7% 18%

GSAT Nb.Sol 100% 2 107 100% 4 107 14% 1 104 41% 2 104

30c 30v Before Min Max After Min Max

GSAT Nb.Sol 100% 4 105 100% 8 105 53% 4 102 93% 6 102

30c 60v Before Min Max After Min Max

















Results of 10 experiments on instances of 30 variables (30 and 60 clauses respectively). Minima and maxima of the following features before and after the improvement of hardness for SGD : hardness for SGD, hardness for GSAT, number of solutions.





N b:Sol

1 105 8 105 1 1 



GSAT SGD 100% 100% 100% 100% 0.1% 0% 0.2% 0.1% GSAT 100% 100% 0.1% 2.5%

SGD 100% 100% 0% 1.5%

Results of 10 experiments on instances of 30 variables (30 and 60 clauses respectively). Minima and maxima of the following features before and after minimization of the number of solutions : number of solutions, hardness for GSAT, hardness for SGD.

Table 1.



N b:Sol

1 107 2 107 16 16

Table 2.

4 Conclusion and perspectives

A con guration is in the neighborhood of another one i these two con gurations di er by exactly one literal. The tness of a con guration I is the ratio of SGD-SAT runs that nd a solution of I , with a given value maxflips.

Searching dicult instances for some basic local search procedures, we found instances which were e ectively dicult and which had otherwise few solutions. Morever, searching instances with few solutions, we found instances which had 3 Experimental results e ectively few solutions and which were otherwise dicult for some basic stochastic local search procedures. Although 3.1 Dealing with the hardness these instances are perhaps not representative, we think they As the computation of the tness function can be very ex- are very interesting, especially if we consider the following pansive, we limited our experimentations to instances of 30 questions : Why these instances are hard for GSAT and SGDvariables. We made 10 experiments with 3SAT instances of SAT ? Are they easy for some other stochastic local search 30 variables and 30 clauses, then 10 experiments with 3SAT algorithms ? Can we nd instances that are dicult for local instances of 30 variables and 60 clauses. Each experiment con- search and that have a lot of solutions at the same time ? sists to start the meta-SGD algorithm with a randomly gener- In a most general way, the production of dicult instances for ated instance and performs 3000 iterations with maxflips=100, a given algorithm could be very useful for studying and imthen 3000 iterations with maxflips=300 and naly 3000 iter- proving the robustness and the eciency of solving algorithms ations with maxflips=1000. The table 1 gives, for each serie for NP-complete problems. of 10 experiments, the maximal and the minimal values of the following features, for the initial and the improved instances Acknowledgements respectively : We would like to thank Jean-Jacques Chabrier for useful dis the ratio of SGD-SAT runs that nd a solution (1000 runs), cussions and comments on this paper.  the ratio of GSAT runs that nd a solution (basic version, 1000 runs), REFERENCES  the number of solutions. 

[1] Olivier Bailleux, Contribution a l'etude des paysages de recherche locale associes au probleme SAT, Ph.D. dissertation, Universite de Bourgogne, 1996. [2] Olivier Bailleux and Jean-Jacques Chabrier. Measures on sat landscapes by statistical exploration of search trees. Workshop on studying and solving really hard problems at CP95, 1995. [3] Alain Billonnet and Alain Sutter, `An ecient algorithm for the 3-satis ability problem', Operation Research Letters, 29{ 36, (1992). [4] Jacqueline Chabrier, Vincent Juliard, and Jean-Jacques Chabrier. Score(fd/b)an ecient complete local-based search method for satis ability problems. Workshop on studying and solving really hard problems at CP95, 1995. [5] O. Dubois, P. Andre, Y. Boufkhad, and J. Carlier. Sat versus unsat. DIMACS Challenge on Satis ability Testing, 1994. [6] P. Ian Gent and Toby Walsh, `The sat phase transition', in Proceedings of ECAI 94. John Wiley and Sons, Ltd., (1994).

The instances obtained thanks to the meta-SGD algorithm present at least two particularities. In comparison with randomly generated 3SAT instances with the same number of clauses and variables, they are much more dicult for SGDSAT and GSAT and they have much less solutions. This observation gave us the idea to use SGD for searching instances with very few solutions.

3.2 Dealing with the number of solutions

The table 2 gives the results obtained with the same landscape as the search for hard instances, except for the tness of a con guration which is the number of solutions. The features presented in this table are the same as the table 1. As expected, the obtained instances have very few solutions, but also they are especially dicult for SGD-SAT and GSAT.

2

[7] David Mitchell, Bart Selman, and Hector Levesque, `Hard and easy distributions of sat problems', in Proceedings of AAAI 92, pp. 459{465, (1992). [8] Christos H. Papadimitriou, Computational Complexity, Addison-Wesley, 1994. [9] B. Selman and H. Kautz, `An empirical study of greedy local search algorithms for satis ability testing', in Proceedings of the 11th National Conference on Arti cial Intelligence, (1993). [10] B. Selman, H.J. Levesque, and G.G. Mitchell, `A new method for solving hard satis ability problems', in Proceedings of AAAI 92, San Jose, CA, pp. 440{446, (1992).

3