Download presentation
Presentation is loading. Please wait.
Published byBuddy Curtis Modified over 9 years ago
1
Computer Science CPSC 502 Lecture 3 Constraint Satisfaction Problems (Ch. 4 )
2
2 Lecture Overview Finish Search Constraint Satisfaction Problems Variables/Features Constraints CSPs Generate-and-Test Search Arc Consistency
3
Course Overview Environment Problem Type Query Planning Deterministic Stochastic Constraint Satisfaction Search Arc Consistency Search Logics STRIPS Vars + Constraints Value Iteration Variable Elimination Belief Nets Decision Nets Markov Processes Static Sequential Representation Reasoning Technique Variable Elimination First Part of the Course
4
Standard Search vs. CSP First studied general state space search in isolation Standard search problem: search in a state space State is a “black box” - any arbitrary data structure that supports three problem-specific routines: goal test: goal(state) finding successor nodes: neighbors(state) if applicable, heuristic evaluation function: h(state) We’ll see more specialized versions of search for various problems 4
5
Constraint Satisfaction Problems (CPS): State Successor function Goal test Solution Heuristic function Query : State Successor function Goal test Solution Heuristic function Planning State Successor function Goal test Solution Heuristic function Search in Specific R&R Systems
6
Course Overview Environment Problem Type Query Planning Deterministic Stochastic Constraint Satisfaction Search Arc Consistency Search Logics STRIPS Vars + Constraints Value Iteration Variable Elimination Belief Nets Decision Nets Markov Processes Static Sequential Representation Reasoning Technique Variable Elimination We’ll start from CPS
7
Slide 7 CSPs: Crossword Puzzles - Proverb Source: Michael Littman
8
Slide 8 CSPs: Radio link frequency assignment Source: INRIA Assigning frequencies to a set of radio links defined between pairs of sites in order to avoid interferences. Constraints on frequency depend on position of the links and on physical environment. Sample Constraint network
9
Constraint Satisfaction Problems (CSP) In a CSP –state is defined by a set of variables V i with values from domain D i –goal test is a set of constraints specifying 1.allowable combinations of values for subsets of variables (hard constraints) 2.preferences over values of variables (soft constraints)
10
Dimensions of Representational Complexity (from lecture 2) Reasoning tasks (Constraint Satisfaction / Logic&Probabilistic Inference / Planning) Deterministic versus stochastic domains Some other important dimensions of complexity: Explicit state or features or relations Flat or hierarchical representation Knowledge given versus knowledge learned from experience Goals versus complex preferences Single-agent vs. multi-agent Explicit state or features or relations
11
Variables/Features and Possible Worlds Variable: a synonym for feature We denote variables using capital letters Each variable V has a domain dom(V) of possible values Variables can be of several main kinds: Boolean: |dom(V)| = 2 Finite: the domain contains a finite number of values Infinite but discrete: the domain is countably infinite Continuous: e.g., real numbers between 0 and 1 Possible world: complete assignment of values to each variable This is equivalent to a state as we have defined it so far Soon, however, we will give a broader definition of state, so it is best to start distinguishing the two concepts.
12
Example (lecture 2) Mars Explorer Example Weather Temperature Longitude Latitude One possible world (state) Number of possible (mutually exclusive) worlds (states) {S, C} [-40, 40] [0, 359] [0, 179]
13
Example (lecture 2) Mars Explorer Example Weather Temperature Longitude Latitude One possible world (state) Number of possible (mutually exclusive) worlds (states) {S, -30, 320, 210} 2 x 81 x 360 x 180 {S, C} [-40, 40] [0, 359] [0, 179] Product of cardinality of each domain … always exponential in the number of variables
14
How many possible worlds? Crossword Puzzle 1: variables are words that have to be filled in domains are English words of correct length possible worlds: all ways of assigning words Number of English words? Let’s say 150,000 Of the right length? Assume for simplicity: 15,000 for each length Number of words to be filled in? 63 How many possible worlds? (assume any combination is ok) 15,000 63 14
15
How many possible worlds? Crossword 2: variables are cells (individual squares) domains are letters of the alphabet possible worlds: all ways of assigning letters to cells Number of empty cells? 15*15 – 32 = 193 Number of letters in the alphabet? 26 How many possible worlds? (assume any combination is ok) 26 193 In general: (domain size) #variables
16
Examples: variables, domains, possible worlds Scheduling Problem: variables are different tasks that need to be scheduled (e.g., course in a university; job in a machine shop) domains are the different combinations of times and locations for each task (e.g., time/room for course; time/machine for job) possible worlds: time/location assignments for each task
17
Constraint Satisfaction Problems (CSP) Allow for usage of useful general-purpose algorithms with more power than standard search algorithms They exploit the multi-dimensional nature of the problem and the structure provided by the goal set of constraints, *not* black box.
18
Constraints Constraints are restrictions on the values that one or more variables can take Unary constraint: restriction involving a single variable k-ary constraint: restriction involving k different variables it turns out that k-ary constraints can always be represented as binary constraints, so we'll mainly only talk about this case Constraints can be specified by 1.listing all combinations of valid domain values for the variables participating in the constraint 2.giving a function that returns true when given values for each variable which satisfy the constraint
19
Example: Map-Coloring Variables WA, NT, Q, NSW, V, SA, T Domains D i = {red,green,blue} Constraints: adjacent regions must have different colors e.g., Or WA NT SA NT QU …………..
20
Example: Map-Coloring Variables WA, NT, Q, NSW, V, SA, T Domains D i = {red,green,blue} Constraints: adjacent regions must have different colors e.g., WA ≠ NT, NT ≠ SA, NT ≠ QU, ….., Or WA NT RedGreen RedBue GreenRed GreenBlue Red BlueGreen NT SA RedGreen RedBue GreenRed GreenBlue Red BlueGreen NT QU RedGreen RedBue GreenRed GreenBlue Red BlueGreen …………..
21
Examples Crossword Puzzle 1: variables are words that have to be filled in domains are valid English words constraints: words have the same letters at points where they intersect h 1 [0] = v 1 [0] h 1 [1] = v 2 [0] ….. ~225 constraints h1h1 v1v1
22
Eight Queen problem: place 8 queens on a chessboard so that no queen can attack the others Constraints: No queens can be in the same row, column or diagonal Example: Eight Queen problem
23
Example 2: 8 queens Variables: V 1,.. V n. V i = Row occupied by the i th queen in the i th column Domains: D Vi = {1,2,3,4,5,6,7,8} Constraints: : Two queens cannot be on the same row or on the same diagonal We can specify the constraints by enumerating explicitly, for each pair of columns, what positions are allowed. Ex: Constr(V 1, V 2 ) = {(1,3), (1,4),..(1,8)(2,4)(2,5)…(8,6)}
24
Constraints Constraints are restrictions on the values that one or more variables can take Unary constraint: restriction involving a single variable k-ary constraint: restriction involving k different variables We will mostly deal with binary constraints Constraints can be specified by 1.listing all combinations of valid domain values for the variables participating in the constraint 2.giving a function that returns true when given values for each variable which satisfy the constraint A possible world satisfies a set of constraints if the values for the variables involved in each constraint are consistent with that constraint 1.Elements of the list of valid domain values 2.Function returns true for those values
25
Models and Possible Worlds Definition: A model of a CSP is an assignment of values to all of its variables (i.e. a possible world) that satisfies all of its constraints. V = {V 1,V 2 } – dom(V 1 ) = {1,2,3} – dom(V 2 ) = {1,2} C = {C 1,C 2,C 3 } – C 1 : V 2 2 – C 2 : V 1 + V 2 < 5 – C 3 : V 1 > V 2 Possible worlds for this CSP: {V 1 =1, V 2 =1} {V 1 =1, V 2 =2} {V 1 =2, V 2 =1} {V 1 =2, V 2 =2} {V 1 =3, V 2 =1} {V 1 =3, V 2 =2} {V 1 =2, V 2 =1} (a model) {V 1 =3, V 2 =1} (a model) end
26
Example: Map-Coloring WA = red, NT = green, Q = red, NSW = green, V = red,SA = blue, T = green Definition: A model of a CSP is an assignment of values to all of its variables (i.e., a possible world) that satisfies all of its constraints.
27
Finite Constraint Satisfaction Problem: Definition Definition: A finite constraint satisfaction problem (FCSP) is a CSP with a finite set of variables and a finite domain for each variable. We will only study finite CSPs here but many of the techniques carry over to countably infinite and continuous domains. We use CSP here to refer to FCSP.
28
Constraint Satisfaction Problems: Variants We may want to solve the following problems with a CSP: determine whether or not a model exists find a model find all of the models count the number of models find the best model, given some measure of model quality this is now an optimization problem determine whether some property of the variables holds in all models
29
Solving Constraint Satisfaction Problems Even the simplest problem of determining whether or not a model exists in a general CSP with finite domains is NP-hard There is no known algorithm with worst case polynomial runtime. We can't hope to find an algorithm that is polynomial for all CSPs. However, we can try to: find efficient (polynomial) consistency algorithms that reduce the size of the search space identify special cases for which algorithms are efficient work on approximation algorithms that can find good solutions quickly, even though they may offer no theoretical guarantees find algorithms that are fast on typical (not worst case) cases
30
30 Lecture Overview Finish Search Constraint Satisfaction Problems Variables/Features Constraints CSPs Generate-and-Test Search Arc Consistency
31
Systematically check all possible worlds -Possible worlds: cross product of domains dom(V 1 ) dom(V 2 ) ... dom(V n ) Generate and Test: -Generate possible worlds one at a time -Test constraints for each one. Example: 3 variables A,B,C Generate and Test (GT) Algorithms For a in dom(A) For b in dom(B) For c in dom(C) if {A=a, B=b, C=c} satisfies all constraints return {A=a, B=b, C=c} fail
32
If there are k variables, each with domain size d, and there are c constraints, the complexity of Generate & Test is -There are d k possible worlds -For each one need to check c constraints Generate and Test (GT) Algorithms 32 Need to find a better way, that exploits the “insights” that we have on the goal expressed in terms of constraints Why does GT fail to do this?
33
CSP as a Search Problem: one formulation States: partial assignment of values to variables Start state: empty assignment Successor function: states with the next variable assigned E.g., follow a total order of the variables V 1, …, V n A state assigns values to the first k variables: {V 1 = v 1,…,V k = v k } Neighbors of node {V 1 = v 1,…,V k = v k }: nodes {V 1 = v 1,…,V k = v k, V k+1 = x} for each x dom(V k+1 ) Goal state: complete assignments of values to variables that satisfy all constraints That is, models Solution: assignment (the path doesn't matter)
34
V 1 = v 1 V 2 = v 1 V 1 = v 1 V 2 = v 2 V 1 = v 1 V 2 = v k CSP as a Search Problem: one formulation V 1 = v 1 V 2 = v 1 V 3 = v 2 V 1 = v 1 V 2 = v 1 V 3 = v 1 {} V 1 = v 1 V 1 = v k
35
Slide 35 CSPs as Search Problems Which search strategy will work well for a CSP formulated this way? If there are n variables every solution is at depth……. Is there a role for a heuristic function? the tree is always finite and has no cycles, so which one is better BFS or IDS or DFS?
36
Is there any way to prune the DFS Search tree? Explore search space via DFS but evaluate each constraint as soon as all its variables are bound. Any partial assignment that doesn’t satisfy the constraint can be pruned. Example: -3 variables A, B, C each with domain {1,2,3,4} -{A = 1, B = 1} is inconsistent with constraint A B regardless of the value of the other variables Fail! Prune! CSP as Search problem
37
V 1 = v 1 V 2 = v 1 V 1 = v 1 V 2 = v 2 V 1 = v 1 V 2 = v k CSP as Graph Searching V 1 = v 1 V 2 = v 1 V 3 = v 2 V 1 = v 1 V 2 = v 1 V 3 = v 1 {} V 1 = v 1 V 1 = v k Problem? Check unary constraints on V 1 If not satisfied = PRUNE Check constraints on V 1 and V 2 If not satisfied = PRUNE
38
V 1 = v 1 V 2 = v 1 V 1 = v 1 V 2 = v 2 V 1 = v 1 V 2 = v k CSP as Graph Searching V 1 = v 1 V 2 = v 1 V 3 = v 2 V 1 = v 1 V 2 = v 1 V 3 = v 1 {} V 1 = v 1 V 1 = v k Problem? Performance heavily depends on the order in which variables are considered Check unary constraints on V 1 If not satisfied = PRUNE Check constraints on V 1 and V 2 If not satisfied = PRUNE
39
Slide 39 Solving CSPs by DFS: Example Variables: A,B,C Domains: {1, 2, 3, 4} Constraints: A < B, B < C Good ordering, lots of pruning happens right away
40
Slide 40 Solving CSPs by DFS: Example Efficiency Variables: A,B,C Domains: {1, 2, 3, 4} Constraints: A < B, B < C Much worse ordering, keeps more branches around A=1 A=2A=3 A=4 C=1C=2C=3C=4 C=1C=2C=3C=4 C=1C=2C=3C=4 C=1C=2C=3C=4
41
Backtracking relies on one or more heuristics to select which variables to consider next. -E.g, variable involved in the largest number of constraints (“Degree heuristics”) But we will look at an alternative approach that can do much better Selecting variables in a smart way
42
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: all variables assigned a value and all constraints satisfied? 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 Inference State Successor function Goal test Solution Heuristic function
43
43 Lecture Overview Finish Search Constraint Satisfaction Problems Variables/Features Constraints CSPs Generate-and-Test Search Arc Consistency
44
Graph Searching Repeats Work 3 Variables: A,B,C. All with domains = {1,2,3,4} Constraints: A<B, B<C, A ≠ 4, C ≠ 1 A ≠ 4 is rediscovered 3 times. So is C ≠ 1 -Solution: remove values from A’s domain and C’s, once and for all
45
Can we do better than Search? Key idea prune the domains as much as possible before searching for a solution. Example: dom(V 2 ) = {1, 2, 3, 4}. Variable V 2 is not domain consistent with the constraint - It is domain consistent once we remove from its domain. Trivial for unary constraints. Trickier for k-ary ones. Def.: A variable is domain consistent if no value of its domain is ruled impossible by any unary constraints. V 2 2
46
Example: -Two variables X and Y -One constraint: X<Y XY X< Y 46 Def. A constraint network is defined by a graph, with - one node for every variable (drawn as circle) - one node for every constraint (drawn as rectangle) - undirected edges running between variable nodes and constraint nodes whenever a given variable is involved in a given constraint. Constraint network: definition
47
Example Constraint Network Def. A constraint network is defined by a graph, with - one node for every variable (drawn as circle) - one node for every constraint (drawn as rectangle) -undirected edges running between variable nodes and constraint nodes whenever a given variable is involved in a given constraint. {2,3} {3} A B A< B A>C {1,2} C
48
Example Constraint Network Example: Variables: A,B,C Domains: {1, 2, 3, 4} 3 Constraints: A < B, B < C, B = 3 Def. A constraint network is defined by a graph, with - one node for every variable (drawn as circle) - one node for every constraint (drawn as rectangle) - undirected edges running between variable nodes and constraint nodes whenever a given variable is involved in a given constraint. 5 edges/arcs in the constraint network: 〈 A,A<B 〉, 〈 B,A<B 〉 〈 B,B<C 〉, 〈 C,B<C 〉 〈 B, B=3 〉
49
Arc Consistency Definition: An arc is arc consistent if for each value x in dom(X) there is some value y in dom(Y) such that r(x,y) is satisfied. A network is arc consistent if all its arcs are arc consistent. 2,3 2,4 A B A< B 2,3 3,4 A B A< B 49 T T TF
50
Arc Consistency Definition: An arc is arc consistent if for each value x in dom(X) there is some value y in dom(Y) such that r(x,y) is satisfied. A network is arc consistent if all its arcs are arc consistent. 2,3 2,4 A B A< B 2,3 3,4 A B A< B Not arc consistent: No value in domain of B that satisfies A<B if B = 2 Both arcs are consistent: Each value in B(A) have ok values for A(B) - e.g. for B=3, A = 2 50
51
Arc Consistency Definition: An arc is arc consistent if for each value x in dom(X) there is some value y in dom(Y) such that r(x,y) is satisfied. A network is arc consistent if all its arcs are arc consistent. TF TF 2,5,7 2,3,13 A B A< B/2 Is this arc consistent? 1,2,3 2,3 A B A< B Not arc consistent: No value in domain of B that satisfies A<B if A=3 Arc consistent: Both B=2 and B=3 have ok values for A (e.g. A=1) 51
52
How can we enforce Arc Consistency? If an arc is not arc consistent - Delete all values x in dom(X) for which there is no corresponding value in dom(Y) - This deletion makes the arc arc consistent. -This removal can never rule out any models/solutions Why? Try this simple example in (easy to create from scratch in AI space) 2,3,4 1,2,3 X Y X< Y 52
53
Arc Consistency Algorithm: high level strategy Consider the arcs in turn, making each arc consistent Reconsider arcs that could be made inconsistent again by this pruning of the domains Eventually reach a ‘fixed point’: all arcs consistent Run ‘simple problem 1’ in AIspace for an example: 53
54
When we reduce the domain of a variable X to make an arc X,c arc consistent, which arcs do we need to reconsider? You do not need to reconsider other arcs - If arc Y,c was arc consistent before, it will still be arc consistent - If an arc X,c' was arc consistent before, it will still be arc consistent - Nothing changes for arcs of constraints not involving X Which arcs need to be reconsidered? 54 every arc Z,c' where c’ c involves Z and X: Z1Z1 c1c1 Z2Z2 c2c2 Z3Z3 c3c3 Y c THESETHESE X A c4c4
55
Consider the arcs in turn, making each arc consistent Reconsider arcs that could be made inconsistent again by this pruning DO trace on ‘simple problem 1’ and on ‘scheduling problem 1’, trying to predict - which arcs are not consistent and - which arcs need to be reconsidered after each removal in 55 Which arcs need to be reconsidered?
56
Arc consistency algorithm (for binary constraints) 56 Procedure GAC(V,dom,C) Inputs V: a set of variables dom: a function such that dom(X) is the domain of variable X C: set of constraints to be satisfied Output arc-consistent domains for each variable Local D X is a set of values for each variable X TDA is a set of arcs 1: for each variable X do 2: D X ←dom(X) 3: TDA ←{〈X,c〉| X ∈ V, c ∈ C and X ∈ scope(c)} 4: while (TDA {}) 5: select 〈X,c〉 ∈TDA 6: TDA ←TDA \ {〈X,c〉} 7: ND X ←{x| x ∈ D X and y ∈ D Y s.t. (x, y ) satisfies c} 8: if (ND X D X ) then 9: TDA ←TDA ∪ { 〈Z,c'〉 | X ∈ scope(c'), c' c, Z ∈ scope(c') \ {X} } 10: D X ←ND X 11: return {D X | X is a variable} Scope of constraint c is the set of variables involved in that constraint ND X : values x for X for which there a value for y supporting x X’s domain changed: arcs (Z,c’) for variables Z sharing a constraint c’ with X could become inconsistent TDA: ToDoArcs, blue arcs in AIspace
57
Slide 57 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 ~n(n-1)/2 or O(n 2 ). How many times the same arc can be inserted in the ToDoArc list? O(d) How many steps are involved in checking the consistency of an arc? O(d 2 )
58
Arc Consistency Algorithm: Interpreting Outcomes Three possible outcomes (when all arcs are arc consistent): 1. Each domain has a single value, e.g. We have a (unique) solution. 2. At least one domain is empty, e.g. No solution! (All values are ruled out for this variable.) 3. Some domains have more than one value, e.g. There may be one solution, many solutions, or none. Need to solve this new CSP (usually simpler) problem: same constraints, domains have been reduced
59
Can we have an arc consistent network with non-empty domains that has no solution? YES Example: vars A, B, C with domain {1, 2} and constraints A ≠ B, B ≠ C, A ≠ C Or see AIspace CSP applet Simple Problem 2
60
Domain splitting (or case analysis) Arc consistency ends: Some domains have more than one value may or may not have a solution A. Apply Depth-First Search with Pruning or B. Split the problem in a number of disjoint cases: CSP with dom(X) = {x 1, x 2, x 3, x 4 } becomes CSP 1 with dom(X) = {x 1, x 2 } and CSP 2 with dom(X) = {x 3, x 4 } Solution to CSP is the union of solutions to CSP i 60
61
Domain splitting Each smaller CSP is easier to solve Arc consistency might already solve it For each subCSP, which arcs have to be on the ToDoArcs list when we get the subCSP by splitting the domain of X? A1A1 c1c1 A2A2 c2c2 A3A3 c3c3 Y c X A c4c4
62
Domain splitting Each smaller CSP is easier to solve Arc consistency might already solve it For each subCSP, which arcs have to be on the ToDoArcs list when we get the subCSP by splitting the domain of X? A1A1 c1c1 A2A2 c2c2 A3A3 c3c3 Y c THESETHESE X A c4c4 THISTHIS
63
If domains with multiple values Split on one Searching by domain splitting 63 CSP, apply AC CSP 1, apply AC CSP 2, apply AC If domains with multiple values …Split on one If domains with multiple values…..Split on one
64
3 variables: A, B, C Domains: all {1,2,3,4} A=B, B=C, A C Let’s trace arc consistency + domain splitting for this network for “Simple Problem 2” in AIspace Domain Splitting in Action: 64
65
Arc consistency + domain splitting: example ({1,2,3,4}, {1,2,3,4}, {1,2,3,4}) ({1,3}, {1,2,3,4}, {1,2,3,4}) ({1,3}, {1,3}, {1,3}) ({2,4}, {1,2,3,4}, {1,2,3,4}) ({1,3}, {1}, {1,3}) AC ({}, {}, {}) ({1,3}, {3}, {1,3}) ({}, {}, {}) AC ({2,4}, {2,4}, {2,4}) ({2,4}, {2}, {2,4}) AC ({}, {}, {}) ({2,4}, {4}, {2,4}) ({}, {}, {}) AC A {1,3}A {2,4} B {1}B {3}B {2} B {4} 3 variables: A, B, C Domains: all {1,2,3,4} A=B, B=C, A C No solution ({1,2,3,4}, {1,2,3,4}, {1,2,3,4}) AC (arc consistency)
66
Arc consistency + domain splitting: another example ({1,2,3,4}, {1,2,3,4}, {1,2,3,4}) ({1,3}, {1,2,3,4}, {1,2,3,4}) ({1,3}, {1,3}, {1,3}) ({2,4}, {1,2,3,4}, {1,2,3,4}) ({1,3}, {1}, {1,3}) AC ({1}, {1}, {1}) ({1,3}, {3}, {1,3}) ({3}, {3}, {3}) AC ({2,4}, {2,4}, {2,4}) ({2,4}, {2}, {2,4}) AC ({2}, {2}, {2}) ({2,4}, {4}, {2,4}) ({4}, {4}, {4}) AC A {1,3}A {2,4} B {1}B {3}B {2} B {4} 3 variables: A, B, C Domains: all {1,2,3,4} A=B, B=C, A=C Solution ({1,2,3,4}, {1,2,3,4}, {1,2,3,4}) AC (arc consistency)
67
Another formulation of CSP as search Arc consistency with domain splitting States: vector (D(V 1 ), …, D(V n )) of remaining domains, with D(V i ) dom(V i ) for each V i Start state: vector of original domains (dom(V 1 ), …, dom(V n )) Successor function: reduce one of the domains + run arc consistency Goal state: vector of unary domains that satisfies all constraints That is, only one value left for each variable The assignment of each variable to its single value is a model Solution: that assignment 67
68
If domains with multiple values Split on one Searching by domain splitting 68 How many CSPs do we need to keep around at a time? Assume solution at depth m and 2 children at each split CSP, apply AC CSP 1, apply AC CSP 2, apply AC If domains with multiple values Split on one If domains with multiple values…..Split on one
69
If domains with multiple values Split on one Searching by domain splitting 69 How many CSPs do we need to keep around at a time? Assume solution at depth m and 2 children at each split O(2m): It is DFS CSP, apply AC CSP 1, apply AC CSP 2, apply AC If domains with multiple values Split on one If domains with multiple values…..Split on one
70
Slide 70 Systematically solving CSPs: Summary Build Constraint Network Apply Arc Consistency One domain is empty Each domain has a single value Some domains have more than one value Apply Depth-First Search with Pruning OR Split the problem in a number of disjoint cases Apply Arc Consistency to each case, and repeat
71
Slide 71 Limitation of Systematic Approaches Many CSPs are simply too big for systematic approaches If you have 10 5 vars with dom(var i ) = 10 4 Systematic Search Branching factor b = Solution depth d = Complexity = Constraint Network Size Complexity of AC Do this as an exerciseS
72
Learning Goals for CSP Define possible worlds in term of variables and their domains Compute number of possible worlds on real examples Specify constraints to represent real world problems differentiating between: Unary and k-ary constraints List vs. function format Verify whether a possible world satisfies a set of constraints (i.e., whether it is a model, a solution) Implement the Generate-and-Test Algorithm. Explain its disadvantages. Solve a CSP by search (specify neighbors, states, start state, goal state). Compare strategies for CSP search. Implement pruning for DFS search in a CSP. 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 72
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.