Skip to content

Add multi_stop_search for multi-waypoint routing (#935)#937

Merged
brendancol merged 1 commit into
masterfrom
multi-stop-search
Mar 4, 2026
Merged

Add multi_stop_search for multi-waypoint routing (#935)#937
brendancol merged 1 commit into
masterfrom
multi-stop-search

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

@brendancol brendancol commented Mar 4, 2026

Summary

  • Adds multi_stop_search(), which routes through N waypoints by calling a_star_search for each consecutive pair and stitching the results into a single cumulative-cost DataArray
  • Two TSP solvers handle optional waypoint reordering: exact Held-Karp (N<=12) and nearest-neighbor + 2-opt (N>12), both with fixed start/end
  • Supports numpy, dask, cupy, and dask+cupy backends; uses .data.get() for CuPy arrays to avoid implicit conversion errors
  • 14 new tests cover TSP solvers, multi-stop routing, input validation, optimize_order, and cross-backend parity
  • README feature matrix and pathfinding user guide notebook updated with multi-stop examples

Test plan

  • All 46 pathfinding tests pass (32 existing + 14 new)
  • Verify notebook cells run end-to-end (jupyter nbconvert --execute docs/source/user_guide/pathfinding.ipynb)

Routes through N waypoints by calling a_star_search for each consecutive
pair and stitching segments into a single cumulative-cost surface.
Supports optional TSP-based reordering of interior waypoints (exact
Held-Karp for N<=12, nearest-neighbor + 2-opt otherwise).
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label Mar 4, 2026
@brendancol brendancol merged commit 4211830 into master Mar 4, 2026
11 checks passed
@brendancol brendancol deleted the multi-stop-search branch May 4, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant