search problems russell and norvig: chapter 3, sections 3.1 – 3.3

58
Search Problems Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Post on 21-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search ProblemsSearch Problems

Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Page 2: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 2

Problem-Solving Problem-Solving AgentAgent

environmentagent

?

sensors

actuators

Page 3: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 3

Problem-Solving AgentProblem-Solving Agent

environmentagent

?

sensors

actuators• Actions • Initial state• Goal test

Page 4: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 4

문제를 어떻게 탐색 문제로

단순한 탐색 길 찾기 추적하기

규칙 문제를 탐색으로 If 비교조건 then 행동 또는 결론 우선순위 없는 수많은 규칙에서 적합한 것 찾기

고차원적 문제 Meta-knowledge 에서 찾기

Page 5: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 5

State Space and Successor State Space and Successor FunctionFunction

• Actions • Initial state• Goal test

state space

successor function

Page 6: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 6

Initial StateInitial State

• Actions • Initial state• Goal test

state space

successor function

Page 7: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 7

Goal TestGoal Test

• Actions • Initial state• Goal test

state space

successor function

Page 8: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 8

Example: 8-puzzleExample: 8-puzzle

1

2

3 4

5 6

7

8 1 2 3

4 5 6

7 8

Initial state Goal state

Page 9: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 9

Example: 8-puzzleExample: 8-puzzle

1

2

3 4

5 6

7

8

1

2

3 4

5 6

7

8

1

2

3 4

5 6

78

1

2

3 4

5 6

7

8

Page 10: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 10

Example: 8-puzzleExample: 8-puzzle

Size of the state space = 9!/2 = 181,440

15-puzzle .65 x 1012

24-puzzle .5 x 1025

10 millions states/sec

0.18 sec

6 days

12 billion years

Page 11: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 11

Search ProblemSearch Problem

State space Initial state Successor function Goal test Path cost

Page 12: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 12

Search ProblemSearch Problem

State space each state is an abstract

representation of the environment the state space is discrete

Initial state Successor function Goal test Path cost

Page 13: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 13

Search ProblemSearch Problem

State space Initial state: usually the current state sometimes one or several

hypothetical states (“what if …”)

Successor function Goal test Path cost

Page 14: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 14

Search ProblemSearch Problem

State space Initial state Successor function: [state subset of states] an abstract representation of the

possible actions

Goal test Path cost

Page 15: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 15

Search ProblemSearch Problem

State space Initial state Successor function Goal test: usually a condition sometimes the description of a state

Path cost

Page 16: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 16

Search ProblemSearch Problem

State space Initial state Successor function Goal test Path cost: [path positive number] usually, path cost = sum of step costs e.g., number of moves of the empty tile

Page 17: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 17

Search of State SpaceSearch of State Space

Page 18: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 18

Search of State SpaceSearch of State Space

Page 19: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 19

Search State SpaceSearch State Space

Page 20: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 20

Search of State SpaceSearch of State Space

Page 21: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 21

Search of State SpaceSearch of State Space

Page 22: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 22

Search of State SpaceSearch of State Space

search tree

Page 23: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 23

Simple Agent AlgorithmSimple Agent Algorithm

Problem-Solving-Agent1. initial-state sense/read state2. goal select/read goal3. successor select/read action models4. problem (initial-state, goal,

successor)5. solution search(problem)6. perform(solution)

Page 24: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 24

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 25: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 25

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 26: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 26

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 27: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 27

실제 n-queen 문제

Neural, Genetic 또는 Heuristic 방법으로 잘 해결 최악의 경우에는 처리 불가능 실제 n 이 커지면 답이 매우 많으므로 간단한

Heuristics 로도 답을 쉽게 찾음 따라서 n 이 커도 답을 잘 찾는다고 해서 인공지능

접근방법이 문제를 해결한다는 증거는 아님 그러나 많은 실제 문제는 알고리즘에서 이야기하는

최악의 경우로는 잘 가지 않음 더구나 대부분 우리가 원하는 답은 최적이 아니라 실제

활용해서 도움이 되는 , feasible solution 을 원하므로 인공지능 기법이 효과적으로 이용될 수 있음

Page 28: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 28

Example: Robot Example: Robot navigationnavigation

What is the state space?

Page 29: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 29

Example: Robot Example: Robot navigationnavigation

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

Page 30: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 30

Example: Robot Example: Robot navigationnavigation

Page 31: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 31

Example: Robot Example: Robot navigationnavigation

Page 32: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 32

Example: Robot Example: Robot navigationnavigation

Cost of one step = ???

Page 33: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 33

Example: Robot Example: Robot navigationnavigation

Page 34: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 34

Example: Robot Example: Robot navigationnavigation

Page 35: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 35

Example: Robot Example: Robot navigationnavigation

Cost of one step: length of segment

Page 36: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 36

Example: Robot Example: Robot navigationnavigation

Page 37: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 37

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 38: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 38

Example: Assembly Example: Assembly PlanningPlanning

Page 39: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 39

Example: Assembly Example: Assembly PlanningPlanning

Page 40: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 40

Assumptions in Basic Assumptions in Basic SearchSearch

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

open-loop solution

Page 41: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 41

Search Problem Search Problem FormulationFormulation

Real-world environment Abstraction

Page 42: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 42

Search Problem Search Problem FormulationFormulation

Real-world environment Abstraction Validity:

Can the solution be executed?

Page 43: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 43

Search Problem Search Problem FormulationFormulation

Real-world environment Abstraction Validity:

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

solution?

Page 44: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 44

Page 45: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 45

Page 46: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 46

Page 47: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 47

Page 48: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 48

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?

Page 49: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 49

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 50: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 50

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

Page 51: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 51

Problem VariantsProblem Variants

One or several initial states One or several goal states The solution is the path or a goal node Any, or the best, or all solutions

Page 52: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 52

Important ParametersImportant Parameters

Number of states in state space

8-puzzle 181,44015-puzzle .65 x 1012 24-puzzle .5 x 1025

8-queens 2,057100-queens 1052

There exist techniques to solveN-queens problems efficiently!

Stating a problem as a search problem is not always a good idea!

Page 53: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 53

Important ParametersImportant Parameters

Number of states in state space Size of memory needed to store a state

Page 54: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 54

Important ParametersImportant Parameters

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

Page 55: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 55

ApplicationsApplications

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

Page 56: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 56

Task Environment Observable Deterministic Episodic Static Discrete Agents

Crossword puzzle Fully Deterministic Sequential Static Discrete Single

Chess with a clock Fully Strategic Sequential Semi Discrete Multi

Poker Partially Strategic Sequential Static Discrete Multi

Backgammon Fully Stochastic Sequential Static Discrete Multi

Taxi driving Partially Stochastic Sequential Dynamic Continuous Multi

Medical diagnosis Partially Stochastic Sequential Dynamic Continuous Single

Image-analysis Fully Deterministic Episodic Semi Continuous Single

Part-picking robot Partially Stochastic Episodic Dynamic Continuous Single

Refinery controller Partially Stochastic Sequential Dynamic Continuous Single

Interactive English tutor Partially Stochastic Sequential Dynamic Discrete Multi

Figure 2.6 Examples of task environments and their characteristics.

Page 57: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 57

SummarySummary

Problem-solving agent State space, successor function, search Examples: 8-puzzle, 8-queens, route finding, robot navigation, assembly planning Assumptions of basic search Important parameters

Page 58: Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3

Search Problems 58

Future ClassesFuture Classes

Search strategies Blind strategies Heuristic strategies

Extensions Uncertainty in state sensing Uncertainty action model On-line problem solving