A technician's shift starts at 8:00 AM. The first appointment opens at 10:00. Without flexibility, the technician leaves at 8:00, arrives at 8:45, and idles for over an hour. Or the opposite: the first appointment opens at 8:00, driving takes 30 minutes, and the technician arrives at 8:30 with the customer waiting.
FlexTime solves both. Positive FlexTime shifts the start later to eliminate idle time. Negative FlexTime shifts the start earlier so the first node is served at opening, with configurable policy on whether early time is for driving only or for driving and working. Both are hard constrained, per resource, per shift, and combinable.
Less idle time. Better first-node alignment. Cleaner Gantt plots. Higher dispatcher and driver acceptance.
In field service and delivery operations, the first stop of the day determines how the rest of the schedule feels. If the first node opens late, a fixed 8:00 start creates an hour of paid idle time. If the first node opens early but driving takes time, the resource arrives late and the schedule cascades.
Dispatchers know this. They manually adjust start times per driver, per day, based on gut feeling and experience. This works for 5 drivers. It does not work for 50. And it certainly does not scale to automated planning where the optimizer must decide start times across hundreds of resources simultaneously.
FlexTime gives the optimizer the same lever that dispatchers use manually: the freedom to shift the start time within controlled bounds.
“By assigning a negative FlexTime, the first nodes of each route are nicely stacked and can be visited at the beginning of their opening hours. The result looks more convincing and leads to higher acceptance.”
JOpt.TourOptimizer Special Features DocumentationPositive FlexTime delays the start to reduce idle time. Negative FlexTime advances the driving start to reach the first node at opening. Both can be combined into a single flexible band around the WorkingHours start. The optimizer picks the best adjustment per day, per resource, based on the actual first node.
Positive FlexTime is for late-opening first stops. A resource with 2 hours of positive FlexTime and an 8:00 shift start can delay departure until 10:00 at most. If the first node opens at 9:30 and driving takes 15 minutes, the optimizer starts at 9:15. Idle time eliminated.
Negative FlexTime is for early-opening first stops. A resource with 1 hour of negative FlexTime can leave as early as 7:00 AM. If the first node opens at 8:00 and driving takes 40 minutes, the optimizer starts at 7:20. The technician arrives at 8:00, ready to work. The user controls whether this early time is restricted to driving only or can also include productive work.
Every route starts at exactly the same time regardless of when work begins. Idle mornings accumulate across the fleet. Gantt plots show long drive segments before the first productive work. Dispatchers question the plan. Drivers lose trust. The optimizer is technically correct but operationally unconvincing.
Negative FlexTime supports a driving-only flag: when set to true, the early time is for positioning only, not for productive work. When set to false, the early time can be used for both driving and working, giving the optimizer maximum flexibility. A separate setting controls whether early time counts toward total working time. These controls together model your organization's labor rules for early starts precisely.
FlexTime is not a cost adjustment. It is an architectural expansion of the feasible solution space. The shift start becomes a hard-constrained time window that the optimizer uses to produce more realistic, more efficient schedules.
| Fixed shift start | JOpt FlexTime |
|---|---|
| × Same start time every day | ✓ Optimized per day and route |
| × Idle time when first stop opens late | ✓ Start delayed, idle eliminated |
| × Late arrival when driving takes time | ✓ Early driving, arrive at opening |
| × Gantt plots look messy | ✓ First nodes aligned to openings |
| × No labor policy distinction | ✓ Driving-only or driving+working flags |
Field service with appointment windows that vary by day. Delivery operations with dock openings at specific times. Healthcare visits scheduled around patient availability. Any operation where the first stop determines the quality of the entire route.
Positive and negative FlexTime work together. On Monday, the first node opens late: the optimizer delays the start. On Tuesday, it opens early: the optimizer starts driving earlier. Same resource, same configuration, different behavior per day. The optimizer picks what works best.
Run PositiveFlexTimeExample.java and NegativeFlexTimeExample.java. Compare the Gantt output with and without FlexTime. Watch idle time disappear and first nodes align to their opening hours.