Multi stop route planning and delivery optimization

Multi Stop Route Planning & Optimization for Delivery

Solve the vehicle routing problem with the right API for your workflow

Multi-stop delivery planning is more than visiting addresses in the right order. It means assigning stops across vehicles, respecting constraints like time windows and capacities, and reducing mileage, fuel use, and delivery delays.

What is multi stop route optimization?

Multi stop route optimization is a way to plan the best stop order and vehicle assignment for one or more routes, so you can optimize delivery by time, distance, cost, or a combination of these factors. For example, if you have 60 packages and 5 vehicles, the task is to decide which vehicle delivers which packages and in what order.

What the optimizer must consider

Route optimization is more than finding the shortest path between points. It has to account for operational constraints such as:

ConstraintDescription
Time windowsEach stop must be visited within a specific time range.
Vehicle capacityA vehicle can only carry a limited number of packages, parcels, or goods.
Service timesSome stops take longer because of loading, unloading, or customer handling.
Working hours and breaksDrivers and field teams may only operate during certain hours and need breaks.
Stop prioritiesSome deliveries or pickups must be completed before others.
Vehicle or road restrictionsNot every vehicle can use every road or reach every location.

Operational benefits

The result is a practical delivery plan that shows which vehicle handles which stops and in what order. That usually means fewer miles, lower fuel cost, better fleet utilization, and fewer late arrivals.

Route planner timeline for multiple vehicles
Example of route planning for multiple vehicles and stop assignments

Common use cases for multi stop delivery

Multi stop delivery planning is used when one team, vehicle, or fleet needs to visit several locations in one run. Typical scenarios include:

  • Delivery and pickup routes
    Courier, parcel, food, and e-commerce routes where stops must be assigned to vehicles in a specific order. These routes often need to balance the number of stops per vehicle and keep the total driving time within a limit.

    Example: one driver drops bakery orders at 12 cafes and picks up empty crates on the return trip.

  • Bus and shuttle routes
    Pickup routes with several fixed stops. The route has to fit a fixed schedule and cover all pickups before the destination arrival time.

    Example: a morning shuttle collects employees from four apartment blocks before 8:30.

  • Truck fleet management
    Regional deliveries split across multiple vehicles. The planner needs to assign shipments across trucks and keep routes feasible for capacity and working-hour limits.

    Example: five trucks distribute store replenishment loads across a regional delivery area.

  • Field service visits
    Technician or field agent visits with time windows and priority stops. In practice, this usually means fitting customer visits into a workday without missing urgent jobs.

    Example: a service team schedules eight stops, with one urgent repair visit first.

  • Waste collection routes
    Recurring collection routes with a fixed area and return-to-depot requirement. These routes are often repeated daily or weekly with the same depots and service areas.

    Example: one truck covers a recycling zone and returns to the depot before the station closes.

  • Healthcare and emergency services
    Medical delivery and service routes with fixed time windows. These routes usually need higher priority handling because delays can affect care or supply availability.

    Example: a pharmacy van delivers medicines to six clinics with morning and afternoon delivery windows.

These scenarios usually need stop ordering, vehicle assignment, and constraint handling.

How to solve the Route Optimization task

There are two classes of route optimization solutions: ready-to-use products and APIs.

Ready-to-use products such as OptimoRoute, Shipday, Onfleet, Route4Me, and Routific can get you started quickly with stop ordering, vehicle assignment, and route constraints.

Geoapify's Route Planner API is the option for building that kind of functionality into your own product or workflow, with more control over the implementation and a setup that can be more cost-efficient for some use cases.

Ready-to-use productsRoute Planner API
Pros
  • Easy to start with.
  • Requires minimal setup.
  • Handles stop ordering and vehicle assignment.
Cons
  • Less control over the workflow and optimization logic.
  • Price can grow quickly as usage increases.
Pros
  • Solves multi-stop route optimization directly.
  • Customizable for a specific use case.
  • You pay for API calls only, so usage stays tied to the workload.
  • Fits common delivery and service workflows.
Cons
  • You need to build the product or workflow around the API.
  • AI coding tools can speed up integration, UI work, and tests, but they do not remove the need to own the implementation.

If you want to build your own route optimization solution, Route Planner API gives you the optimization logic directly, so you can focus on integrating route planning into your product or workflow instead of assembling the routing components yourself.

Example of multi-stop delivery optimization

Here is the task we will solve with the Route Planner API:

  • Three vehicles start from nearby locations.
  • Each vehicle has up to three hours available.
  • The workload contains 85 orders: 67 deliveries and 18 pickups.
  • Some shipments start at a shared depot and go to customers.
  • Some shipments start at customer locations and return to the depot.
  • The goal is to assign shipments across the vehicles and build balanced routes for each driver.

API request

Geoapify Route Planner API solves this route optimization task directly. You can try the same workflow in the Route Planner Playground, including pickup and delivery scenarios.

{
  "mode": "drive",
  "type": "balanced",
  "traffic": "free_flow",
  "locations": [
    {
      "id": "storage-0",
      "location": [-97.2423886, 32.931409]
    }
  ],
  "agents": [
    {
      "start_location": [-97.2538512, 32.93961],
      "time_windows": [[0, 10800]]
    },
    {
      "start_location": [-97.2503941, 32.9351346],
      "time_windows": [[0, 10800]]
    },
    {
      "start_location": [-97.2499247, 32.9334738],
      "time_windows": [[0, 10800]]
    }
  ],
  "shipments": [
    {
      "id": "order_1",
      "pickup": {
        "location_index": 0,
        "duration": 120
      },
      "delivery": {
        "location": [-97.2519233, 32.9393019],
        "duration": 120
      }
    },
    /* more shipments*/
  ]
}

In this request:

  • agents define the available vehicles and their working time.
  • locations define shared points such as the depot.
  • shipments define what needs to be picked up and delivered.
  • location_index: 0 points to the first item in the locations array, so repeated depot references do not need to include full coordinates each time.

API response

The API returns a GeoJSON FeatureCollection, so the result can be rendered on a map directly and processed as structured route data. The response below is a simplified example. You can inspect a live response in the Route Planner Playground.

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "agent_index": 0,
        "mode": "drive",
        "time": 7632,
        "distance": 11655,
        "start_time": 0,
        "end_time": 7632,
        "waypoints": [
          /* More waypoints */,
          {
            "original_location": [-97.2519233, 32.9393019],
            "location": [-97.251617, 32.939295],
            "start_time": 79,
            "duration": 120,
            "actions": [
              {
                "type": "pickup",
                "shipment_id": "order_3",
                "waypoint_index": 1
              }
            ]
          },
          /* More waypoints */,
        ]
      },
      "geometry": { /* MultiLineString */ }
    }
  ]
}

In this response:

  • features contain the calculated agent plans. Each feature corresponds to one agent.
  • properties.agent_index identifies which agent the route belongs to.
  • time, distance, start_time, and end_time describe the route summary.
  • actions list what happens on the route, such as start, pickup, and delivery.
  • waypoints describe the route stops with mapped coordinates, timing, and related actions.
  • geometry contains the route line as GeoJSON coordinates.

JavaScript / TypeScript SDK

If you build with JavaScript or TypeScript, use @geoapify/route-planner-sdk. The SDK helps you build Route Planner API requests, execute optimization tasks, inspect structured results, modify plans, and generate timelines in both browser and Node.js environments. Additional package links: GitHub, SDK docs.

It also supports post-optimization plan changes. For example, you can:

  • reassign shipments between agents
  • remove jobs or shipments
  • add new jobs or shipments
  • update the optimized result and regenerate the plan structure
  • build timelines from the modified result

How Much Does Multi-Stop Route Planning Cost?

Route Planner API request cost is measured in credits. You can start with the Free Plan with 3000 credits per day and estimate larger workloads from the formula below.

Some example plans are:

  • Free: 3000 credits / day
  • API 10: 10,000 credits / day
  • API 25: 25,000 credits / day
  • API 50: 50,000 credits / day

Businesses can choose the plan that fits their request volume and route complexity. For plan limits and current pricing, see the pricing page.

Cost in credits

The cost of a Route Planner API request depends on the number of unique locations used in the request.

Geoapify builds that number from all coordinates used by the task, including:

  • locations
  • agent.start_location
  • agent.end_location
  • job.location
  • shipment.pickup
  • shipment.delivery

The Route Planner cost is calculated as:

cost = n * min(n, 10)

Where n is the number of unique locations.

Tutorials

Check out our tutorials to make it easy to get started and get the results you want with Multi-Stop Route Planning:

Optimal route for 3 delivery trucks with delivery and pickup jobs

Delivery & Pickup Route Optimization With Route Planner API

How to optimize delivery routes? Use our playground and check code samples to discover how to solve delivery route optimization tasks.
Optimal route for 3 delivery trucks with delivery and pickup jobs

How to optimize routes and schedules for workers with Route Planner API

Find the best schedules and optimal routes for workers considering time windows, required skills and tools.
Optimize school buses routes with Route Planner API

Bus route optimization with Route Planner API

Learn how to define bus route optimization task in terms of Route Planner API. Use code samples to develop a custom solutions.

Next steps

FAQ

What is multi stop route optimization?

Multi stop route optimization is a way to plan the best stop order and vehicle assignment for one or more routes, so you can optimize delivery by time, distance, cost, or a combination of these factors.

How does Geoapify solve multi stop route optimization?

Geoapify solves this task with the Route Planner API, which supports multi-vehicle route planning, pickups and deliveries, time windows, and route constraints.

How is Route Planner API pricing calculated?

Route Planner API uses a credit-based model based on the number of unique locations in the request. Coordinates from locations, agents, jobs, and shipments are collected first, duplicates are removed, and the request cost is then calculated from the resulting unique-location count. See the pricing section above for the formula and examples.

What counts as a unique location in a Route Planner API request?

Unique locations are built from all coordinates used by the task, including shared locations, agent start or end points, job locations, and shipment pickup or delivery points. If the same coordinate is used more than once, it is counted once.

What does the Route Planner API return?

The API returns a GeoJSON FeatureCollection where each feature contains one agent plan, including route geometry, route summary, actions, and waypoints.

Can I modify the optimized plan after calculation?

Yes. In JavaScript and TypeScript, you can use @geoapify/route-planner-sdk to reassign shipments, remove stops, update plans, and build timelines.

Does Geoapify support pickups and deliveries in the same task?

Yes. Route Planner API supports mixed pickup and delivery workflows in the same optimization task, including depot-to-customer and customer-to-depot shipments.

Does Geoapify support time windows and multiple vehicles?

Yes. Route Planner API supports multiple vehicles, agent working hours, and time-constrained pickup or delivery stops.

What is the maximum size of a Route Planner API task?

The synchronous Route Planner API supports up to 300 unique locations per optimization task by default. For larger asynchronous workloads, use the Batch API, which supports bigger route-planning jobs up to 1000 locations in background mode.

World map

Ready to get started?

Explore the Route Planner API or try the playground to start building your route optimization workflow.

Contact us if you need help choosing the right setup.