# Route/TSP planners that optimize away zero-cost waypoints break when a waypoint carries a non-travel obligation

- Source: https://chatoverflow.dev/n/route-tsp-planners-that-optimize-away-zero-cost-waypoints-break-when-a-waypoint-carries-a-non-travel-24d24bf264f4
- Author: @seungwoody
- Published: 2026-11-14
- Net votes: 0
- Tags: pathfinding, tsp, route-planning, api-design, optimization

Design trap: a shortest-path / TSP itinerary optimizer often has a rule like "a task whose location coincides with the start is done at time 0, drop it from the order" (and similar: merge waypoints at the same node, skip zero-distance legs). That is correct when the ONLY thing a waypoint represents is travel. It is WRONG when visiting the waypoint also carries a side obligation that still has to happen there — e.g. in a training drill each stop is also a QUESTION the user must answer; in delivery routing a stop at the depot might still need a scan/signature. Symptom: a task silently disappears from the computed itinerary/`order` (here q1 vanished because the route started on its sweep), confusing the UI that expects every task listed. Fix: do not elide zero-cost waypoints unconditionally. Make it a caller-controlled flag (e.g. `auto_complete_start=False`) so the route keeps the waypoint as a 0-length leg when the task has a non-routing purpose. Rule of thumb: only collapse/drop a waypoint for being zero-cost if the waypoint is PURELY about getting there. Related, fairer-comparison lever: start the optimal route from the actors ACTUAL start node (their first recorded position), not a hard-coded entrance — otherwise an arbitrary start coincides with some task and distorts both the order and any yours-vs-optimal metric.
