Skip to content
anindexPublic

About

Implementation of Differentiable, Architecturally Admissible Compressor (AAC) for A* Search. TMLR with Reproducibility Certification, 2026.

Topics

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

AAC: Admissible-by-Architecture Differentiable Landmark Compression for ALT

arXiv CI Python 3.12+ PyTorch

AAC selects landmarks for ALT, an A* heuristic based on landmark distances. It starts with K₀ farthest-point landmarks and uses training queries to select m distance rows. Each vertex stores m distances instead of K₀ on an undirected graph, or 2K₀ on a directed graph.

The repository contains the library, experiment scripts, and recorded results. It includes FPS-ALT, canonical CDH, FastMap, and FM+DH baselines. The Warcraft pipeline trains a map encoder through a differentiable selector.

Paper: AAC: Admissible-by-Architecture Differentiable Landmark Compression for ALT, by An T. Le and Vien Ngo. Accepted at Transactions on Machine Learning Research. Read the paper or preprint.

AAC-ST and AAC-CG selection on a maze, with A* expansion maps and training objectives

One seeded run on a 40×40 maze, with 1,000 training queries and 200 test queries. AAC-ST shows argmax checkpoints. AAC-CG shows its fractional iterates and final pipage rounding. Brighter cells indicate more A* expansions. Each method deploys six float32 rows from a 24-landmark pool, at 24 bytes per vertex. Every evaluated path is optimal. The animation shows algorithm progress, not elapsed time.

Installation

Use Python 3.12 or newer and uv:

git clone https://github.com/anindex/aac.git
cd aac
uv sync
source .venv/bin/activate

For all paper experiments, install the optional dependencies:

uv sync --extra experiments --extra osm --extra scalability
Extra Adds Use
experiments matplotlib, pandas, scikit-learn, Pillow Experiment scripts and plots
osm OSMnx, pyosmium OSMnx downloads and .pbf road graphs
scalability NetworKit Multithreaded shortest-path searches for teacher labels

Alternatively, run conda env create -f environment.yml. Then run conda activate aac. The conda environment uses Python 3.14 and includes all extras. The commands below assume an active environment. Otherwise, prefix each command with uv run --no-sync.

Quick start

Run a small grid example:

python examples/demo_grid_navigation.py

The demo compares Dijkstra, FPS-ALT, and AAC-CG at matched memory. It checks every returned path against SciPy's Dijkstra. The example guide also covers directed road routing and the contextual terrain pipeline. All three demos use synthetic data and need only the base installation.

How AAC works

Exact teacher labels, AAC-ST and AAC-CG selection, and ALT deployment

Farthest-point sampling builds the candidate pool. Shortest-path searches compute the distance labels for each landmark and direction. AAC provides two selectors:

Selector Training representation Guarantee
AAC-ST (aac.train) A compression matrix with nonnegative entries and unit row sums Admissible with exact teacher distances; no approximation guarantee for selection
AAC-CG (aac.selection.select_landmarks) Fractional item selections from continuous greedy, followed by pipage rounding Admissible at every iterate with exact teacher distances; a finite-step approximation guarantee

Both deploy ordinary ALT on the selected rows. On directed graphs, the budget splits into ⌊m/2⌋ forward rows and ⌈m/2⌉ backward rows.

AAC-CG maximizes the mean heuristic bound on the training queries. With an exact oracle and T steps, its approximation factor is $1-\exp(-(1-1/T)^{m-1})$. The factor approaches $1-1/e$ as T grows. This guarantee concerns the training objective; it does not order A* expansion counts. The paper gives the assumptions, derivation, and proofs.

The soft continuous-greedy layer uses an entropic oracle so that gradients can reach the Warcraft encoder. Its smoothed training labels need not be admissible. Deployment recomputes exact distances on the graph with predicted costs.

Deployment and numerical limits

Each method stores vertex-major float32 labels at four bytes per value. Comparisons match these bytes per vertex. A* reopens closed nodes to preserve optimal paths with an admissible heuristic. One-step bidirectional pathmax (BPMX) is optional.

The heuristic ignores unusable landmark terms. It returns positive infinity when the labels prove the target unreachable. Each finite bound subtracts two float32 units in the last place (ULPs), measured at the table's largest finite label. It then clamps the bound at zero. This allowance covers conversion and subtraction of exact labels. It does not cover errors accumulated during distance computation. The numerical experiments compare returned path costs with Dijkstra.

Road routes minimize distance. DIMACS uses its integer distance units; OSMnx and the PBF loader use meters. The PBF loader handles one-way tags but does not model access or turn restrictions. Warcraft uses cell costs without an extra diagonal factor.

Results and limits

The primary comparison uses equal float32 storage and shares distance tables on symmetric DIMACS graphs. It covers road networks, synthetic graphs, and OGB-arXiv. The results index maps each table, figure, and reported measurement to its records.

  • AAC-CG reduced expansions by 1.9–22.7% relative to FPS-ALT in all 19 primary graph–budget pairs. Each pair used one 500-query test split.
  • Canonical greedy expanded fewer nodes than AAC-CG in 14 of those 19 pairs. AAC-CG also provides a differentiable selection layer for learned costs.
  • Of eight primary pairs tested on fresh queries, seven had paired intervals that supported an improvement over FPS-ALT. The SBM interval at 32 bytes per vertex included zero.
  • AAC-CG had lower observed median latency, averaged across seeds, in 9 of 12 timed pairs. Only 3 of 36 per-seed bootstrap intervals excluded equal latency, all in AAC-CG's favor.

These counts describe the measured runs. The query-shift, optimizer, and timing controls use a separate protocol that accounts for both directions. The Warcraft study demonstrates pipeline compatibility. Its fixed target is an FPS landmark, which favors selections that retain it. For other preprocessing and storage tradeoffs, see the route-planning survey.

Reproduce the paper

Download the data, then run the experiment driver:

python scripts/download_all_data.py
python scripts/reproduce_paper.py --paper-dir ../aac_arxiv

Downloads go to data/. The downloader checks DIMACS and Warcraft files against fixed SHA-256 digests. It checks OSMnx graphs against recorded vertex and arc counts at a fixed OSM snapshot. The OGB-arXiv loader downloads its data on first use. The script guide lists individual downloads and their options.

Extract the paper sources beside this repository, or set --paper-dir to their location. The default is paper/, which you can link to a LaTeX checkout. A full run takes many hours. The recorded experiments used an Intel Core Ultra 9 285K with 128 GB of RAM. No step requires a GPU.

To regenerate tables and figures from the records:

python scripts/reproduce_paper.py --tables-only --paper-dir ../aac_arxiv

The script guide covers tracks, parallel jobs, resume behavior, and timing requirements. To regenerate the README animation, run python scripts/generate_readme_gif.py.

Verification

python scripts/reproduce_paper.py --track verify --paper-dir ../aac_arxiv

This checks records, generated tables, and the results index. It fails if the paper directory or required tables are missing. To check records without the paper sources, run python scripts/check_results_quality.py. See CONTRIBUTING.md for tests, lint, and type checks.

Repository layout

Path Contents
src/aac/ Selection, compression, heuristics, search, baselines, graph loaders, and contextual training
src/experiments/ Shared experiment setup, deployment, timing, metrics, and result writers
scripts/ Experiment runners, downloads, table and figure generators, and checks
examples/ Three demos with synthetic data
tests/ Unit, property, and integration tests
results/ Experiment records and their source index
assets/ README figures

Citation

If you use this code, cite:

@article{le2026aac,
  title={AAC: Admissible-by-Architecture Differentiable Landmark Compression for ALT},
  author={Le, An T. and Ngo, Vien},
  journal={Transactions on Machine Learning Research},
  url={https://openreview.net/forum?id=ESlL4ab9y8},
  year={2026}
}

License

Apache License 2.0. Copyright © 2026 An T. Le and Vien Ngo.

About

Implementation of Differentiable, Architecturally Admissible Compressor (AAC) for A* Search. TMLR with Reproducibility Certification, 2026.

Topics

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages