Skip to content

feat(tsp): make OR-Tools solver time limit configurable#5

Merged
wietzesuijker merged 1 commit into
mainfrom
feat/configurable-tsp-time-limit
Jun 7, 2026
Merged

feat(tsp): make OR-Tools solver time limit configurable#5
wietzesuijker merged 1 commit into
mainfrom
feat/configurable-tsp-time-limit

Conversation

@wietzesuijker

Copy link
Copy Markdown
Member

The TSP solver time limit was hardcoded to 30s in solve_tsp_ortools. OR-Tools' guided-local-search runs the full budget even after it has found the optimum, so:

  • large surveys could not extend the budget, and
  • each route unit test burned the full 30s.

This adds a tsp_time_limit_seconds config field (default 30, behaviour-preserving), threads it through BuildCSV to the solver, and lets the route tests use a short budget. The suite drops from ~151s to ~12s. A test for the new parameter is included.

19 tests pass.


AI (Claude) supported my development of this PR.

The TSP time limit was hardcoded to 30s in solve_tsp_ortools. OR-Tools'
guided-local-search runs the full budget even after the optimum is found, so
large surveys could not extend it and the unit tests each burned 30s. Add a
tsp_time_limit_seconds config field (default 30, behaviour-preserving), thread
it through BuildCSV to the solver, and let the route tests use a short budget —
suite drops from ~151s to ~12s. Adds a test for the new parameter.
@wietzesuijker wietzesuijker merged commit c3b5ee9 into main Jun 7, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant