Orginated from my research "A_r*: a Bounded Suboptimal Search algorithm using Conditional Node Re-expansion Policy"
A clean, research-ready package for comparing Weighted A* variants:
- CR: Weighted A* with Conditional Re-expansion (threshold
r, multiple modes). - NR: Never Re-open.
- AR: Always Re-open.
- ARA*: Anytime Repairing A* (baseline with reuse).
Includes diverse scenarios (grids, inconsistent heuristics, geometric graphs, 8-puzzle, terrain, mazes), a benchmark suite, and optional plotting.
pip install -e .[dev,plot]
pre-commit install# Compare on a wall+gap grid (CSV to stdout)
reexpastar-compare --width 60 --height 60 --weight 1.5 --r_cr 0.2
# Ablation of r (NR/AR/CR)
reexpastar-ablate --width 80 --height 80 --weight 1.5 --r_values "inf,1.0,0.5,0.2,0.0" --r_mode rel_edge
# Full benchmark suite (writes CSV -> results/)
reexpastar-benchmark --weight 1.5 --r_values "inf,0.5,0.2,0.0" --r_mode abs --seed 42 --include_ara
# Then produce annotated scatter plots for each scenario
reexpastar-plot results/benchmark_YYYYMMDD_HHMMSS.csvPYTHONPATH=. python -m unittest discover -s tests -t .
# or with pytest if you prefer
# pytest -q --cov=reexpastarreexpastar/
src/reexpastar/ # package code (CR/NR/AR/ARA*, grids, terrain, scenarios)
tests/ # unit tests
examples/ # runnable samples
docs/ # MkDocs (optional)
.github/workflows/ # CI config
See CONTRIBUTING.md. By participating you agree to the Code of Conduct.
See CITATION.cff.
- Best Paper, KICS – ICTC 2023 (selected from ~600 papers). This repository accompanies my research on re-expansion strategies in heuristic search.
- Generics & Protocols for type-safe state definitions (
reexpastar.core.types). - Tie-breaking:
tie_break='g_low'|'g_high'to control OPEN ordering when f ties. - Guards & telemetry:
max_expansions,max_runtime_ms,log_everywithreexpastar.logging.get_logger()(JSON-capable). - Parallel benchmarks:
reexpastar.cli.benchmark_parallelto run multiple seeds in parallel. - Profiling:
reexpastar.cli.profile_searchto get cProfile snapshots on heavy instances.