Lookahead Schemas Foundations of Constraint Processing CSCE 421821

  • Slides: 12
Download presentation
Lookahead Schemas Foundations of Constraint Processing CSCE 421/821, Spring 2011 www. cse. unl. edu/~choueiry/S

Lookahead Schemas Foundations of Constraint Processing CSCE 421/821, Spring 2011 www. cse. unl. edu/~choueiry/S 09 -421 -821/ All questions to cse 421@cse. unl. edu Berthe Y. Choueiry (Shu-we-ri) Avery Hall, Room 360 choueiry@cse. unl. edu Tel: +1(402)472 -5444 Foundations of Constraint Processing Lookahead Schemas 1

Outline • Looking ahead Schemas – Forward checking (FC) – Directional Arc Consistency (DAC)

Outline • Looking ahead Schemas – Forward checking (FC) – Directional Arc Consistency (DAC) – Maintaining Arc Consistency (a. k. a. full arcconsistency) Foundations of Constraint Processing Lookahead Schemas 2

Looking ahead • Rationale: – As decisions are made (conditioning), • Revise the domain

Looking ahead • Rationale: – As decisions are made (conditioning), • Revise the domain of future variables to propagate the effects of decisions • i. e. , eliminate inconsistent choices in future sub-problem – Domain annihilation of a future variable avoids expansion of useless portions of the tree • Techniques – Partial: forward-checking (FC), directional arcconsistency (DAC) – Full: Maintaining arc-consistency (MAC) – Use: Revise(Vf, Vc), Vf future variable, Vc current variable Foundations of Constraint Processing Lookahead Schemas 3

Revise the domain of Vi • Revising the domain of Vi given a constraint

Revise the domain of Vi • Revising the domain of Vi given a constraint CVi, Vj on Vi (i. e. , Vi Scope(C)) • General notation: Revise(Vi, CVi, Vj) • In a binary CSP: Revise(Vi, CVi, Vj)=Revise(Vi, Vj) Foundations of Constraint Processing Lookahead Schemas 4

Revise(Vi, Vj) NOTE: only DVi may be updated Revise(Vi, Vj) 1. revised nil 2.

Revise(Vi, Vj) NOTE: only DVi may be updated Revise(Vi, Vj) 1. revised nil 2. x DVi 3. found nil 4. y DVj 5. If Check((Vi, x), (Vj, y)) Then Begin 6. found t 7. Break�� 8. End 9. If found=nil Then Begin 10. revised t 11. DVi {x} 12. End 13. Return (revised) Foundations of Constraint Processing Lookahead Schemas 5

Revise(Vi, Vj) 1. 2. 3. 4. 5. 6. 7. revised nil x Dvi y

Revise(Vi, Vj) 1. 2. 3. 4. 5. 6. 7. revised nil x Dvi y DVj If Check((Vi, x), (Vj, y)) Then Break() revised t DVi {x} Return (revised) Simpler, equivalent code but not as obvious as the previous one Foundations of Constraint Processing Lookahead Schemas 6

Domain filtering in lookahead • • • Vc current variable Vf future variable {Vf}

Domain filtering in lookahead • • • Vc current variable Vf future variable {Vf} all future variables Revise(Vf, Vc) FC(Vc): – Vf {Vf} connected to Vc – Revise(Vf, Vc) – If DVf ={} then return(nil) Foundations of Constraint Processing Lookahead Schemas 7

Directional Arc Consistency • Choose an ordering d, stick to it • After instantiating

Directional Arc Consistency • Choose an ordering d, stick to it • After instantiating a variable at level i, do the following 1. For k from i to (n-1) in the ordering d Do 2. If FC(Vk)=nil then Return(nil) Foundations of Constraint Processing Lookahead Schemas 8

Maintaining Arc Consistency • First, FC(Vc), • If it does not fail, then, form

Maintaining Arc Consistency • First, FC(Vc), • If it does not fail, then, form a queue with all constraints (Vi, Vj) and (Vj, Vi) between future variables, and run AC AC-1 • • • Q {(Vi, Vj), (Vj, Vi), …, (Vk, Vm), (Vm, VK)} Change true While Change Do Change false For all (Va, Vb) in Q Do If Revise(Va, Vb) Then If Dom(Va) = Then Return (nil) Else Change true Foundations of Constraint Processing Lookahead Schemas 9

Look-ahead techniques: • FC: • DAC: – FC, DAC, MAC FC(Vc); While not failure:

Look-ahead techniques: • FC: • DAC: – FC, DAC, MAC FC(Vc); While not failure: For the next Vf in the ordering d, assumes a fixed variable ordering d • MAC: FC(Vf) FC(Vc); AC({Vf}) FC(Vc); Repeat until quiescence or failure Vf 1, Vf 2 {Vf}, Revise(Vf 1, Vf 2) – does more pruning (search may visit fewer nodes) at the cost of more consistency checks Foundations of Constraint Processing Lookahead Schemas 10

Terminology overload alert: FC • FC is used to denote any of the following:

Terminology overload alert: FC • FC is used to denote any of the following: – a partial look-ahead schema – a specific chronological backtrack search algorithm that uses the partial look-ahead schema • Meaning is inferred from context • Not a healthy situation, but a fact of reality • Advice: state upfront the meaning of your terms and stick to them throughout your paper Foundations of Constraint Processing Lookahead Schemas 11

(BT Search +) MAC vs. FC • Reference: [Sabin & Freuder, ECAI 94], [Bessière

(BT Search +) MAC vs. FC • Reference: [Sabin & Freuder, ECAI 94], [Bessière & Régin, CP 97], [Sabin & Freuder, CP 97], [Gent & Prosser, APES-20 -2000], [Experiments by Lin XU, 2001], [Yang, MS thesis 2003] • Results: (sketchy) Low tightness High tightness Low density (sparse) FC MAC High density (dense) FC FC Note: Results depend on • Variable ordering (static vs. dynamic) • Problem difficulty (positive relative to crossover point) Foundations of Constraint Processing Lookahead Schemas 12