Advanced Time & Scheduling Features
Beyond basic time windows, the VRP solver offers sophisticated time management capabilities for complex scheduling scenarios. This guide covers advanced features including multiple time windows, soft constraints, wait time optimization, and more.Multiple Time Windows
Jobs can have multiple valid time slots, giving the solver flexibility to choose the most efficient option:Multiple time windows are ideal for customers who offer morning OR afternoon availability. The solver automatically selects the window that optimizes the overall route.
Soft Time Windows
Allow time window violations with penalties instead of hard constraints:When
false
, the time window becomes a soft constraint that can be violated with a penaltyPenalty weight for violating the soft time window. Higher values make violations less likely.
Combining Hard and Soft Windows
Time Snapping (snapUnit)
Round arrival times to specific intervals for cleaner schedules:How snapUnit works:
- Arrival times are rounded UP to the nearest snapUnit
- Example: With
snapUnit: 300
(5 minutes)- Arrival at 9:02 → Snapped to 9:05
- Arrival at 9:05 → Stays at 9:05
- Arrival at 9:07 → Snapped to 9:10
Use Cases for snapUnit
Job Padding
Add buffer time before and after jobs:Padding is applied AFTER snap unit calculations. If arrival is snapped to 9:00 and padding is 300 seconds, the actual arrival becomes 9:05.
Duration Squash
Reduce service time for consecutive jobs at the same location:1
First Job at Location
Full duration applies: 600 seconds (10 minutes)
2
Subsequent Jobs
If travel time < 1 minute, duration becomes durationSquash: 120 seconds (2 minutes)
Resumable Jobs
Allow breaks to interrupt long service jobs:With
resumable: true
, the 4-hour job can be split:- 8:00-12:00: Work 4 hours
- 12:00-13:00: Lunch break
- 13:00-13:00: Resume and complete
Wait Time Optimization
Control how the solver handles waiting time at locations:Wait Time Scenarios
Overtime Management
Handle shift extensions with soft or hard constraints:Overtime Behavior:
- Regular shift: 8:00-17:00 (no penalty)
- Overtime zone: 17:00-19:00 (penalized but allowed)
- After overtimeEnd: Not allowed (hard constraint)
Multi-Day ASAP Scheduling
Optimize job scheduling across multiple days:ASAP scheduling automatically assigns jobs to the earliest feasible day, helping complete work sooner and improving customer satisfaction.
Complex Example: Field Service
Combining multiple time features for realistic field service:Performance Tips
Time Feature Performance Impact:
- Multiple Windows: Each additional window increases complexity
- Soft Constraints: More flexible but requires more computation
- Small snapUnit: More precision = more possible solutions
- Resumable Jobs: Adds complexity to break scheduling
Related Features
- Time Windows - Basic time window configuration
- Break Management - Detailed break scheduling
- Resource Shifts - Multi-shift scheduling
- Job Relations - Time-based job dependencies