cs 1571 introduction to ai lecture 7milos/courses/cs1571-fall... · 2013. 9. 20. · cs 1571 intro...
TRANSCRIPT
![Page 1: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/1.jpg)
M. HauskrechtCS 1571 Intro to AI
CS 1571 Introduction to AILecture 7
Milos [email protected] Sennott Square
Constraint satisfaction search
![Page 2: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/2.jpg)
M. HauskrechtCS 1571 Intro to AI
Search methods• Uninformed search methods
– Breadth-first search (BFS)
– Depth-first search (DFS)
– Iterative deepening (IDA)
– Bi-directional search
– Uniform cost search
• Informed (or heuristic) search methods:
– Best first search with the heuristic function
![Page 3: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/3.jpg)
M. HauskrechtCS 1571 Intro to AI
Best-first search
Best-first search • Driven by the evaluation function to guide the search. • incorporates a heuristic function in• heuristic function measures a potential of a state (node) to
reach a goalSpecial cases (differ in the design of evaluation function):
– Greedy search
– A* algorithm
+ iterative deepening version of A* : IDA*
)(nf
)()( nhnf
)()()( nhngnf
)(nh )(nf
![Page 4: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/4.jpg)
M. HauskrechtCS 1571 Intro to AI
A* search
• The problem with the greedy search is that it can keep expanding paths that are already very expensive.
• The problem with the uniform-cost search is that it uses only past exploration information (path cost), no additional information is utilized
• A* search
• Additional A*condition: admissible heuristic
)()()( nhngnf
)(ng - cost of reaching the state)(nh - estimate of the cost from the current state to a goal)(nf - estimate of the path length
)()( * nhnh for all n
![Page 5: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/5.jpg)
M. HauskrechtCS 1571 Intro to AI
Optimality of A*
• In general, a heuristic function :Can overestimate, be equal or underestimate the true distance
of a node to the goal • Admissible heuristic condition
– Never overestimate the distance to the goal !!!
Example: the straight-line distance in the travel problem never overestimates the actual distance
)()( * nhnh for all n
)(* nh
)(nh
![Page 6: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/6.jpg)
M. HauskrechtCS 1571 Intro to AI
Iterative deepening algorithm (IDA)
• Based on the idea of the limited-depth search, but• It resolves the difficulty of knowing the depth limit ahead of
time.
Idea: try all depth limits in an increasing order.That is, search first with the depth limit l=0, then l=1, l=2, and so on until the solution is reached
Iterative deepening combines advantages of the depth-first and breadth-first search with only moderate computational overhead
![Page 7: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/7.jpg)
M. HauskrechtCS 1571 Intro to AI
Properties of IDA
• Completeness: Yes. The solution is reached if it exists.(the same as BFS)
• Optimality: Yes, for the shortest path.(the same as BFS)
• Time complexity:
exponential in the depth of the solution dworse than BFS, but asymptotically the same
• Memory (space) complexity:
much better than BFS
)()()()()1( 21 dd bObObObOO
)(dbO
![Page 8: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/8.jpg)
M. Hauskrecht
IDA*
Iterative deepening version of A*
• Progressively increases the evaluation function limit (instead of the depth limit)
• Performs limited-cost depth-first search for the current evaluation function limit – Keeps expanding nodes in the depth-first manner up to the
evaluation function limit
• Problem: the amount by which the evaluation limit should be progressively increased
![Page 9: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/9.jpg)
M. Hauskrecht
IDA*
Problem: the amount by which the evaluation limit should be progressively increased
Solutions: (1) peak over the previous step boundary to guarantee that in
the next cycle some number of nodes are expanded(2) Increase the limit by a fixed cost increment – say
(1) (2)
Cost limit = k
![Page 10: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/10.jpg)
M. Hauskrecht
IDA*Solution 1: peak over the previous step boundary to
guarantee that in the next cycle more nodes are expanded
Properties:• the choice of the new cost limit influences how many nodes
are expanded in each iteration• Assume I choose a limit such that at least 5 new nodes are
examined in the next DFS run• What is the problem here?
25 29
2324
16 12 17 11
19
limit 10
![Page 11: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/11.jpg)
M. Hauskrecht
IDA*Solution 1: peak over the previous step boundary to
guarantee that in the next cycle more nodes are expanded
Properties:• the choice of the new cost limit influences how many nodes
are expanded in each iteration• Assume I choose a limit such that at least 5 new nodes are
examined in the next DFS run• What is the problem here?
We may find a sub-optimal solution– Fix: ?
25 29
2324
16 12 17 11
19
![Page 12: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/12.jpg)
M. Hauskrecht
IDA*Solution 1: peak over the previous step boundary to
guarantee that in the next cycle more nodes are expanded
Properties:• the choice of the new cost limit influences how many nodes
are expanded in each iteration• Assume I choose a limit such that at least 5 new nodes are
examined in the next DFS run• What is the problem here?
We may find a sub-optimal solution– Fix: complete the search up to the limit to find the best
25 29
2324
16 12 17 11
19
![Page 13: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/13.jpg)
M. Hauskrecht
IDA*
Solution 2: Increase the limit by a fixed cost increment ()
Properties:– What is bad?
Cost limit = k
k-th step
![Page 14: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/14.jpg)
M. Hauskrecht
IDA*
Solution 2: Increase the limit by a fixed cost increment ()
Properties:What is bad? Too many or too few nodes expanded – no
control of the number of nodesWhat is the quality of the solution?
Cost limit = k
k-th step
![Page 15: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/15.jpg)
M. Hauskrecht
IDA*
Solution 2: Increase the limit by a fixed cost increment ()
Properties:What is bad? Too many or too few nodes expanded – no
control of the number of nodesWhat is the quality of the solution? – The solution found first may differ by < from the
optimal solution
Cost limit = k
k-th step
![Page 16: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/16.jpg)
M. HauskrechtCS 1571 Intro to AI
next
Constraint satisfaction search
![Page 17: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/17.jpg)
M. HauskrechtCS 1571 Intro to AI
Search problem
A search problem:• Search space (or state space): a set of objects among which
we conduct the search;• Initial state: an object we start to search from;• Operators (actions): transform one state in the search space
to the other;• Goal condition: describes the object we search for
• Possible metric on the search space:– measures the quality of the object with respect to the goal
![Page 18: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/18.jpg)
M. HauskrechtCS 1571 Intro to AI
Constraint satisfaction problem (CSP)
Two types of search:• path search (a path from the initial state to a state satisfying
the goal condition)• configuration search (a configuration satisfying goal
conditions)
Constraint satisfaction problem (CSP)= a configuration search problem where:
• A state is defined by a set of variables and their values• Goal condition is represented by a set constraints on
possible variable valuesSpecial properties of the CSP lead to special search procedures
we can design to solve them
![Page 19: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/19.jpg)
M. HauskrechtCS 1571 Intro to AI
Example of a CSP: N-queens
Goal: n queens placed in non-attacking positions on the board
Variables:• Represent queens, one for each column:
–• Values:
– Row placement of each queen on the board{1, 2, 3, 4}
Constraints:
4321 ,,, QQQQ
ji QQ
|||| jiQQ ji Two queens not in the same row
Two queens not on the same diagonal
4,2 21 QQ
![Page 20: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/20.jpg)
M. HauskrechtCS 1571 Intro to AI
Satisfiability (SAT) problem
Determine whether a sentence in the conjunctive normal form (CNF) is satisfiable (can evaluate to true)– Used in the propositional logic (covered later)
Variables:• Propositional symbols (P, R, T, S)• Values: True, False
Constraints:• Every conjunct must evaluate to true, at least one of the literals
must evaluate to true
)()()( TQPSRPRQP
,)(,)( TrueSRPTrueRQP
![Page 21: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/21.jpg)
M. HauskrechtCS 1571 Intro to AI
Other real world CSP problems
Scheduling problems:– E.g. telescope scheduling– High-school class schedule
Design problems:– Hardware configurations– VLSI design
More complex problems may involve:– real-valued variables– additional preferences on variable assignments – the
optimal configuration is sought
![Page 22: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/22.jpg)
M. HauskrechtCS 1571 Intro to AI
Exercise: Map coloring problem
Color a map using k different colors such that no adjacent countries have the same color
Variables: ?
• Variable values: ?
Constraints: ?
![Page 23: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/23.jpg)
M. HauskrechtCS 1571 Intro to AI
Map coloring
Color a map using k different colors such that no adjacent countries have the same color
Variables:• Represent countries
–• Values:
– K -different colors{Red, Blue, Green,..}
Constraints: ?
EDCBA ,,,,
![Page 24: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/24.jpg)
M. HauskrechtCS 1571 Intro to AI
Map coloring
Color a map using k different colors such that no adjacent countries have the same color
Variables:• Represent countries
–• Values:
– K -different colors{Red, Blue, Green,..}
Constraints:An example of a problem with binary constraints
EDCBA ,,,,
etc,,, ECCABA
![Page 25: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/25.jpg)
M. HauskrechtCS 1571 Intro to AI
Constraint satisfaction as a search problem
A formulation of the search problem:• States. Assignment (partial or complete) of values to variables.• Initial state. No variable is assigned a value.• Operators. Assign a value to one of the unassigned variables.• Goal condition. All variables are assigned, no constraints are
violated.
• Constraints can be represented:– Explicitly by a set of allowable values– Implicitly by a function that tests for the satisfaction of
constraints
![Page 26: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/26.jpg)
M. HauskrechtCS 1571 Intro to AI
Search strategies for solving CSP
Unassigned:
Assigned:4321 ,,, QQQQ
Unassigned:
Assigned:432 ,, QQQ
11 Q
Unassigned:
Assigned:432 ,, QQQ
21 Q
Unassigned:
Assigned:43 , QQ
4,2 21 QQ
![Page 27: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/27.jpg)
M. HauskrechtCS 1571 Intro to AI
Search strategies for solving CSP• Maximum depth of the tree (m): ?• Depth of the solution (d) : ?• Branching factor (b) : ?
Unassigned:
Assigned:4321 ,,, QQQQ
Unassigned:
Assigned:432 ,, QQQ
11 QUnassigned:
Assigned:432 ,, QQQ
21 Q
Unassigned:
Assigned:43 , QQ
4,2 21 QQ
![Page 28: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/28.jpg)
M. HauskrechtCS 1571 Intro to AI
Search strategies for solving CSP• Maximum depth of the tree: Number of variables in the CSP• Depth of the solution: Number of variables in the CSP• Branching factor: if we fix the order of variable assignments
the branch factor depends on the number of their values
Unassigned:
Assigned:4321 ,,, QQQQ
Unassigned:
Assigned:432 ,, QQQ
11 QUnassigned:
Assigned:432 ,, QQQ
21 Q
Unassigned:
Assigned:43 , QQ
4,2 21 QQ
![Page 29: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/29.jpg)
M. HauskrechtCS 1571 Intro to AI
Search strategies for solving CSP• What search algorithm to use: ?
Depth of the tree = Depth of the solution=number of vars
Unassigned:
Assigned:4321 ,,, QQQQ
Unassigned:
Assigned:432 ,, QQQ
11 QUnassigned:
Assigned:432 ,, QQQ
21 Q
Unassigned:
Assigned:43 , QQ
4,2 21 QQ
![Page 30: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/30.jpg)
M. HauskrechtCS 1571 Intro to AI
Search strategies for solving CSP• What search algorithm to use: ?
Unassigned:
Assigned:4321 ,,, QQQQ
Unassigned:
Assigned:432 ,, QQQ
11 QUnassigned:
Assigned:432 ,, QQQ
21 Q
Unassigned:
Assigned:43 , QQ
4,2 21 QQ
![Page 31: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/31.jpg)
M. HauskrechtCS 1571 Intro to AI
Search strategies for solving CSP• What search algorithm to use: Depth first search !!!
• Since we know the depth of the solution• We do not have to keep large number of nodes in queues
Unassigned:
Assigned:4321 ,,, QQQQ
Unassigned:
Assigned:432 ,, QQQ
11 QUnassigned:
Assigned:432 ,, QQQ
21 Q
Unassigned:
Assigned:43 , QQ
4,2 21 QQ
![Page 32: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/32.jpg)
M. HauskrechtCS 1571 Intro to AI
Search strategies for solving CSP• What search algorithm to use: Depth first search !!!
• Since we know the depth of the solution• We do not have to keep large number of nodes in queues
Unassigned:
Assigned:4321 ,,, QQQQ
Unassigned:
Assigned:432 ,, QQQ
11 QUnassigned:
Assigned:432 ,, QQQ
21 Q
Unassigned:
Assigned:43 , QQ
4,2 21 QQ
Depth-first search strategy for CSP is also referred to as backtracking
![Page 33: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/33.jpg)
M. HauskrechtCS 1571 Intro to AI
Constraint consistencyQuestion: • When to check the constraints defining the goal condition? • The violation of constraints can be checked:
– at the end (for the leaf nodes)– for each node of the search tree during its generation or
before its expansion
Checking the constraints for intermediate nodes:• More efficient: cuts branches of the search tree early
![Page 34: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/34.jpg)
M. HauskrechtCS 1571 Intro to AI
Constraint consistency
Assuring consistency of constraints:• Current variable assignments together with constraints
restrict remaining legal values of unassigned variables
• The remaining legal and illegal values of variables may be inferred (effect of constraints propagates)
• To prevent “blind” exploration we can keep track of the remaining legal values, so we know when the constraints are violated and when to terminate the search
![Page 35: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/35.jpg)
M. HauskrechtCS 1571 Intro to AI
Constraint propagationA state (more broadly) is defined:• by a set of assigned variables, their values and • a list of legal and illegal assignments for unassigned variablesLegal and illegal assignments can be represented: • equations (value assignments) and • disequations (list of invalid assignments)
Constraints + assignmentscan entail new equations and disequations
Red Red BAConstraint propagation: the process of inferring of new equations and disequationsfrom existing equations and disequations
Blue Red,A RedC
![Page 36: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/36.jpg)
M. HauskrechtCS 1571 Intro to AI
Constraint propagation
• Assign A=Red
ABCDEF
Red Blue Green
- equations - disequations
A=Red
![Page 37: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/37.jpg)
M. HauskrechtCS 1571 Intro to AI
Constraint propagation
• Assign A=Red
ABCDEF
Red Blue Green
- equations - disequations
A=Red
xE=
![Page 38: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/38.jpg)
M. HauskrechtCS 1571 Intro to AI
Constraint propagation
• Assign E=Blue
ABCDEF
Red Blue Green
A=Red
xE=Blue
![Page 39: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/39.jpg)
M. HauskrechtCS 1571 Intro to AI
Constraint propagation
• Assign E=Blue
ABCDEF
Red Blue Green
A=Red
xE=Blue
F=? x
![Page 40: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/40.jpg)
M. HauskrechtCS 1571 Intro to AI
Constraint propagation
• Assign F=Green
ABCDEF
Red Blue Green
A=Red
xE=Blue
F=Green x
![Page 41: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/41.jpg)
M. HauskrechtCS 1571 Intro to AI
Constraint propagation
• Assign F=Green
ABCDEF
Red Blue Green
A=Red
xE=Blue
F=Green xB=? xxx
![Page 42: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/42.jpg)
M. HauskrechtCS 1571 Intro to AI
Constraint propagation
• Assign F=Green
Conflict !!! No legal assignmentsavailable for B and C
ABCDEF
Red Blue Green
A=Red
xE=Blue
F=Green xB=? xxx
![Page 43: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/43.jpg)
M. HauskrechtCS 1571 Intro to AI
Constraint propagation
• We can derive remaining legal values through propagation
B=GreenC=Green
ABCDEF
Red Blue Green
A=Red
xE=Blue
B=? xC=? xx
x
![Page 44: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/44.jpg)
M. HauskrechtCS 1571 Intro to AI
Constraint propagation• We can derive remaining legal
values through propagation
B=GreenC=Green
ABCDEF
Red Blue Green
F=Red
A=Red
xE=Blue
B=? xC=? xx
xF=? xx
![Page 45: CS 1571 Introduction to AI Lecture 7milos/courses/cs1571-Fall... · 2013. 9. 20. · CS 1571 Intro to AI M. Hauskrecht Iterative deepening algorithm (IDA) • Based on the idea of](https://reader036.vdocument.in/reader036/viewer/2022071511/613109721ecc515869447acd/html5/thumbnails/45.jpg)
M. HauskrechtCS 1571 Intro to AI
Constraint propagation• We can derive remaining legal
values through propagation
B=GreenC=Green
ABCDEF
Red Blue Green
F=Red
A=Red
xE=Blue
B=Green xC=Green xx
xF=Red xx