CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH)...

34
CS 730/830: Intro AI Are We Done? Beyond A* Suboptimal Search Anytime Search Real-time Search EOLQs Wheeler Ruml (UNH) Lecture 4, CS 730 – 1 / 24 1 handout: slides

Transcript of CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH)...

Page 1: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

CS 730/830: Intro AI

■ Are We Done?

Beyond A*

Suboptimal Search

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 1 / 24

1 handout: slides

Page 2: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

EOLQs

■ Are We Done?

Beyond A*

Suboptimal Search

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 2 / 24

Page 3: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

Are We Done?

■ Are We Done?

Beyond A*

Suboptimal Search

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 3 / 24

Page 4: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

Beyond A*

■ Are We Done?

Beyond A*

■ GBFS

■ 8-puzzle

■ Evaluating Greedy

■ Beam Search

Suboptimal Search

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 4 / 24

Page 5: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

Greedy Best-first Search (BGFS)

■ Are We Done?

Beyond A*

■ GBFS

■ 8-puzzle

■ Evaluating Greedy

■ Beam Search

Suboptimal Search

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 5 / 24

Q ← an ordered list containing just the initial state.Loop

If Q is empty,then return failure.

Node ← Pop(Q).If Node is a goal,

then return Node (or path to it)else

Children ← Expand (Node).Merge Children into Q, keeping sorted by heuristic.←

Page 6: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

GBFS on the 8-puzzle

■ Are We Done?

Beyond A*

■ GBFS

■ 8-puzzle

■ Evaluating Greedy

■ Beam Search

Suboptimal Search

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 6 / 24

h(n) = number of tiles out of place. (The blank is not a tile.)

Start state:2 8 31 6 47 ⊔ 5

Goal state:1 2 38 ⊔ 47 6 5

Please draw the tree resulting from the first two node expansions.

Page 7: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

Evaluating Greedy

■ Are We Done?

Beyond A*

■ GBFS

■ 8-puzzle

■ Evaluating Greedy

■ Beam Search

Suboptimal Search

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 7 / 24

Assume branching factor b and solution at depth d.

Completeness:Time:Space:

Admissibility:

Page 8: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

Beam Search

■ Are We Done?

Beyond A*

■ GBFS

■ 8-puzzle

■ Evaluating Greedy

■ Beam Search

Suboptimal Search

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 8 / 24

Truncate queue to hold the most promising k nodes.k is the beam width.

Page 9: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

Suboptimal Search

■ Are We Done?

Beyond A*

Suboptimal Search

■ Problem Settings

■ wA*

■ wA* Behavior

■ Distance-to-go

■ EES

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 9 / 24

Page 10: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

Problem Settings

■ Are We Done?

Beyond A*

Suboptimal Search

■ Problem Settings

■ wA*

■ wA* Behavior

■ Distance-to-go

■ EES

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 10 / 24

optimal: minimize solution costsuffer all with f(n) = g(n) + h(n) < f∗

greedy: minimize solving time

bounded suboptimal: minimize time subject to relative costbound (factor of optimal)

bounded cost: minimize time subject to absolute cost bound

contract: minimize cost subject to absolute time bound

anytime: iteratively converge to optimal

utility: maximize given function of cost and time

Page 11: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

Weighted A*

■ Are We Done?

Beyond A*

Suboptimal Search

■ Problem Settings

■ wA*

■ wA* Behavior

■ Distance-to-go

■ EES

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 11 / 24

f ′(n) = g(n) + w · h(n)

■ nodes with high h(n) look even worse■ no infinite rabbit holes■ suboptimality bounded: within a factor of w of optimal!

Page 12: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

wA* Behavior

■ Are We Done?

Beyond A*

Suboptimal Search

■ Problem Settings

■ wA*

■ wA* Behavior

■ Distance-to-go

■ EES

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 12 / 24

optimal: uniform-cost search

Page 13: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

wA* Behavior

■ Are We Done?

Beyond A*

Suboptimal Search

■ Problem Settings

■ wA*

■ wA* Behavior

■ Distance-to-go

■ EES

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 12 / 24

optimal: A*

Page 14: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

wA* Behavior

■ Are We Done?

Beyond A*

Suboptimal Search

■ Problem Settings

■ wA*

■ wA* Behavior

■ Distance-to-go

■ EES

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 12 / 24

bounded suboptimal: Weighted A*

Page 15: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

For Speed: Distance-to-go, Not Cost-to-go

■ Are We Done?

Beyond A*

Suboptimal Search

■ Problem Settings

■ wA*

■ wA* Behavior

■ Distance-to-go

■ EES

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 13 / 24

how to minimize solving time?

Page 16: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

For Speed: Distance-to-go, Not Cost-to-go

■ Are We Done?

Beyond A*

Suboptimal Search

■ Problem Settings

■ wA*

■ wA* Behavior

■ Distance-to-go

■ EES

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 13 / 24

how to minimize solving time?how to minimize number of expansions?

Page 17: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

For Speed: Distance-to-go, Not Cost-to-go

■ Are We Done?

Beyond A*

Suboptimal Search

■ Problem Settings

■ wA*

■ wA* Behavior

■ Distance-to-go

■ EES

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 13 / 24

how to minimize solving time?how to minimize number of expansions?take the shortest path to a goal

Page 18: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

For Speed: Distance-to-go, Not Cost-to-go

■ Are We Done?

Beyond A*

Suboptimal Search

■ Problem Settings

■ wA*

■ wA* Behavior

■ Distance-to-go

■ EES

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 13 / 24

how to minimize solving time?how to minimize number of expansions?take the shortest path to a goalfor domains with costs, this is not h(n)

new information source: distance-to-go= d(n)

n

h = 4d = 2

h = 5d = 1

Page 19: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

For Speed: Distance-to-go, Not Cost-to-go

■ Are We Done?

Beyond A*

Suboptimal Search

■ Problem Settings

■ wA*

■ wA* Behavior

■ Distance-to-go

■ EES

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 13 / 24

how to minimize solving time?how to minimize number of expansions?take the shortest path to a goalfor domains with costs, this is not h(n)

new information source: distance-to-go= d(n)

n

h = 4d = 2

h = 5d = 1

Speedy: best-first search on d

Page 20: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

Explicit Estimation Search

■ Are We Done?

Beyond A*

Suboptimal Search

■ Problem Settings

■ wA*

■ wA* Behavior

■ Distance-to-go

■ EES

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 14 / 24

bounded-suboptimal using h, d, and h

optimal: uniform-cost

Page 21: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

Explicit Estimation Search

■ Are We Done?

Beyond A*

Suboptimal Search

■ Problem Settings

■ wA*

■ wA* Behavior

■ Distance-to-go

■ EES

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 14 / 24

bounded-suboptimal using h, d, and h

optimal: A*

Page 22: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

Explicit Estimation Search

■ Are We Done?

Beyond A*

Suboptimal Search

■ Problem Settings

■ wA*

■ wA* Behavior

■ Distance-to-go

■ EES

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 14 / 24

bounded-suboptimal using h, d, and h

bounded suboptimal: Weighted A*

Page 23: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

Explicit Estimation Search

■ Are We Done?

Beyond A*

Suboptimal Search

■ Problem Settings

■ wA*

■ wA* Behavior

■ Distance-to-go

■ EES

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 14 / 24

bounded-suboptimal using h, d, and h

bounded suboptimal: Optimistic Search (ICAPS, 2008)

Page 24: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

Explicit Estimation Search

■ Are We Done?

Beyond A*

Suboptimal Search

■ Problem Settings

■ wA*

■ wA* Behavior

■ Distance-to-go

■ EES

Anytime Search

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 14 / 24

bounded-suboptimal using h, d, and h

bounded suboptimal: Explicit Estimation Search (IJCAI, 2011)

Page 25: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

Anytime Search

■ Are We Done?

Beyond A*

Suboptimal Search

Anytime Search

■ Anytime A*

■ Break

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 15 / 24

Page 26: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

Anytime A*

■ Are We Done?

Beyond A*

Suboptimal Search

Anytime Search

■ Anytime A*

■ Break

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 16 / 24

1. run weighted A*2. keep going after finding a goal3. keep best goal found (can test at generation)4. prune anything with f(n) > incumbent

Anytime Restarting A* (ARA*): lower weight after finding eachsolutionAnytime EES

Page 27: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

Break

■ Are We Done?

Beyond A*

Suboptimal Search

Anytime Search

■ Anytime A*

■ Break

Real-time Search

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 17 / 24

■ asst2■ scores and grades■ AAAI

Page 28: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

Real-time Search

■ Are We Done?

Beyond A*

Suboptimal Search

Anytime Search

Real-time Search

■ RTA*

■ LSS-LRTA*

■ Search Algorithms

■ Other Algorithms

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 18 / 24

Page 29: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

RTA*

■ Are We Done?

Beyond A*

Suboptimal Search

Anytime Search

Real-time Search

■ RTA*

■ LSS-LRTA*

■ Search Algorithms

■ Other Algorithms

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 19 / 24

keep hash table of h values for visited states

1. for each neighbor of current state s

2. either find h in table or do some lookahead3. add edge cost to get f4. update h(s) to second-best f value5. move to best neighbor

Page 30: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

LSS-LRTA*

■ Are We Done?

Beyond A*

Suboptimal Search

Anytime Search

Real-time Search

■ RTA*

■ LSS-LRTA*

■ Search Algorithms

■ Other Algorithms

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 20 / 24

1. single A* lookahead (LSS)2. update all h values in LSS3. move to frontier

Page 31: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

Search Algorithms

■ Are We Done?

Beyond A*

Suboptimal Search

Anytime Search

Real-time Search

■ RTA*

■ LSS-LRTA*

■ Search Algorithms

■ Other Algorithms

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 21 / 24

Uninformed: DFS, UCSAdmissible: A*Limited memory: iterative deepening (IDDFS, IDA*)Satisficing: GBFS, Speedy, BeamBounded suboptimal: wA*, EESReal-time: RTA*, LSS-LRTA*

Page 32: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

Other Shortest-path Algorithms

■ Are We Done?

Beyond A*

Suboptimal Search

Anytime Search

Real-time Search

■ RTA*

■ LSS-LRTA*

■ Search Algorithms

■ Other Algorithms

EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 22 / 24

■ SMA*, IE■ RBFS■ Bugsy■ RTAA*

Course projects!

Page 33: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

EOLQs

■ Are We Done?

Beyond A*

Suboptimal Search

Anytime Search

Real-time Search

EOLQs

■ EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 23 / 24

Page 34: CS 730/830: Intro AIruml/cs730/slides/lecture-4-more-search.pdf · 2020-01-30 · WheelerRuml(UNH) Lecture4,CS730–6/24 h(n)=number of tiles out of place. (The blank is not a tile.)

EOLQs

■ Are We Done?

Beyond A*

Suboptimal Search

Anytime Search

Real-time Search

EOLQs

■ EOLQs

Wheeler Ruml (UNH) Lecture 4, CS 730 – 24 / 24

Please write down the most pressing question you have aboutthe course material covered so far and put it in the box on yourway out.Thanks!