Euclidean Pathfinding with Compressed Path Databases

Bojie Shen, Muhammad Aamir Cheema, Daniel Harabor, Peter J. Stuckey

Introduction

Finding the shortest path between two points in a 2D environment populated by polygonal obstacles is a cornerstone problem in robotics, computational geometry, and video game development. While grid-based search algorithms like A* are widely used, they often result in jagged, suboptimal paths that require post-processing. Mesh-based planners, such as Polyanya, offer a solution by finding optimal paths in continuous space. However, these methods can suffer from "first move lag"—a noticeable delay while the algorithm computes the entire optimal path before an agent can begin moving.

This paper introduces End Point Search (EPS), a novel algorithm that addresses these challenges by combining mesh-based search with precomputed Compressed Path Databases (CPDs). EPS achieves optimal results up to an order of magnitude faster than previous state-of-the-art methods and provides high-quality "anytime" solutions almost instantaneously.

Methodology

The EPS approach is divided into an offline preprocessing phase and an online search phase.

Offline Preprocessing

The goal of preprocessing is to build a compact database that can quickly provide path information during runtime.

  1. Visibility Graph Construction: The authors extract a graph of "co-visible" convex vertices from a navigation mesh. A key insight is that optimal paths in a 2D polygonal environment only "bend" at convex corners. By focusing only on these vertices, the complexity of the search space is significantly reduced.
  2. CPD Building: Using Dijkstra's algorithm, the shortest paths between all pairs of vertices in the visibility graph are computed. To manage memory, the system stores only the "first move" (the next vertex to visit) for every pair. This data is then compressed using Run-Length Encoding (RLE), which is highly effective because many source vertices share the same first move for a range of target vertices.

Online Search: End Point Search (EPS)

Since the start ($s$) and target ($t$) points can be located anywhere in the continuous space, the algorithm must bridge the gap between these points and the precomputed graph vertices.

Incremental exploration in EPS from start (s) and target (t) points.

EPS utilizes two simultaneous Polyanya-style searches starting from $s$ and $t$ to identify visible graph vertices ($V_s$ and $V_t$). As soon as a vertex $v_s$ is found from the start and $v_t$ from the target, the CPD can immediately provide the optimal path between them. To optimize this process, the algorithm employs distance-based pruning—skipping vertices that cannot possibly lead to a shorter path than the one already found—and caches intermediate results to accelerate database lookups.

Evaluation

The algorithm was rigorously evaluated using 373 real-world game maps from the HOG2 repository, spanning four major benchmark suites: Dragon Age: Origins (DAO), Dragon Age II (DA), Baldur’s Gate II (BG), and StarCraft (SC). These maps represent a wide variety of pathfinding challenges, from wide-open fields to intricate, narrow corridors.

Key Results

The experimental results demonstrate that EPS is a significant advancement in Euclidean pathfinding.

Runtime comparison on Baldur's Gate II (BG) maps.
  • Computational Speedup: For optimal pathfinding, EPS is 2–4 times faster than Poly-ENLSVG and frequently over 10 times faster than Polyanya on the most difficult queries.
  • Anytime Performance: EPS is exceptionally responsive, finding a valid path within 10µs and a path within 1% of the optimal length within 15µs on average. This virtually eliminates "first move lag."
  • Memory Efficiency: Despite the "all-pairs" nature of the database, compression keeps the CPD size manageable. Most maps require only a few hundred kilobytes to a few megabytes, making it suitable for memory-constrained systems.
  • Efficient Preprocessing: Building the CPD is fast, typically taking only a few minutes on standard consumer hardware.

Conclusion and Future Work

EPS successfully bridges the gap between continuous mesh-based search and discrete precomputed databases. By leveraging the geometric property that optimal paths only turn at convex corners, it provides a highly efficient and responsive pathfinding solution.

However, some limitations remain. The current implementation is designed for static 2D environments; dynamic obstacles would require recomputing parts of the CPD. Future research could explore extending this technique to 3D environments, handling varying terrain costs, or implementing partitioning strategies to scale to massive open-world maps where the $O(V^2)$ preprocessing cost might otherwise become prohibitive.

Summary updated

BibTeX
@inproceedings{shen2020euclidean,
  author = {Bojie Shen and Muhammad Aamir Cheema and Daniel Harabor and Peter J. Stuckey},
  title = {{Euclidean Pathfinding with Compressed Path Databases}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.24963/ijcai.2020/584},
}
Figure