Modeling your planning problem
Answers to common questions about modeling your planning problem in the Field Service Routing model.
- Which model fits my planning problem?
- Should I plan my whole operation in one dataset or split it up?
- Which rules belong in the model, and which can I handle in my own system?
- What happens to work that doesn’t fit in the plan?
- How do visit priorities work?
- How do I use my own technicians before contractors?
- How do I model skills, certifications, and crews?
- How do I keep linked or co-located visits together?
- How do I handle long visits, breaks, and time windows?
- Can I plan work that spans several days?
Which model fits my planning problem?
Choose the model based on what you assign, and whether travel between locations is part of the work.
| Model | Use it when | Typical use cases |
|---|---|---|
People travel between locations during their shift, and the order of their visits matters. |
||
Drivers pick up people or goods at one location and take them to another. |
Non-emergency medical transportation, and courier and express delivery |
|
Employees work shifts at a location, and you decide who works which shift. |
||
Jobs run on machines, employees, or other resources, often with dependencies between jobs. |
Discrete manufacturing, project scheduling, and single-site maintenance |
If employees travel between several locations during a shift, and the route or the order of visits matters, use the Field Service Routing model. The Employee Shift Scheduling model calculates straight-line distances between locations and doesn’t plan routes.
The Task Scheduling model has Preview maturity, so backward-incompatible changes can still be introduced.
If your planning problem matches more than one model, contact us to discuss which one fits best.
For more information, see the model catalog.
Should I plan my whole operation in one dataset or split it up?
Split your operation into separate datasets when its parts don’t share resources or work. Keep the parts in one dataset when they do.
For instance, if each branch has its own employees and its own work, solve one dataset per branch. Smaller datasets solve faster, and a problem in one branch’s data doesn’t affect the others.
If some resources, for instance employees, vehicles, or machines, work for more than one branch, keep those branches in one dataset. The model can then decide where the shared resources are needed most. When you split them, each dataset is planned without knowing about the others, which usually leads to a worse plan overall.
If you need different kinds of plans, for instance shift schedules and routes, use a separate model for each. Solve them in order, and use the output of one plan to prepare the input for the next. For instance, use the shifts from your shift schedule as the vehicle shifts when you plan routes.
Which rules belong in the model, and which can I handle in my own system?
Include a rule in the model when it can make one plan better than another. When a rule doesn’t change which plan is best, handle it in your own system, before you submit the dataset or after the model returns the plan.
For instance:
-
Leave work out of the dataset when it can’t be done yet, for instance a job that’s waiting for parts or materials. Add it to a later dataset when it’s ready.
-
Handle steps that only depend on the finished plan in your own system, for instance creating work orders or notifying customers.
Some work can’t be expressed with the model’s features. Leave that work out of the dataset, and show it in your planning tool so planners can schedule it manually. If that work takes up a resource’s time, make sure the dataset shows the resource as unavailable for that time, so the model plans around it.
What happens to work that doesn’t fit in the plan?
The Field Service Routing model leaves it unassigned. Unassigned work appears in the output dataset and in the dataset’s metrics, so you can see what wasn’t planned and decide what to do with it.
Work is left unassigned when assigning it would break a hard constraint, for instance when no available resource has the right skills, or when there isn’t enough capacity for all the work.
To control which work is assigned when there isn’t capacity for everything, give your work priorities. When not all work can be assigned, the model prefers higher-priority work. Depending on the model, you can also mark work as optional. Optional work is treated as a soft constraint and assignments will be balanced against other soft constraints.
You can send more work than fits in the planning period. For instance, send a month of maintenance work when you plan two weeks, and give work that must happen soon a higher priority. The model assigns the urgent work, fills the gaps with lower priority work where possible, and leaves the rest unassigned. The unassigned work can be included in the next dataset.
To find out why a specific piece of work wasn’t assigned, use score analysis.
How do visit priorities work?
Give each visit a priority to control which visits are assigned when there isn’t capacity for all of them.
There are ten built-in priorities, from 1 (highest) to 10 (lowest), and ten optional built-in priorities, from opt-1 to opt-10.
Visits without a priority use priority 6.
By default, priorities 1 to 10 use the AUTO assignment type.
A visit is mandatory when its time window ends within the planning window, and optional when its time window extends beyond it.
To make visits with priorities 1 to 10 always mandatory, set defaultAssignmentType to MANDATORY in the configuration overrides.
Visits with priorities opt-1 to opt-10 are always optional.
Each built-in priority is ten times more important than the next, and the penalties for unassigned visits add up.
For instance, leaving one priority 1 visit unassigned counts as much as leaving ten priority 2 visits unassigned.
To change how much each priority counts, define custom priorities with priorityWeights in the configuration overrides:
-
Use large gaps between weights when higher-priority visits should almost always be assigned first.
-
Use weights close together, for instance 1002, 1001, and 1000, when the model should assign as many visits as possible. This is only an approximation of using priority as a tie-breaker: differences accumulate across visits, so the model can still prefer fewer higher-priority visits.
For more information, see Priority visits and optional visits.
How do I use my own technicians before contractors?
Give each vehicle shift a cost that matches how you pay the technician, and the model minimizes the total cost of the plan.
-
For employees, set a
fixedCost. The model counts the fixed cost whether or not the technician has visits, so assigning visits to employees adds no extra cost. -
For contractors, set hourly
rates, and anactivationCostif the contractor charges a fee for being booked. The model only counts these costs when the contractor is assigned visits, so it uses contractors when your own technicians can’t cover the work.
An activation cost is paid once, when the contractor starts working, so when the model books a contractor, it tends to give the contractor enough visits to justify the fee.
Cost competes with other goals, such as minimizing travel time, so check the balance with the minimizeShiftCostsWeight constraint weight.
For more information, see Technician costs.
How do I model skills, certifications, and crews?
Add each technician’s skills to their vehicle shifts, and add the skills each visit needs with requiredSkills.
The model only assigns a visit to a technician who has all the required skills.
-
Skill levels: give a skill a
level, and set aminLevelon the visit. The model attempts to assign a technician with the requiredminLevel, but it will send a more experienced technician than the visit requires if necessary. -
Certifications and site requirements: model yes-or-no requirements, for instance a security clearance or site-specific training, with tags.
-
Skills that change during the shift: use
temporarySkillSetswhen a technician only offers a skill at certain times. -
Crews: a vehicle is whatever travels and works as one unit, so model a crew that always travels together as one vehicle.
-
Visits that need several technicians at once: use multi-vehicle visits. Each technician drives their own route, and they’re at the visit at the same time.
-
Visits that must happen in order, for instance one trade after another: use visit dependencies.
To prefer higher-rated technicians in general, set technicianRating on vehicles and enable the Maximize technician rating constraint, as described in Technician ratings.
This preference is weighted by effective service duration, not visit priority.
For more information, see Skills.
How do I keep linked or co-located visits together?
Choosing the right feature depends on how the visits are linked:
-
Several visits at the same location: the travel time and travel distance constraints usually group these already. If technicians should finish all the work at a location before moving on, enable the
Prefer grouping co-located visitsconstraint. For visits in the same building with slightly different coordinates, also setpreferGroupingColocatedVisitsRadiusMeters, up to 200 meters. -
Visits that belong together at different locations, for instance several buildings on one site: give the visits the same
preferredConsecutiveGroupId, and enable thePrefer grouping visits in the same consecutive groupconstraint. -
Visits that must happen in a specific order: use visit dependencies. A dependency can include a minimum or maximum delay, and its
coordinationcan require the same vehicle or the same vehicle shift. -
Visits that need several technicians at the same time: use multi-vehicle visits.
Both grouping constraints are soft and disabled by default, so set a weight to enable them. They compete with other goals, such as minimizing travel time.
For work that depends on parts arriving, you can add a visit to collect the parts, and make the work visit depend on it with a delay for the lead time. Alternatively, leave the work out of the dataset until the parts arrive, as described in Which rules belong in the model, and which can I handle in my own system?.
For more information, see Route optimization.
How do I handle long visits, breaks, and time windows?
Long visits: the model doesn’t split visits that are longer than a shift. Split them into smaller visits before you submit the dataset, and link the parts with visit dependencies. Make each part at least as long as the shortest visit that’s worth the travel, for instance 30 or 60 minutes. For long work at a remote site, also define linked shifts, so the technician can stay near the site overnight and continue the next day, instead of traveling back and forth. For more information, see Long-running visits.
Breaks: add breaks to vehicle shifts with requiredBreaks.
A floating break can start any time within its window, so the model fits it around the visits.
Keep break windows wide enough: if a break must end too early, the model might leave a visit unassigned because it can’t fit both.
Use breaks with a location for personal appointments and team meetings.
For more information, see Lunch breaks and personal appointments.
Time windows: give a visit one or more required time windows when the customer is available, and preferred time windows for times the customer would like.
For an appointment at an exact time, create a visit with a maxStartTime at the same value as its minStartTime so the visit can only be assigned at that time.
For more information, see Time windows and opening hours.
Can I plan work that spans several days?
Yes. Use a planning window that covers several days, and give each technician a vehicle shift for each day.
-
Visits that can happen on any of several days: give the visit a time window that spans those days. The model then chooses the day, and can combine flexible work, such as maintenance, with fixed appointments in the same area. For more information, see Multi-day schedules and movable visits.
-
Work that takes longer than a shift: split it into visits that fit in a shift, and link them with a visit dependency with
SAME_VEHICLEcoordination, so the same technician continues the work. -
Overnight stays: define linked shifts, and the model decides when combining consecutive shifts into one, with an overnight stay near the work, produces a better plan. Linked shifts are only used for visits far from the technician’s local area. Linked shifts are in preview, so the API might change. If you already know where the technician stays, use the hotel’s location as the start and end location of their shifts. For more information, see Hotel breaks.
For work that needs a team, see How do I model skills, certifications, and crews?.