Top Banner
Search Problems Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/200 3/home.htm by Prof. Jean-Claude Latombe
30

Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Dec 19, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Search ProblemsSearch Problems

Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Slides adapted from:robotics.stanford.edu/~latombe/cs121/2003/home.htmby Prof. Jean-Claude Latombe

Page 2: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Why Search?

In many tasks, we know what a solution looks like, but do not have an algorithm that produces a solution. Goal + preferences

Search is a general problem solving technique for this kind of situations. Search Problem: Input: Initial State + Goal (utility) + actions

(state transitions) Output: A sequence of actions to reach the

goal.

Page 3: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Example: Travel Task

Page 4: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Clean House Task

Page 5: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Vacuum Cleaner Space

Page 6: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Search ProblemSearch Problem

State space Initial state Successor function Goal test Path cost

Page 7: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Example: 8-queensExample: 8-queens

Place 8 queens in a chessboard so that no two queens are in the same row, column, or diagonal.

A solution Not a solution

Page 8: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Example: 8-queensExample: 8-queens

Formulation #1:• States: any arrangement of 0 to 8 queens on the board• Initial state: 0 queens on the board• Successor function: add a queen in any square• Goal test: 8 queens on the board, none attacked

648 states with 8 queens

Page 9: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Example: 8-queensExample: 8-queensFormulation #2:• States: any arrangement of k = 0 to 8 queens in the k leftmost columns with none attacked• Initial state: 0 queens on the board• Successor function: add a queen to any square in the leftmost empty column such that it is not attacked by any other queen• Goal test: 8 queens on the board

2,067 states

Page 10: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Example: Robot Example: Robot navigationnavigation

What is the state space?

Page 11: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Example: Robot Example: Robot navigationnavigation

Cost of one horizontal/vertical step = 1Cost of one diagonal step = 2

Page 12: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Example: Robot Example: Robot navigationnavigation

Page 13: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Example: Robot Example: Robot navigationnavigation

Page 14: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Example: Robot Example: Robot navigationnavigation

Cost of one step = ???

Page 15: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Example: Robot Example: Robot navigationnavigation

Page 16: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Example: Robot Example: Robot navigationnavigation

Page 17: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Example: Robot Example: Robot navigationnavigation

Cost of one step: length of segment

Page 18: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Example: Robot Example: Robot navigationnavigation

Page 19: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Example: Assembly Example: Assembly PlanningPlanning

Initial state

Goal state

Successor function:• Merge two subassemblies

Complex function:it must find if a collision-freemerging motion exists

Page 20: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Example: Assembly Example: Assembly PlanningPlanning

Page 21: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Example: Assembly Example: Assembly PlanningPlanning

Page 22: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Assumptions in Basic Assumptions in Basic SearchSearch

The environment is staticThe environment is discretizableThe environment is observableThe actions are deterministic

open-loop solution

Page 23: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Search Problem Search Problem FormulationFormulation

Real-world environment Abstraction Validity:

Can the solution be executed?

Page 24: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Search Problem Search Problem FormulationFormulation

Real-world environment Abstraction Validity:

Can the solution be executed? Does the state space contain the solution?

Usefulness Is the abstract problem easier than the real-

world problem?

Without abstraction an agent would be swamped by the real world

Page 25: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Search Problem VariantsSearch Problem Variants

One or several initial states One or several goal states The solution is the path or a goal node In the 8-puzzle problem, it is the path to

a goal node In the 8-queen problem, it is a goal node

Any, or the best, or all solutions

Page 26: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Multi-state Search

In vacuum problem, what if we don’t have sensors to tell us whether the floor is clean or not, and which room are we in?

Page 27: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.
Page 28: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

Important ParametersImportant Parameters

Number of states in state space Size of memory needed to store a state Running time of the successor function

Page 29: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

ApplicationsApplications

Route finding: airline travel, telephone/computer networks Pipe routing, VLSI routing Pharmaceutical drug design Robot motion planning Video games

Page 30: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm by Prof. Jean-Claude.

SummarySummary

Problem-solving agent State space, successor function, search Examples: Travel Task, house cleaning, 8-queens, robot navigation, assembly planning Assumptions of basic search Important parameters