The performance of search algorithms for grid-based pathfinding, e.g. A*, critically depends on the heuristic function that is used to focus the search. Recent studies have shown that informed heuristics that take the positions/shapes of the obstacles into account can be approximated with the deep neural networks. Unfortunately, the existing learning-based approaches mostly rely on the assumption that training and test grid maps are drawn from the same distribution (e.g., city maps, indoor maps, etc.) and perform poorly on out-of-distribution tasks. This naturally limits their application in practice when often a universal solver is needed that is capable of efficiently handling any problem instance. In this work, we close this gap by designing an universal heuristic predictor: a model trained once, but capable of generalizing across a full spectrum of unseen tasks. Our extensive empirical evaluation shows that the suggested approach halves the computational effort of A* by up to a factor of 2.2, while still providing solutions within 3% of the optimal cost on average altogether on the tasks that are completely different from the ones used for training \unicodex2013 a milestone reached for the first time by a learnable solver.
Figures & tables
Figure 1: The difference between WA* and our approach. Expanded nodes are shown in magenta, while path in green.
Figure 2: Beta-Figures, 64x64.
Figure 3: Neural network architecture.
Figure 4: UPF topologies, 64x64.
Optimal Found
Cost
Exp
Ratio ( % ) ↑
Ratio ( % ) ↓
Ratio ( % ) ↓
A*
100.00
100.0
100.0
UPath (Uniform)
63.23
101.1 ± 2.9
53.8 ± 29.0
UPath (Beta)
55.24
105.1 ± 16.2
45.3 ± 31.9
UPath (Beta+Fig)
72.63
101.1 ± 4.1
47.4 ± 27.7
WA*, w=2
32.35
103.7 ± 4.9
54.6 ± 30.1
Table 1: Performance comparison on 64x64 UPF.
Figure 5: Trade-off analysis.
Figure 6: Total runtime (in seconds) as a function of batch size.
Skips
Masking
Optimal Found
Cost
Expansions
Ratio ( % ) ↑
Ratio ( % ) ↓
Ratio ( % ) ↓
✓
✓
55.24
105.1 ± 16.2
45.3 ± 31.9
×
✓
51.64
105.7 ± 16.75
53.65 ± 31.14
×
×
6.40
110.6 ± 15.11
77.4 ± 36.2
Table 2: Ablation on long skip connections and loss masking.
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
Table 3: Representative map samples (five per source/generator).
Optimal Found
Length
Expansions
Ratio ( % ) ↑
Ratio ( % ) ↓
Ratio ( % ) ↓
A*
100.00
100.0
100.0
UPath (64x64)
23.84
103.7 ± 7.0
48.79 ± 31.3
UPath (128x128)
54.20
102.4 ± 6.9
44.0 ± 28.7
WA*, w=2
21.22
104.5 ± 5.3
48.2 ± 33.8
WA*, w=5
7.17
109.2 ± 9.2
41.4 ± 33.4
Appendix
Table 4: Performance of the evaluated planners on 128×128 UPF maps.
Figure 7: Total runtime (in seconds) on UPF 128×128 as a function of batch size.
DeepXube is a free and open-source Python package and command-line tool that seeks to automate the solution of pathfinding problems by using machine learning to learn heuristic functions that guide heuristic search algorithms tailored to deep neural networks (DNNs). DeepXube is comprised of the latest advances in deep reinforcement learning, heuristic search, and formal logic for solving pathfinding problems. This includes limited-horizon Bellman-based learning, hindsight experience replay, batched heuristic search, and specifying goals with answer-set programming. A robust multiple-inheritance structure simplifies the definition of pathfinding domains and the generation of training data. Training heuristic functions is made efficient through the automatic parallelization of the generation of training data across central processing units (CPUs) and reinforcement learning updates across graphics processing units (GPUs). Pathfinding algorithms that take advantage of the parallelism of GPUs and DNN architectures, such as batch weighted A* and Q* search and beam search are easily employed to solve pathfinding problems through command-line arguments. Finally, several convenient features for visualization, code profiling, and progress monitoring during training and solving are available. The GitHub repository is publicly available at https://github.com/forestagostinelli/deepxube.
Forest Agostinelli
Department of Computer Science and Engineering University of South Carolina
Existing exact methods for 4-connected grid pathfinding reduce online search, but often either retain fine-grained search states or require substantial preprocessing. This paper presents Key-Interval A* (KIA*), an optimal pathfinding algorithm that uses lightweight preprocessing to construct and search over a compact interval-level abstraction of free space. KIA* represents free space using intervals: maximal contiguous runs of traversable cells. It extracts key intervals that capture structural boundary changes and connects them through contiguous non-key regions. KIA* then performs A*-style search on the resulting key-interval graph and constructively reconstructs grid paths from interval chains, without cell-level local search. We prove the completeness and optimality of KIA* on 4-connected grids. Experiments on standard benchmarks show that KIA* preserves exact shortest-path lengths and achieves the fastest runtime on seven of eight benchmark groups, with the largest gains on structured and game maps.
Taiquan Sui
Department of Computer Science and Engineering, Chalmers University of Technology, Gothenburg, Sweden
Recent learning-based path planners use neural networks to process visual map representations and approximate heuristics for classical search algorithms, yielding near-optimal paths with reduced search effort. However, these methods are tied to the shortest-path objective implicit in their supervision, which limits their flexibility to accommodate alternative criteria. We introduce FlexPath, a two-stage framework that decouples feasibility from preference. In Stage 1, we use imitation learning to acquire a task-independent spatial prior over feasible paths from visual map inputs. In Stage 2, differentiable Path Shape Objectives (PSOs) adapt this prior toward task-specific criteria without relearning path structure, requiring only efficient objective-level adaptation. A single pretrained model can be adapted to multiple objectives. For shortest-path planning, FlexPath reduces search effort on TMP by 14.3% compared to the state-of-the-art TransPath, while also finding lower-cost paths on average and demonstrating strong zero-shot generalization across three unseen domains. For obstacle clearance with minimum clearance distance 2, it achieves 96.8% full obstacle avoidance while maintaining low search cost. The framework further extends to semantic-aware avoidance and waypoint guidance via objective-level adaptation, and remains compatible with classical planners at inference time. Data and code are available at https://github.com/FraunhoferIVI/FlexPath.