Long-running visits
Sometimes, tasks may take longer than a single shift to complete. If such a task is part of the input with its full duration and no shift is long enough to handle them, the task will not be scheduled. The following guide will help you understand how to handle such long-running tasks.
Please be advised that this approach needs to be adapted to the specific scenario. |
1. Splitting tasks
Long-running tasks need to be split into smaller tasks that can be scheduled within the available shifts. The model doesn’t automatically split long-running tasks into smaller tasks. This needs to happen upfront before the input is submitted to the model.
For the size of these smaller split-up tasks it is important to find a good balance between:
-
Creating enough flexibility for the solver to fill smaller gaps with parts of the long-running task.
-
The number of individual parts created. The more visits that are created for the long-running task, the bigger the problem size will be.
If the split-up tasks are too big the solver will not be able to fill smaller gaps with parts of the task. Ideally, select a duration for the split-up tasks that is equal to the minimum time a visit to a customer should have. For example, driving to a customer and performing a task for 10 minutes before leaving might not be a good size for some scenarios. A visit duration of at least 30 minutes or 60 minutes might be a better choice.
Depending on the scenarios and the minimum visit duration that is acceptable, the long-running task should be split into smaller tasks of that size.
2. Model input
The split-up tasks of the long-running task need to be added to the model input as individual visits (please note that each visit needs a unique visit ID). If the original task had a time window, the splits should have the same time window as well. Other attributes like location, required vehicles, skills, etc., must also be the same. In order to avoid a solution where these individual visits are planned in parallel or overlapping, we need to use visit dependencies, which will add an ordered sequence to the visits defined by the visit dependencies feature of the FSR model.
3. Examples
The following examples present different scenarios of long-running tasks and make use of splitting the tasks into smaller visits for the model input. For these examples, a vehicle shift duration of eight hours can be assumed.
3.1. Simple split of a long-running task
In this example, there is a long-running task that has a duration longer than the shift durations of the technicians. Therefore, the task needs to be split into smaller visits for the model. Otherwise, it won’t be scheduled.
Consider the following task:
Task ID: c20sw08d
Task Location: 33.80209, -84.40296
Task Duration: 10 hours
Assuming that the technician should spent at least two hours at the customer, the task should be split into five smaller tasks of two hours each. In order to avoid overlapping visits in the schedule, visit dependencies are used. For the model input, the following visits are created:
{
"visits": [
{
"id": "c20sw08d-1",
"location": [33.80209, -84.40296],
"serviceDuration": "PT2H"
},
{
"id": "c20sw08d-2",
"location": [33.80209, -84.40296],
"serviceDuration": "PT2H",
"visitDependencies": [
{
"id": "c20sw08d-2-dependency",
"precedingVisit": "c20sw08d-1",
"coordination": "SAME_VEHICLE"
}
]
},
{
"id": "c20sw08d-3",
"location": [33.80209, -84.40296],
"serviceDuration": "PT2H",
"visitDependencies": [
{
"id": "c20sw08d-3-dependency",
"precedingVisit": "c20sw08d-2",
"coordination": "SAME_VEHICLE"
}
]
},
{
"id": "c20sw08d-4",
"location": [33.80209, -84.40296],
"serviceDuration": "PT2H",
"visitDependencies": [
{
"id": "c20sw08d-4-dependency",
"precedingVisit": "c20sw08d-3",
"coordination": "SAME_VEHICLE"
}
]
},
{
"id": "c20sw08d-5",
"location": [33.80209, -84.40296],
"serviceDuration": "PT2H",
"visitDependencies": [
{
"id": "c20sw08d-5-dependency",
"precedingVisit": "c20sw08d-4",
"coordination": "SAME_VEHICLE"
}
]
}
]
}
3.2. Uneven splits
Not all long-running tasks can be evenly divided.
Task ID: c20sw08d
Task Location: 33.80209, -84.40296
Task Duration: 10 hours 15 min
In this case, you could make 4 2-hour tasks and 1 2-hour and 15-minutes task.
Long-running tasks might also naturally be divided into different sized splits.
For instance, a visit that takes 10 hours and 15 minutes, might include a section of work that requires a single 4-hour and 15 minutes block to complete, while the rest of the visit can be split into tasks that take 1 hour each.
Determining these split sizes and where to put remainders is a very specific task that requires the knowledge of the business. Preferences from customers and technicians as well as operational constraints might play a role in this decision.
3.3. Use overtime instead
Using overtime is also an option. Consider the following task:
Task ID: c20sw08d
Task Location: 33.80209, -84.40296
Task Duration: 6 hours
At first, this task seems to be manageable in a single shift. However, if the travel time to the customer and back is 2 hours and the technician needs a break of 30 minutes, the task will not fit into a single shift.
This might be a common scenario and a potential reason for unassigned visits in a solution. In order to solve that, the planner needs to decide whether a split of this task is acceptable or not. Maybe, in this case, the split is not acceptable because the customer prefers to have the task done in a single visit. As an alternative for this specific task, allowing for overtime might be a solution.
4. Conclusion
Long-running tasks are a common challenge in field service routing. By splitting these tasks into smaller visits, you can ensure that they are scheduled effectively within the available shifts. This approach allows for better use of resources and can lead to more efficient scheduling. Determining the appropriate split size is a task that requires careful consideration of the specific use case and task at hand. It needs to consider the preferences of the business and the technicians, as well as operational constraints. Alternatives like overtime, can also be considered if splitting is not feasible or practical.
Next
-
See the full API spec or try the online API.
-
Learn more about field service routing from our YouTube playlist.