“Solving Combinatorial Problem Using Adaptive Process of Enumeration Strategies”
Total Page:16
File Type:pdf, Size:1020Kb
PONTIFICIA UNIVERSIDAD CATOLICA´ DE VALPARAISO´ FACULTAD DE INGENIERIA´ ESCUELA DE INGENIERIA´ INFORMATICA´ “SOLVING COMBINATORIAL PROBLEM USING ADAPTIVE PROCESS OF ENUMERATION STRATEGIES” MARY CLAUDIA ARANDA CABEZAS TESIS DE GRADO MAGISTER´ EN INGENIERIA´ INFORMATICA´ Julio 2008 Pontificia Universidad Catolica´ de Valpara´ıso Facultad de Ingenier´ıa Escuela de Ingenier´ıa Informatica´ “SOLVING COMBINATORIAL PROBLEM USING ADAPTIVE PROCESS OF ENUMERATION STRATEGIES” MARY CLAUDIA ARANDA CABEZAS Profesor Gu´ıa: Broderick Crawford Labr´ın Programa: Mag´ıster en Ingenier´ıa Informatica´ Julio 2008 Resumen En la actualidad, la comunidad de Programacion´ con Restricciones utiliza una aproximacion´ completa de resolucion´ que alterna fases de propagacion´ de restricciones y enumeracion,´ en este contexto se han realizado numerosos estudios tendientes a mostrar la efectividad de las estrategias de enumeracion´ y el efecto sobre el proceso de resolucion´ que tienen las heur´ısticas de seleccion´ de variable y valor que la constituyen. Sin embargo, es imposible prever los efectos reales de estas estrategias. Por otra parte, si bien estudios previos han demostrado que diferentes estrategias tienen rendimientos significativamente diferentes, por lo cual es crucial seleccionar una buena estrategia de enumeracion,´ no es posible determinar una estrategia de enumeracion´ que sea la mejor para un conjunto amplio de problemas, de esta manera el proposito´ de este proyecto es evaluar un proceso de resolucion´ adaptativo que permitan encontrar soluciones a diferentes problemas, donde las posibilidades de adaptacion´ tienen relacion´ con cambiar la estrategia de enumeracion´ utilizada al momento de detectar su mal rendimiento durante el proceso. La deteccion´ del mal rendimiento de la estrategia de enumeracion´ se realiza mediante la observacion´ continua del proceso de resolucion,´ desde donde se obtiene informacion´ relevante del estado de la resolucion.´ i Abstract At the present, the Constraint Programming community uses a complete approach alternating phases of Constraint Propagation and Enumeration, in this context numerous studies have been conducted designed to show the effective- ness of enumeration strategies and the effect on resolution process that variable and value selection heuristics have. However, the effects and efficiencies of strategies are generally unpredictable. Moreover, although previous studies have shown that different strategies have significantly different performance, for which it is crucial to select a good enumeration strategy, but it is not possible to determine an enumeration strategy that is best for a set of problems. Thus, the purpose of this project is to evaluate an adaptive resolution process to find solutions to a broad spectrum of different types of problems, where the ability to adapt is related to changing the strategy used at the time of detecting its poor performance during the process. The detection of bad performance of enumeration strategy is done through continuous observation of resolution process, where you get relevant information of the state of resolution. ii Contents List of Figures vi List of Tables vii 1 Project Description 1 1.1 Introduction . ............................................. 1 1.2 Goals ................................................... 2 1.2.1 Hypothesis . ........................................... 2 1.2.2 General Goal ........................................... 2 1.2.3 Specific Goals .......................................... 2 1.3 Methodology . ............................................. 3 1.4 Problem Definition and Motivation .................................... 4 1.5 Outline of this Thesis ........................................... 6 2 Constraint Programming 7 2.1 Definition ................................................. 7 2.2 Combinatorial Problems ......................................... 7 2.2.1 Constraint Satisfaction Problems ................................. 8 2.2.2 Constraint Satisfaction Optimisation Problems ......................... 8 2.3 Modelling ................................................. 9 2.4 CSP Solving . ............................................. 10 2.4.1 Basic Search Strategies for Solving CSPs ............................ 10 2.4.1.1 General Search Strategies ............................... 10 2.4.1.2 Hybrid Techniques ................................... 11 2.4.2 Consistency Techniques ..................................... 13 2.4.2.1 Node Consistency ................................... 13 2.4.2.2 Arc Consistency .................................... 14 2.4.2.3 Path Consistency .................................... 16 iii 2.5 Constraint Propagation and Enumeration ................................. 17 2.5.1 Variable Selection Heuristics ................................... 18 2.5.1.1 Static Selection Heuristics ............................... 18 2.5.1.2 Dynamic Selection Heuristics ............................. 19 2.5.2 Value Selection Heuristics .................................... 20 3 Adaptive 23 3.1 Elemental Definitions ........................................... 23 3.2 Adaptive Model . ............................................. 25 3.2.1 Adaptive Constraint Satisfaction ................................. 26 3.2.2 Adaptive Enumeration Strategies ................................. 27 3.2.3 Adaptive Constraint Engine ................................... 28 4 Adaptive Approach Based on Enumeration Strategies 30 4.1 Scheme Proposed ............................................. 30 4.1.1 Solver: . ........................................... 31 4.1.2 Library Strategies ......................................... 32 4.1.3 Observation . ........................................... 32 4.1.4 Analysis . ........................................... 32 4.2 Enumeration Strategies .......................................... 33 4.3 Indicators ................................................. 34 4.4 Problems ................................................. 37 4.4.1 N-Queens . ........................................... 37 4.4.1.1 Model ......................................... 37 4.4.1.2 Script . ......................................... 37 4.4.2 Magic Square ........................................... 38 4.4.2.1 Model ......................................... 38 4.4.2.2 Script . ......................................... 39 4.4.3 Latin Square ........................................... 40 4.4.3.1 Model ......................................... 40 4.4.3.2 Script . ......................................... 40 4.4.4 Sudoku . ........................................... 41 4.4.4.1 Model ......................................... 41 4.4.4.2 Script . ......................................... 41 iv 5 Experimental Results 43 5.1 Initial Considerations ........................................... 43 5.2 Enumeration Strategies Alone vs Adaptive Process ........................... 43 5.3 Tuning of the Bracktracking ....................................... 44 6 Conclusion and Future Work 45 Bibliography 46 v List of Figures 1.1 Constraint Programming Structure .................................... 4 1.2 10-Queens solving with 3 Different Strategies .............................. 5 2.1 Example: No Node Consistency ..................................... 13 2.2 Example: Node Consistency ....................................... 14 2.3 Example: No Arc Consistent CSP .................................... 15 2.4 Directional Arc Consistency under the order x2 → x1 .......................... 15 2.5 Arc Consistency CSP ........................................... 15 2.6 No Path Consistency CSP ......................................... 16 2.7 Path Consistency CSP ........................................... 17 3.1 Taxonomy of parameter control [1] .................................... 24 3.2 Adaptive Constraint Satisfaction [13] ................................... 26 3.3 The Dynamic Strategy Framework [34] ................................. 27 3.4 Organization and Management Advisers to make a decision [17] . .................. 29 4.1 Scheme of Adaptive Solving Process ................................... 31 vi List of Tables 1.1 Enumerations (E), Backtracks (B) in the resolution of 10-Queens and Magic Squares (N=9) ...... 5 1.2 Enumerations (E), Backtracks (B) in the resolution of 20-Queens and Magic Squares (N=16) ..... 6 2.1 Justification Variable Selection Heuristics ................................ 22 2.2 Justification for Value Selection Heuristics ................................ 22 5.1 N-Queens: Enumeration Strategies Alone vs Adaptive Process measuring Backtrack (B) ....... 44 5.2 Latin Square: Enumeration Strategies Alone vs Adaptive Process measuring Backtrack (B) ...... 44 5.3 Tuning of the bracktracking to adaptive process in N-Queens problems ................. 44 vii Chapter 1 Project Description 1.1 Introduction Constraint Programming (CP) has been defined as a software technology used to describe and effectively solve large and complex problems, particularly combinatorial [5, 7]; these problems can be modelled as Constraint Satisfaction Problem (CSP) [2, 48], which is defined by a set of variables, each one with a domain associated and a set of con- straints. The domain corresponds to a set of possible values that can be assigned to the variables. Each constraint is defined on a group of variables restricting the combination of values that can be assigned to these variables. Solving a CSP consists in finding a value that can be assigned to the variable in a way that satisfies all the