Implementing Semiring-Based Constraints using Mozart Alberto - - PowerPoint PPT Presentation

implementing semiring based constraints using mozart
SMART_READER_LITE
LIVE PREVIEW

Implementing Semiring-Based Constraints using Mozart Alberto - - PowerPoint PPT Presentation

Implementing Semiring-Based Constraints using Mozart Alberto Delgado Carlos Alberto Olarte Jorge Andres Perez Camilo Rueda 1 1 Pontificia Universidad Javeriana-Cali Mozart/Oz Conference 2004 Delgado A., Olarte C., Perez J. and Rueda C.


slide-1
SLIDE 1

Implementing Semiring-Based Constraints using Mozart

Alberto Delgado Carlos Alberto Olarte Jorge Andres Perez Camilo Rueda 1

1Pontificia Universidad Javeriana-Cali

Mozart/Oz Conference 2004

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-2
SLIDE 2

Motivation

CSP CSP is an expressive approach for modelling many real life problems, but it is not flexible enough to deal with: Over-constrained settings Non-crisp constraints Preferences Uncertainties SCSP SCSP extends CSP by allowing preferences, uncertainty, probabilities and similar ideas. Some proposals: Fuzzy CSP [Dubois,93] VCSP [Schiex,95] Partial CSP [Freuder,92] C-semirings [Bistarelli,97]

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-3
SLIDE 3

Motivation

Cont.

The problem There are not many solvers for SCSP. Most of them using CLP: CLP(FD,S) [Georget,98] Semiring integration with CHR [Bistarelli, 02] Evaluation-based semiring Meta-Constraints [Kelleher,03] But, what about CCP? Our contribution To integrate mechanisms for handling semiring-based constraints into the Mozart system.

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-4
SLIDE 4

Outline

1

Introduction C-semiring formalism CCP in Mozart

2

Implementing Soft Constraints Soft Propagators

3

Results / Examples An over-constrained timetabling problem Frequency Assignment Problem Imposing Preferences

4

Conclusions

5

Future Work

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-5
SLIDE 5

Outline

1

Introduction C-semiring formalism CCP in Mozart

2

Implementing Soft Constraints Soft Propagators

3

Results / Examples An over-constrained timetabling problem Frequency Assignment Problem Imposing Preferences

4

Conclusions

5

Future Work

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-6
SLIDE 6

C-semiring formalism

Defines a semiring structure A, +, ×, 0, 1 where :

A is the set of possible valuations × is used to combine constraints + is the operator to order the elements in A (a ≥s b iff a + b = a) 0, 1 are the min and max elements in A

Some instances:

Classic CSP: {false, true}, ∨, ∧, false, true Fuzzy CSP: {x | x ∈ [0, 1]}, max, min, 0, 1 Weighted CSP: ℜ+, min, +, +∞, 0

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-7
SLIDE 7

C-semiring formalism (cont.)

Some Definitions

A Constraint System is a tuple V , D, S where V is a set of variables, D the variable domains and S a c-semiring A Constraint is a tuple def , con where con is a set of variables and the function def : D|con| → A represents the tuple valuations. Given c1 = def1, con1 and c2 = def2, con2, the Constraint Combination c1 ⊗ c2 is the constraint c3 = def3, con3 with def3(t) = def1(t ↓con1

con3) × def2(t ↓con2 con3) and con3 = con1 ∪ con2

A Soft CSP (SCSP) is a tuple C, con where C is a set of constraints and con a set of variables Sol(P): The solution of the SCSP P = C, con is the constraint

ci∈C ↓con

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-8
SLIDE 8

An Example

Given the SCSP: Using SFuzzy, defSol(P)(2, 1) = min(0.6, 0.2, 0.4) = 0.2, defSol(P)(1, 1) = 0.3 and 2, 1 ≤s 1, 1 Using SWeighted, defSol(P)(2, 1) = +(0.6, 0.2, 0.4) = 1.2, defSol(P)(1, 1) = 1.1

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-9
SLIDE 9

Outline

1

Introduction C-semiring formalism CCP in Mozart

2

Implementing Soft Constraints Soft Propagators

3

Results / Examples An over-constrained timetabling problem Frequency Assignment Problem Imposing Preferences

4

Conclusions

5

Future Work

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-10
SLIDE 10

How does CCP work in Mozart

Propagation Propagators impose constraints narrowing the variable domains

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-11
SLIDE 11

How does CCP work in Mozart

Distribution Propagation is not

  • complete. When a

computation space becomes stable two choices are created: in most cases Xi = V and Xi = V

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-12
SLIDE 12

Outline

1

Introduction C-semiring formalism CCP in Mozart

2

Implementing Soft Constraints Soft Propagators

3

Results / Examples An over-constrained timetabling problem Frequency Assignment Problem Imposing Preferences

4

Conclusions

5

Future Work

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-13
SLIDE 13

Soft Propagators

We provide propagators (soft ones) dealing with the c-semiring formalism concepts They exploit standard mechanisms (CPI) for extending Mozart with new constraint systems and user-defined constraints Each propagator implements a filter and a valuation (def )

  • function. The latter is computed only when the propagator

becomes entailed, saving space and time. Filter is written according to the valuation function

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-14
SLIDE 14

Current Implementation

Propagators Soft propagators for: LessThan,Equal , AllDiferent , UnaryPreference , nPreference , Distance constraints. Useful mechanisms that make expressing soft statements easier Softness Degree : Makes propagators harder or softer minLevel of preference (α): Rejects solutions where def (t) <s α Mechanisms to extend our implementation An abstract class to create new soft-propagators Classes and procedures handling semiring operations

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-15
SLIDE 15

How does it work?

Let X ∈ [3..5], Y ∈ [1..10] and Z ∈ [2..6]. Imposing {Soft.lt X Y} and {Soft.lt Y Z} we get: minLevel=0.5 and SDegree=0.4 def (2, 3) = 1.0 def (3, 3) = 1.0 − 0.4 = 0.6 def (3, 2) = 1.0 − 0.4 − 0.4 = 0.2 ≤s 0.5 mLevel=0.6,SDegree=0.5 Soft.lt is like FD.lt and only tuples where di < dj are allowed.

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-16
SLIDE 16

Outline

1

Introduction C-semiring formalism CCP in Mozart

2

Implementing Soft Constraints Soft Propagators

3

Results / Examples An over-constrained timetabling problem Frequency Assignment Problem Imposing Preferences

4

Conclusions

5

Future Work

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-17
SLIDE 17

An over-constrained timetabling problem

Problem To allocate conferences with preferences and disjoint constraints a

  • aC. Schulte, G. Smolka. Finite Domain Constraint in Mozart

Solution in [Schulte,Smolka. 2004] FD.atMost: enforcing the maximum number of parallel sessions FD.<: imposing precedence constraints FD.distinct: enforcing disjoint constraints Turning it over-constrained Adding some precedence constraint, the solver fail Solution?: Changing FD.<: by Soft.< and/or FD.distinct by Soft.distinct

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-18
SLIDE 18

Outline

1

Introduction C-semiring formalism CCP in Mozart

2

Implementing Soft Constraints Soft Propagators

3

Results / Examples An over-constrained timetabling problem Frequency Assignment Problem Imposing Preferences

4

Conclusions

5

Future Work

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-19
SLIDE 19

Frequency Assignment Problem

This problem tries to assign communication channels to radio links from limited spectral resources. constraints xi = fi pre-assigned frequency (soft) |xi − xj| > dij when xi and xj may interfere together (soft) |xi − xj| > δij defines a duplex link (hard)

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-20
SLIDE 20

Frequency Assignment Problem (cont.)

The Model Use Sweighted c-semiring Use Soft.eq to impose pre-assigned constraints and Soft.distance for imposing interference ones Use FD.distance to define duplex links # Vars # Cons Time(ms) 14 20 36 27 56 167 10 86 338 20 121 543 70 158 795 90 200 1322 140

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-21
SLIDE 21

Outline

1

Introduction C-semiring formalism CCP in Mozart

2

Implementing Soft Constraints Soft Propagators

3

Results / Examples An over-constrained timetabling problem Frequency Assignment Problem Imposing Preferences

4

Conclusions

5

Future Work

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-22
SLIDE 22

Imposing Preferences

Preferences Given a variable, we can define preferences over elements in its domain. e.g. Color : red ≻ white ≻ blue And given two variables we can define conditional preferences. e.g. Shape = circle : Color = blue ≻ Color = white In most cases, not all the preferences can be satisfied. Solution?: Use CP-Nets and solve a SCSP [Rossi et all, 2003]

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-23
SLIDE 23

Imposing Preferences (cont.)

A Simple CP-Net Steak ≻ Fish ≻ Chicken Red wine ≻ White wine Rise ≻ Fries Fish : White wine ≻ Red wine Chicken : Fries ≻ Rise The model Choose the fuzzy or weighted c-semiring Impose independent preferences by means of the UnaryPreference propagator Impose conditional preferences by means of the nPreference propagator

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-24
SLIDE 24

Advantages

Advantages Using a semiring-based approach? Avoids a double distribution process Solution can be easily compared (by using +) Allows to impose preferences and Soft Constraints by making

  • rthogonal changes in the model and source code

It is easy to make propagators harder or softer

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-25
SLIDE 25

Conclusions and Future Work

Conclusions Soft, a new Mozart module to handle semiring-based constraints We model hard constraints (i.e by using FDs propagators) without using soft constraint (i.e by using Scsp and then solving a multicriteria problem) Adding preferences and soft constraints can be achieved without change the core of the application and/or model.

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-26
SLIDE 26

Future Work

Future Work Extend our set of soft propagators. Include soft ideas into the distribution process. Implement the abstraction scheme [Bistarelli,02], by using information obtained from processing the abstract problem in the distribution process of the concrete one. Test our implementation on real-life applications.

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.

slide-27
SLIDE 27

Thank you!

Delgado A., Olarte C., Perez J. and Rueda C. Implementing Semiring-Based Constraints using Mozart.