A route recommendation must satisfy more than short travel distance. For each stop, compute arrival from the previous departure and the selected travel estimate, then start service no earlier than the appointment window and finish within any hard end constraint. Preserve service duration, skill eligibility, capacity, break rules, and access restrictions as typed inputs. The prompt may rank feasible options, but a deterministic validator should reject routes with a missed hard window or missing leg. If a window is soft, label the trade-off explicitly; do not quietly reinterpret it as hard or vice versa.
Location prompts: compute stop-window feasibility before recommending
Operational case
Technician T-8 leaves the Quartz depot at 08:30. A 22-minute leg reaches J-47 at 08:52; service waits until the 09:00 window and lasts 30 minutes, ending 09:30. An 18-minute leg reaches J-52 at 09:48; service starts 10:00 and ends 10:25 after 25 minutes. A 31-minute leg reaches J-71 at 10:56; service starts 11:00 and ends 11:20 after 20 minutes. Those calculations support the three stated windows, but only if the technician is eligible for all jobs and the travel estimates remain valid.
T-8 departs 08:30; depot→J-47 22 min; arrives 08:52.
J-47 window 09:00; service 30 min; departs 09:30.
J-52 arrival 09:48; starts 10:00; departs 10:25.
J-71 arrival 10:56; starts 11:00; finishes 11:20.
Release gate: skill, capacity, breaks, and access checked.Performance and operating cost
Validating one ordered route of S stops is O(S) time and O(1) working state beyond the input. Searching every permutation is O(S factorial) and quickly impractical; use a route solver or bounded candidate set for larger fleets, then validate the chosen route independently. A few precise arithmetic checks prevent a fluent prompt from hiding a ten-minute conflict. Keep traffic estimates separate from appointment rules so a later refresh changes only the affected legs.
Common Mistakes
- Do not add travel time without waiting for a window that has not opened.
- Do not ignore service duration when checking the next stop.
- Do not call a route feasible before skill and capacity rules are checked.
Connected lessons
- Production prompt engineering
- Prompt Engineering
- Numeric prompts: let code calculate and the model explain
- Capacity prompts: check units, headroom, and a failed worker
- Aggregation prompts: pin the denominator and recompute the rate
- Location prompts: resolve ambiguous addresses before routing
- Location prompts: validate coordinates, units, and precision
- Location prompts: label travel estimates and stale matrices
- Location prompts: review the map and gate dispatch effects
- Project: review a Quartz field-service route
- Location-aware prompt decisions
