• Keine Ergebnisse gefunden

Foundations of Artificial Intelligence 5. State-Space Search: State Spaces Malte Helmert

N/A
N/A
Protected

Academic year: 2022

Aktie "Foundations of Artificial Intelligence 5. State-Space Search: State Spaces Malte Helmert"

Copied!
21
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

5. State-Space Search: State Spaces

Malte Helmert

University of Basel

March 8, 2021

(2)

State-Space Search Problems

(3)

Classical State-Space Search Problems Informally

(Classical) state-space search problemsare among the “simplest”

andmost importantclasses of AI problems.

objective of the agent:

from a given initial state apply a sequence of actions in order to reach a goal state

performance measure: minimize total action cost

(4)

Motivating Example: 15-Puzzle

9 2 12 6

5 7 14 13

3 1 11

15 4 10 8

1 2 3 4

5 6 7 8

9 10 11 12

13 14 15

(5)

Classical Assumptions

“classical” assumptions:

no other agents in the environment (single-agent) always knows state of the world (fully observable) state only changed by the agent (static)

finite number of states/actions (in particulardiscrete) actions have deterministic effect on the state

can all be generalized (but not in this part of the course) For simplicity, we omit “classical” in the following.

(6)

Classification

Classification:

State-Space Search environment:

static vs. dynamic

deterministic vs. non-deterministicvs. stochastic fully vs.partially vs. notobservable

discrete vs.continuous single-agent vs. multi-agent problem solving method:

problem-specificvs. generalvs. learning

(7)

Search Problem Examples

toy problems: combinatorial puzzles

(Rubik’s Cube, 15-puzzle, towers of Hanoi, . . . ) schedulingof events, flights, manufacturing tasks query optimizationin databases

behavior of NPCsin computer games code optimization in compilers verificationof soft- and hardware sequence alignment in bioinformatics route planning(e.g., Google Maps) . . .

thousandsof practical examples

(8)

State-Space Search: Overview

Chapter overview: state-space search 5.–7. Foundations

5. State Spaces

6. Representation of State Spaces 7. Examples of State Spaces 8.–12. Basic Algorithms 13.–19. Heuristic Algorithms

(9)

Formalization

(10)

Formalization

preliminary remarks:

to cleanly study search problems we need a formal model fundamental concept: state spaces

state spaces are (labeled, directed)graphs paths to goal states representsolutions shortest paths correspond tooptimal solutions

(11)

State Spaces: Example

State spaces are often depicted asdirected graphs.

states: graph vertices transitions: labeled arcs (here: colors instead of labels) initial state: incoming arrow goal states: marked (here: by the dashed ellipse) actions: the arc labels

action costs: described separately (or implicitly = 1)

A B C

D

E F

initial state goal states

(12)

State Spaces

Definition (state space)

Astate spaceor transition system is a 6-tuple S=hS,A,cost,T,s0,S?i with

S: finite set ofstates A: finite set ofactions cost:A→R+0 action costs

T ⊆S ×A×S transition relation;deterministic inhs,ai (see next slide)

s0∈S initial state S? ⊆S set of goal states

German: Zustandsraum, Transitionssystem, Zust¨ande, Aktionen, Aktionskosten, Transitions-/ ¨Ubergangsrelation, deterministisch, Anfangszustand, Zielzust¨ande

(13)

State Spaces: Transitions, Determinism

Definition (transition, deterministic)

LetS =hS,A,cost,T,s0,S?i be a state space.

The tripleshs,a,s0i ∈T are called (state) transitions.

We sayS has the transitionhs,a,s0i ifhs,a,s0i ∈T. We write this ass −→a s0, or s →s0 when adoes not matter.

Transitions aredeterministic in hs,ai: it is forbidden to have boths −→a s1 ands −→a s2 with s1 6=s2.

(14)

State Spaces: Terminology

We use common terminology from graph theory.

Definition (predecessor, successor, applicable action) LetS =hS,A,cost,T,s0,S?i be a state space.

Lets,s0 ∈S be states withs →s0. s is a predecessor ofs0

s0 is a successor of s

Ifs −→a s0, then action ais applicable in s.

German: Vorg¨anger, Nachfolger, anwendbar

(15)

State Spaces: Terminology

We use common terminology from graph theory.

Definition (path)

LetS =hS,A,cost,T,s0,S?i be a state space.

Lets(0), . . . ,s(n)∈S be states and π1, . . . , πn∈A be actions such thats(0)−→π1 s(1), . . . , s(n−1)−→πn s(n).

π =hπ1, . . . , πni is a pathfroms(0) to s(n) length of π: |π|=n

costof π: cost(π)=Pn

i=1cost(πi) German: Pfad, L¨ange, Kosten

paths may have length 0

sometimes “path” is used for state sequencehs(0), . . . ,s(n)i or sequencehs(0), π1,s(1), . . . ,s(n−1), πn,s(n)i

(16)

State Spaces: Terminology

more terminology:

Definition (reachable, solution, optimal) LetS =hS,A,cost,T,s0,S?i be a state space.

state s is reachableif a path froms0 tos exists paths from s ∈S to some state s? ∈S?

are solutions for/from s

solutions for s0 are called solutions forS optimal solutions (fors) have minimal costs among all solutions (for s)

German: erreichbar, L¨osung von/f¨ur s, optimale L¨osung

(17)

State-Space Search

(18)

State-Space Search

State-Space Search

State-space searchis the algorithmic problem of finding solutions in state spaces or proving that no solution exists.

Inoptimal state-space search, only optimal solutions may be returned.

German: Zustandsraumsuche, optimale Zustandsraumsuche

(19)

Learning Objectives for State-Space Search

Learning Objectives for the Topic of State-Space Search understanding state-space search:

What is the problem and how can we formalize it?

evaluate search algorithms:

completeness, optimality, time/space complexity get to know search algorithms:

uninformed vs. informed; tree and graph search evaluate heuristics for search algorithms:

goal-awareness, safety, admissibility, consistency efficient implementation of search algorithms experimental evaluationof search algorithms

design and comparison of heuristics for search algorithms

(20)

Summary

(21)

Summary

classical state-space search problems:

find action sequence from initial state to a goal state performance measure: sum of action costs

formalization via state spaces:

states,actions,action costs,transitions, initial state,goal states

terminology for transitions, paths, solutions definition of (optimal) state-space search

Referenzen

ÄHNLICHE DOKUMENTE

recognize duplicates: when a state is reached on multiple paths, only keep one search node search nodes correspond 1:1 to reachable states search tree bounded, as number of states

breadth-first search ( this chapter) uniform cost search ( Chapter 11) depth-first search ( Chapter 12) depth-limited search ( Chapter 12) iterative deepening search ( Chapter

breadth-first search optimal if all action costs equal otherwise no optimality guarantee example:.. remedy: uniform

space complexity O(bm) if m maximal search depth reached low memory complexity main reason why depth-first search interesting despite its disadvantages.. Depth-first

heuristics estimate distance of a state to the goal can be used to focus search on promising states soon: search algorithms that

Best-first search is a class of search algorithms that expand the “most promising” node in each iteration?. decision which node is most promising

some practical remarks on implementing A ∗ : common bug: reopening not implemented although heuristic is not consistent common bug: duplicate test “too early”. (upon generation

f -bound lemma: The minimum f value in the open list at the beginning of each A ∗ iteration is a lower bound on the optimal