comp 8620 advanced topics in ai

113
25/07/2008 25/07/2008 1 1 COMP 8620 COMP 8620 Advanced Topics in AI Advanced Topics in AI Lecturers: Lecturers: Philip Kilby & Philip Kilby & Jinbo Jinbo Huang Huang

Upload: others

Post on 22-Mar-2022

10 views

Category:

Documents


0 download

TRANSCRIPT

25/07/200825/07/2008 11

COMP 8620COMP 8620

Advanced Topics in AIAdvanced Topics in AI

Lecturers: Lecturers:

Philip Kilby & Philip Kilby &

JinboJinbo HuangHuang

25/07/200825/07/2008 22

Part 1: SearchPart 1: SearchLecturer: Dr Philip KilbyLecturer: Dr Philip Kilby

[email protected]@nicta.com.au

Weeks 1Weeks 1--77(Week 7 is assignment seminars)(Week 7 is assignment seminars)

Part 2: Part 2: Probabilistic Reasoning with Probabilistic Reasoning with Bayesian networks Bayesian networks Lecturer: Dr Lecturer: Dr JinboJinbo HuangHuang

[email protected]@nicta.com.au

Weeks 8Weeks 8--1313

3325/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Course Outline Course Outline –– Part 1Part 1

11--22 IntroductionIntroduction

Systematic SearchSystematic Search

33--44 Linear Programming /Linear Programming /

Integer Programming / Integer Programming /

Branch and BoundBranch and Bound

55--66 NeighbourhoodNeighbourhood--based based

methods:methods:

�� Simulated AnnealingSimulated Annealing

�� TabuTabu SearchSearch

�� Genetic AlgorithmsGenetic Algorithms

77--88 Constraint Programming Constraint Programming

(Guest lecturer: Jason Li)(Guest lecturer: Jason Li)

77--88 Constraint Programming Constraint Programming

(Guest lecturer: Jason Li)(Guest lecturer: Jason Li)

99--1010 Case Studies:Case Studies:

�� TSPTSP

�� Planning (Planning (JussiJussi

RintanenRintanen))

1111 Dynamic ProgrammingDynamic Programming

1212 Qualitative Reasoning Qualitative Reasoning

(Guest lecturer: Jason Li)(Guest lecturer: Jason Li)

1313--1414 SeminarsSeminars

(Guest Lecturers: You lot!)(Guest Lecturers: You lot!)

4425/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

AssessmentAssessment

40% Exam40% Exam

60% Assignment60% Assignment

SearchSearch

�� 1 x Assignment (next week) 15%1 x Assignment (next week) 15%

�� 1 x Seminar 15%1 x Seminar 15%

ReasoningReasoning

�� 3 x Assignment (10% each) 3 x Assignment (10% each) (tentative)(tentative)

5525/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

What is Search?What is Search?

Search finds a Search finds a solutionsolution to a to a problemproblem

Landscape of solutionsLandscape of solutions

Some are Some are ““goodgood””

Lots (and lots and lots) are Lots (and lots and lots) are ““badbad””

How do we find the good ones?How do we find the good ones?

6625/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

What is Search?What is Search?

Landscape can continuous or discreteLandscape can continuous or discrete

(We will only deal with discrete)(We will only deal with discrete)

Landscape can be (approximated by?) a Landscape can be (approximated by?) a treetree

Landscape can be (approximated by?) a Landscape can be (approximated by?) a graphgraph

7725/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

What is Search?What is Search?

X + 2 * Y < 3, X ∈ [0,5] Y ∈ [1,5]

8825/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

What is Search?What is Search?

X + 2 * Y < 3, X ∈ [0,5] Y ∈ [1,5]

X=0

Y=1

X=0

Y=0

X=0

Y=1X=0

Y=5

X=0

Y=2 X=0

Y=3

X=0

Y=4

X=1

Y=5

X=1

Y=4

X=1

Y=3

X=1

Y=2

X=1

Y=1

X=2

Y=5

X=2

Y=1

X=2

Y=4

X=2

Y=3

X=2

Y=2

X=3

Y=5

X=3

Y=4

X=3

Y=3X=3

Y=2

X=3

Y=1

X=5

Y=5

X=4

Y=5

X=4

Y=4

X=4

Y=3

X=4

Y=2

X=4

Y=1

X=5

Y=4

X=5

Y=3

X=5

Y=2

X=5

Y=1

9925/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

What is Search?What is Search?

X + 2 * Y < 3, X ∈ [0,5] Y ∈ [1,5]

X=1X=0 X=2 X=3 X=4 X=5

Y=5Y=4Y=3Y=1 Y=2

101025/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

What is Search?What is Search?

X + 2 * Y < 3, X ∈ [0,5] Y ∈ [1,5]

Y=2Y=1 Y=3 Y=4 Y=5

X=5X=4X=3X=2X=0 X=1

111125/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

What is Search?What is Search?

X + 2 * Y < 3, X ∈ [0,5] Y ∈ [1,5]

X>0 X=0

Y>1 Y=1

121225/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

What is Search?What is Search?

Different flavoursDifferent flavours

�� Find a solution (Satisfaction/Decision)Find a solution (Satisfaction/Decision)

�� Find the Find the bestbest solution (Combinatorial solution (Combinatorial

Optimisation)Optimisation)

Decision problems: Decision problems:

�� Search variant: Find a solution (or show none Search variant: Find a solution (or show none

exists)exists)

�� Decision variant: Does a solution exist?Decision variant: Does a solution exist?

131325/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

What is SearchWhat is Search

Constructive Search Constructive Search –– Find a solution by Find a solution by

constructionconstruction

Local Search Local Search –– Given a solution, explore the Given a solution, explore the

““neighbourhoodneighbourhood”” of that solution to find other of that solution to find other

(possibly better) solutions(possibly better) solutions

141425/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

What is Search?What is Search?

Anytime algorithm (for optimisation Anytime algorithm (for optimisation probprob):):

After a (short) After a (short) startupstartup time, an answer is time, an answer is

availableavailable

The longer the The longer the algalg is run, the better the solutionis run, the better the solution

Quality guarantee may be available (e.g. Quality guarantee may be available (e.g.

solution is within 5% of optimal)solution is within 5% of optimal)

OneOne--shot algorithmshot algorithm

Answer only available at completionAnswer only available at completion

151525/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

What is Search?What is Search?

A problem is defined byA problem is defined by

Initial state Initial state

Successor function Successor function

(an action leading from one state to another)(an action leading from one state to another)

Goal testGoal test

Path costPath cost

A solution is a sequence of actions leading from A solution is a sequence of actions leading from

the start state to a goal statethe start state to a goal state

161625/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Example: RomaniaExample: Romania

171725/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Problem formulationProblem formulation

A problem is defined by four items:

initial state� e.g., “at Arad”

successor function S(x) � set of action–state pairs

� e.g., S(Arad) = {<Arad → Zerind, at Zerind>, . . .}goal test e.g., x = “at Bucharest”

� can be implicit, e.g., HasAirport(x)

path cost (additive) � e.g. sum of distances, number of actions executed,

etc.� c(x, a, y) is the step cost, assumed to be ≥ 0

181825/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Tree SearchTree Search

function Tree-Search (problem, fringe) returns a solution, or failure

fringe ← Insert (Make-Node (Initial-State (problem)), fringe)

loop do

if Is-Empty (fringe) then return failure

node ← Remove-Front (fringe)

if Goal-Test (problem, State[node]) then return node

fringe ← InsertAll (Expand (node, problem), fringe)

function Expand (node, problem) returns a set of nodes

successors ← the empty set

for each (action, result) in Successor-Fn (problem, State[node]) do

s ← a new Node

Parent-Node[s] ← node; Action[s] ← action; State[s] ← result

Path-Cost[s] ← Path-Cost[node] + Step-Cost(State[node], action, result)

Depth[s] ← Depth[node] + 1

successors ← Insert (s)

return successors

191925/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

BreadthBreadth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

202025/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

BreadthBreadth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

212125/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

BreadthBreadth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

222225/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

BreadthBreadth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

232325/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

BreadthBreadth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

242425/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

BreadthBreadth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

252525/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

BreadthBreadth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

262625/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

BreadthBreadth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

272725/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

BreadthBreadth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

282825/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

BreadthBreadth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

292925/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

BreadthBreadth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

303025/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

BreadthBreadth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

313125/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

BreadthBreadth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

323225/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

BreadthBreadth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O!!

333325/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

DepthDepth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

343425/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

DepthDepth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

353525/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

DepthDepth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

363625/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

DepthDepth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

373725/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

DepthDepth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

383825/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

DepthDepth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

393925/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

DepthDepth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

404025/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

DepthDepth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

414125/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

DepthDepth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

424225/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

DepthDepth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

434325/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

DepthDepth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

444425/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

DepthDepth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

454525/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

DepthDepth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O

464625/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

BreadthBreadth--first Searchfirst Search

A

CB

H

D E

I

F G

L M O!!

474725/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

484825/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

494925/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

505025/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

515125/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

525225/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

535325/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

545425/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

555525/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

565625/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

575725/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

585825/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

595925/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

606025/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

616125/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

626225/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

636325/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

646425/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

656525/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

666625/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

676725/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

686825/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

696925/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

707025/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

717125/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

727225/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

737325/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O

747425/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Iterative Deepening DFS SearchIterative Deepening DFS Search

A

CB

H

D E

I

F G

L M O!!

757525/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Uniform cost searchUniform cost search

Expand in order of costExpand in order of cost

Identical to BreadthIdentical to Breadth--First Search if all step costs First Search if all step costs

are equalare equal

Number of nodes expanded depends on Number of nodes expanded depends on εε > 0 > 0 ––

the smallest cost action cost.the smallest cost action cost.

(If (If εε = 0, uniform= 0, uniform--Cost search may infiniteCost search may infinite--loop)loop)

767625/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

BiBi--directional Searchdirectional Search

Extend BFS from Start and Goal states Extend BFS from Start and Goal states

simultaneouslysimultaneously

bbd/2d/2 + b+ bd/2d/2 << << bbdd

777725/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

BiBi--directional Searchdirectional Search

Restrictions:Restrictions:

Can only use if 1 (or a few) Can only use if 1 (or a few) knownknown goal nodesgoal nodes

Can only use if actions are reversible Can only use if actions are reversible

i.e. if we can efficiently calculate i.e. if we can efficiently calculate PredPred(s(s)) (for state (for state ss) )

wherewhere}:{)( srarsPred

a

→∃=

787825/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

SummarySummary

YesYes

O(bO(bCC*/*/ε)

O(bO(bCC*/*/ε)

YesYes

Uniform Uniform

CostCost

Yes, for Yes, for

unit costunit cost

O(bO(bd/2d/2))

O(bO(bd/2d/2))

YesYes

BiBi--direcdirec--

tionaltional

OptimalOptimal

SpaceSpace

TimeTime

CompleteComplete

CriterionCriterion

Yes, for Yes, for

unit costunit cost

O(bO(bd+1d+1))

O(bO(bd+1d+1))

YesYes

BFSBFS

NoNo

O(bmO(bm))

O(bO(bmm))

NoNo

DFSDFS

Yes, for Yes, for

unit costunit cost

O(bdO(bd))

O(bO(bdd))

YesYes

IDDFSIDDFS

b = branching factor ; m = max depth of tree ; d = depth of goal node

C* = cost of goal ; ε = min action cost

797925/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Repeated State DetectionRepeated State Detection

Test for previouslyTest for previously--seen statesseen states

Essentially, search graph mimics state graphEssentially, search graph mimics state graph

808025/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Repeated State DetectionRepeated State Detection

��Can make exponential improvement in timeCan make exponential improvement in time

��Can make DFS completeCan make DFS complete

��DFS now has potentially exponential space DFS now has potentially exponential space

requirementrequirement

��Have to be careful to guarantee optimalityHave to be careful to guarantee optimality

In practice, almost always use repeated state In practice, almost always use repeated state

detectiondetection

818125/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

A* SearchA* Search

Idea: avoid expanding paths that are already expensive

Evaluation function f(n) = g(n) + h(n)

g(n) = cost so far to reach nh(n) = estimated cost from n to the closest goalf(n) = estimated total cost of path through n to goal

A∗ search uses an admissible heuristici.e., h(n) ≤ h∗(n) where h∗(n) is the true cost from n.(Also require h(n) ≥ 0, so h(G) = 0 for any goal G.)E.g., hSLD(n) never overestimates the actual road distanceWhen h(n) is admissible, f(n) never overestimates the total cost of theshortest path through n to the goalTheorem: A∗ search is optimal

828225/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

A* ExampleA* ExampleArad

366=0+366

838325/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

A* ExampleA* ExampleArad

366=0+366

848425/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

A* ExampleA* Example

Sibiu

393=140+253

Arad

Timisoara

447=118+329

Zerind

449=75+374

858525/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

A* ExampleA* Example

Sibiu

393=140+253

Arad

Timisoara

447=118+329

Zerind

449=75+374

868625/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

A* ExampleA* Example

Oradea

671=291+380

Sibiu

Arad

Timisoara

447=118+329

Zerind

449=75+374

Arad

646=280+366

Fagaras

415=239+176

Rimnicu Vilcea

413=220+193

878725/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

A* ExampleA* Example

Oradea

671=291+380

Sibiu

Arad

Timisoara

447=118+329

Zerind

449=75+374

Arad

646=280+366

Fagaras

415=239+176

Rimnicu Vilcea

413=220+193

888825/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

A* ExampleA* Example

Oradea

671=291+380

Sibiu

Arad

Timisoara

447=118+329

Zerind

449=75+374

Arad

646=280+366

Fagaras

415=239+176Rimnicu Vilcea

Craiova

526=366+160Pitesti

417=317+100

Sibiu

553=300+253

898925/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

A* ExampleA* Example

Oradea

671=291+380

Sibiu

Arad

Timisoara

447=118+329

Zerind

449=75+374

Arad

646=280+366

Fagaras

415=239+176Rimnicu Vilcea

Craiova

526=366+160Pitesti

417=317+100

Sibiu

553=300+253

909025/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

A* ExampleA* Example

Bucharest

450=450+0

Oradea

671=291+380

Sibiu

Arad

Timisoara

447=118+329

Zerind

449=75+374

Arad

646=280+366Fagaras Rimnicu Vilcea

Sibiu

591=338+253

Craiova

526=366+160Pitesti

417=317+100

Sibiu

553=300+253

919125/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

A* ExampleA* Example

Bucharest

450=450+0

Oradea

671=291+380

Sibiu

Arad

Timisoara

447=118+329

Zerind

449=75+374

Arad

646=280+366Fagaras Rimnicu Vilcea

Sibiu

591=338+253

Craiova

526=366+160Pitesti

417=317+100

Sibiu

553=300+253

929225/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

A* ExampleA* Example

Bucharest

450=450+0

Bucharest

418=418+0

Oradea

671=291+380

Sibiu

Arad

Craiova

615=455+160

Rimnicu Vilcea

607=414+193

Timisoara

447=118+329

Zerind

449=75+374

Arad

646=280+366Fagaras Rimnicu Vilcea

Sibiu

591=338+253

Craiova

526=366+160Pitesti

Sibiu

553=300+253

939325/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

A* ExampleA* Example

Bucharest

450=450+0

Bucharest

418=418+0

Oradea

671=291+380

Sibiu

Arad

Craiova

615=455+160

Rimnicu Vilcea

607=414+193

Timisoara

447=118+329

Zerind

449=75+374

Arad

646=280+366Fagaras Rimnicu Vilcea

Sibiu

591=338+253

Craiova

526=366+160Pitesti

Sibiu

553=300+253

949425/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

A* ExampleA* Example

Bucharest

450=450+0

Bucharest

418=418+0

Oradea

671=291+380

Sibiu

Arad

Craiova

615=455+160

Rimnicu Vilcea

607=414+193

Timisoara

447=118+329

Zerind

449=75+374

Arad

646=280+366Fagaras Rimnicu Vilcea

Sibiu

591=338+253

Craiova

526=366+160Pitesti

Sibiu

553=300+253

959525/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

A* SearchA* Search

��OptimalOptimal

��No other optimal algorithm expands fewer nodes No other optimal algorithm expands fewer nodes

((modulo order of expansion of nodes with same costmodulo order of expansion of nodes with same cost))

��Exponential space requirementExponential space requirement

969625/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Greedy SearchGreedy Search

Use (always admissible) Use (always admissible) h(nh(n)) = 0= 0

in in f(n) = g(n) + h(n)

i.e. always use the cheapest found so far

979725/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Variants of A* SearchVariants of A* Search

Many variants of A* developedMany variants of A* developed

Weighted A*: Weighted A*: f(n) = g(n) + W h(n)

� Not exact

� Faster

� Answer is within W of optimal

989825/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Variants of A* SearchVariants of A* Search

Many variants of A* developedMany variants of A* developed

Weighted A*: Weighted A*: f(n) = g(n) + W h(n)

� Not exact

� Faster

� Answer is within W of optimal

A*

999925/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Variants of A* SearchVariants of A* Search

Many variants of A* developedMany variants of A* developed

Weighted A*: Weighted A*: f(n) = g(n) + W h(n)

� Not exact

� Faster

� Answer is within W of optimal

Weighted

A*

10010025/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Variants of A* SearchVariants of A* Search

Iterative Deepening A* (IDA*)Iterative Deepening A* (IDA*)

�� Incrementally increase max depthIncrementally increase max depth

MemoryMemory--bounded A*bounded A*

�� Impose bound on memoryImpose bound on memory

�� Discard nodes with largest Discard nodes with largest f(xf(x)) if necessaryif necessary

Others to come in seminarsOthers to come in seminars……

10110125/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Limited Discrepancy SearchLimited Discrepancy Search

Requires a heuristic to order choicesRequires a heuristic to order choices

(e.g. admissible heuristic, but don(e.g. admissible heuristic, but don’’t require t require

underestimate)underestimate)

If heuristic was right, we could always take the If heuristic was right, we could always take the

choice given by the heuristicchoice given by the heuristic

LDS allows the heuristic to make mistakes:LDS allows the heuristic to make mistakes:

kk--LDS allows LDS allows kk mistakes.mistakes.

10210225/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Limited Discrepancy Search (Limited Discrepancy Search (kk = 1)= 1)

A

CB

H

D E

I

F G

L N OJ K M

10310325/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Limited Discrepancy Search (Limited Discrepancy Search (kk = 1)= 1)

A

CB

H

D E

I

F G

L N OJ K M

0 1

10410425/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Limited Discrepancy Search (Limited Discrepancy Search (kk = 1)= 1)

A

CB

H

D E

I

F G

L N OJ K M

0 1

0 1

10510525/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Limited Discrepancy Search (Limited Discrepancy Search (kk = 1)= 1)

A

CB

H

D E

I

F G

L N OJ K M

0 1

0 1

01

10610625/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Limited Discrepancy Search (Limited Discrepancy Search (kk = 1)= 1)

A

CB

H

D E

I

F G

L N OJ K M

0 1

0 1

01

10710725/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Limited Discrepancy Search (Limited Discrepancy Search (kk = 1)= 1)

A

CB

H

D E

I

F G

L N OJ K M

0 1

0 1

01

10810825/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Limited Discrepancy Search (Limited Discrepancy Search (kk = 1)= 1)

A

CB

H

D E

I

F G

L N OJ K M

0 1

0 1

01 1

10910925/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Limited Discrepancy Search (Limited Discrepancy Search (kk = 1)= 1)

A

CB

H

D E

I

F G

L N OJ K M

0 1

0 1

01 1

11011025/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Limited Discrepancy Search (Limited Discrepancy Search (kk = 1)= 1)

A

CB

H

D E

I

F G

L N OJ K M

0 1

0 1

01 1

1

11111125/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Limited Discrepancy Search (Limited Discrepancy Search (kk = 1)= 1)

A

CB

H

D E

I

F G

L N OJ K M

0 1

0 1

01 1

1

1

11211225/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Limited Discrepancy Search (Limited Discrepancy Search (kk = 1)= 1)

A

CB

H

D E

I

F G

L N OJ K M

0 1

0 1

01 1

1

1

11311325/07/200825/07/2008 Search Search –– Lecture 1Lecture 1--22

Next weekNext week……..

(Integer) Linear Programming and (Integer) Linear Programming and

Branch & BoundBranch & Bound