CPSC 322, Lecture 13Slide 1 CSPs: Arc Consistency & Domain Splitting Computer Science cpsc322, Lecture 13 (Textbook Chpt 4.5,4.6) February, 01, 2010.

Slides:



Advertisements
Similar presentations
Local Search Jim Little UBC CS 322 – CSP October 3, 2014 Textbook §4.8
Advertisements

CPSC 322, Lecture 14Slide 1 Local Search Computer Science cpsc322, Lecture 14 (Textbook Chpt 4.8) Oct, 5, 2012.
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
ICS-271:Notes 5: 1 Lecture 5: Constraint Satisfaction Problems ICS 271 Fall 2008.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.4) January, 14, 2009.
Uninformed Search Jim Little UBC CS 322 – Search 2 September 12, 2014
Slide 1 Search: Advanced Topics Jim Little UBC CS 322 – Search 5 September 22, 2014 Textbook § 3.6.
CPSC 322, Lecture 16Slide 1 Stochastic Local Search Variants Computer Science cpsc322, Lecture 16 (Textbook Chpt 4.8) February, 9, 2009.
CPSC 322, Lecture 9Slide 1 Search: Advanced Topics Computer Science cpsc322, Lecture 9 (Textbook Chpt 3.6) January, 23, 2009.
CPSC 322, Lecture 35Slide 1 Finish VE for Sequential Decisions & Value of Information and Control Computer Science cpsc322, Lecture 35 (Textbook Chpt 9.4)
CPSC 322, Lecture 23Slide 1 Logic: TD as search, Datalog (variables) Computer Science cpsc322, Lecture 23 (Textbook Chpt 5.2 & some basic concepts from.
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) January, 12, 2009.
CPSC 322, Lecture 14Slide 1 Local Search Computer Science cpsc322, Lecture 14 (Textbook Chpt 4.8) February, 3, 2010.
CPSC 322, Lecture 18Slide 1 Planning: Heuristics and CSP Planning Computer Science cpsc322, Lecture 18 (Textbook Chpt 8) February, 12, 2010.
CPSC 322, Lecture 10Slide 1 Finish Search Computer Science cpsc322, Lecture 10 (Textbook Chpt 3.6) January, 25, 2010.
CPSC 322, Lecture 9Slide 1 Search: Advanced Topics Computer Science cpsc322, Lecture 9 (Textbook Chpt 3.6) January, 22, 2010.
CPSC 322, Lecture 15Slide 1 Stochastic Local Search Computer Science cpsc322, Lecture 15 (Textbook Chpt 4.8) February, 6, 2009.
CPSC 322, Lecture 11Slide 1 Constraint Satisfaction Problems (CSPs) Introduction Computer Science cpsc322, Lecture 11 (Textbook Chpt 4.0 – 4.2) January,
CPSC 322, Lecture 23Slide 1 Logic: TD as search, Datalog (variables) Computer Science cpsc322, Lecture 23 (Textbook Chpt 5.2 & some basic concepts from.
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
CPSC 322, Lecture 13Slide 1 CSPs: Arc Consistency & Domain Splitting Computer Science cpsc322, Lecture 13 (Textbook Chpt 4.5,4.8) February, 02, 2009.
CPSC 322, Lecture 14Slide 1 Local Search Computer Science cpsc322, Lecture 14 (Textbook Chpt 4.8) February, 4, 2009.
Decision Theory: Sequential Decisions Computer Science cpsc322, Lecture 34 (Textbook Chpt 9.3) April, 12, 2010.
CPSC 322, Lecture 17Slide 1 Planning: Representation and Forward Search Computer Science cpsc322, Lecture 17 (Textbook Chpt 8.1 (Skip )- 8.2) February,
CPSC 322, Lecture 17Slide 1 Planning: Representation and Forward Search Computer Science cpsc322, Lecture 17 (Textbook Chpt 8.1 (Skip )- 8.2) February,
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) March, 8, 2010.
Uninformed Search (cont.)
Slide 1 CSPs: Arc Consistency & Domain Splitting Jim Little UBC CS 322 – Search 7 October 1, 2014 Textbook §
Slide 1 Constraint Satisfaction Problems (CSPs) Introduction Jim Little UBC CS 322 – CSP 1 September 27, 2014 Textbook §
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) Oct, 26, 2010.
Local Search CPSC 322 – CSP 5 Textbook §4.8 February 7, 2011.
Computer Science CPSC 502 Lecture 3 Constraint Satisfaction Problems (Ch. 4 )
Constraint Satisfaction Problems (CSPs) CPSC 322 – CSP 1 Poole & Mackworth textbook: Sections § Lecturer: Alan Mackworth September 28, 2012.
Computer Science CPSC 322 Lecture 13 Arc Consistency (4.5, 4.6 ) Slide 1.
Solving Constraint Satisfaction Problems (CSPs) using Search CPSC 322 – CSP 2 Textbook § January 31, 2011.
Solving Constraint Satisfaction Problems (CSPs) using Search
CPSC 322, Lecture 23Slide 1 Logic: TD as search, Datalog (variables) Computer Science cpsc322, Lecture 23 (Textbook Chpt 5.2 & some basic concepts from.
Search with Costs and Heuristic Search 1 CPSC 322 – Search 3 January 17, 2011 Textbook §3.5.3, Taught by: Mike Chiang.
Arc Consistency CPSC 322 – CSP 3 Textbook § 4.5 February 2, 2011.
CPSC 322, Lecture 6Slide 1 Uniformed Search (cont.) Computer Science cpsc322, Lecture 6 (Textbook finish 3.5) Sept, 17, 2012.
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) Sept, 12, 2012.
Arc Consistency and Domain Splitting in CSPs CPSC 322 – CSP 3 Textbook Poole and Mackworth: § 4.5 and 4.6 Lecturer: Alan Mackworth October 3, 2012.
CPSC 322, Lecture 16Slide 1 Stochastic Local Search Variants Computer Science cpsc322, Lecture 16 (Textbook Chpt 4.8) Oct, 11, 2013.
Domain Splitting, Local Search CPSC 322 – CSP 4 Textbook §4.6, §4.8 February 4, 2011.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.5) Sept, 13, 2013.
CPSC 322, Lecture 10Slide 1 Finish Search Computer Science cpsc322, Lecture 10 (Textbook Chpt 3.6) Sep, 26, 2010.
Computer Science CPSC 322 Lecture 12 SLS wrap up, Forward Planning, Planning as CSP (Ch 8.2, 8.4) Slide 1.
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) Oct, 30, 2013.
Automatic Test Generation
Constraint Satisfaction Problems (CSPs) Introduction
Uniformed Search (cont.) Computer Science cpsc322, Lecture 6
Search: Advanced Topics Computer Science cpsc322, Lecture 9
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Computer Science cpsc322, Lecture 13
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Constraint Satisfaction Problems (CSPs) Introduction
Planning: Representation and Forward Search
Computer Science cpsc322, Lecture 14
Search: Advanced Topics Computer Science cpsc322, Lecture 9
Uniformed Search (cont.) Computer Science cpsc322, Lecture 6
Planning: Heuristics and CSP Planning
Planning: Heuristics and CSP Planning
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Planning: Representation and Forward Search
Computer Science cpsc322, Lecture 13
Planning: Heuristics and CSP Planning
Search: Advanced Topics Computer Science cpsc322, Lecture 9
Logic: Domain Modeling /Proofs + Computer Science cpsc322, Lecture 22
Domain Splitting CPSC 322 – CSP 4 Textbook §4.6 February 4, 2011.
Planning: Representation and Forward Search
Presentation transcript:

CPSC 322, Lecture 13Slide 1 CSPs: Arc Consistency & Domain Splitting Computer Science cpsc322, Lecture 13 (Textbook Chpt 4.5,4.6) February, 01, 2010

CPSC 322, Lecture 13Slide 2 Lecture Overview Recap (CSP as search & Constraint Networks) Arc Consistency Algorithm Domain splitting

CPSC 322, Lecture 11Slide 3 Standard Search vs. Specific R&R systems Constraint Satisfaction (Problems): State: assignments of values to a subset of the variables Successor function: assign values to a “free” variable Goal test: set of constraints Solution: possible world that satisfies the constraints Heuristic function: none (all solutions at the same distance from start) Planning : State Successor function Goal test Solution Heuristic function Query State Successor function Goal test Solution Heuristic function

CPSC 322, Lecture 13Slide 4 Recap: We can do much better.. Build a constraint network: Enforce domain and arc consistency

CPSC 322, Lecture 13Slide 5 Lecture Overview Recap Arc Consistency Algorithm Abstract strategy Details Complexity Interpreting the output Domain Splitting

CPSC 322, Lecture 13Slide 6 Arc Consistency Algorithm: high level strategy Consider the arcs in turn, making each arc consistent. BUT, arcs may need to be revisited whenever…. NOTE - Regardless of the order in which arcs are considered, we will terminate with the same result

CPSC 322, Lecture 13Slide 7 What arcs need to be revisited? When we reduce the domain of a variable X to make an arc  X,c  arc consistent, we add…… You do not need to add other arcs  X,c' , c  c‘ If an arc  X,c'  was arc consistent before, it will still be arc consistent (in the ``for all'' we'll just check fewer values) every arc  Z,c'  where c' involves Z and X:

Arc Consistency Algorithm (for binary C) 1: Procedure GAC(V,dom,C) 2: Inputs 3: V: a set of variables 4: dom: a function such that dom(X) is the domain of variable X 5: C: set of constraints to be satisfied 6: Output 7: arc-consistent domains for each variable 8: Local 9: D X is a set of values for each variable X 10: TDA is a set of arcs 11: for each variable X do 12: D X ←dom(X) 13: TDA ←{〈X,c〉| c∈C and X∈scope(c)} 14: 15: while (TDA ≠{}) 16: select 〈X,c〉 ∈TDA; 17: TDA ←TDA \ {〈X,c〉}; 18: ND X ←{x| x ∈D X and there is y i ∈D Yi {X=x,Y=y} ∈ c }; 19: if (ND X ≠D X ) then 20: TDA ←TDA ∪{〈Z,c'〉|X ∈scope(c'), c' is not c, Z∈scope(c') \ {X} } 21: D X ←ND X 22: 23: 24: return {D X | X is a variable}

CPSC 322, Lecture 13Slide 9 Arc Consistency Algorithm: Complexity Let’s determine Worst-case complexity of this procedure (compare with DFS) let the max size of a variable domain be d let the number of variables be n The max number of binary constraints is……. How many times the same arc can be inserted in the ToDoArc list? How many steps are involved in checking the consistency of an arc?

CPSC 322, Lecture 13Slide 10 Arc Consistency Algorithm: Interpreting Outcomes Three possible outcomes (when all arcs are arc consistent): One domain is empty  Each domain has a single value  Some domains have more than one value  may or may not be a solution in this case, arc consistency isn't enough to solve the problem: we need to perform search

CPSC 322, Lecture 13Slide 11 Lecture Overview Recap Arc Consistency Domain splitting

CPSC 322, Lecture 13Slide 12 Domain splitting (or case analysis) Arc consistency ends: Some domains have more than one value  may or may not be a solution A. Apply Depth-First Search with Pruning B. Split the problem in a number of disjoint cases Set of all solution equals to….

CPSC 322, Lecture 13Slide 13 But what is the advantage? Simplify the problem using arc consistency No unique solution i.e., for at least one var, |dom(X)|>1 Split X For all the splits Restart arc consistency on arcs these are the ones that are possibly…………. Disadvantage  : you need to keep all these CSPs around (vs. lean states of DFS) By reducing dom(X) we may be able to….

CPSC 322, Lecture 13Slide 14 Searching by domain splitting Disadvantage  : you need to keep all these CSPs around (vs. lean states of DFS)

CPSC 322, Lecture 4Slide 15 Learning Goals for today’s class You can: Define/read/write/trace/debug the arc consistency algorithm. Compute its complexity and assess its possible outcomes Define/read/write/trace/debug domain splitting and its integration with arc consistency

CPSC 322, Lecture 13Slide 16 Next Class (Chpt. 4.8) Local search: Many search spaces for CSPs are simply too big for systematic search (but solutions are densely distributed). Keep only the current state (or a few) Use very little memory / often find reasonable solution ….. Local search for CSPs

CPSC 322, Lecture 13Slide 17 K-ary vs. binary constraints Not a topic for this course but if you are curious about it… Wikipedia example clarifies basic idea… The dual problem is a reformulation of a constraint satisfaction problem expressing each constraint of the original problem as a variable. Dual problems only contain binary constraints, and are therefore solvable by algorithms tailored for such problems.constraint satisfaction problembinary constraintsalgorithms See also: hidden transformations