Re-Optimizing A Route Plan

In dynamic logistics environments, routing plans must often adapt to real-time changes—whether due to last-minute task cancellations, new incoming orders, or vehicle availability changes. The re-optimization feature enables users to efficiently update an existing route plan by referencing its original request ID and applying incremental changes to vehicles or tasks. This avoids the need to re-run the entire optimization process from scratch, significantly reducing response times and improving operational agility. Re-optimization is particularly valuable in use cases such as field service operations, on-demand delivery, NEMT scheduling, grocery distribution, and other industries where routing decisions evolve continuously due to dynamic real-world constraints.

Here's a practical example to illustrate the utility of the re-optimization feature.

Sample Use Case: NEMT Scheduling

Consider a Non-Emergency Medical Transportation (NEMT) provider managing daily appointments for 3 vehicles servicing a mix of dialysis, physical therapy, and outpatient visits. Early in the day, an optimized route plan for 6 patients’ pickup and dropoff is generated and dispatched to drivers.

Here is the original route optimization problem and the associated optimized route plan:

1
curl --location 'https://api.nextbillion.io/optimization/v2?key=<your_api_key>'
2
--header 'Content-Type: application/json'
3
--data '{
4
"description":"Re_Optimization Example",
5
"shipments":"[..]",
6
"vehicles":"[..]"
7
}'

Once the request is successfully submitted, we get a unique ID in the response:

1
{
2
"id": "21ad9df701583891ac1aadd754258748",
3
"message": "Optimization job created",
4
"status": "Ok"
5
}

We use the unique ID above to retrieve the optimized route plan:

1
{
2
"description": "Re_Optimization Example",
3
"result": "{...}"
4
}

We can see from the suggested route plan that only 2 vans were used out of the 3 available to complete all the patient drop-offs. However, shortly after dispatching this route, a few changes occur:

  • Two patients cancel their trips after postponing appointments to different dates.
  • A nearby clinic calls in with two new urgent pickups for same-day appointments.

Without re-optimization capabilities, adapting to these changes would require removing canceled tasks from the dispatched routes and re-running the entire route optimization from scratch. Consequently, apart from losing time in planning the routes again, the dispatcher also risks unnecessary disruption resulting from completely new routes, even if a driver’s individual assignments hadn’t been directly affected.

With re-optimization, however, the system retains the structure of the existing plan with minimal changes to accommodate targeted updates - remove the canceled tasks and add the urgent pickups. This approach ensures continuity, reduces dispatcher workload, and enables real-time responsiveness—all crucial in a service environment where punctuality and passenger experience are non-negotiable.

Let’s understand how the Re-Optimization feature of Route Optimization API overcomes dynamic changes to the routing constraints.

Example API Request

We use the re-optimization method along with the unique ID of the original request to accommodate the new changes - adding 2 urgent patient pickups & dropoff details and removing two shipments which were cancelled - into the existing route plan.

1
curl --location 'https://api.nextbillion.io/optimization/re_optimization?key=<your_api_key>'
2
--header 'Content-Type: application/json'
3
--data '{
4
"existing_request_id": "21ad9df701583891ac1aadd754258748",
5
"shipment_changes":"{..}",
6
}'

Example API Response

1
{
2
"description": "Re_Optimization Example",
3
"result": "{...}"
4
}

Interpreting the Re-Optimized Route Plan

  • In the re-optimized route plan all 3 vehicles were used to accommodate the new urgent appointments.

  • Upon taking a closer look we observe the changes to the original route plan were intelligently accommodated in the new route plan.

    • Originally, NEMT Van 2 was responsible for Patient Pickups 1, 2, 3, 4. In the new plan the vehicle retained the pickups 3, 4 which were not affected directly. Since the Patients 1 & 2 cancelled their trips, those stops were simply removed from the vehicle’s route plan without any other changes to its trip.

    • NEMT Van 1 was not assigned any pickups initially as there was no need. However, the new plan utilized this previously idle vehicle to handle urgent pickups while ensuring no other stops are added to its route.

    • Since the original pickups for NEMT Van 3 were not directly affected by the changing constraints, its original route plan was retained as-is in the re-optimized solution as well.

What We Learned?

This example illustrates how re-optimization enables routing systems to adapt to real-world changes in a controlled, efficient manner. Rather than recalculating the entire solution from scratch, the optimizer applies targeted updates—removing only the affected appointments and intelligently utilizing available resources to accommodate new ones. Unaffected vehicle assignments remain stable, minimizing operational disruption and communication overhead. For highly dynamic logistics operations where constraints change constantly, incremental route corrections via re-optimization ensure service standards are honoured in the face of volatility, providing business owners a powerful lever for scalability and resilience.

Learn more about the other powerful features and the related use cases that Route Optimization API can solve for you.

© 2025 NextBillion.ai all rights reserved.