Title: Intelligent Systems 2II40 C3
1Intelligent Systems (2II40)C3
September 2005
2Outline
- Intelligent agents
- Search
- Uninformed
- Informed
- Heuristic
- Local
- Online
3Iterative deepening search
- Depth first search with growing depth
- l allowed maximal depth in tree
4Iterative deepening search example
l 0
Arad
5Iterative deepening search example
l 1
Arad
6Iterative deepening search example
l 1
Arad
Zerind
Sibiu
Timisoara
7Iterative deepening search example
l 2
Arad
8Iterative deepening search example
l 2
Arad
Zerind
Sibiu
Timisoara
9Iterative deepening search example
l 2
Arad
Zerind
Sibiu
Timisoara
Arad
Oradea
10Iterative deepening search example
l 2
Arad
Sibiu
Timisoara
Arad
Oradea
Fagarash
Ramnicu Valcea
11Iterative deepening search example
l 2
Arad
Timisoara
Arad
Lugoj
12Proprieties of iterative deepening search
- Complete? Yes (b,d finite)
- Time? (d1) db (d-1)b2 bd O(bd)
- Space? O(bd)
- Optimal? Yes (b,d finite cost/step1)
13Outline
- Intelligent agents
- Search
- Uninformed
- Informed
- Heuristic
- Local
- Online
14Uniform cost search
- Expand least cost node first
- Implementation increasing cost order queue
- e min(cost/step) the smallest step cost
15Ex Romania w. step costs (km)
16Uniform cost example
Arad
17Uniform cost example
Arad
118
75
140
Zerind
Sibiu
Timisoara
18Uniform cost example
Arad
118
75
140
Sibiu
Zerind
Timisoara
7575 150
111118 229
7571 146
236
Arad
Oradea
Arad
Lugoj
19Uniform 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
20Uniform 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
21Uniform 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
22Uniform 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
23Uniform 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
24Properties of uniform cost search
- Complete? Yes (b,d finite cost/step ? e)
- Optimal? Yes (b,d finite cost/step ? e)
- Time? O(bC/e 1) (C cost optimal solution)
- Space? O(bC/e 1)
25III.2. Informed search algorithms
26III.2. Informed Search Strategies
- A. Heuristic
- Best-first search
- Greedy search
- A search
- B. Local
- Hill climbing
- Simulated annealing
- Genetic algorithms
27Best first search
- f(n) evaluation function
- desirability of n
- Implementation
- queue of decreasing desirability
28Greedy search
- f(n) h(n),
- h(n) heuristic distance from n to goal
- expands n closest to goal
- Important heuristic should be admissible
- h(n) ? h(n), with
- h(n) real cost from n to goal
29Example Greedy search
- Map of Romania
- possible heuristic
- hsld(n) straight_line_distance (n, Bucharest)
30Greedy search example
Arad
366
31Greedy search example
Arad
366
Zerind
Timisoara
Sibiu
374
329
253
32Greedy search example
Arad
366
Zerind
Timisoara
Sibiu
329
374
253
Arad
Oradea
Ramnicu Valcea
Fagarash
366
380
178
193
33Greedy search example
Arad
366
Zerind
Timisoara
Sibiu
329
374
253
Arad
Oradea
Ramnicu Valcea
Fagarash
366
380
178
193
Sibiu
Bucharest
253
0
34Properties of Greedy search
- Complete? No (could get stuck in loops)
- Optimal? No
- Time? O(bm)
- Space? O(bm)
35Homework 3 part 1
- Check Dijkstras Greedy algorithm and shortly
compare! - Give 3 recent applications of a (modified) Greedy
algorithm. Explain in what consists the
application, evtl. the modification, and give
your source.
36A search
- f(n) g(n) h(n)
- g(n) real (!!) cost from start to n
- h(n) heuristic distance from n to goal
- NOTE
- considers the whole cost incurred from start to
goal at all times !!
37A search example
Arad
366
38A search example
Arad
366
118
75
140
Zerind
Timisoara
Sibiu
37475 449
447
393
39A search example
Arad
366
118
75
140
Zerind
Timisoara
Sibiu
449
447
393
140
80
151
99
Arad
Oradea
Ramnicu Valcea
Fagarash
646
671
417
413
40A search example
Arad
366
118
75
140
Zerind
Timisoara
Sibiu
449
447
393
140
80
151
99
Arad
Oradea
Ramnicu Valcea
Fagarash
646
671
417
413
80
97
146
Sibiu
Craiova
Pitesti
415
553
526
41A search example
Arad
366
118
75
140
Zerind
Timisoara
Sibiu
449
447
393
140
80
151
99
Arad
Oradea
Ramnicu Valcea
Fagarash
646
671
417
413
80
97
146
Sibiu
Craiova
Pitesti
415
553
526
101
138
97
Rm.Vilcea
Craiova
Bucharest
615
607
418
42A search example
Arad
366
118
75
140
Zerind
Timisoara
Sibiu
449
447
393
140
80
151
99
Arad
Oradea
Ramnicu Valcea
Fagarash
646
671
417
413
99
80
97
146
211
Sibiu
Bucharest
Sibiu
Craiova
Pitesti
415
553
526
591
450
101
138
97
Rm.Vilcea
Craiova
Bucharest
615
607
418
43Properties of A search
- Complete? Yes (if nodes w. f ? C finite)
- Optimal? Yes optimally efficient!!
- Time? O (b(rel. err. in h) x (length of
solution)) - Space? All nodes in memory
44Optimality A
- Be G optimal goal state (path cost f)
- Be G2 suboptimal goal state (local minimum)
- f(G2) g(G2) (heuristic zero in goal state)
- f(G2) gt f (G2 suboptimal)
- n fringe node on optimal path to G
- h is admissible
- f(n) g(n) h(n) ? g(n) h(n) ?f.
- f(n) ? ?flt f(G2)
- n will be chosen instead of G2, q.e.d.
45Improved 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)
46Summary (un-)informed search
- Uninformed
- blind
- computationally cheaper (heuristic?)
- Research continues on finding better search
- i.e., problem solving algorithms
- Informed uninformed
- global search algorithms
- exponential timespace (10120 molecules in
universe)
47Homework 3 - part 2
- 3. 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 these
properties comment upon dimensions of AI (as in
C1) that you find in the LAO algorithm.
48II.2.B. Local Search
- Greedy local search (hill-climbing)
- Simulated annealing
- Genetic algorithms
49Homework 3 part 2
- Perform steps FAQ 5-6 of the project.