Problem Spaces & Search

Slides:



Advertisements
Similar presentations
Solving problems by searching Chapter 3. Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms.
Advertisements

Additional Topics ARTIFICIAL INTELLIGENCE
Announcements Course TA: Danny Kumar
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
CS 480 Lec 3 Sept 11, 09 Goals: Chapter 3 (uninformed search) project # 1 and # 2 Chapter 4 (heuristic search)
Blind Search1 Solving problems by searching Chapter 3.
Search Strategies Reading: Russell’s Chapter 3 1.
May 12, 2013Problem Solving - Search Symbolic AI: Problem Solving E. Trentin, DIISM.
Implementation and Evaluation of Search Methods. Use a stack data structure. 1. Push root node of tree on the stack. 2. Pop the top node off the stack.
Touring problems Start from Arad, visit each city at least once. What is the state-space formulation? Start from Arad, visit each city exactly once. What.
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
UNINFORMED SEARCH Problem - solving agents Example : Romania  On holiday in Romania ; currently in Arad.  Flight leaves tomorrow from Bucharest.
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
UnInformed Search What to do when you don’t know anything.
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 Spaces & Search CSE 473. © Daniel S. Weld Topics Agents & Environments Problem Spaces Search & Constraint Satisfaction Knowledge Repr’n.
Solving problems by searching
Solving Problems by Searching
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
1 Solving problems by searching This Lecture Chapters 3.1 to 3.4 Next Lecture Chapter 3.5 to 3.7 (Please read lecture topic material before and after each.
Lecture 3: Uninformed Search
Problem Spaces & Search CSE 573. © Daniel S. Weld 2 Logistics Mailing list Reading Ch 4.2, Ch 6 Mini-Project I Partners Game Playing?
SOLVING PROBLEMS BY SEARCHING Chapter 3 August 2008 Blind Search 1.
1 Solving Problems by Searching. 2 Terminology State State Space Goal Action Cost State Change Function Problem-Solving Agent State-Space Search.
Implementation: General Tree Search
Solving problems by searching A I C h a p t e r 3.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Artificial Intelligence Solving problems by searching.
Chapter 3 (Part-II) Section 3.4, 3.5, 3.6 Uninformed Search.
Lecture 3 Problem Solving through search Uninformed Search
Lecture 3: Uninformed Search
Problem Solving Agents
EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS
Logistics Problem Set 1 Mailing List Due 10/13 at start of class
CSE 473 Artificial Intelligence Oren Etzioni
Introduction to Artificial Intelligence
Uninformed Search Chapter 3.4.
Problem Solving by Searching
Uninformed Search Strategies
Artificial Intelligence (CS 370D)
Uninformed Search Introduction to Artificial Intelligence
Russell and Norvig: Chapter 3, Sections 3.4 – 3.6
Solving problems by searching
CS 188: Artificial Intelligence Spring 2007
Problem Solving and Searching
What to do when you don’t know anything know nothing
CSE 4705 Artificial Intelligence
EA C461 – Artificial Intelligence
Artificial Intelligence
Searching for Solutions
Problem Solving and Searching
CS 2710, ISSP 2160 Foundations of Artificial Intelligence
Principles of Computing – UFCFA3-30-1
Problem Spaces & Search
Problem Spaces & Search
CSE 473: Artificial Intelligence Spring 2012
CSE 473 University of Washington
Solving problems by searching
UNINFORMED SEARCH -BFS -DFS -DFIS - Bidirectional
State-Space Searches.
ECE457 Applied Artificial Intelligence Fall 2007 Lecture #2
CMSC 471 Fall 2011 Class #4 Tue 9/13/11 Uninformed Search
Solving Problems by Searching
Search Strategies CMPT 420 / CMPG 720.
Solving Problems by Searching
Solving problems by searching
Presentation transcript:

Problem Spaces & Search CSE 473 A handful of GENERAL SEARCH TECHNIQUES lie at the heart of practically all work in AI We will encounter the SAME PRINCIPLES again and again in this course, whether we are talking about GAMES LOGICAL REASONING MACHINE LEARNING These are principles for SEARCHING THROUGH A SPACE OF POSSIBLE SOLUTIONS to a problems.

473 Topics Agents & Environments Problem Spaces Search & Constraint Satisfaction Knowledge Repr’n & Logical Reasoning Machine Learning Uncertainty: Repr’n & Reasoning Robotics © D. Weld, D. Fox

Weak Methods “In the knowledge lies the power…” [Feigenbaum] But what if no knowledge???? Generate & test: As weak as it gets © D. Weld, D. Fox

Example: Fragment of 8-Puzzle Problem Space © D. Weld, D. Fox

Problem Space / State Space Search thru a Problem Space / State Space Input: Set of states Operators [and costs] (successor function) Start state Goal state [test] Output: Path: start  a state satisfying goal test [May require shortest path] State Space Search is basically a GRAPH SEARCH PROBLEM STATES are whatever you like! OPERATORS are a compact DESCRIPTION of possible STATE TRANSITIONS – the EDGES of the GRAPH May have different COSTS or all be UNIT cost OUTPUT may be specified either as ANY PATH (REACHABILITY), or a SHORTEST PATH © D. Weld, D. Fox

Example: Route Planning Input: Set of states Operators [and costs] Start state Goal state (test) Output: States = cities Start state = starting city Goal state test = is state the destination city? Operators = move to an adjacent city; cost = distance Output: a shortest path from start state to goal state SUPPOSE WE REVERSE START AND GOAL STATES? © D. Weld, D. Fox

Example: N Queens Q Input: Set of states Operators [and costs] Start state Goal state (test) Output: © D. Weld, D. Fox

Search Strategies Blind Search Informed Search Constraint Satisfaction Adversary Search Depth first search Breadth first search Iterative deepening search Iterative broadening search © D. Weld, D. Fox

Search Strategies A search strategy is defined by picking the order of node expansion Strategies are evaluated along the following dimensions: completeness: does it always find a solution if one exists? time complexity: number of nodes generated space complexity: maximum number of nodes in memory optimality: does it always find a least-cost solution? Time and space complexity are measured in terms of b: maximum branching factor of the search tree d: depth of the least-cost solution m: maximum depth of the state space (may be ∞) © D. Weld, D. Fox

Breadth First Search Maintain queue of nodes to visit Evaluation Complete? Time Complexity? Space Complexity? Yes a O(b^d) b c O(b^d) g h d e f © D. Weld, D. Fox

Memory a Limitation? Suppose: 2 GHz CPU 1 GB main memory 100 instructions / expansion 5 bytes / node 200,000 expansions / sec Memory filled in 100 sec … < 2 minutes © D. Weld, D. Fox

Depth First Search Maintain stack of nodes to visit Evaluation Complete? Time Complexity? Space Complexity? © D. Weld, D. Fox

Depth First Search Maintain stack of nodes to visit Evaluation Complete? Time Complexity? Space Complexity? © D. Weld, D. Fox

Depth First Search Maintain stack of nodes to visit Evaluation Complete? Time Complexity? Space Complexity? © D. Weld, D. Fox

Depth First Search Maintain stack of nodes to visit Evaluation Complete? Time Complexity? Space Complexity? © D. Weld, D. Fox

Depth First Search Maintain stack of nodes to visit Evaluation Complete? Time Complexity? Space Complexity? © D. Weld, D. Fox

Depth First Search Maintain stack of nodes to visit Evaluation Complete? Time Complexity? Space Complexity? © D. Weld, D. Fox

Depth First Search Maintain stack of nodes to visit Evaluation Complete? Time Complexity? Space Complexity? © D. Weld, D. Fox

Depth First Search Maintain stack of nodes to visit Evaluation Complete? Time Complexity? Space Complexity? © D. Weld, D. Fox

Depth First Search Maintain stack of nodes to visit Evaluation Complete? Time Complexity? Space Complexity? © D. Weld, D. Fox

Depth First Search Maintain stack of nodes to visit Evaluation Complete? Time Complexity? Space Complexity? © D. Weld, D. Fox

Depth First Search Maintain stack of nodes to visit Evaluation Complete? Time Complexity? Space Complexity? © D. Weld, D. Fox

Depth First Search Maintain stack of nodes to visit Evaluation Complete? Time Complexity? Space Complexity? © D. Weld, D. Fox

Depth First Search Maintain stack of nodes to visit Evaluation Complete? Time Complexity? Space Complexity? Not for infinite spaces O(b^m) O(bm) © D. Weld, D. Fox

Iterative Deepening Search DFS with limit; incrementally grow limit Evaluation Complete? Time Complexity? Space Complexity? Yes a b e O(b^d) c f d i O(bd) g h j k l © D. Weld, D. Fox

Iterative deepening search Number of nodes generated in a depth-limited search to depth d with branching factor b: NDLS = b0 + b1 + b2 + … + bd-2 + bd-1 + bd Number of nodes generated in an iterative deepening search to depth d with branching factor b: NIDS = (d+1)b0 + d b^1 + (d-1)b^2 + … + 3bd-2 +2bd-1 + 1bd For b = 10, d = 5, NDLS = 1 + 10 + 100 + 1,000 + 10,000 + 100,000 = 111,111 NIDS = 6 + 50 + 400 + 3,000 + 20,000 + 100,000 = 123,456 Overhead = (123,456 - 111,111)/111,111 = 11% © D. Weld, D. Fox

Speed BFS Nodes Time Iter. Deep. Nodes Time 8 Puzzle 2x2x2 Rubik’s Assuming 10M nodes/sec & sufficient memory BFS Nodes Time Iter. Deep. Nodes Time 8 Puzzle 2x2x2 Rubik’s 15 Puzzle 3x3x3 Rubik’s 24 Puzzle 105 .01 sec 106 .2 sec 1013 6 days 1019 68k yrs 1025 12B yrs 105 .01 sec 106 .2 sec 1017 20k yrs 1020 574k yrs 1037 1023 yrs © D. Weld, D. Fox Adapted from Richard Korf presentation

When to Use Iterative Deepening N Queens? Q Q Q Q © D. Weld, D. Fox

Forwards vs. Backwards start end © D. Weld, D. Fox

vs. Bidirectional © D. Weld, D. Fox

Repeated states Failure to detect repeated states can turn a linear problem into an exponential one! Graph search: Stores expanded nodes in a set called Closed and only adds new nodes to the fringe © D. Weld, D. Fox

Graph search © D. Weld, D. Fox

Problem All these methods are slow (blind) Solution  add guidance (“heurstic estimate”)  “informed search” © D. Weld, D. Fox