0% found this document useful (0 votes)
5 views19 pages

hierarchical pathfinding algorithm

hierarchical pathfinding algorithm

Uploaded by

s.s.v.vjanand2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views19 pages

hierarchical pathfinding algorithm

hierarchical pathfinding algorithm

Uploaded by

s.s.v.vjanand2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 19

Hierarchical Path Finding

Hierarchical PathFinding
 Plans a route in much the same way as a person would.
 Human plan an overview route first and then refine it as needed.
 Ex: The high-level overview route might be

 “To get to the rear parking lot” 


• we’ll go down the stairs, For a longer route, the high-level
• out of the front lobby, plan would be even more abstract:
• and around the side of the building,” “To get to the London office” 
•we’ll go to the airport,
or
• We’ll go through the office, •catch a flight,
• out the fire door, and •and get a cab when we land.
• down the fire escape.
• Each stage of the path will consist of another route plan.
• To get to the airport, for example, we need to know the route.
• The first stage of this route might be
• to get to the car.
• This, in turn, might require a plan to get to the rear parking lot,
which in turn will require a plan to move around the desks and get
out of the office.

The A* & dijkstra


Hierarchical Plans
For a longer route, the high-level
plan would be even more abstract:
“To get to the London office” 
•we’ll go to the airport, to get to the car.
•catch a flight,
•and get a cab when we land. to get to the rear parking lot

move around the desks


and get out of the office

The A* & dijkstra


Hierarchical PathFinding
 This is a very efficient way of pathfinding.
To start with, we plan the abstract route,
take the first step of that plan, find a route to complete it,
and so on down to the level where we can actually move.
After the initial multi-level planning, we only need to plan
the next part of the route when we complete a previous
section.
The plan at each level is typically simple, and we split the
pathfinding problem over a long period of time, only doing
the next bit when the current bit is complete.
Example
• When we arrive at the bottom of the stairs, on our way to
the parking lot (and from there to the London office), we
plan our route through the lobby.
• When we arrive at the car, we then have completed the “get
to the car” stage of the more abstract plan, and we can plan
the “drive to the airport” stage.

The A* & dijkstra


THE HIERARCHICAL PATHFINDING GRAPH
 To pathfind at higher levels we can still use the A* algorithm
and all its optimizations.
In order to support hierarchical pathfinding, we need to alter
the graph data structure
Node
This is done by grouping locations together to form clusters.
The individual locations for a whole room, for example, can
be grouped together. There may be 50 navigation points in the
room, but for higher level plans they can be treated as one.
This group can be treated as a single node in the pathfinder
THE HIERARCHICAL PATHFINDING GRAPH
This process can be
repeated as many times
as needed.
The nodes for all the
rooms in one building
 combined
all the buildings in a
complex  combined
etc.
The final product is a
hierarchical graph.
Hierarchical nodes
THE HIERARCHICAL PATHFINDING GRAPH
Pathfinding graphs require
connections as well as nodes.
The connections between
higher level nodes need to
reflect the ability to move
between grouped areas.
If any low-level node in one
group is connected to any low-
level node in another group,
then a character can move
between the groups, and the
two groups should have a
connection.
Shows connections between two nodes based on
the connectivity of their constituent nodes at the
next level down in the hierarchy.
THE HIERARCHICAL PATHFINDING GRAPH

Connection Cost

The cost of a connection between two groups should reflect the difficulty of traveling
between them.

This can be specified manually, or it can be calculated from the cost of the low-level
connections between those groups.
THE HIERARCHICAL PATHFINDING
GRAPH
 complex calculation,(cost of moving
from group C to group D)
 Cost = 5 (if entered from A
 Cost = 2(if entered from B)
 In general, the grouping should be
chosen to minimize this problem, but
it cannot be resolved easily.

A tile-based representation of
a level with groups marked

There are three heuristics that are commonly used to calculate the connection cost
between groups  Min. Distance, Maximin. Distance, Avg. Minimum Distance
Heuristics are the strategies derived from previous
experiences with similar problems.
Heuristics
• Minimum Distance
This heuristic says that the cost of moving between two groups is the
cost of the cheapest link between any nodes in those groups.
Pathfinder will try to find the shortest route between two locations.
Ex: Cost of moving from C to D would be 1. Note that if you entered C
from either A or B, it would take more than one move to get to D.
The value of 1 is almost certainly too low, but this may be an
important property depending on how accurate you want your final
path to be.
The A* & dijkstra
Heuristics
• Maximin Distance
To calculate the cost of moving from C to D, two costs are
calculated:
the minimum cost from C1 to C5 (4) and the minimum cost from C6 to
C7 (1). The largest of these (C1 to C5) is then added to the cost of
moving from C5 to D1 (1). This leaves a final cost from C to D of 5.

The A* & dijkstra


Heuristics
• Average Minimum Distance
A value in the middle of these extremes is sometimes better. The
“average minimum” distance is a good general choice.

The A* & dijkstra


PATHFINDING ON THE HIERARCHICAL
GRAPH
Data Structures and Interfaces
Performance
Hierarchical Pathfinding Algorithm
• Apply A∗ algorithm several times, starting at a high level of the
hierarchy and working down.
• results at higher levels used to limit the work at lower levels.
• end point is set at the end of the first move in the high-level plan.
• no need to initially know the fine detail of the end of the plan; we
need that only when we get closer

The A* & dijkstra


Hierarchical Pathfinding Algorithm
• Data structures: we need to convert nodes between different levels of
the hierarchy.
• increasing the level of a node, simply find which higher level node it
is mapped to. decreasing the level of a node, one node might map to
any number of nodes at the next level down (localization). Choose
representative point: center of nodes mapped to same node (easy
geometric preprocessing), most connected node, etc

The A* & dijkstra

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy