Outline for 3/28 Introduction & Logistics Textbook: chapters 3, 4 and 5. Notion of a Problem Space Search Techniques Constraint Satisfaction Techniques.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Review: Search problem formulation
An Introduction to Artificial Intelligence
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
This lecture topic (two lectures) Chapter 6.1 – 6.4, except 6.3.3
Search I: Chapter 3 Aim: achieving generality Q: how to formulate a problem as a search problem?
1 Finite Constraint Domains. 2 u Constraint satisfaction problems (CSP) u A backtracking solver u Node and arc consistency u Bounds consistency u Generalized.
Games & Adversarial Search Chapter 5. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent’s reply. Time.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
Game Playing (Tic-Tac-Toe), ANDOR graph By Chinmaya, Hanoosh,Rajkumar.
Search in AI.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
Lecture 13 Last time: Games, minimax, alpha-beta Today: Finish off games, summary.
CPSC 322 Introduction to Artificial Intelligence October 25, 2004.
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
Game Playing CSC361 AI CSC361: Game Playing.
Constraint Satisfaction CSE 473 University of Washington.
1 search CS 331/531 Dr M M Awais A* Examples:. 2 search CS 331/531 Dr M M Awais 8-Puzzle f(N) = g(N) + h(N)
Constraint Satisfaction Problems
Problem Spaces & Search CSE 473. © Daniel S. Weld Topics Agents & Environments Problem Spaces Search & Constraint Satisfaction Knowledge Repr’n.
Foundations of Constraint Processing, Fall 2005 Sep 20, 2005BT: A Theoretical Evaluation1 Foundations of Constraint Processing CSCE421/821, Fall 2005:
Informed Search CSE 473 University of Washington.
Search in Artificial Intelligence zFind the next move in chess, checkers. zScheduling: finding a good class schedule. zTheorem proving: given a set of.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
Outline Introduction & Logistics Textbook: Russell and Norvig chapters 3, 4 and 5. Notion of a Problem Space Search Techniques Constraint Satisfaction.
Chapter 5 Outline Formal definition of CSP CSP Examples
Games & Adversarial Search Chapter 6 Section 1 – 4.
1 Adversary Search Ref: Chapter 5. 2 Games & A.I. Easy to measure success Easy to represent states Small number of operators Comparison against humans.
Constraint Satisfaction Problems
Constraint Satisfaction Problems
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
Constraint Satisfaction Problems (CSPs) CPSC 322 – CSP 1 Poole & Mackworth textbook: Sections § Lecturer: Alan Mackworth September 28, 2012.
Constraint Satisfaction Problems Chapter 6. Review Agent, Environment, State Agent as search problem Uninformed search strategies Informed (heuristic.
Constraint Satisfaction CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Chapter 5: Constraint Satisfaction ICS 171 Fall 2006.
Outline for 4/2 Introduction & Logistics Notion of a Problem Space Search Techniques Video: Kasparov vs. Deep Blue Constraint Satisfaction Techniques.
Lecture 3: Uninformed Search
Chapter 5 Constraint Satisfaction Problems
Review Test1. Robotics & Future Technology Future of Intelligent Systems / Ray Kurzweil futurist Ray Kurzweil / A Long Bet A Long Bet / Robot Soccer.
CSE 473: Artificial Intelligence Constraint Satisfaction Daniel Weld Slides adapted from Dan Klein, Stuart Russell, Andrew Moore & Luke Zettlemoyer.
© Daniel S. Weld 1 Logistics PS3 Project Additional problem Reading Planning & CSP for “today” SAT plan paper review for Wed.
CHAPTER 5 SECTION 1 – 3 4 Feb 2004 CS Constraint Satisfaction 1 Constraint Satisfaction Problems.
© Daniel S. Weld 1 Midterm Search Space Bayes Net Learning / Cross Validation Lessons for the Final I’ll hit these areas again I’ll include one midterm.
1. 2 Outline of Ch 4 Best-first search Greedy best-first search A * search Heuristics Functions Local search algorithms Hill-climbing search Simulated.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Heuristics & Constraint Satisfaction CSE 573 University of Washington.
Computing & Information Sciences Kansas State University Friday, 08 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 7 of 42 Friday, 08 September.
Chapter 5 Team Teaching AI (created by Dewi Liliana) PTIIK Constraint Satisfaction Problems.
Graph Search II GAM 376 Robin Burke. Outline Homework #3 Graph search review DFS, BFS A* search Iterative beam search IA* search Search in turn-based.
Constraint Satisfaction CSE 473 University of Washington.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 5 Adversarial Search (Thanks Meinolf Sellman!)
CMPT 463. What will be covered A* search Local search Game tree Constraint satisfaction problems (CSP)
Adversarial Search and Game-Playing
Done Done Course Overview What is AI? What are the Major Challenges?
Constraint Satisfaction
Constraint Satisfaction
Heuristics Local Search
Constraint Satisfaction Problems
Constraints and Search
Problem Spaces & Search
Heuristics Local Search
Outline for 4/9 Recap Constraint Satisfaction Techniques
Problem Spaces & Search
Constraint Satisfaction
CS 8520: Artificial Intelligence
Search.
Search.
Constraint Satisfaction Problems
Minimax strategies, alpha beta pruning
Presentation transcript:

Outline for 3/28 Introduction & Logistics Textbook: chapters 3, 4 and 5. Notion of a Problem Space Search Techniques Constraint Satisfaction Techniques Game Search; Video: Kasparov vs. Deep Blue

Logistics: John Q. Yang Mathrew Cary Reading –Required: Textbook by Russell & Norvig and Tom Mitchell –Recommended: various papers Grading: –Problem Set25% –AI Tool Demonstration in Class25% –Final Project (Group)50%

Defining Intelligence?

4 Artificial Intelligence Planning (To get a good job I should get an MS/CSE…) Diagnosis (My car won’t start, but I know it has gas…) Design (Space Shuttle, Boeing 777, Pentium) Communicate ( Language + Social reasoning) Theorem Proving (Fermat’s Last Theorem) Perceive/Act (Vision, Manipulation) Game Playing (Kasparov vs. Deep Blue) Create Art (MacBeth, Mona Lisa, Taj Mahal) Learn to...

AI as Science Origin & Laws of the Physical Universe Origin & Laws of Biological Life Nature of Intelligent Thought AI as Engineering Softbots & Intelligent User Interfaces Mobile Robots … Immobots Machine Learning Algorithms; Data Mining Medical Expert Systems...

AI Theory For example, Machine Learning –Given tree structured instance space with n attributes, you need 4 log(2/  ) + 16n log(13/  examples AI Practice Game Playing Pattern Classification: Character Recognition, … Machine Learning: Data Mining, Web Agents Perception – Vision, Speech

Course Topics by Week Search (1 and 2-person) & Constraint Satisfaction KR&R 1: Logic representation & Theorem Proving KR&R 2: Planning and Diagnosis Machine Learning 1: Supervised Learning Machine Learning 2: Unsupervised Learning Natural Language Processing AI-Tools demo Application Sampler I Application Sampler II Final Project

Search (one solution) Brute force –DFS, BFS, iterative deepening, iterative broadening Heuristic –Best first, beam, hill climbing, simulated annealing, limited discrepancy Optimizing –Branch & bound, A*, IDA*, SMA* Adversary Search –Minimax, alpha-beta, conspiracy search Constraint Satisfaction –As search, preprocessing, backjumping, forward checking, dynamic variable ordering

Search (Internet and Databases) Look for all solutions Must be efficient Often uses indexing Also uses heuristics (e.g., Google ) More than search itself –NLP can be important –Scale up to thousands of users –Caching is often used

Outline Defining a Search Space Types of Search –Blind –Heuristic –Optimization –Adversary Search –Constraint Satisfaction Analysis –Completeness –Time & Space Complexity

11 Specifying a search problem? What are states (nodes in graph)? What are the operators (arcs between nodes)? Initial state? Goal test? [Cost?, Heuristics?, Constraints?] E.g., Eight Puzzle

12 Towers of Hanoi What are states (nodes in graph)? What are the operators (arcs between nodes)? Initial state? Goal test? a bc

13 Planning What is Search Space? –What are states? –What are arcs? What is Initial State? What is Goal? Path Cost? Heuristic? a c b c b a PickUp(Block) PutDown(Block)

14 Missionaries and Cannibals m m m c c c What are states (nodes in graph)? What are the operators (arcs between nodes)? Initial state? Goal test? 2 Representations

15 Search Strategies Blind Search –Depth first search –Breadth first search –Iterative deepening search –Iterative broadening search Heuristic Search Optimizing Search Constraint Satisfaction

Depth First Search a b de c f gh Maintain stack of nodes to visit Evaluation –Complete? –Time Complexity? –Space Complexity? Not for infinite spaces O(b^d) O(d)

Breadth First Search a b c def gh Maintain queue of nodes to visit Evaluation –Complete? –Time Complexity? –Space Complexity? Yes O(b^d)

Iterative Deepening Search DFS with limit; incrementally grow limit a b c

Iterative Deepening Search DFS with limit; incrementally grow limit Evaluation –Complete? –Time Complexity? –Space Complexity? Yes O(b^d) O(d) b de c f gh a

Heuristic Search A heuristic is: –Function from a state to a real number Low number means state is close to goal High number means state is far from the goal Designing a good heuristic is very important! (And hard) More on this in a bit...

A* Search Idea –Best first search with admissible heuristic –Plus keep checking until all possibilities look worse Evaluation –Finds optimal solution? –Time Complexity? –Space Complexity? Yes O(b^d) Underestimates cost of any solution which can reached from node

Admissable Heuristics f(x) = g(x) + h(x) g: cost so far h: underestimate of remaining costs a b c d e f For transportation planning? For eight puzzle?

Hill Climbing Idea –Always choose best child; no backtracking Evaluation –Complete? –Time Complexity? –Space Complexity? No - suffers from plateau, local maxima, ridges O(b^d) but only in pathological cases O(b)

Simulated Annealing Objective: avoid local minima Technique: –For the most part use hill climbing –Occasionally take non-optimal step –Reduce probability(non-optimal) over time Comparison to Hill Climbing –Completeness? –Speed? –Space Complexity? temp

Importance of Heuristics D IDS A*(h1)A*(h2) h1 = number of tiles in the wrong place h2 = sum of distances of tiles from correct loc

Constraint Satisfaction Chronological Backtracking (BT) Backjumping (BJ) Conflict-Directed Backjumping (CBJ) Forward checking (FC) Dynamic variable ordering heuristics Preprocessing Strategies

Chinese Constraint Network Soup Total Cost < $30 Chicken Dish Vegetable RiceSeafood Pork Dish Appetizer Must be Hot&Sour No Peanuts No Peanuts Not Chow Mein Not Both Spicy

CSPs in the real world Scheduling Space Shuttle Repair Transportation Planning Computer Configuration Diagnosis

Recognizing Trihedral Objects Trihedral objects: all vertices are intersections of three planes. Labeling: with +, - and -> Enumerating all labels: Using constraint satisfaction to find correct labels –NP hard in general –CSP gives good solutions

Binary Constraint Network Set of n variables: x 1 … x n Value domains for each variable: D 1 … D n Set of binary constraints (also known as relations) –R ij  D i  D j –Specifies which values of x i are consistent w/ those of x j Partial assignment of values with a tuple of pairs –{...(x,a)…} means variable x gets value a... –Consistent if all constraints satisfied on all vars in tuple –Tuple = full solution if consistent & all vars included Tuple {(x i, a i ) … (x j, a j )} consistent w/ a set of vars {x m … x n } iff  a m … a n such that this tuple is consistent: {(x i, a i ) … (x j, a j ), (x m, a m ) … (x n, a n )} }

N Queens Variables = board columns Domain values = rows R ij = {(a i, a j ) : (a i  a j )  (|i-j|  |a i -a j |) –e.g. R 12 = {(1,3), (1,4), (2,4), (3,1), (4,1), (4,2)} Q Q Q {(x 1, 2), (x 2, 4), (x 3, 1)} consistent with (x 4 ) Shorthand: “{2, 4, 1} consistent with x 4 ”

32 CSP as a search problem? What are states (nodes in graph)? What are the operators (arcs between nodes)? Initial state? Goal test? Q Q Q

Chronological Backtracking (BT) (e.g., depth first search) Q Q Q Q Q Q Q Q Q Q Q Consistency check performed in the order in which vars were instantiated If c-check fails, try next value of current var If no more values, backtrack to most recent var

Backjumping (BJ) Similar to BT, but more efficient when no consistent instantiation can be found for the current var Instead of backtracking to most recent var… BJ reverts to deepest var which was checked against the current var Q Q Q Q BJ Discovers (2, 5, 3, 6) inconsistent with x 6 No sense trying other values of x 5 Q

BT vs. BJ {

Preprocessing Strategies Even FC-CBJ is O(b^d) time worst case Sometimes useful to spend polynomial time preprocessing to achieve local consistency before doing exponential search Arc consistency –Consider all pairs of vars –Can any values be eliminated from a domain ala FC –Propagate –O(d^2) time where d= number of vars

Forward Checking (FC) Perform Consistency Check Forward Whenever assign var a value –Prune inconsistent values from –As-yet unvisited variables –Backtrack if domain of any var ever collapses Q Q Q Q Q FC only visits consistent nodes but not all such nodes skips (2, 5, 3, 4) which CBJ visits But FC can’t detect that (2, 5, 3) inconsistent with {x 5, x 6 }

Dynamic variable ordering In the N-queens examples we assumed –First x 1 then x 2 then... But this order not required –Any order ok with respect to completeness –A good order leads to huge speedup A good heuristic: –Choose variable w/ minimum remaining values This is easy if one is doing FC

Number of Nodes Explored BT=BM BJ=BMJ=BMJ2 CBJ=BM-CBJ=BM-CBJ2 FC-CBJ FC More Fewer

Number of Consistency Checks BMJ2 BT BJ BMJ BM-CBJ CBJ FC-CBJ BM BM-CBJ2 FC

Combinatorial Optimization Nonlinear Programs Convex Programs –Local optimality  global optimality –Kuhn Tucker conditions for optimality Linear Programs –Simplex Algorithm Flow and Matching Integer Programming

Game Tree Search (java applet) Two person games: min (adversary) and max (me!) Max wants to win by expanding all possible moves of min, and looks for the ‘best’ branch There is a utility function e(n) attached to each terminal node Values of utility function propagates upward –Max: chooses the max value of all children – Min: chooses the min value of all children Tic-Tac-Toe –MAX = “X”, MIN = “O” –e (leaf node) = Total-Open-Paths(MAX) – Total-Open-Paths(MIN) –e (leaf node) = +/- infinity for winning nodes –e (MAX node) = MAX {e(succ nodes)}; e(MIN node) = MIN {}

Search Tree Start node -2 1 XX X XX O O OO O 6-5=15-5=0 ? MIN X X X ? MAX

Tricks Alpha value: for MAX nodes, is a current lower bound on its evaluation function (it never goes down for MAX) Beta value: for MIN nodes, is a current upper bound on its evaluation function (it never goes up for MIN) Rule 1: –if MAX is parent, MIN is a child and – (alpha(MAX) > = beta(MIN), – then terminate search on MIN Rule 2: –if MIN is parent, MAX is a child, and – (alpha(MAX) > = beta(MIN), –Then terminate search on MAX

Watch Video