constraint propagation as the core of local search nikolaos pothitos, george kastrinis, panagiotis...

20
Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications University of Athens Constraint Propagation as the Core of Local Search 1/20

Upload: jocelin-roberts

Post on 13-Jan-2016

214 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

Constraint Propagationas the Core of Local Search

Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos

Department of Informatics and Telecommunications

University of Athens

Constraint Propagation as the Core of Local Search 1/20

Page 2: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

Constraint Propagation as the Core of Local Search – Presentation Structure

Introduction to Constraint Programming Constraint-Based Local Search Intermediate Variables Assignment Propagation Experiments

Constraint Propagation as the Core of Local Search 2/20

Intro to CP CBLS Intermediate Variables ExperimentsAssignment Propagation

Page 3: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

Introduction to Constraint Programming

Constraint Programming (CP) is a popular paradigm for solving Constraint Satisfaction Problems (CSPs).

Its power stems from the separation of the solving algorithms phase, from the CSP specification phase [Freuder, 1996].

Constraint Propagation as the Core of Local Search 3/20

Intro to CP CBLS Intermediate Variables ExperimentsAssignment Propagation

Page 4: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

Constraint Programming ArchitectureA) CSP Description Phase

We use the following triplet to state a CSP: The variables of the problem. The domains of the variables. The constraints between the variables.

B) Solution Phase

We search for an assignment to the variables, that does not violate the constraints.

Constraint Propagation as the Core of Local Search 4/20

Intro to CP CBLS Intermediate Variables ExperimentsAssignment Propagation

Page 5: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

A) CSP Description Phase

Take for example the 4-Queens CSP: It includes four variables: X

1, X

2, X

3, X

4.

The domain of each variable is {1, 2, 3, 4}. The constraints between the variables are

summarized into the phrase “no Xi attacks X

j.”

B) Solution Phase

We can use several search methods to solve a CSP.

Constraint Programming: An Example

Constraint Propagation as the Core of Local Search 5/20

Intro to CP CBLS Intermediate Variables ExperimentsAssignment Propagation

X3

X1

X4

X2

Page 6: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

Constraint-Based Local Search

“Constraint-Based Local Search (CBLS) is the idea of specifying local search algorithms as two components:

1. A high-level model describing the applications in terms of constraints, constraint combinators, and objective functions.

2. A clearly separated search procedure that implicitly takes advantage of the model in a general fashion.”

[van Hentenryck, 2011]

Constraint Propagation as the Core of Local Search 6/20

Intro to CP CBLS Intermediate Variables ExperimentsAssignment Propagation

Page 7: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

CBLS and Its Relation toConstraint Programming

So, CBLS keeps intact the independent declaration phase, but employ local search procedures to seek a solution in the second phase.

Constraint Propagation as the Core of Local Search 7/20

Intro to CP CBLS Intermediate Variables ExperimentsAssignment Propagation

Page 8: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

Local Search Methods

The central idea in local search is to assign values to all the variables and then to iteratively try to modify the assignment in order to make it a solution

More specifically, local search methods (such as hill climbing, simulated annealing, etc.) exploit the conflict sets notion, i.e. the constraints that are violated due to an assignment.

Constraint Propagation as the Core of Local Search 8/20

Intro to CP CBLS Intermediate Variables ExperimentsAssignment Propagation

Page 9: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

NAXOS SOLVER: Our CP+CBLS SystemOur contribution was to provide a CBLS framework,

with a generic problem specification ability that is absolutely same to the non-local-search (i.e. constructive) CP systems [Pothitos, 2011].

In the solution phase, we focused on implementing a freely available platform to design existing and new local search methods, by providing to the user a simple way to access conflict sets.

Constraint Propagation as the Core of Local Search 9/20

Intro to CP CBLS Intermediate Variables ExperimentsAssignment Propagation

Page 10: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

Related Systems and WorkProminent CBLS systems include COMET,

EASYLOCAL++, HOTFRAME, etc.

Existing systems cannot be integrated into constructive search CP systems, and usually do not provide efficient tools to design custom local search methods.

Besides, the state-of-the-art of these systems are proprietary and/or unavailable, and it is difficult to figure out their internal mechanisms [KANGAROO, 2011].

Constraint Propagation as the Core of Local Search 10/20

Intro to CP CBLS Intermediate Variables ExperimentsAssignment Propagation

Page 11: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

Intermediate Variables

Intermediate variables or invariants or dependent variables are practical for stating a CSP in a real CP system.

E.g., in the N-Queens problem, it is pretty much theoretical to state the constraint:

Constraint Propagation as the Core of Local Search 11/20

Intro to CP CBLS Intermediate Variables ExperimentsAssignment Propagation

Xi

Xjdoes not attack

Page 12: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

Intermediate Variables in PracticeBut it is common in a real CP solver to state:

Constraint Propagation as the Core of Local Search 12/20

Intro to CP CBLS Intermediate Variables ExperimentsAssignment Propagation

Xi

Xj≠

≠Xi' := X

i+i

Xi'' := X

i-i

Xj' := X

j+j

Xj'' := X

j-j

Note that Xi', X

j', X

i'', and X

j'' are intermediate variables.

Page 13: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

Issues when Local Search Adopts Intermediate Variables

While intermediate variables come in handy when stating a problem (in a real programming language), in the solution phase we should get rid of them, because their assignments actually depend on the non-intermediate variables.

Constraint Propagation as the Core of Local Search 13/20

Intro to CP CBLS Intermediate Variables ExperimentsAssignment Propagation

Page 14: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

Assignment Propagation

When a value is assigned to a variable, the assignment is propagated to the constraint network.

It should hold the property that:

If a constrained variable Y is intermediate with regard to the variables X

1, X

2, ..., X

n, it holds that

|DX1

|=1 |∧ DX2

|=1 ··· |∧ ∧ DXn

|=1 |⇒ DY|=1,

where DX is the domain of X.

Constraint Propagation as the Core of Local Search 14/20

Intro to CP CBLS Intermediate Variables ExperimentsAssignment Propagation

Page 15: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

Updating Conflict SetsWhen an assignment of a variable is incompatible with

another assignment, we add the tuple of the conflicting variables to the corresponding set.

Proposition: If a constraint which involves the variables X

1, ..., X

n is violated, then it holds

depend(X1)∪···∪depend(X

n) ⊆ ConflictSet, where

depend(X) is the set of non-intermediate variables that the intermediate X depends on. If X is not intermediate, then we suppose depend(X)={X}.

Constraint Propagation as the Core of Local Search 15/20

Intro to CP CBLS Intermediate Variables ExperimentsAssignment Propagation

Page 16: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

The Propagation Algorithm

Constraint Propagation as the Core of Local Search 16/20

Intro to CP CBLS Intermediate Variables ExperimentsAssignment Propagation

Page 17: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

Experiments

We have implemented several local search methods on top of this propagation/conflict-set engine, such as hill climbing, simulated annealing etc.

Constraint Propagation as the Core of Local Search 17/20

Intro to CP CBLS Intermediate Variables ExperimentsAssignment Propagation

Page 18: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

Hill Climbing and Simulated Annealing

We also compared systematic search to local search. The latter scales far better, using the same CP solver and CSP specification.

Constraint Propagation as the Core of Local Search 18/20

Intro to CP CBLS Intermediate Variables ExperimentsAssignment Propagation

Page 19: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

Conclusions and Future WorkOur goal is to provide a flexible platform for both the specification of a problem and the design of local search methods. Beyond facilitating the compound constraints expression, intermediate variables were the key feature for propagating assignments.

A future direction is to enrich the available methods, by adopting e.g. genetic algorithms. It will be also interesting and easy, to describe a methodology for exploiting NAXOS hybrid framework to mix direct and indirect methods.

Constraint Propagation as the Core of Local Search 19/20

Intro to CP CBLS Intermediate Variables ExperimentsAssignment Propagation

Page 20: Constraint Propagation as the Core of Local Search Nikolaos Pothitos, George Kastrinis, Panagiotis Stamatopoulos Department of Informatics and Telecommunications

References1. Freuder, E.C.: In pursuit of the holy grail. ACM Computing

Surveys 28(4es), 63 (1996)

2. Hakim Newton, M.A., Pham, D.N., Sattar, A., Maher, M.: KANGAROO: An Efficient Constraint-Based Local Search System Using Lazy Propagation. In: Lee, J. (ed.) CP 2011. LNCS, vol. 6876, pp. 645–659. Springer, Heidelberg (2011)

3. Hoos, H.H., Tsang, E.: Local search methods. In: Rossi, et al. (eds.): Handbook of Constraint Programming, ch. 5, pp. 135–167. Elsevier Science, Amsterdam (2006)

4. Pothitos, N.: NAXOS SOLVER (2011), http://di.uoa.gr/~pothitos/naxos

5. Van Hentenryck, P.: COMET: http://dynadec.com/ technology/constraint-based-local-search (2011)

Constraint Propagation as the Core of Local Search 20/20

Intro to CP CBLS Intermediate Variables ExperimentsAssignment Propagation

Thank You!