Use eager delivery to prioritize sequential job completion

Standard cost optimization in HERE Tour Planning might defer nearby jobs to serve more distant ones first and require subsequent backtracking. In contrast, the eagerDelivery feature fundamentally shifts this focus by prioritizing immediate task completion. This feature focuses on serving delivery jobs sequentially at the earliest possible time rather than waiting to include them during a return trip. This is crucial for postal or waste management scenarios where drivers passing through without delivering post or collecting trash could cause service quality deterioration or result in customer complaints about being skipped.

While eagerDelivery influences the optimization algorithm to prefer serving jobs on the outbound journey, it does not guarantee that all jobs will be performed "on the way out," as the algorithm still balances eagerness with other optimization constraints such as cost thresholds and route efficiency, as the sample use cases demonstrate.

📘

Note

This is an ALPHA feature, which means it is new or experimental and under active development. Alpha features are provided for testing and feedback purposes. They may change significantly or might not become generally available.

For more information, see Explore experimental features.

Configure eager delivery within the minimizeCost objective

The eagerDelivery configuration is nested within the minimizeCost objective, as the following snippet demonstrates:

{
  "objectives": [
    {
      "type": "minimizeUnassigned"
    },
    {
      "type": "minimizeCost",
      "eagerDelivery": {
        "enabled": true,
        "tieThreshold": 0.1,
        "improvementThreshold": 0.001
      }
    }
  ]
}

The accompanying settings allow you to control the optimization algorithm's propensity for serving jobs as quickly as possible in the tour:

  • tieThreshold: Sets the acceptable range for cost increase to achieve more sequential delivery behavior. In the previous snippet, a value of 0.1 means that you accept tours up to 10% more expensive in return for a more eager solution.
  • improvementThreshold: Specifies the minimum percentage eagerness improvement required to justify accepting a cost increase. In the previous snippet, 0.001 (0.1%) means that even small improvements in serving jobs earlier in the tour are sufficient enough to return a more eager job sequence, as long as the cost increase stays within the 10% tieThreshold
  • additionalWeightAtFirstEdge (optional): An advanced parameter that controls the strength of the eager delivery bias across the tour (default: 0.5). Higher values amplify the preference for serving jobs with shorter distances early in the tour and longer distances later, creating a stronger sequential delivery behavior. The weight decreases monotonically from the first to the last stop.
📘

Note

  • The tieThreshold and improvementThreshold parameters create a safety boundary in which eager tours must provide meaningful improvement within acceptable cost limits.
  • Eager delivery might find solutions that improve both eagerness and efficiency simultaneously.

Compare routing behavior with and without eager delivery

This following sections provide a comparison of two scenarios; with and without the eagerDelivery feature. Both scenarios use identical fleet and plan configuration with six delivery jobs. The comparison reveals how using the eagerDelivery option affects the job sequence and tour efficiency.

The following figure shows the location of the depot and the jobs to serve:

Depot and job locations for the sample comparison scenario

Scenario 1: Standard cost optimization without eager delivery

The following baseline scenario does not use the eagerDelivery feature, as demonstrated by the objectives array that contains only minimizeUnassigned and minimizeCost objectives, without the eagerDelivery configuration.

See the following section for the full problem JSON:

Click to expand/collapse the sample JSON
{
  "fleet": {
    "types": [
      {
        "profile": "vehicle",
        "amount": 1,
        "capacity": [
          100
        ],
        "costs": {
          "time": 5e-7,
          "distance": 2e-7,
          "fixed": 100
        },
        "id": "vehicle_1",
        "shifts": [
          {
            "start": {
              "location": {
                "lat": 52.53107,
                "lng": 13.38489
              },
              "time": "2026-07-15T08:00:00+02:00"
            },
            "end": {
              "location": {
                "lat": 52.53107,
                "lng": 13.38489
              },
              "time": "2026-07-15T18:00:00+02:00"
            }
          }
        ]
      }
    ],
    "profiles": [
      {
        "name": "vehicle",
        "type": "car",
        "traffic": {
          "mode": "disabled"
        }
      }
    ]
  },
  "plan": {
    "jobs": [
      {
        "id": "job_1",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "duration": 300,
                  "location": {
                    "lat": 52.54104,
                    "lng": 13.41673
                  }
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "job_2",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "duration": 300,
                  "location": {
                    "lat": 52.54858489433329,
                    "lng": 13.4268818423152
                  }
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "job_3",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "duration": 300,
                  "location": {
                    "lat": 52.57003083236631,
                    "lng": 13.429714255034927
                  }
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "job_4",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "duration": 300,
                  "location": {
                    "lat": 52.55949180308455,
                    "lng": 13.427911810576918
                  }
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "job_5",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "duration": 300,
                  "location": {
                    "lat": 52.579106976087516,
                    "lng": 13.426967673003677
                  }
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "job_6",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "duration": 300,
                  "location": {
                    "lat": 52.54033768049578,
                    "lng": 13.401561789214613
                  }
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      }
    ]
  },
  "objectives": [
    {
      "type": "minimizeUnassigned"
    },
    {
      "type": "minimizeCost"
    }
  ]
}

Solution interpretation - baseline scenario

The following visualization shows the solution for the "non-eager" baseline scenario:

Solution showing heavy backtracking

The optimization algorithm produces the following job sequence: job_2 → job_3 → job_5 → job_4 → job_1 → job_6. In that sequence, the vehicle travels northeast to job_2, continues further northeast to job_3, then to the northernmost point at job_5, and then backtracks significantly south through job_4, job_1, and finally job_6 (near the depot). This route demonstrates heavy backtracking as the vehicle travels to the farthest point first, then returns south to serve jobs it could have served along the way.

This scenario highlights a case where the optimization algorithm prioritizes cost efficiency over operational feasibility as, for example, backtracking (especially on narrow streets) can be particularly troublesome for heavy garbage collection vehicles, risking damage to infrastructure or the vehicle, in addition to slowing down operations unnecessarily.

The following table summarizes the solution metrics for the baseline scenario:

MetricValue
Cost100.0058078
Distance18,934 meters
Duration4,042 seconds (67 minutes)

See the following section for the full solution JSON:

Click to expand/collapse the sample JSON
{
  "statistic": {
    "cost": 100.0058078,
    "distance": 18934,
    "duration": 4042,
    "times": {
      "break": 0,
      "driving": 2242,
      "serving": 1800,
      "stopping": 0,
      "waiting": 0,
      "intraStop": 0
    },
    "intraStopDistance": 0
  },
  "tours": [
    {
      "shiftIndex": 0,
      "statistic": {
        "cost": 100.0058078,
        "distance": 18934,
        "duration": 4042,
        "times": {
          "break": 0,
          "driving": 2242,
          "serving": 1800,
          "stopping": 0,
          "waiting": 0,
          "intraStop": 0
        },
        "intraStopDistance": 0
      },
      "stops": [
        {
          "activities": [
            {
              "jobId": "departure",
              "type": "departure",
              "location": {
                "lat": 52.53107,
                "lng": 13.38489
              },
              "time": {
                "end": "2026-07-15T06:00:00Z",
                "start": "2026-07-15T06:00:00Z",
                "arrival": "2026-07-15T06:00:00Z"
              }
            }
          ],
          "load": [
            6
          ],
          "time": {
            "arrival": "2026-07-15T06:00:00Z",
            "departure": "2026-07-15T06:00:00Z"
          },
          "distance": 0,
          "location": {
            "lat": 52.53107,
            "lng": 13.38489
          }
        },
        {
          "activities": [
            {
              "jobId": "job_2",
              "type": "delivery",
              "location": {
                "lat": 52.54858489433329,
                "lng": 13.4268818423152
              },
              "time": {
                "end": "2026-07-15T06:14:03Z",
                "start": "2026-07-15T06:09:03Z",
                "arrival": "2026-07-15T06:09:03Z"
              }
            }
          ],
          "load": [
            5
          ],
          "time": {
            "arrival": "2026-07-15T06:09:03Z",
            "departure": "2026-07-15T06:14:03Z"
          },
          "distance": 4040,
          "location": {
            "lat": 52.54858489433329,
            "lng": 13.4268818423152
          }
        },
        {
          "activities": [
            {
              "jobId": "job_3",
              "type": "delivery",
              "location": {
                "lat": 52.57003083236631,
                "lng": 13.429714255034929
              },
              "time": {
                "end": "2026-07-15T06:23:55Z",
                "start": "2026-07-15T06:18:55Z",
                "arrival": "2026-07-15T06:18:55Z"
              }
            }
          ],
          "load": [
            4
          ],
          "time": {
            "arrival": "2026-07-15T06:18:55Z",
            "departure": "2026-07-15T06:23:55Z"
          },
          "distance": 6736,
          "location": {
            "lat": 52.57003083236631,
            "lng": 13.429714255034929
          }
        },
        {
          "activities": [
            {
              "jobId": "job_5",
              "type": "delivery",
              "location": {
                "lat": 52.57910697608752,
                "lng": 13.426967673003675
              },
              "time": {
                "end": "2026-07-15T06:34:27Z",
                "start": "2026-07-15T06:29:27Z",
                "arrival": "2026-07-15T06:29:27Z"
              }
            }
          ],
          "load": [
            3
          ],
          "time": {
            "arrival": "2026-07-15T06:29:27Z",
            "departure": "2026-07-15T06:34:27Z"
          },
          "distance": 9682,
          "location": {
            "lat": 52.57910697608752,
            "lng": 13.426967673003675
          }
        },
        {
          "activities": [
            {
              "jobId": "job_4",
              "type": "delivery",
              "location": {
                "lat": 52.55949180308455,
                "lng": 13.427911810576918
              },
              "time": {
                "end": "2026-07-15T06:45:27Z",
                "start": "2026-07-15T06:40:27Z",
                "arrival": "2026-07-15T06:40:27Z"
              }
            }
          ],
          "load": [
            2
          ],
          "time": {
            "arrival": "2026-07-15T06:40:27Z",
            "departure": "2026-07-15T06:45:27Z"
          },
          "distance": 13124,
          "location": {
            "lat": 52.55949180308455,
            "lng": 13.427911810576918
          }
        },
        {
          "activities": [
            {
              "jobId": "job_1",
              "type": "delivery",
              "location": {
                "lat": 52.54104,
                "lng": 13.41673
              },
              "time": {
                "end": "2026-07-15T06:56:17Z",
                "start": "2026-07-15T06:51:17Z",
                "arrival": "2026-07-15T06:51:17Z"
              }
            }
          ],
          "load": [
            1
          ],
          "time": {
            "arrival": "2026-07-15T06:51:17Z",
            "departure": "2026-07-15T06:56:17Z"
          },
          "distance": 16058,
          "location": {
            "lat": 52.54104,
            "lng": 13.41673
          }
        },
        {
          "activities": [
            {
              "jobId": "job_6",
              "type": "delivery",
              "location": {
                "lat": 52.54033768049578,
                "lng": 13.401561789214613
              },
              "time": {
                "end": "2026-07-15T07:03:50Z",
                "start": "2026-07-15T06:58:50Z",
                "arrival": "2026-07-15T06:58:50Z"
              }
            }
          ],
          "load": [
            0
          ],
          "time": {
            "arrival": "2026-07-15T06:58:50Z",
            "departure": "2026-07-15T07:03:50Z"
          },
          "distance": 17227,
          "location": {
            "lat": 52.54033768049578,
            "lng": 13.401561789214613
          }
        },
        {
          "activities": [
            {
              "jobId": "arrival",
              "type": "arrival",
              "location": {
                "lat": 52.53107,
                "lng": 13.38489
              },
              "time": {
                "end": "2026-07-15T07:07:22Z",
                "start": "2026-07-15T07:07:22Z",
                "arrival": "2026-07-15T07:07:22Z"
              }
            }
          ],
          "load": [
            0
          ],
          "time": {
            "arrival": "2026-07-15T07:07:22Z",
            "departure": "2026-07-15T07:07:22Z"
          },
          "distance": 18934,
          "location": {
            "lat": 52.53107,
            "lng": 13.38489
          }
        }
      ],
      "typeId": "vehicle_1",
      "vehicleId": "vehicle_1_1"
    }
  ]
}

Scenario 2: Sequential delivery with eager delivery enabled

In this updated problem, the objectives array now includes the eagerDelivery feature, as shown in the following snippet:

{
  "objectives": [
    {
      "type": "minimizeUnassigned"
    },
    {
      "type": "minimizeCost",
      "eagerDelivery": {
        "enabled": true,
        "tieThreshold": 0.2,
        "improvementThreshold": 0.001
      }
    }
  ]
}

This change forces the optimization algorithm to favor solutions that serve jobs more sequentially throughout the tour, accepting a cost increase up to the specified tieThreshold (20% in this case) to achieve more eager delivery behavior. Other problem parameters, including fleet and plan configuration, remain unchanged.

See the following section for the full problem JSON:

Click to expand/collapse the sample JSON
{
  "fleet": {
    "types": [
      {
        "profile": "vehicle",
        "amount": 1,
        "capacity": [
          100
        ],
        "costs": {
          "time": 5e-7,
          "distance": 2e-7,
          "fixed": 100
        },
        "id": "vehicle_1",
        "shifts": [
          {
            "start": {
              "location": {
                "lat": 52.53107,
                "lng": 13.38489
              },
              "time": "2026-07-15T08:00:00+02:00"
            },
            "end": {
              "location": {
                "lat": 52.53107,
                "lng": 13.38489
              },
              "time": "2026-07-15T18:00:00+02:00"
            }
          }
        ]
      }
    ],
    "profiles": [
      {
        "name": "vehicle",
        "type": "car",
        "traffic": {
          "mode": "disabled"
        }
      }
    ]
  },
  "plan": {
    "jobs": [
      {
        "id": "job_1",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "duration": 300,
                  "location": {
                    "lat": 52.54104,
                    "lng": 13.41673
                  }
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "job_2",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "duration": 300,
                  "location": {
                    "lat": 52.54858489433329,
                    "lng": 13.4268818423152
                  }
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "job_3",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "duration": 300,
                  "location": {
                    "lat": 52.57003083236631,
                    "lng": 13.429714255034927
                  }
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "job_4",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "duration": 300,
                  "location": {
                    "lat": 52.55949180308455,
                    "lng": 13.427911810576918
                  }
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "job_5",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "duration": 300,
                  "location": {
                    "lat": 52.579106976087516,
                    "lng": 13.426967673003677
                  }
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "job_6",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "duration": 300,
                  "location": {
                    "lat": 52.54033768049578,
                    "lng": 13.401561789214613
                  }
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      }
    ]
  },
  "objectives": [
    {
      "type": "minimizeUnassigned"
    },
    {
      "type": "minimizeCost",
      "eagerDelivery": {
        "enabled": true,
        "tieThreshold": 0.2,
        "improvementThreshold": 0.001
      }
    }
  ]
}

Solution interpretation - eager delivery

As the following visualization demonstrates, the job sequence resulting from the addition of the eagerDelivery feature has transformed significantly:

Solution showing eager delivery

The updated sequence looks as follows: job_6 → job_1 → job_2 → job_4 → job_3 → job_5.

In this eager delivery scenario, the vehicle now serves jobs more sequentially as it encounters them, traveling in a smooth progression from southwest to northeast. Starting with job_6 (southwest), the route progresses through job_1, job_2, job_4, job_3, and finally job_5 (the northernmost point). Unlike the baseline scenario, this solution eliminates the heavy backtracking pattern, resulting in a more operationally efficient route that serves jobs as the vehicle naturally progresses through its territory.

Click to expand/collapse the sample JSON
{
  "statistic": {
    "cost": 100.0058458,
    "distance": 18789,
    "duration": 4176,
    "times": {
      "break": 0,
      "driving": 2376,
      "serving": 1800,
      "stopping": 0,
      "waiting": 0,
      "intraStop": 0
    },
    "intraStopDistance": 0
  },
  "tours": [
    {
      "shiftIndex": 0,
      "statistic": {
        "cost": 100.0058458,
        "distance": 18789,
        "duration": 4176,
        "times": {
          "break": 0,
          "driving": 2376,
          "serving": 1800,
          "stopping": 0,
          "waiting": 0,
          "intraStop": 0
        },
        "intraStopDistance": 0
      },
      "stops": [
        {
          "activities": [
            {
              "jobId": "departure",
              "type": "departure",
              "location": {
                "lat": 52.53107,
                "lng": 13.38489
              },
              "time": {
                "end": "2026-07-15T06:00:00Z",
                "start": "2026-07-15T06:00:00Z",
                "arrival": "2026-07-15T06:00:00Z"
              }
            }
          ],
          "load": [
            6
          ],
          "time": {
            "arrival": "2026-07-15T06:00:00Z",
            "departure": "2026-07-15T06:00:00Z"
          },
          "distance": 0,
          "location": {
            "lat": 52.53107,
            "lng": 13.38489
          }
        },
        {
          "activities": [
            {
              "jobId": "job_6",
              "type": "delivery",
              "location": {
                "lat": 52.54033768049578,
                "lng": 13.401561789214613
              },
              "time": {
                "end": "2026-07-15T06:08:51Z",
                "start": "2026-07-15T06:03:51Z",
                "arrival": "2026-07-15T06:03:51Z"
              }
            }
          ],
          "load": [
            5
          ],
          "time": {
            "arrival": "2026-07-15T06:03:51Z",
            "departure": "2026-07-15T06:08:51Z"
          },
          "distance": 1720,
          "location": {
            "lat": 52.54033768049578,
            "lng": 13.401561789214613
          }
        },
        {
          "activities": [
            {
              "jobId": "job_1",
              "type": "delivery",
              "location": {
                "lat": 52.54104,
                "lng": 13.41673
              },
              "time": {
                "end": "2026-07-15T06:17:06Z",
                "start": "2026-07-15T06:12:06Z",
                "arrival": "2026-07-15T06:12:06Z"
              }
            }
          ],
          "load": [
            4
          ],
          "time": {
            "arrival": "2026-07-15T06:12:06Z",
            "departure": "2026-07-15T06:17:06Z"
          },
          "distance": 2909,
          "location": {
            "lat": 52.54104,
            "lng": 13.41673
          }
        },
        {
          "activities": [
            {
              "jobId": "job_2",
              "type": "delivery",
              "location": {
                "lat": 52.54858489433329,
                "lng": 13.4268818423152
              },
              "time": {
                "end": "2026-07-15T06:26:17Z",
                "start": "2026-07-15T06:21:17Z",
                "arrival": "2026-07-15T06:21:17Z"
              }
            }
          ],
          "load": [
            3
          ],
          "time": {
            "arrival": "2026-07-15T06:21:17Z",
            "departure": "2026-07-15T06:26:17Z"
          },
          "distance": 4733,
          "location": {
            "lat": 52.54858489433329,
            "lng": 13.4268818423152
          }
        },
        {
          "activities": [
            {
              "jobId": "job_4",
              "type": "delivery",
              "location": {
                "lat": 52.55949180308455,
                "lng": 13.427911810576918
              },
              "time": {
                "end": "2026-07-15T06:35:32Z",
                "start": "2026-07-15T06:30:32Z",
                "arrival": "2026-07-15T06:30:32Z"
              }
            }
          ],
          "load": [
            2
          ],
          "time": {
            "arrival": "2026-07-15T06:30:32Z",
            "departure": "2026-07-15T06:35:32Z"
          },
          "distance": 6421,
          "location": {
            "lat": 52.55949180308455,
            "lng": 13.427911810576918
          }
        },
        {
          "activities": [
            {
              "jobId": "job_3",
              "type": "delivery",
              "location": {
                "lat": 52.57003083236631,
                "lng": 13.429714255034929
              },
              "time": {
                "end": "2026-07-15T06:43:54Z",
                "start": "2026-07-15T06:38:54Z",
                "arrival": "2026-07-15T06:38:54Z"
              }
            }
          ],
          "load": [
            1
          ],
          "time": {
            "arrival": "2026-07-15T06:38:54Z",
            "departure": "2026-07-15T06:43:54Z"
          },
          "distance": 8276,
          "location": {
            "lat": 52.57003083236631,
            "lng": 13.429714255034929
          }
        },
        {
          "activities": [
            {
              "jobId": "job_5",
              "type": "delivery",
              "location": {
                "lat": 52.57910697608752,
                "lng": 13.426967673003675
              },
              "time": {
                "end": "2026-07-15T06:54:26Z",
                "start": "2026-07-15T06:49:26Z",
                "arrival": "2026-07-15T06:49:26Z"
              }
            }
          ],
          "load": [
            0
          ],
          "time": {
            "arrival": "2026-07-15T06:49:26Z",
            "departure": "2026-07-15T06:54:26Z"
          },
          "distance": 11222,
          "location": {
            "lat": 52.57910697608752,
            "lng": 13.426967673003675
          }
        },
        {
          "activities": [
            {
              "jobId": "arrival",
              "type": "arrival",
              "location": {
                "lat": 52.53107,
                "lng": 13.38489
              },
              "time": {
                "end": "2026-07-15T07:09:36Z",
                "start": "2026-07-15T07:09:36Z",
                "arrival": "2026-07-15T07:09:36Z"
              }
            }
          ],
          "load": [
            0
          ],
          "time": {
            "arrival": "2026-07-15T07:09:36Z",
            "departure": "2026-07-15T07:09:36Z"
          },
          "distance": 18789,
          "location": {
            "lat": 52.53107,
            "lng": 13.38489
          }
        }
      ],
      "typeId": "vehicle_1",
      "vehicleId": "vehicle_1_1"
    }
  ]
}

The following table compares the solution metrics between the baseline (standard cost optimization) and the eager delivery scenarios:

MetricBaselineEager DeliveryChange
Cost100.0058078100.0058458+0.000038
Distance18,934 meters18,789 meters-145 meters
Duration4,042 seconds (67 min)4,176 seconds (69 min)+134 seconds

The eager delivery scenario demonstrates improved route efficiency compared to the baseline solution. The cost increase is negligible (0.00004%), and notably, the distance actually decreases by 145 meters (0.77%) due to eliminating the heavy backtracking pattern. The duration increases by 134 seconds (3.3%), which represents a small trade-off for achieving a more operationally feasible route. All metrics remain well within the accepted 20% tieThreshold tolerance configured in this example.

This demonstrates the practical benefit of eager delivery: the algorithm achieves improved customer experience and operational efficiency without exceeding acceptable cost constraints. Jobs are served sequentially as the vehicle encounters them, reducing the perception of being skipped and improving real-world scenarios, such as waste management or postal delivery.

Next steps


Did this page help you?