constraint based planning and scheduling
play

CONSTRAINT-BASED PLANNING AND SCHEDULING k Ro om ma an n B Ba - PDF document

CONSTRAINT-BASED PLANNING AND SCHEDULING k Ro om ma an n B Ba ar rt t k Ch ha ar rl le es s U Un ni iv ve ers sit ty y, , P Pr ra ag gue e ( (C CZ Z) ) roman.bartak@mff.cuni.cz


  1. CONSTRAINT-BASED PLANNING AND SCHEDULING k Ro om ma an n B Ba ar rt tá ák Ch ha ar rl le es s U Un ni iv ve ers sit ty y, , P Pr ra ag gue e ( (C CZ Z) ) roman.bartak@mff.cuni.cz http://ktiml.mff.cuni.cz/~bartak Constraint-based Planning and Scheduling WHAT AND WHY? ! Wh ha at t i is s t th he e t to op pi ic c o of f t th he e t tu ut to or ri ia al l? ? " constraint satisfaction techniques useful for P&S ! Wh ha at t i is s c co on ns st tr ra ai in nt t s sa at ti is sf fa ac ct ti io on n? ? " technology for modeling and solving combinatorial optimization problems ! Wh hy y s sh ho ou ul ld d o on ne e l lo oo ok k a at t c co on ns st tr ra ai in nt t s sa at ti is sf fa ac ct ti io on n? ? " powerful solving technology " planning and scheduling are coming together and constraint satisfaction may serve as a bridge between them ! Wh hy y s sh ho ou ul ld d o on ne e u un nd de er rs st ta an nd d i in ns si id de es s o of f c co on ns st tr ra ai in nt t s sa at ti is sf fa ac ct ti io on n a al lg go or ri it th hm ms s? ? " better exploitation of the technology " design of better (solvable) constraint models 2

  2. Constraint-based Planning and Scheduling TUTORIAL OUTLINE ! Co on ns st tr ra ai in nt t s sa at ti is sf fa ac ct ti io on n i in n a a n nu ut ts sh he el ll l " domain filtering and local consistencies " search techniques ! Co on ns st tr ra ai in nt ts s f fo or r p pl la an nn ni in ng g " constraint models " temporal reasoning ! Co on ns st tr ra ai in nt ts s f fo or r s sc che ed du ul li in ng g " a base constraint model " resource constraints " branching schemes 3 CONSTRAINT SATISFACTION IN A NUTSHELL

  3. Constraint-based Planning and Scheduling STARTING SIMPLE CONSTRAINT SATISFACTION Mo od de el li in ng g ( (p pr ro ob bl le em m f fo or rm mu ul la at ti io on n) ) " N queens problem " de ec ci is si io on n v va ar ri ia ab bl le es s for positions of queens in rows r(i) in {1,…,N} " co on ns st tr ra ai in nt ts s describing (non-)conflicts ∀ i ≠ j r(i) ≠ r(j) & |i-j| ≠ |r(i)-r(j)| Se ea ar rc ch h a an nd d i in nf fe er re en nc ce e ( (p pr ro op pa ag ga at ti io on n) ) " ba ac ck kt tr ra ac ck ki in ng g (assign values and return upon failure) " infer consequences of decisions × × × × × × via maintaining c co on ns si is st te en nc cy y × × × × × × failure × × × × × of constraints × × × 5 Constraint-based Planning and Scheduling CONSTRAINT SATISFACTION based on d de ec cl la ar ra at ti iv ve e p pr ro ob bl le em m d de es sc cr ri ip pt ti io on n via: " va ar ri ia ab bl le es s w wi it th h d do om ma ai in ns s (sets of possible values) describe d de ec ci is si io on n p po oi in nt ts s of the problem with possible op o pt ti io on ns s for the decisions e.g. the start time of activity with time windows " co on ns st tr ra ai in nt ts s restricting combinations of values, describe arbitrary r re el la at ti io on ns s over the set of variables e.g. end(A) < start(B) A f fe ea as si ib bl le e so ol lu ut ti io on n to a constraint satisfaction problem is a complete assignment of variables satisfying all the constraints. An o op pt ti im ma al l s so ol lu ut ti io on n to a CSP is a feasible solution minimizing/maximizing a given objective function. 6

  4. CONSTRAINT SATISFACTION CONSISTENCY TECHNIQUES Constraint-based Planning and Scheduling DOMAIN FILTERING ! Ex xa am mp pl le e: : " D a = {1,2}, D b = {1,2,3} " a < b ! Value 1 can be safely removed from D b . ! Constraints are used a ac cti iv ve el ly y t to o r re em mo ov ve e in i nc con ns si is st te en nc cie es s from the problem. " in nc co on ns si is st te en nc cy y = a value that cannot be in any solution ! This is realized via a procedure FILTER that is attached to each constraint. 8

  5. Constraint-based Planning and Scheduling FILTER ! Re em mo ov ve es s a al ll l v va al lu ue es s v vi io ol la at ti in ng g a a g gi iv ve en n c co on ns st tr ra ai in nt t. " for each value we need to find values (s su up pp po or rt t) in domains of other variables such that the tuple satisfies the constraint " filter for constraints specified using a table of compatible tuples procedure c.FILTER(OrigD) Constraint scope is NewD ← OrigD a set of constrained variables for each X in scope(c) do for each v in NewD X do if there is no support for v in c then NewD X ← NewD X - {v} Support is end for a tuple of values from variables’ domains that end for satisfies the constraint return NewD end FILTER 9 Constraint-based Planning and Scheduling ARC-CONSISTENCY ! We say that a c co on ns st tr ra ai in nt t is a ar rc c c co on ns si is st te en nt t (AC) if for any value of the variable in the constraint there exists a value (a s su up pp po or rt t) for the other variable(s) in such a way that the constraint is satisfied (we say that the value is supported). Unsupported values are filtered out of the domain. ! A C CS SP P is a ar rc c c co on ns si is st te en nt t if all the constraints are arc consistent. 10

  6. Constraint-based Planning and Scheduling MAKING PROBLEMS AC ! How to e es st ta ab bl li is sh h a ar rc c c con ns si is st te en nc cy y in a CSP? ! Every constraint must be made AC! Ex xa am mp pl le e: : X in [1,..,6], Y in [1,..,6], Z in [1,..,6], X<Y, Z<X-2 X<Y Z<X-2 X<Y X in [1,..,6] X in [1,..,5] X in [4,5] X in [4,5] Y in [1,..,6] Y in [2,..,6] Y in [2,..,6] Y in [5,6] Z in [1,..,6] Z in [1,..,6] Z in [1,2] Z in [1,2] ! Filtering through every constraint just once is not enough! ! Filtering must be repeated until any domain is changed (AC-1). 11 Mackworth (1977) Constraint-based Planning and Scheduling ALGORITHM AC-3 ! Uses a q qu ue eu ue e o of f c co on ns st tr ra ai in nt ts s that should be checked for AC. ! When a domain of variable is changed, only the constraints over this variable are added back to the queue for filtering. procedure AC-3(V,D,C) Q ← C while non-empty Q do select c from Q D’ ← c.FILTER(D) if any domain in D’ is empty then return (fail,D’) Q ← Q ∪ {c’ ∈ C | ∃ x ∈ var(c’) D’ x ≠ D x } – {c} D ← D’ end while return (true,D) end AC-3 12

  7. Constraint-based Planning and Scheduling AC IN PRACTICE ! Uses a qu ue eu ue e o of f v va ar ri ia ab ble es s with changed domains. " Users may specify for each constraint when the filtering should be done depending on the domain change. ! The algorithm is sometimes called A AC C- -8 8. procedure AC-8(V,D,C) Q ← V while non-empty Q do select v from Q for c ∈ C such that v is constrained by c do D’ ← c.FILTER(D) if any domain in D’ is empty then return (fail,D’) Q ← Q ∪ {u ∈ V | D’ u ≠ D u } D ← D’ end for end while return (true,D) end AC-8 13 Lhomme (1993) Constraint-based Planning and Scheduling ARC-B-CONSISTENCY ! Sometimes, making the problem arc-consistent is costly (for example, when domains of variables are large). ! In such a case, a weaker form of arc-consistency might be useful. ! We say that a constraint is a ar rc c- -b b- -c co on ns si is st te en nt t (bound consistent) if for any bound values of the variable in the constraint there exists a value for the other variable(s) in such a way that the constraint is satisfied. " a bound value is either a minimum or a maximum value in domain " domain of the variable can be represented as an interval " for some constraints (like x<y) it is equivalent to AC procedure (x<y).FILTER(OrigD) NewD X ← OrigD X ∩ (inf .. max(OrigD Y )-1) NewD Y ← OrigD Y ∩ (min(OrigD X )+1 .. sup) ∀ Z ≠ X,Y NewD Z ← OrigD Z return NewD end FILTER 14

Recommend


More recommend