Choueiry AIMA: Chapter 3 (Setions 3.1, 3.2 and 3.3) In - - PowerPoint PPT Presentation

choueiry aima chapter 3 se tions 3 1 3 2 and 3 3 in tro
SMART_READER_LITE
LIVE PREVIEW

Choueiry AIMA: Chapter 3 (Setions 3.1, 3.2 and 3.3) In - - PowerPoint PPT Presentation

B.Y. Title: Solving Problems b y Sear hing Choueiry AIMA: Chapter 3 (Setions 3.1, 3.2 and 3.3) In tro dution to Artiial In telligene CSCE 476-876, Spring 2016 URL: www.se.unl.edu/~ ho uei ry/ S1


slide-1
SLIDE 1

✬ ✫ ✩ ✪

Title: Solving Problems b y Sear hing AIMA: Chapter 3 (Se tions 3.1, 3.2 and 3.3) In tro du tion to Arti ial In telligen e CSCE 476-876, Spring 2016 URL:
  • www. se.unl.edu/~
ho uei ry/ S1 6-4 76- 87 6 Berthe Y. Choueiry (Sh u-w e-ri) (402)472-5444 B.Y. Choueiry 1 Instru tor's notes #5 Jan uary 29, 2016
slide-2
SLIDE 2

✬ ✫ ✩ ✪

Summary In telligen t Agen ts
  • Designing
in telligen t agen ts: P AES
  • T
yp es
  • f
In telligen t Agen ts 1. Self Reex 2. ? 3. ? 4. ?
  • T
yp es
  • f
en vironmen ts:
  • bserv
able (fully
  • r
partially), deterministi
  • r
sto hasti , episo di
  • r
sequen tial, stati vs. dynami , dis rete vs.
  • n
tin uous, single agen t vs. m ultiagen t B.Y. Choueiry 2 Instru tor's notes #5 Jan uary 29, 2016
slide-3
SLIDE 3

✬ ✫ ✩ ✪

Outline
  • Problem-solving
agen ts
  • F
  • rm
ulating problems
  • Problem
  • mp
  • nen
ts
  • Imp
  • rtan e
  • f
mo deling
  • Sear
h
  • basi
elemen ts/ omp
  • nen
ts
  • Uninformed
sear h (Se tion 3.4)
  • Informed
(heuristi ) sear h (Se tion 3.5) B.Y. Choueiry 3 Instru tor's notes #5 Jan uary 29, 2016
slide-4
SLIDE 4

✬ ✫ ✩ ✪

Simple reex agen t unable to plan ahead
  • a tions
limited b y urren t p er epts
  • no
kno wledge
  • f
what a tions do
  • no
kno wledge
  • f
what they are trying to a hiev e Problem-solving agen t: goal-based agen t Giv en:
  • a
problem form ulation: a set
  • f
states and a set
  • f
a tions
  • a
goal to rea h/a omplish Find:
  • a
sequen e
  • f
a tions leading to goal B.Y. Choueiry 4 Instru tor's notes #5 Jan uary 29, 2016
slide-5
SLIDE 5

✬ ✫ ✩ ✪

Example: Holida y in Romania On holida y in Romania, urren tly in Arad, w an t to go to Bu harest B.Y. Choueiry 5 Instru tor's notes #5 Jan uary 29, 2016
slide-6
SLIDE 6

✬ ✫ ✩ ✪

Example: On holida y in Romania, urren tly in Arad, w an t to go to Bu harest F
  • rm
ulate goal : b e in Bu harest F
  • rm
ulate problem : states: v arious ities a tions: (op erators, su essor fun tion) driv e b et w een ities Find solution : sequen e
  • f
ities, e.g. Arad, Sibiu, F agaras, Bu harest B.Y. Choueiry 6 Instru tor's notes #5 Jan uary 29, 2016
slide-7
SLIDE 7

✬ ✫ ✩ ✪

Driv e to Bu harest... ho w man y roads
  • ut
  • f
Arad?

Giurgiu Urziceni Hirsova Eforie Neamt Oradea Zerind Arad Timisoara Lugoj Mehadia Dobreta Craiova Sibiu Fagaras Pitesti Vaslui Iasi Rimnicu Vilcea Bucharest 71 75 118 111 70 75 120 151 140 99 80 97 101 211 138 146 85 90 98 142 92 87 86

Use map to
  • nsider
h yp
  • theti al
journeys through ea h road un til rea hing Bu harest B.Y. Choueiry 7 Instru tor's notes #5 Jan uary 29, 2016
slide-8
SLIDE 8

✬ ✫ ✩ ✪

Giurgiu Urziceni Hirsova Eforie Neamt Oradea Zerind Arad Timisoara Lugoj Mehadia Dobreta Craiova Sibiu Fagaras Pitesti Vaslui Iasi Rimnicu Vilcea Bucharest 71 75 118 111 70 75 120 151 140 99 80 97 101 211 138 146 85 90 98 142 92 87 86

Lo
  • king
for a sequen e
  • f
a tions −

sear h Sequen e
  • f
a tions to goal −

solution Carrying
  • ut
a tions −

exe ution phase F
  • rm
ulate, sear h, exe ute B.Y. Choueiry 8 Instru tor's notes #5 Jan uary 29, 2016
slide-9
SLIDE 9

✬ ✫ ✩ ✪

F
  • rm
ulate, sear h, exe ute

×

Up date-State

×

F
  • rm
ulate-goal

F
  • rm
ulate-Problem

Sear h Re ommendation = rst, and Remainder = rest Assumptions for en vironmen t:
  • bserv
able, stati , dis rete, deterministi sequen tial, single-agen t B.Y. Choueiry 9 Instru tor's notes #5 Jan uary 29, 2016
slide-10
SLIDE 10

✬ ✫ ✩ ✪

Problem form ulation A pr
  • blem
is dened b y the follo wing items: 1. initial state: In(Arad) 2. su essor fun tion S(x) (op erators, a tions) Example, S(In(Arad)) = {Go(Sibiu), In(Sibiu),

Go(Timisoara), In(Timisoara), Go(Zerind), In(Zerind)}

3. go al test, an b e expli it, e.g., x = In(Bucharest)
  • r
a prop ert y NoDirt(x) 4. step
  • st:
assumed non-negativ e 5. p ath
  • st
(additiv e) e.g., sum
  • f
distan es, n um b er
  • f
  • p
erators exe uted, et . A solution is a sequen e
  • f
  • p
erators leading from the initial state to a goal state. Solution qualit y ,
  • ptimal
solutions. B.Y. Choueiry 10 Instru tor's notes #5 Jan uary 29, 2016
slide-11
SLIDE 11

✬ ✫ ✩ ✪

Imp
  • rtan e
  • f
mo deling (for problem form ulation) Real art
  • f
problem solving is mo deling, de iding what's in

  

state des ription a tion des ription ho
  • sing
the righ t lev el
  • f
abstra tion State abstra tion: road maps, w eather fore ast, tra v eling
  • mpanions,
s enery , radio programs, ... A tion abstra tion: generate p
  • llution,
slo wing do wn/sp eeding up, time duration, turning
  • n
the radio, .. Com binatorial explosion. Abstra tion b y remo ving irrelev an t detail mak e the task easier to handle B.Y. Choueiry 11 Instru tor's notes #5 Jan uary 29, 2016
slide-12
SLIDE 12

✬ ✫ ✩ ✪

State spa e vs. state set

R L S S S S R L R L R L S S S S L L L L R R R R

1 2 8 7 5 6 3 4

B.Y. Choueiry 12 Instru tor's notes #5 Jan uary 29, 2016
slide-13
SLIDE 13

✬ ✫ ✩ ✪

Example problems T
  • y
Problems:

in tended to illustrate
  • r
exer ise

8 < :

  • n epts
problem-solving metho ds

an b e giv e
  • n ise,
exa t des ription

resear hers an
  • mpare
p erforman e
  • f
algorithms

×

yield metho ds that rarely s ale-up

×

ma y ree t realit y ina urately (or not at all) Real-w
  • rld
Problems:

more di ult but whose solutions p eople a tually are ab
  • ut

more redible, useful for pra ti al settings

×

di ult to mo del, rarely agreed-up
  • n
des riptions B.Y. Choueiry 13 Instru tor's notes #5 Jan uary 29, 2016
slide-14
SLIDE 14

✬ ✫ ✩ ✪

T
  • y
problem: v a uum Single state ase States: Initial State: Su essor fun tion: Goal test: P ath
  • st:
With 2 lo ations: 2.22 states. With n lo ations: n.2n states B.Y. Choueiry 14 Instru tor's notes #5 Jan uary 29, 2016
slide-15
SLIDE 15

✬ ✫ ✩ ✪

T
  • y
problem: 8-puzzle States: Initial state: Su essor fun tion: Goal test: P ath
  • st:

instan e
  • f
sliding-blo k puzzles, kno wn to b e NP- omplete

Optimal solution
  • f n-puzzle
NP-hard

so far, nothing b etter than sear h

8-puzzle, 15-puzzle traditionally used to test sear h algorithms B.Y. Choueiry 15 Instru tor's notes #5 Jan uary 29, 2016
slide-16
SLIDE 16

✬ ✫ ✩ ✪

T
  • y
problem: n
  • Queens

F
  • rm
ulation: in remen tal vs.
  • mplete-state
States: An y arrangemen t
  • f x ≤ 8
queens
  • n
b
  • ard
Initial state: Su essor fun tion: add a queen (alt., mo v e a queen) Goal test: 8 queens not atta king
  • ne
another P ath
  • st:
irrelev an t (only nal state matters)

→ 648

p
  • ssible
states, but ∃
  • ther
more ee tiv e form ulations B.Y. Choueiry 16 Instru tor's notes #5 Jan uary 29, 2016
slide-17
SLIDE 17

✬ ✫ ✩ ✪

T
  • y
problems: requiring sear h

8 puzzles

√ n

  • queens

v a uum Others: Missionaries & annibals, farmer's dilemma, et . B.Y. Choueiry 17 Instru tor's notes #5 Jan uary 29, 2016
slide-18
SLIDE 18

✬ ✫ ✩ ✪

Real-w
  • rld
problems: requiring sear h
  • Route
nding: state = lo ations, a tions = transitions routing
  • mputer
net w
  • rks,
tra v el advisory , et .
  • T
  • uring:
start in Bu harest, visit ev ery it y at least
  • n e
T ra v eling salesp erson problem (TSP) (exa tly
  • n e,
shortest tour)
  • VLSI
la y
  • ut:
ell la y
  • ut,
hannel la y
  • ut
minimize area and
  • nne tion
lengths to maximize sp eed
  • Rob
  • t
na vigation ( on tin uous spa e, 2D, 3D, ldots )
  • Assem
bly b y rob
  • t-arm
States: rob
  • t
join t angles, rob
  • t
and parts
  • rdinates
Su essor fun tion:
  • n
tin uous motions
  • f
the rob
  • t
joins goal test:
  • mplete
assem bly path
  • st:
time to exe ute
  • +
protein design, in ternet sear h, et . ( he k AIMA) B.Y. Choueiry 18 Instru tor's notes #5 Jan uary 29, 2016
slide-19
SLIDE 19

✬ ✫ ✩ ✪

Problem solving p erforman e Measures for ee tiv eness
  • f
sear h: 1. Do es it nd a solution?
  • mplete
2. Is it a go
  • d
solution? path
  • st
lo w 3. Sear h
  • st?
time & spa e T
  • tal
  • st
= Sear h
  • st
+ P ath
  • st

− →

problem? Example: Arad to Bu harest P ath
  • st:
total mileage, fuel, tire w ear f (route), et . Sear h
  • st:
time,
  • mputer
at hand, et . B.Y. Choueiry 19 Instru tor's notes #5 Jan uary 29, 2016
slide-20
SLIDE 20

✬ ✫ ✩ ✪

So far
  • Problem-solving
agen ts F
  • rm
ulate, Sear h, Exe ute
  • F
  • rm
ulating problems
  • Problem
  • mp
  • nen
ts: States, Initial state, Su essor fun tion, Goal test, Step
  • st,
P ath
  • st
Solution: sequen e
  • f
a tions from initial state to goal state
  • Imp
  • rtan e
  • f
mo deling No w, sear h
  • T
erminology: tree, no de, expansion, fringe, leaf, queue, strategy
  • Implemen
tation: data stru tures
  • F
  • ur
ev aluation riteria.. ? B.Y. Choueiry 20 Instru tor's notes #5 Jan uary 29, 2016
slide-21
SLIDE 21

✬ ✫ ✩ ✪

Sear h: generate a tion sequen es partial solution: sequen e yielding a (non goal) in termediate state Sear h

  

generate main tain

  

a set
  • f
sequen es
  • f
partial solutions T w
  • asp
e ts: 1. ho w to generate sequen es 2. whi h data stru tures to k eep tra k
  • f
them B.Y. Choueiry 21 Instru tor's notes #5 Jan uary 29, 2016
slide-22
SLIDE 22

✬ ✫ ✩ ✪

Sear h generate a tion sequen es Basi idea:
  • ine,
sim ulated exploration
  • f
state spa e b y generating su essors
  • f
already-explored states

exp anding states Start from a state, test if it is a goal state If it is, w e are done If it is not: exp and state Apply all
  • p
erators appli able to urren t state to generate all p
  • ssible
sequen es
  • f
future states now we have set
  • f
p artial solutions ... B.Y. Choueiry 22 Instru tor's notes #5 Jan uary 29, 2016
slide-23
SLIDE 23

✬ ✫ ✩ ✪

(a) The initial state (b) After expanding Arad (c) After expanding Sibiu

Rimnicu Vilcea

Lugoj Arad Fagaras Oradea Arad Arad Oradea

Rimnicu Vilcea

Lugoj Zerind Sibiu Arad Fagaras Oradea

Timisoara

Arad Arad Oradea Lugoj Arad Arad Oradea Zerind Arad Sibiu

Timisoara

Arad

Rimnicu Vilcea

Zerind Arad Sibiu Arad Fagaras Oradea

Timisoara

Sear h tree, no des

8 < :

ro
  • t:
initial state lea v es: states that an/should not b e expanded B.Y. Choueiry 23 Instru tor's notes #5 Jan uary 29, 2016
slide-24
SLIDE 24

✬ ✫ ✩ ✪

Data stru ture LHW Chapter 13 A no de x has a paren t, hildren, depth, path
  • st g(x)
A data stru ture for a sear h no de

                   State[x]

state in state spa e

Parent − Node[x]

paren t no de

Action[x]

  • p
erator used to generate no de

Path − Cost[x]

path
  • st
  • f
paren t+ ost step, path
  • st g(x)

Depth[x]

depth: # no des from ro
  • t
(path length) No des to b e expanded

      

  • nstitute
a fringe (fron tier) managed in a queue,
  • rder
  • f
no de expansion determines sear h strategy B.Y. Choueiry 24 Instru tor's notes #5 Jan uary 29, 2016
slide-25
SLIDE 25

✬ ✫ ✩ ✪

W arning:

1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8

Node

DEPTH = 6 STATE PARENT-NODE ACTION = right

  • PATH-COST = 6
Do not
  • nfuse:
State spa e and Sear h (tree) spa e Holida y in Romania:

8 > > > > > > > > < > > > > > > > > :

What is a state? What is the state spa e? What is the size
  • f
state spa e? What is the size
  • f
sear h tree ? A no de has a paren t, hildren, depth, path
  • st g(x)
A state has no paren t, hildren, depth, et .. B.Y. Choueiry 25 Instru tor's notes #5 Jan uary 29, 2016
slide-26
SLIDE 26

✬ ✫ ✩ ✪

T yp es
  • f
Sear h Uninformed: use
  • nly
information a v ailable in problem denition Heuristi : exploits some kno wledge
  • f
the domain Uninformed sear h strategies: Breadth-rst sear h, Uniform- ost sear h, Depth-rst sear h, Depth-limited sear h, Iterativ e deep ening sear h, Bidire tional sear h B.Y. Choueiry 26 Instru tor's notes #5 Jan uary 29, 2016
slide-27
SLIDE 27

✬ ✫ ✩ ✪

Sear h strategies Criteria for ev aluating sear h: 1. Completeness: do es it alw a ys nd a solution if
  • ne
exists? 2. Time
  • mplexit
y: n um b er
  • f
no des generated/expanded 3. Spa e
  • mplexit
y: maxim um n um b er
  • f
no des in memory 4. Optimalit y: do es it alw a ys nd a least- ost solution? Time/spa e
  • mplexit
y measured in terms
  • f:
  • b:
maxim um bran hing fa tor
  • f
the sear h tree
  • d :
depth
  • f
the least- ost solution
  • m
: maxim um depth
  • f
the sear h spa e (ma y b e ∞ ) B.Y. Choueiry 27 Instru tor's notes #5 Jan uary 29, 2016