Find the best available time slots for new jobs in existing routes
The suggest endpoint helps you find optimal time slots for new jobs within your existing planned routes. This feature enables dynamic scheduling by identifying the best insertion points for unplanned work while minimizing disruption to current plans.
Perfect for appointment booking systems, field service scheduling, and dynamic route optimization scenarios.
The suggest endpoint analyzes your current route plan and evaluates all possible insertion points for new jobs. For each potential slot, it calculates:
The response provides ranked suggestions with detailed scoring, allowing you to offer customers the most efficient appointment options.
Jobs must be explicitly marked as planned using initialResource
and initialArrival
. Jobs without these fields are considered candidates for suggestion.
initialResource
and initialArrival
setEach suggestion includes a comprehensive score breakdown:
Score Type | Description | Impact |
---|---|---|
hardScore | Constraint violations that must be avoided | Must be 0 for feasible solutions |
mediumScore | Important but flexible constraints | Lower is better |
softScore | Optimization objectives like travel time | Lower is better |
feasible | Overall feasibility indicator | true/false |
The executedAfter
field indicates where the job would be inserted:
Define existing routes accurately
Ensure all currently planned jobs have correct initialResource
and initialArrival
values to represent your actual schedule.
Set appropriate limits
Use maxSuggest
to balance between offering choices and API performance. Start with 5-10 suggestions.
Handle infeasible suggestions
When onlyFeasibleSuggestions
is false, check the feasible
flag and hardScore
to identify problematic suggestions.
Consider time granularity
For appointment booking, set suggestionTimeGranularity
to match your booking intervals (e.g., 900 for 15-minute slots).
Offer customers available time slots that minimize disruption:
Find the best slot for urgent work:
The suggest endpoint evaluates multiple insertion points, making it more computationally intensive than standard solve operations. Consider caching results for frequently requested scenarios.
Complete route optimization from scratch
Score existing route plans
Define dependencies between jobs
Constrain job scheduling times