beyond a* - harablog.files.wordpress.com · hpa* overview • [botea, müller & schaeffer,...

126
Beyond A*: Speeding up pathfinding through hierarchical abstraction Daniel Harabor NICTA & The Australian National University

Upload: others

Post on 23-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Beyond A*: Speeding up pathfinding through

hierarchical abstraction

Daniel HaraborNICTA & The Australian National University

Page 2: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Motivation

• Myth: Pathfinding is a solved problem.

Page 3: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Motivation

• Myth: Pathfinding is a solved problem.

Reality: Pathfinding is not solved!

Page 4: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Motivation

• Myth: Pathfinding is a solved problem.

Reality: Pathfinding is not solved!

A* underlies many pathfinding systems but...

Many open problems persist!

Page 5: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Problem: Efficient pathfinding in very largeenvironments

Image: World of Warcraft (Blizzard Entertainment)

Page 6: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Problem: Dynamic terrainImage: Company of Heroes (Relic Entertainment)

Page 7: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Problem: Different unit classesImage: Red Alert 3 (Electronic Arts)

Page 8: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Problem: Cooperative PathfindingImage: Settlers: Heritage of Kings (Blue Byte Software)

Page 9: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Rest of this talk

• Some background on A*

• Then, a story in 3 parts:

• Part 1: Hierarchical pathfinding

• Part 2: Dealing with diversity

• Part 3: Probabilistic roadmaps

Page 10: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Background

Page 11: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

A* In Brief

• [Hart, Nilsson & Raphael, 1968]

• Heuristic search

• f(n) = g(n) + h(n), where: g(n) = distance so far h(n) = estimate remaining distance

• Complete + Optimal

Page 12: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

A* exampleS

1.5

+31+5 1+5

1.5 1 1

Page 13: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

A* exampleS

1.5

+31+5 1+5

1.5 1 1

Page 14: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

2.5

+4

3+

1.5

2.5

+4

1 1.5 1

A* exampleS

1.5

+31+5 1+5

1.5 1 1

Page 15: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

2.5

+4

3+

1.5

2.5

+4

1 1.5 1

A* exampleS

1.5

+31+5 1+5

1.5 1 1

Page 16: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

1.5

2.5

+4

3+

1.5

2.5

+4

1 1.5 1

A* exampleS

1.5

+31+5 1+5

1.5 1 1

Page 17: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

The problem with A*

• Time complexity (nodes expanded)

• Memory overhead (stuff to remember)

• Good heuristics not enough.

Page 18: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

A* Example

18 18 18

16 16 16 16 16 16 16

16 16

16 16 16 16

16 16

16 16

16 16

16 16

16 16

16 16 16 16 16 16 16 16

18

18

18

Page 19: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

A* Example

18 18 18

16 16 16 16 16 16 16

16 16

16 16 16 16

16 16

16 16

16 16

16 16

16 16

16 16 16 16 16 16 16 16

18

18

18

Cost = 18

An optimal path(straight-line movement only)

Page 20: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

A* Example

Another optimal path

18 18 18

16 16 16 16 16 16 16

16 16

16 16 16 16

16 16

16 16

16 16

16 16

16 16

16 16 16 16 16 16 16 16

18

18

18

Cost = 18

Cost = 18

Page 21: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

A* Example

Lots of optimal paths(and many more exist!)

18 18 18

16 16 16 16 16 16 16

16 16

16 16 16 16

16 16

16 16

16 16

16 16

16 16

16 16 16 16 16 16 16 16

18

18

18

Cost = 18

Cost = 18

Page 22: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

A* Example

A* expands: all green tiles + some white

18 18 18 18 18 18 18 18 18

16 16 16 16 16 16 16

16 16

16 16 16 16

16 16

16 16

16 16

16 16

16 16

16 16 16 16 16 16 16 16

18

18

18

18

18

18

18

18

18

Page 23: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Part 1: Hierarchical pathfinding

Page 24: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Hierarchical pathfinding

• Build a smaller, approximate search space.

• Area-based vs. Tile-based pathfinding.

• Factored problems are easy!

• Faster + lower memory requirements.

Page 25: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

HPA* Overview• [Botea, Müller & Schaeffer, 2004]

• Pre-processing:

• Build abstract graph (Clusters and Entrances)

• Run-time processing:

• Insert start and goal into abstract graph

• Find abstract solution

• Refine if necessary (or use cached info)

Page 26: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Map: Temple Prime (Red Alert 3)

Page 27: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Split map into square clusters (e.g. 10x10)Image: Adi Botea

Page 28: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Identify entrances between adjacent clustersImage: Adi Botea

Page 29: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Small entrance (length < 6)

1 central transition point

Large entrance (length >= 6)

2 perimeter transition points

Page 30: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Transition point = 2 abstract nodes + 1 abstract (inter) edge

1.0

Abstract graphEntrance

Page 31: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Select transition points for each entranceImage: Adi Botea

Page 32: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Connect abstract nodes inside the same clusterImage: Adi Botea

Page 33: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Intra-edges (cost = path length) added to abstract graph

Page 34: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Intra-edges (cost = path length) added to abstract graph

Page 35: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Intra-edges (cost = path length) added to abstract graph

Page 36: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Intra-edges (cost = path length) added to abstract graph

8.0

Page 37: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Intra-edges (cost = path length) added to abstract graph

8.0

Page 38: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Intra-edges (cost = path length) added to abstract graph

8.0

Page 39: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Intra-edges (cost = path length) added to abstract graph

8.012.0

Page 40: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Intra-edges (cost = path length) added to abstract graph

8.012.0

Page 41: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Intra-edges (cost = path length) added to abstract graph

8.012.0

Page 42: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Insert intra-edges (of cost = path length) to abstract graph.

8.012.0

Page 43: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Insert intra-edges (of cost = path length) to abstract graph.

8.012.0

Page 44: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Insert intra-edges (of cost = path length) to abstract graph.

8.012.0

6.0

Page 45: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Insert intra-edges (of cost = path length) to abstract graph.

8.012.0

6.0

Page 46: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Insert intra-edges (of cost = path length) to abstract graph.

8.012.0

6.0

Page 47: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Final abstract graphImage: Adi Botea

Page 48: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Runtime processing

• Insert start + goal into abstract graph.

• Find an abstract path connecting them.

• Refine each abstract step using a small A* search to traverse each cluster (free if we cache intra-edge paths).

Page 49: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Add Start + Goal as (temp.) abstract nodesImage: Adi Botea

Page 50: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Insert temp. edges to connect Start + GoalImage: Adi Botea

Page 51: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Run A* to find an abstract pathImage: Adi Botea

Page 52: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Refine the abstract path before execution. Each step is independent (and fast!)

Images: Adi Botea

Page 53: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

HPA* Advantages

• Easy to understand + implement

• Very fast (Beats A* by 10x)

• Low memory overhead (vs. A*)

• Complete

Page 54: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

HPA* Disadvantages

• Non-optimal (but very close!).

• Assumes fixed-size 1x1 units.

• Only supports single terrain type.

• Insertion effort.

Page 55: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Part 2: Dealing with diversity

Page 56: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Assumptions in pathfinding literature

Page 57: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Assumptions in pathfinding literature

Assumption #1: all units are the same size.

Page 58: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Assumptions in pathfinding literature

• Assumption #2: any terrain traversable for one unit is traversable for all.

Assumption #1: all units are the same size.

Page 59: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Assumptions in pathfinding literature

• Assumption #2: any terrain traversable for one unit is traversable for all.

Assumption #1: all units are the same size.

Pathfinding breaks when either assumption is lifted.

Page 60: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

HPA* Tank Fail

HPA* loses information (like sizes of entrances)

Page 61: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Challenging pathfinding

Unit sizes: Small, Medium, LargeTerrains: Snow, Road, Water, Ground

Images: Red Alert 3 (Electronic Arts)

Page 62: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

HAA* Overview

• [Harabor, Botea, 2008]

• HPA*-style abstraction & search.

• Combined with clearance-based pathfinding.

• Caters for different terrains and unit sizes.

• Constructs complete abstractions.

Page 63: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Modeling diversityAgent Sizes

Small Big

Movement rules

OK OK Not OK

Example Map

Ground (white tiles)Water (blue tiles)Obstacles (black tiles)

Terrain traversal Capabilities

{Ground}{Water}{Ground or Water}

Page 64: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Clearance-based pathfinding

• Intuition:

• Calculate how much clearance (traversable space) exists at a given tile (t) on the map.

• A tile (t) is traversable by an agent (a) if:

1. terrain(t) is in capability(a)

2. clearance(t, capability(a)) >= size(a)

Page 65: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Example

1 11 11 1 1 111

2 22 22 1222 2

3 213 123 3

1 113 22

12 111 1

2 1 11

12 12 1

3 2 122

3 12 1

11123

2 1 11

12 1 2

12 12 3

32 23 2

43333

Agent size = 1 Capability = {Ground}

Each tile on the path is traversable for the agent

Page 66: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Computing clearance

1

Initial Clearance.Capability = {Ground}

(white tiles)

Page 67: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Computing clearance

1

Initial Clearance.Capability = {Ground}

(white tiles)

2

First Expansion OK

Page 68: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Computing clearance

1

Initial Clearance.Capability = {Ground}

(white tiles)

2

First Expansion OK

3

Second Expansion OK

Page 69: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Computing clearance

1

Initial Clearance.Capability = {Ground}

(white tiles)

2

First Expansion OK

3

Second Expansion OK

3

Third Expansion Fail

Page 70: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Maps with multiple terrain types

• Easy! Each tile has a clearance-value for each possible capability.

Clearances for {Ground} Capability

Page 71: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Maps with multiple terrain types

• Easy! Each tile has a clearance-value for each possible capability.

Clearances for {Ground} Capability

Clearances for {Water} Capability

Page 72: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Maps with multiple terrain types

• Easy! Each tile has a clearance-value for each possible capability.

Clearances for {Ground} Capability

Clearances for {Ground, Water} Capability

Clearances for {Water} Capability

Page 73: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

1 11 11 1 1 111

2 22 22 1222 2

3 213 123 3

1 113 22

12 111 1

2 1 11

12 12 1

3 2 122

3 12 1

11123

2 1 11

12 1 2

12 12 3

32 23 2

43333

Dealing with large agents

Each 2x2 agent occupies 4 tiles. Which clearance value do we consider?

Agent size = 2, Capability = {Ground}

Page 74: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Problem reduction

1 11 11 1 1 111

2 22 22 1222 2

3 213 123 3

1 113 22

12 111 1

2 1 11

12 12 1

3 2 122

3 12 1

11123

2 1 11

12 1 2

12 12 3

32 23 2

43333

A

G

Initial problem

Theorem: Any pathfinding problem can be reduced into a canonical problem (agent size = 1, capability = 1 terrain)

Page 75: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Problem reduction

1 11 11 1 1 111

2 22 22 1222 2

3 213 123 3

1 113 22

12 111 1

2 1 11

12 12 1

3 2 122

3 12 1

11123

2 1 11

12 1 2

12 12 3

32 23 2

43333

A

G

Initial problem

1 11 11 1 1 111

2 22 22 1222 2

3 213 123 3

1 113 22

12 111 1

2 1 11

12 12 1

3 2 122

3 12 1

11123

2 1 11

12 1 2

12 12 3

32 23 2

43333

A

G

Reduced size

Theorem: Any pathfinding problem can be reduced into a canonical problem (agent size = 1, capability = 1 terrain)

Page 76: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Problem reduction

1 11 11 1 1 111

2 22 22 1222 2

3 213 123 3

1 113 22

12 111 1

2 1 11

12 12 1

3 2 122

3 12 1

11123

2 1 11

12 1 2

12 12 3

32 23 2

43333

A

G

Initial problem

1 11 11 1 1 111

2 22 22 1222 2

3 213 123 3

1 113 22

12 111 1

2 1 11

12 12 1

3 2 122

3 12 1

11123

2 1 11

12 1 2

12 12 3

32 23 2

43333

A

G

Reduced size

Theorem: Any pathfinding problem can be reduced into a canonical problem (agent size = 1, capability = 1 terrain)

1 11 11 1 1 111

1

1 1

1 11

1111 1

1 11

1 11

1

11

111

1 11

1 1

11

Reduced size and capability

A

G

Page 77: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Annotated A*

• Search process: 

• Similar to A*.

• Extra parameters: Agent's size and capability.

• Only expand nodes with clearance > agent size.

• Works great!

• For small problem sizes... 

Page 78: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Abstraction Process

• Similar to HPA*:

• Divide map into NxN clusters.

• Identify entrances for all capabilities.

• Using AA*, find intra-edges for all agent sizes and capabilities

• Reduce the graph using dominance

Page 79: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Clusters

C1 C2

C3 C4

Page 80: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Identifying entrances

Entrances

Transition points

E1

{Ground, 2}

E2

{Water, 1}

E3

{Ground, Water, 5}

12

12

1

1

35 4 25

6 5 4 23

C1

C3

Abstract graph

C1

C3

y

z

w

x

E1E3 E2

Page 81: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Intra-edges• Use AA* to find all possible ways (sizes/capabilities)

to traverse across each cluster.

• For each path found, add a new abstract edge.

C1E1

E2E6

E3 E5 yw

u

E4

Edge Annotations {Terrain, Clearance}:E1 = {Ground, 2}E2 = {Ground, 1}E3 = {Ground, Water,2}E4 = {Ground, Water, 2}E3 = {Ground, Water, 1}E4 = {Ground, Water, 1}

Page 82: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Initial abstraction

C1 C2

C4C3

Page 83: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Compacting the abstract graph

• Method produces a representationally complete graph but can get rather large.

• Solutions:

• Strong dominance

• Weak dominance

Page 84: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

High Quality graphInitial graph

Strong dominance

w

u

y

E4

E6

E3

E5

E2

E1

w

u

y

E4

E3

E2

E1

Remove edges with smaller clearance (all else being identical)

Edge Annotations [Capability, Clearance, Length]:E1 = [{Ground}, 2, 7.5]E2 = [{Ground}, 1, 4.5]E3 = [{Ground, Water}, 2, 3.0]E4 = [{Ground, Water}, 2, 3.0]E5 = [{Ground, Water}, 1, 3.0]E6 = [{Ground, Water}, 1, 3.0]

Edge Annotations [Capability, Clearance, Length]:E1 = [{Ground}, 2, 7.5]E2 = [{Ground}, 1, 4.5]E3 = [{Ground, Water}, 2, 3.0]E4 = [{Ground, Water}, 2, 3.0]

Page 85: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Low Quality graphHigh Quality graph

Weak dominance

u

x

y

z

E4 E5

E6

u

v

w

x

y

z

E1

E2

E3

E4

E5

E6

Two places of interest: U and X.Path p = {E1, E2, E3}. Length: 15, Max Size = 1, Capability: {Ground, Water}Path q = {E4, E5, E6}. Length: 17, Max Size = 2, Capability: {Ground}

Retain only edges traversable by largest number of agents (aka. prefer freeways where possible)

Lake

Page 86: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Weak dominance

Low Quality graphHigh Quality graph

Weak dominance is applied to transitions between adjacent clusters (inter-edges).

C1 C2

C4C3 (c)

C1 C2

C4C3

Page 87: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

HAA*

• Similar search process to HPA*

• Insert Start + Goal

• Find + refine abstract path

• Differences:

• Add a node to open list only if reachable according to edge annotations.

Page 88: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

(c)

C1 C2

C4C3

(c)

C1 C2

C4C3 (c)

C1 C2

C4C3Initial problem Size = 2, Capability = {Ground}

Reducing the problem

Inserting Start + Goal Solution

Page 89: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

HAA* Advantages

• Works for units with different sizes and capabilities.

• Complete and near-optimal (within 4-8% from optimal on average)

• Fast (similar performance to HPA*)

• Low overhead (storing abstract graph requires little memory in practice)

Page 90: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

HAA* Disadvantages

• Only works on grids.

• Need to model units using square bounding volumes.

• Insertion effort.

Page 91: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Part 3:Probabilistic Roadmaps

Page 92: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Limitations of grid methods

• Coarse coverage of underlying terrain.

• Restricted movement (fixed angles)

• Paths don’t look realistic

• Often need to apply smoothing

• Not very useful in 3D spaces

Page 93: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

vs.

Page 94: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

vs.

Page 95: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

vs.

Page 96: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Probabilistic Road Maps

• PRM: Robotics inspired method from mid 90s.e.g. see [Choset et al, 2004].

• Pick a robot configuration.

• Build a graph by taking lots of sample points.

Page 97: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Select non-obstacle sample points from the map

Page 98: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Retain collision-free points for some configuration of an agent

X X

X

X

XX

X

X

XXX

X

X

X

X

Configuration

Page 99: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Connect nearby points to form a graph

Page 100: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Pathfinding: Connect start and goal to rest of roadmap

Page 101: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Pathfinding: Connect start and goal to rest of roadmap

Page 102: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Pathfinding: Connect start and goal to rest of roadmap

Page 103: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Pathfinding: Connect start and goal to rest of roadmap

Page 104: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Most PRMs are only useful for agent/configuration used during construction.

Page 105: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Most PRMs are only useful for agent/configuration used during construction.

Page 106: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Most PRMs are only useful for agent/configuration used during construction.

Page 107: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Most PRMs are only useful for agent/configuration used during construction.

Page 108: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Most PRMs are only useful for agent/configuration used during construction.

Page 109: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

2 options to fix this problem:

• Create a PRM for each unit type

• Opt for a (generalised) Voronoi-based PRM

Page 110: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Voronoi diagram: Each point on the medial axis maximises clearance.

Page 111: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Intuition: retract PRM (nodes and edges) to the medial axis.

Page 112: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

x

y

Identify the closest obstacle then retract the point to a position equidistant to 2 obstacles.

z

Node retraction

Page 113: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

x

y

dist(x) = 2

Identify the closest obstacle then retract the point to a position equidistant to 2 obstacles.

z

Node retraction

Page 114: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

x

y

dist(x) = 2

Identify the closest obstacle then retract the point to a position equidistant to 2 obstacles.

dist(y) = 2

z

Node retraction

Page 115: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

x

y

dist(x) = 2

Identify the closest obstacle then retract the point to a position equidistant to 2 obstacles.

dist(y) = 2

dist(x) = 2dist(y) = 2

z

Node retraction

Page 116: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

x

y

Edges too close to obstacles are retracted by splitting.

z

Edge retraction

Page 117: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

x

y

Edges too close to obstacles are retracted by splitting.

z

Edge retraction

Page 118: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

x

y

Edges too close to obstacles are retracted by splitting.

z

Edge retraction

Page 119: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

x

y

Edges too close to obstacles are retracted by splitting.

z

Edge retraction

Page 120: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

• Other improvements:

• Remove overlapping edges (similar idea to weak dominance)

• Smooth edges using circular blends

Page 121: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Other improvements

Remove overlapping edges(similar to weak dominance)

Apply circular blends

Page 122: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

PRM Advantages

• Fast to construct.

• Low overhead (especially Vornoi PRMs)

• Facilitate pathfinding in n-dimensional spaces

• Generalisable to different unit sizes (Voronoi PRMs only)

• Nice alternative to navigation meshes

Page 123: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

PRM Disadvantages

• Only probabilistically complete*

• Might need several PRMs (to support units with different capabilities).

• Non Voronoi PRMs produce ugly paths.

Page 124: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Conclusion

• There’s more to pathfinding than A*!

• Many open problems; some with nice solutions

• HPA*, HAA*, Roadmaps

• Pathfinding with abstraction is very effective.

Page 125: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

References• A Formal Basis for the Heuristic Determination of Minimum Cost Paths

P.E. Hart, N.J Nilsson, B. RaphaelIEEE Transactions on Systems Science and Cybernetics, 1968, Vol 4, Issue 2, pp. 100-107

• Near-Optimal Hierarchical PathfindingA. Botea, M. Muller, and J. Schaeffer Journal of Game Development, Volume 1, 2004

• Hierarchical path planning for multi-size agents in heterogeneous environments Harabor D. and Botea, A. IEEE Symposium on Computational Intelligence & Games, 2008

• Principles of Robot MotionH. Choset, K. M. Lynch, S. Hutchinson, G. Kantor, W. Burgard, L. E. Kavraki and S. Thrun MIT Press, 2004

• Automatic Construction of Roadmaps for Path Planning in GamesD. Nieuwenhuisen, A. Kamphuis, M. Mooijekind and M. H. Overmars,International Conference on Computer Games: Artificial Intelligence, Design and Education, 2004

• Roland Geraerts and Mark H. Overmars. Creating Small Roadmaps for Solving Motion Planning Problems. IEEE International Conference on Methods and Models in Automation and Robotics (MMAR'05), 2005, pp. 531-536.

Page 126: Beyond A* - harablog.files.wordpress.com · HPA* Overview • [Botea, Müller & Schaeffer, 2004] • Pre-processing: • Build abstract graph (Clusters and Entrances) • Run-time

Questions?