1. STUDY AND DEVELOPMENT OF HIERARCHICAL PATH
FINDING TO SPEED UP CROWD SIMULATION
MSc. Carlos Fuentes Paredes1
2. OUTLINE
○ Introduction
○ State of the Art
● Spatial Subdivision
● Path Finding Algorithms
● Hierarchical Path Finding
○ Our Approach
● Hierarchical Subdivision
● Path Finding Computation
○ Results
● Performance Test
○ Conclusions and Future Work 2
3. INTRODUCTION
3
○ Pathfinding: A*
● Expands the nodes in the
graph representation of
the environment with the
smallest estimated
solution cost first
○ Path finding cost can
grow exponentially with
the size of the terrain!
○ Hierarchical approaches
4. SPATIAL SUBDIVISION
○ Regular Grids
● 2D square cells (cell same size)
● Each cell stores information.
○ Passable or impassable
○ Local information for collision of the environment
● Nodes represent cells and edges the connectivity
4
5. SPATIAL SUBDIVISION
○ Probabilistic Roadmaps (PRM)
● Select non-obstacle sample points from the map
● Retain collision-free points for some configuration of
an agent. “milestone”
● Linked by straight paths to its k-nearest neighbours.
5
6. SPATIAL SUBDIVISION
○ Navigation Meshes (NavMesh)
● Cover walkable surfaces with convex polygons
● Each polygon represents a walkable area and the
connection between cells are the edges.
○ Quality paths.
○ Dynamic updates.
6
7. PATHFINDING ALGORITHMS
○ A*
● f(s) = g(n)+h(n)
● At each iteration it expands the node n with the lowest cost
○ Anytime Repairing A* (ARA*)
● f(s) = g(n)+ε∗h(n) ε ≥1
● Reuse of Search Results
○ D* Lite
● Re-planning method in unknown terrain
○ Anytime Dynamic A* (AD*)
● D* Lite + ARA*
7
8. HIERARCHICAL APPROACHES
○ Problem: Efficient pathfinding in very large
environments
○ Sometimes there are many optimal paths
○ A* would expand too many nodes!
8
9. HPA*
○ Build a smaller search space (abstract graph)
○ Pathfinding based on areas, not on tiles
○ Faster and lower memory requirements
○ Pre-processing:
● Build abstract graph (Clusters and Entrances)
○ Run-time processing:
● Insert start and goal into abstract graph
● Find abstract solution
● Refine if necessary
9
20. GRIDS VS NAVMESHES
○ Grids
● Paths don’t look realistic (fixed angles) .
● Often need to apply smoothing
● Not very useful in 3D spaces
● High resolution grids have large memory footprint
○ NavMeshes
● Much smaller graphs
● Creates shorter and more natural paths
● Handle indoor and outdoor terrains well
20
21. OUR APPROACH
○ Inspired by HPA*
○ Hierarchy of graphs
○ Based on NavMeshes
○ Pre-processing Step
● Graph partitioning
● Build hierarchy of graphs
○ Online Step
● Path finding computation
21
22. PRE-PROCESSING STEP
○ Recast Tool
● NavMesh discretization from a triangle soup
● Via Watershed Partitioning
● Input: arbitrary polygon soup with triangles marked
as walkable.
22
23. RECAST TOOL
1) Voxelize the polygons. 2) Build navigable space from
solid voxels.
3) Build watershed partitioning 4) Trace and simplify region
filter out unwanted regions. and contours.
23
27. COARSENING PHASE
○ A coarser graph can be obtained by collapsing
adjacent vertices.
● Matching
○ No two of which are incident on the same vertex.
● Maximal Matching
○ No more edges can be added and remain a matching
27
28. INITIAL PARTITIONING PHASE
○ Partition of the coarsest using k-way partitioning
algorithm
● Divide the graph into k equal-sized sets
● Apply the Kernighan-Lin algorithm for each pair of
subsets
○ Starts with an initial bipartition of the graph
○ In each iteration, it searches for a subset of vertices such
that swapping them leads to a partition with a smaller edge
cut
● Each part contains roughly half of the vertex weight
of the original graph
○ High quality edge cuts
28
29. UNCOARSENING PHASE
○ The partitioning of the coarser graph Gm is
projected back to the original.
○ Assign the pairs of vertices that were collapsed
together to the same partition as that of their
corresponding collapsed vertex.
29
34. ONLINE STEP
○ Path Finding Computation between Start (S) and
Goal (G) positions.
○ Done at any level of the hierarchy.
○ Five steps
● Find S and G al certain level
● Connect S and G to the graph
● Search for a path between S and G at the highest level
● Obtain optimal subpaths
● Delete temporal nodes
34
35. FIND S AND G AL CERTAIN LEVEL
○ Input: Start (S) and Goal (G) positions at level 0.
○ Recursively look for their parents.
35
Level 0 Level 1 Level 2
Level 3 Level 4
36. CONNECT S AND G TO THE GRAPH
○ Temporal Start an Goal nodes are created.
○ Add temporal IntraEdges to the portals.
● Run A*
● Store paths and costs
36
Level 2
37. SEARCH FOR A PATH BETWEEN S AND G AT
THE HIGHEST LEVEL
○ A* at certain level
37
Level 2
58. CONCLUSIONS AND FUTURE WORK
○ Hierarchical path finding framework
○ Over navigation meshes.
○ Fast time executions for path planning.
○ Improve Link S and G step
○ GPU implementation.
○ Dynamic environments
58
59. STUDY AND DEVELOPMENT OF HIERARCHICAL PATH
FINDING TO SPEED UP CROWD SIMULATION
Thank you!59