CS 416 Artificial Intelligence Lecture 4 Uninformed Searches (cont) Lecture 4 Uninformed Searches (cont)

Slides:



Advertisements
Similar presentations
Review: Search problem formulation
Advertisements

Uninformed search strategies
Classic AI Search Problems
Informed Search Methods Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 4 Spring 2004.
1 Heuristic Search Chapter 4. 2 Outline Heuristic function Greedy Best-first search Admissible heuristic and A* Properties of A* Algorithm IDA*
Problem-solving as search. History Problem-solving as search – early insight of AI. Newell and Simon’s theory of human intelligence and problem-solving.
Problem Solving Agents A problem solving agent is one which decides what actions and states to consider in completing a goal Examples: Finding the shortest.
1 Lecture 3 Uninformed Search. 2 Uninformed search strategies Uninformed: While searching you have no clue whether one non-goal state is better than any.
Solving Problems by Searching Currently at Chapter 3 in the book Will finish today/Monday, Chapter 4 next.
CS 480 Lec 3 Sept 11, 09 Goals: Chapter 3 (uninformed search) project # 1 and # 2 Chapter 4 (heuristic search)
CSC 423 ARTIFICIAL INTELLIGENCE
Artificial Intelligence (CS 461D)
Search Strategies CPS4801. Uninformed Search Strategies Uninformed search strategies use only the information available in the problem definition Breadth-first.
Review: Search problem formulation
1 Solving Problems by Searching. 2 Terminology State State Space Initial State Goal Test Action Step Cost Path Cost State Change Function State-Space.
Problem Solving and Search in AI Heuristic Search
CSC344: AI for Games Lecture 4: Informed search
ITCS 3153 Artificial Intelligence Lecture 4 Uninformed Searches (cont) Lecture 4 Uninformed Searches (cont)
5-Nov-2003 Heuristic Search Techniques What do you do when the search space is very large or infinite? We’ll study three more AI search algorithms: Backtracking.
State-Space Searches. 2 State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
Solving Problems by Searching
State-Space Searches.
CMU Snake Robot
Problem Solving and Search Andrea Danyluk September 11, 2013.
CS 416 Artificial Intelligence Lecture 5 Finish Uninformed Searches Begin Informed Searches Lecture 5 Finish Uninformed Searches Begin Informed Searches.
CHAPTER 4: INFORMED SEARCH & EXPLORATION Prepared by: Ece UYKUR.
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
Informed search algorithms Chapter 4. Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
Search (cont) & CSP Intro Tamara Berg CS 560 Artificial Intelligence Many slides throughout the course adapted from Dan Klein, Stuart Russell, Andrew Moore,
Informed searching. Informed search Blind search algorithms do not consider any information about the states and the goals Often there is extra knowledge.
Informed Search Methods. Informed Search  Uninformed searches  easy  but very inefficient in most cases of huge search tree  Informed searches  uses.
Informed Search Strategies Lecture # 8 & 9. Outline 2 Best-first search Greedy best-first search A * search Heuristics.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
Advanced Artificial Intelligence Lecture 2: Search.
CSC3203: AI for Games Informed search (1) Patrick Olivier
Lecture 5-1CS250: Intro to AI/Lisp “If I Only had a Brain” Search Lecture 5-1 October 26 th, 1999 CS250.
Uninformed Search ECE457 Applied Artificial Intelligence Spring 2007 Lecture #2.
1 Kuliah 4 : Informed Search. 2 Outline Best-First Search Greedy Search A* Search.
Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state).
Search (continued) CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Uninformed search strategies A search strategy is defined by picking the order of node expansion Uninformed search strategies use only the information.
Informed Search II CIS 391 Fall CIS Intro to AI 2 Outline PART I  Informed = use problem-specific knowledge  Best-first search and its variants.
Informed Search CSE 473 University of Washington.
A* optimality proof, cycle checking CPSC 322 – Search 5 Textbook § 3.6 and January 21, 2011 Taught by Mike Chiang.
Chapter 3.5 and 3.6 Heuristic Search Continued. Review:Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
For Monday Read chapter 4 exercise 1 No homework.
CS 416 Artificial Intelligence Lecture 4 Finish Uninformed Searches Begin Informed Searches Lecture 4 Finish Uninformed Searches Begin Informed Searches.
ARTIFICIAL INTELLIGENCE Dr. Seemab Latif Lecture No. 4.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Chapter 3.5 Heuristic Search. Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Review: Tree search Initialize the frontier using the starting state
Last time: Problem-Solving
Artificial Intelligence Problem solving by searching CSC 361
HW #1 Due 29/9/2008 Write Java Applet to solve Goats and Cabbage “Missionaries and cannibals” problem with the following search algorithms: Breadth first.
Discussion on Greedy Search and A*
Discussion on Greedy Search and A*
CS 4100 Artificial Intelligence
EA C461 – Artificial Intelligence
Artificial Intelligence
CSE 473 University of Washington
HW 1: Warmup Missionaries and Cannibals
ECE457 Applied Artificial Intelligence Fall 2007 Lecture #2
HW 1: Warmup Missionaries and Cannibals
Artificial Intelligence
CS 416 Artificial Intelligence
Informed Search.
“If I Only had a Brain” Search
Presentation transcript:

CS 416 Artificial Intelligence Lecture 4 Uninformed Searches (cont) Lecture 4 Uninformed Searches (cont)

Chess Kasparov won the first chess game

Cost of Breadth-first Search (BFS) b – max branching factor (infinite?)b – max branching factor (infinite?) d – depth to shallowest goal noded – depth to shallowest goal node m – max length of any path (infinite?)m – max length of any path (infinite?) Analysis of space and time performance…Analysis of space and time performance… –see example on blackboard –big Oh = O(f(n)) is the asymptotic upper bound –means that there are positive constants c and n 0 such that  0 = n 0  Read algorithms textbook if this is new to you b – max branching factor (infinite?)b – max branching factor (infinite?) d – depth to shallowest goal noded – depth to shallowest goal node m – max length of any path (infinite?)m – max length of any path (infinite?) Analysis of space and time performance…Analysis of space and time performance… –see example on blackboard –big Oh = O(f(n)) is the asymptotic upper bound –means that there are positive constants c and n 0 such that  0 = n 0  Read algorithms textbook if this is new to you

BFS Space Requirements What’s important is the path, not just the existence of the goal in the tree.What’s important is the path, not just the existence of the goal in the tree. We must be able to reconstruct the path to the goal.We must be able to reconstruct the path to the goal. We’ve got to store the tree for reconstruction.We’ve got to store the tree for reconstruction. What’s important is the path, not just the existence of the goal in the tree.What’s important is the path, not just the existence of the goal in the tree. We must be able to reconstruct the path to the goal.We must be able to reconstruct the path to the goal. We’ve got to store the tree for reconstruction.We’ve got to store the tree for reconstruction.

Cost of Uniform Search See example on blackboard

Cost of Depth-first Search time complexity = O (b m )time complexity = O (b m ) –length of longest path anchors upper bound space complexity = O (bm)space complexity = O (bm) What’s an example that highlights difference in performance between BFS and DFS?What’s an example that highlights difference in performance between BFS and DFS? time complexity = O (b m )time complexity = O (b m ) –length of longest path anchors upper bound space complexity = O (bm)space complexity = O (bm) What’s an example that highlights difference in performance between BFS and DFS?What’s an example that highlights difference in performance between BFS and DFS?

Iterative Deepening Essentially DFS with a depth limit Why? Remember the space complexity, O(bm) and time complexity, O(b m ) of DFS?Remember the space complexity, O(bm) and time complexity, O(b m ) of DFS? So... limit m to be smallSo... limit m to be small But what if m is smaller than d?But what if m is smaller than d? –we’ll never find solution So… increment depth limit starting from 0So… increment depth limit starting from 0 Essentially DFS with a depth limit Why? Remember the space complexity, O(bm) and time complexity, O(b m ) of DFS?Remember the space complexity, O(bm) and time complexity, O(b m ) of DFS? So... limit m to be smallSo... limit m to be small But what if m is smaller than d?But what if m is smaller than d? –we’ll never find solution So… increment depth limit starting from 0So… increment depth limit starting from 0

Cost of Iterative Deepening See example on blackboard Preferred uninformed search method when search space is large and depth of solution is not known See example on blackboard Preferred uninformed search method when search space is large and depth of solution is not known

Bidirectional Search Search from goal to start Search from start to goal See example on blackboard Search from goal to start Search from start to goal See example on blackboard

Bidirectional Search Do you always know the predecessors of a goal state?Do you always know the predecessors of a goal state? Do you always know the goal state?Do you always know the goal state? –8-puzzle –Path planning –Chess Do you always know the predecessors of a goal state?Do you always know the predecessors of a goal state? Do you always know the goal state?Do you always know the goal state? –8-puzzle –Path planning –Chess

Avoid Repeated States How might you create repeated states in 8-puzzle? How can you detect repeated states? What about preserving lowest cost path among repeated states? uniform-cost search and BFS w/ constant step costsuniform-cost search and BFS w/ constant step costs How might you create repeated states in 8-puzzle? How can you detect repeated states? What about preserving lowest cost path among repeated states? uniform-cost search and BFS w/ constant step costsuniform-cost search and BFS w/ constant step costs

Interesting problems Exercise 3.9: 3 cannibals and 3 missionaries and a boat that can hold one or two people are on one side of the river. Get everyone across the river.3 cannibals and 3 missionaries and a boat that can hold one or two people are on one side of the river. Get everyone across the river. 8-puzzle and 15-puzzle, invented by Sam Loyd in good ol’ USA in 1870s. Think about search space.8-puzzle and 15-puzzle, invented by Sam Loyd in good ol’ USA in 1870s. Think about search space. Rubik’s cubeRubik’s cube Traveling Salesman Problem (TSP)Traveling Salesman Problem (TSP) Exercise 3.9: 3 cannibals and 3 missionaries and a boat that can hold one or two people are on one side of the river. Get everyone across the river.3 cannibals and 3 missionaries and a boat that can hold one or two people are on one side of the river. Get everyone across the river. 8-puzzle and 15-puzzle, invented by Sam Loyd in good ol’ USA in 1870s. Think about search space.8-puzzle and 15-puzzle, invented by Sam Loyd in good ol’ USA in 1870s. Think about search space. Rubik’s cubeRubik’s cube Traveling Salesman Problem (TSP)Traveling Salesman Problem (TSP)

Chapter 4 – Informed Search INFORMED? Uses problem-specific knowledge beyond the definition of the problem itselfUses problem-specific knowledge beyond the definition of the problem itself –selecting best lane in traffic –playing a sport  what’s the heuristic (or evaluation function)? INFORMED? Uses problem-specific knowledge beyond the definition of the problem itselfUses problem-specific knowledge beyond the definition of the problem itself –selecting best lane in traffic –playing a sport  what’s the heuristic (or evaluation function)?

Best-first Search Use an evaluation function to select node to expand f(n) = evaluation function = expected distance to goalf(n) = evaluation function = expected distance to goal select the node that minimizes f(n)select the node that minimizes f(n) but if we knew the ‘best’ node to explore it wouldn’t be search!!!but if we knew the ‘best’ node to explore it wouldn’t be search!!! Let’s use heuristics for our evaluation functionsLet’s use heuristics for our evaluation functions Use an evaluation function to select node to expand f(n) = evaluation function = expected distance to goalf(n) = evaluation function = expected distance to goal select the node that minimizes f(n)select the node that minimizes f(n) but if we knew the ‘best’ node to explore it wouldn’t be search!!!but if we knew the ‘best’ node to explore it wouldn’t be search!!! Let’s use heuristics for our evaluation functionsLet’s use heuristics for our evaluation functions

Heuristics A function, h(n), that estimates cost of cheapest path from node n to the goal h(n) = 0 if n == goal nodeh(n) = 0 if n == goal node A function, h(n), that estimates cost of cheapest path from node n to the goal h(n) = 0 if n == goal nodeh(n) = 0 if n == goal node

Greedy Best-first Search Trust your heuristic evaluate node that minimizes h(n)evaluate node that minimizes h(n) f(n) = h(n)f(n) = h(n) Example: getting from A to B Explore nodes with shortest straight distance to BExplore nodes with shortest straight distance to B Shortcomings of heuristic?Shortcomings of heuristic? –slow route (traffic), long route, dead end Trust your heuristic evaluate node that minimizes h(n)evaluate node that minimizes h(n) f(n) = h(n)f(n) = h(n) Example: getting from A to B Explore nodes with shortest straight distance to BExplore nodes with shortest straight distance to B Shortcomings of heuristic?Shortcomings of heuristic? –slow route (traffic), long route, dead end

A* (A-star) Search Combine two costs f(n) = g(n) + h(n)f(n) = g(n) + h(n) –g(n) = cost to get to n –h(n) = cost to get to goal from n Minimize f(n) Combine two costs f(n) = g(n) + h(n)f(n) = g(n) + h(n) –g(n) = cost to get to n –h(n) = cost to get to goal from n Minimize f(n)

A* is Optimal? A* can be optimal if h(n) satisfies conditions h(n) never overestimates cost to reach the goalh(n) never overestimates cost to reach the goal –admissible heurisitic –h(n) is optimistic –f(n) never overestimates cost of a solution through n Proof of optimality?Proof of optimality? A* can be optimal if h(n) satisfies conditions h(n) never overestimates cost to reach the goalh(n) never overestimates cost to reach the goal –admissible heurisitic –h(n) is optimistic –f(n) never overestimates cost of a solution through n Proof of optimality?Proof of optimality?

A* is Optimal We must prove that A* will not return a suboptimal goal or a suboptimal path to a goal Let G be a suboptimal goal nodeLet G be a suboptimal goal node –f(G) = g(G) + h(G) –h(G) = 0 because G is a goal node –f(G) = g(G) > C* (because G is suboptimal) We must prove that A* will not return a suboptimal goal or a suboptimal path to a goal Let G be a suboptimal goal nodeLet G be a suboptimal goal node –f(G) = g(G) + h(G) –h(G) = 0 because G is a goal node –f(G) = g(G) > C* (because G is suboptimal)

A* is Optimal We must prove that A* will not return a suboptimal goal or a suboptimal path to a goal Let G be a suboptimal goal nodeLet G be a suboptimal goal node –f(G) = g(G) + h(G) –h(G) = 0 because G is a goal node –f(G) = g(G) > C* (because G is suboptimal) We must prove that A* will not return a suboptimal goal or a suboptimal path to a goal Let G be a suboptimal goal nodeLet G be a suboptimal goal node –f(G) = g(G) + h(G) –h(G) = 0 because G is a goal node –f(G) = g(G) > C* (because G is suboptimal) Let n be a node on the optimal pathLet n be a node on the optimal path –because h(n) does not overestimate –f(n) = g(n) + h(n) <= C* Therefore f(n) <= C* < f(G)Therefore f(n) <= C* < f(G) –node n will be selected before node G Let n be a node on the optimal pathLet n be a node on the optimal path –because h(n) does not overestimate –f(n) = g(n) + h(n) <= C* Therefore f(n) <= C* < f(G)Therefore f(n) <= C* < f(G) –node n will be selected before node G