Intelligent Systems 2II40 C3 - PowerPoint PPT Presentation

1 / 53
About This Presentation
Title:

Intelligent Systems 2II40 C3

Description:

... the LAO* paper find the different notations used by the author for the ... created '53 by Metropolis et al., for physical process modeling ... – PowerPoint PPT presentation

Number of Views:38
Avg rating:3.0/5.0
Slides: 54
Provided by: wwwisW
Category:

less

Transcript and Presenter's Notes

Title: Intelligent Systems 2II40 C3


1
Intelligent Systems (2II40)C3
  • Alexandra I. Cristea

September 2003
2
Outline
  • Intelligent agents
  • Search
  • Uninformed
  • Informed
  • Heuristic
  • Local
  • Online

3
Uniform cost search
  • Expand least cost node first
  • Implementation increasing cost order queue
  • e min(cost/step) the smallest step cost

4
Ex Romania w. step costs (km)
5
Uniform cost example
Arad
6
Uniform cost example
Arad
118
75
140
Zerind
Sibiu
Timisoara
7
Uniform cost example
Arad
118
75
140
Sibiu
Zerind
Timisoara
7575 150
111118 229
7571 146
236
Arad
Oradea
Arad
Lugoj
8
Uniform cost example
Arad
118
75
140
Sibiu
Zerind
Timisoara
150
229
146
280
220
239
291
236
Arad
Oradea
Arad
Lugoj
Arad
Oradea
Ramnicu Valcea
Fagarash
9
Uniform cost example
Arad
118
75
140
Sibiu
Zerind
Timisoara
150
229
146
280
220
239
291
236
Arad
Oradea
Arad
Lugoj
Arad
Oradea
Ramnicu Valcea
Fagarash
297
217
Sibiu
Zerind
10
Uniform cost example
Arad
118
75
140
Sibiu
Zerind
Timisoara
150
229
146
280
220
239
291
236
Arad
Oradea
Arad
Lugoj
Arad
Oradea
Ramnicu Valcea
Fagarash
297
217
Sibiu
225
Zerind
290
268
11
Uniform cost example
Arad
118
75
140
Sibiu
Zerind
Timisoara
150
229
146
280
220
239
291
236
Arad
Oradea
Arad
Lugoj
Arad
Oradea
Ramnicu Valcea
Fagarash
297
217
300
382
317
Sibiu
225
Sibiu
Pitesti
Craiova
Zerind
290
268
12
Uniform cost example
Arad
118
75
140
Sibiu
Zerind
Timisoara
150
229
146
280
220
239
291
236
Arad
Oradea
Arad
Lugoj
Arad
Oradea
Ramnicu Valcea
Fagarash
297
217
300
382
317
Sibiu
225
Sibiu
Pitesti
Craiova
Zerind
290
268
13
Properties of uniform cost search
  • Complete? Yes (b,d finite cost/step ? e)
  • Time? O(bC/e) (C total cost)
  • Space? O(bC/e)
  • Optimal? Yes (b,d finite cost/step ? e)

14
III.2. Informed search algorithms
15
III.2. Informed Search Strategies
  • A. Heuristic
  • Best-first search
  • Greedy search
  • A search
  • B. Local
  • Hill climbing
  • Simulated annealing
  • Genetic algorithms

16
Best first search
  • f(n) evaluation function
  • estimates desirability of the node to be expanded
  • Implementation queue of decreasing order of
    desirability
  • Special cases
  • Greedy search
  • A

17
Greedy search
  • f(n) h(n), where
  • h(n) heuristic that estimates distance (cost)
    from n to goal
  • Expands node that appears closest to goal

18
Example Greedy search
  • Map of Romania
  • A possible heuristic is
  • hsld(n) straight line distance from n to
    Bucharest

19
Greedy search example
Arad
366
20
Greedy search example
Arad
366
Zerind
Timisoara
Sibiu
374
329
253
21
Greedy search example
Arad
366
Zerind
Timisoara
Sibiu
329
374
253
Arad
Oradea
Ramnicu Valcea
Fagarash
366
380
178
193
22
Greedy search example
Arad
366
Zerind
Timisoara
Sibiu
329
374
253
Arad
Oradea
Ramnicu Valcea
Fagarash
366
380
178
193
Sibiu
Bucharest
253
0
23
Properties of Greedy search
  • Complete? No (could get stuck in loops)
  • Time? O(bm)
  • Space? O(bm)
  • Optimal? No

24
A search
  • f(n) g(n) h(n), where
  • g(n)cost from start to n (real cost!!)
  • h(n) heuristic that estimates distance or cost
    from n to goal
  • considers the whole cost incurred from start to
    goal at all times
  • Important heuristic should be admissible
  • h(n) ? h(n), w. h(n) real cost from n to goal

25
A search example
Arad
366
26
A search example
Arad
366
118
75
140
Zerind
Timisoara
Sibiu
37475 449
447
393
27
A search example
Arad
366
118
75
140
Zerind
Timisoara
Sibiu
449
447
393
140
80
99
151
Arad
Oradea
Ramnicu Valcea
Fagarash
646
526
417
413
28
A search example
Arad
366
118
75
140
Zerind
Timisoara
Sibiu
449
447
393
140
80
99
151
Arad
Oradea
Ramnicu Valcea
Fagarash
646
526
417
413
146
80
97
Sibiu
Craiova
Pitesti
553
526
415
29
A search example
Arad
366
118
75
140
Zerind
Timisoara
Sibiu
449
447
393
140
80
99
151
Arad
Oradea
Ramnicu Valcea
Fagarash
646
526
417
413
146
80
97
Sibiu
Pitesti
Craiova
553
526
415
97
138
101
Ramnicu Valcea
Bucharest
Craiova
615
607
418
30
A search example
Arad
366
118
75
140
Zerind
Timisoara
Sibiu
449
447
393
140
80
99
151
Arad
Oradea
Ramnicu Valcea
Fagarash
646
526
417
413
146
80
99
97
211
Sibiu
Pitesti
Craiova
Sibiu
Bucharest
553
526
415
97
138
591
450
101
Ramnicu Valcea
Bucharest
Craiova
615
607
418
31
Properties of A search
  • Complete? Yes (if nodes w. f ? C finite)
  • Time? O (b(rel. err. in h) x (length of
    solution))
  • Space? All nodes in memory
  • Optimal? Yes

32
Improved A alg.
  • IDA A iterative deepening depending on f
  • RBFS recursive depth first search remembering
    value of best ancestor spaceO(bd)
  • MA memory bound A (use of available memo
    only)
  • SMA simple MA (A if memo full, discard
    worst node, but store f value of children w.
    parents)

33
Summary (un-)informed search
  • Non-informed search is also called blind
  • Informed search can be computationally cheaper
    than uninformed, depending on heuristic
  • Research continues on finding better search
    (i.e., problem solving) algorithms
  • Informed uninformed search are global search
    algorithms gt exponential timespace (10120
    no. molecules in universe)

34
Homework 3 part I
  • Prove that the A search is optimal (Hint use
    the admissibility of the heuristic)
  • Read the LAO paper find the different notations
    used by the author for the properties of the
    search algorithm and make a table of
    equivalences Describe LAO in terms of
    properties (as in C2, C3) comment upon
    dimensions of AI (as in C1) that you find in the
    LAO algorithm.
  • Check the FAQ and perform the next project steps
    that are missing (1-4)!

35
II.2.B. Local Search
  • Greedy local search (hill-climbing)
  • Simulated annealing
  • Genetic algorithms

36
Why local search?
  • If path is not part of the solution
  • If the problem is an optimization problem (I.e.,
    finding max or min of an objective function)
  • If there is no goal (to do goal test or path cost)

Objective function
State space
37
Hill-climbing (gradient ascent/descent)
  • Like climbing Everest in thick fog with amnesia

38
Visualizing hill-climbing
  • Problem alg. can get stuck in local maxima/minima

39
Simulated annealing
40
Properties of simulated annealing
  • created 53 by Metropolis et al., for physical
    process modeling
  • Metallurgy annealing heating metals/ glass to
    high temperature, then cooling gradually (to
    harden them)
  • used in airline scheduling, VLSI layout, etc.
  • allowing moves up-hill
  • why?

41
Simulated annealing probability
  • Probability of state occupation
  • At fixed temperature T, probability Boltzman
    distribution
  • If T decreases slowly enough, the best state is
    always reached

42
Simulated Annealing Algorithm
  • function S_A(problem, schedule) returns a
    solution state
  • inputs problem, a problem
  • schedule, a mapping from time to temperature
  • local variables current, a node
  • next, a node
  • T, a temperature controlling the
    probability of downwards steps
  • current?MAKE-NODE(INITIAL-STATEproblem)
  • for t ?1 to ? do
  • T ? schedulet
  • if T0 then return current
  • next ? a randomly selected successor of
    current
  • ?E ? VALUEnext VALUEcurrent
  • if ?E gt 0 then current ?next
  • else current ?next only with probability
    e?E/T

43
Genetic Algorithms(stochastic hill-climbing)
44
GA terminology
  • Chromosome state (in search space),
    made up of genes
  • Genes state variables
  • Alleles possible values for genes
  • Locus position along the chromosome
  • Crossover new child chromosome generation by
    aligning two parents
  • Mutation new chromosome generation from one
    individual (altering val. of loci)

45
Crossover
Single point cross-over
Multiple point cross-over
46
Mutation
Problems validity check!!
47
Genetic Algorithm
  • function G_A(population, FITNES-FN) returns an
    individual
  • inputs population, a set of individuals
  • FITNESS-FN, a fct. measuring fitness of an
    individual
  • repeat
  • new_population ? empty set
  • loop for i from 1 to SIZE(population) do
  • x ? RANDOM_SELECTION(population,
    FITNESS-FN)
  • y ? RANDOM_SELECTION(population,
    FITNESS-FN)
  • child ? REPRODUCE(x,y)
  • if (small random probability) then child ?
    MUTATE(child)
  • add child to new_population
  • population ? new_population
  • until some individual is fit enough, or enough
    time has elapsed
  • return the best individual in the population,
    according to the FITNESS-FN

48
Selection some examples
  • Fitness-proportionate no. offspring proportional
    w. fitness (roulette wheel selection)
  • Linear fitness scaling (simfic)
  • Boltzmann fitness sc. (siexp(fi/T))
  • Tournament selection (binary 2 by 2)
  • Elitism (a group of individuals pass unchanged)

49
III.2.c. Online search agents and unknown
environments
50
Online search
  • Exploration problem
  • Agent doesnt know the environment (states,
    actions)
  • Local algorithms are fine for online search, as
    they only require knowledge of a limited vicinity
    of the current state
  • A good algorithm has to outperform random walk

51
  • function LTRA(s) returns an action
  • inputs s, a percept that identifies the current
    state
  • static result, a table, indexed by action and
    state, initially empty
  • H, a table of cost estimates indexed by
    state, initially empty
  • s,a, the previous state and action,
    initially null
  • if GOAL-TEST(s) then return stop
  • if s is a new state (not in H) then Hs ?h(s)
  • unless s is null
  • resulta,s ?s
  • Hs ? min (b?ACTIONS(s)) LRTA-COST(s,b,resu
    ltb,s,H)
  • s ?s
  • return a
  • function LRTA-COST(s,a,s,H) returns a cost
    estimate
  • if s is undefined then return h(s)
  • else return c(s,a,s) Hs

52
LTRA steps (in 1-dimensional space)
Initial state
8
9
2
2
4
3
(1)
53
Homework 3 part II
  • Find the memory requirements (propertiesspace)
    of the simulated annealing algorithm (Hint
    express space in states kept in memory).
  • How many alleles are there for a binary-encoded
    gene that is N bits wide?
  • Find out where the name LTRA comes from? What
    does the L stand for, and how do you explain it?
Write a Comment
User Comments (0)
About PowerShow.com