Route optimization
Overview
Optimize Route (under Generate Route in day view) reorders geocoded stops to reduce driving time and refreshes the map path between consecutive stops. The same control exists in:
- Route Scheduler (route-centric day view)
- Call Scheduler (cluster / call-list day view)
This page describes what happens when you run it and how directions between events are produced.
When the option appears
- Day view only — The Generate Route menu is not shown in month or other calendar layouts.
- At least one event on the current route must have a valid geocoded location (usable latitude and longitude). Events with missing or placeholder coordinates are skipped for optimization; you may see a warning, and those stops stay off the optimized path until addresses are fixed.
Before you run Optimize Route
- Resource shift — Optimization is designed for days where the resource has at least one assigned shift. Shift start and end locations, when configured, are treated as the first and last anchors of the route; only middle stops (your visits) are candidates for reordering.
- Accurate addresses — Poor geocoding produces wrong pins and unreliable travel estimates. Fix locations before relying on optimization.
Single shift on the day (typical)
When the resource has one shift for that day, the app calls a backend optimize endpoint that:
- Builds a coordinate list — Optional shift start, then each included event in the current list, then optional shift end.
- Proposes visit order — HERE waypoint sequencing finds a better order for the intermediate stops, optimizing for travel time (car, fastest path, traffic-aware settings in the API). The first and last points in that list stay fixed as origin and destination. If sequencing fails, the app falls back to the original stop order.
- Computes driving directions — HERE routing then builds a full car route through the stops in that final order. Directions between events are the road network segments HERE returns between each pair of consecutive stops: geometry (polyline), distance, and time for each segment (shown as legs on the map).
- Saves and refreshes — The visit order is stored on the shift (event sequence in metadata). The page reloads so the map and event list match the new order.
Multiple shifts on the same day
When the resource has more than one shift that day, the app uses a different pipeline (not the single-shift HERE sequence endpoint alone):
- MapQuest route matrix supplies all-pairs distance and time estimates between shift start/end locations and event locations.
- An internal vehicle routing (VRP) service assigns stops to shifts and orders them within solver constraints.
- MapQuest directions are requested per shift through the stops in that solution to draw map lines and leg summaries.
Treat this path as split-shift / complex routing: assignment across shifts happens first, then directions per shift.
Flow summary
flowchart TD ui[GenerateRoute_OptimizeRoute] branch{resourceShifts} single[One_shift] multi[Multiple_shifts] lambda[Backend_optimize_endpoint] hereSeq[HERE_stop_sequence] hereRoute[HERE_car_route] vrp[Internal_VRP_service] mqMatrix[MapQuest_distance_matrix] mqRoute[MapQuest_directions_per_shift] ui --> branch branch --> single --> lambda --> hereSeq --> hereRoute branch --> multi --> mqMatrix --> vrp --> mqRouteRelated pages
- Route Scheduler
- Call Scheduler
- Locations (geocoding and addresses)
- Resources (shifts)