anyLogistix
Expand
Font size

Flower Logistics (Last Mile Optimization)

In this example, we will use the Last Mile Optimization experiment to optimize transportation routes in our supply chain by solving the Capacitated Vehicle Routing Problem with Time Windows (CVRPTW).

Problem Definition

A company transporting flowers in the Netherlands wants to improve the efficiency of its supply chain by implementing a process for solving the analytical task of scheduling deliveries with time windows and limited vehicle capacity.

Current Task

We are analyzing completed deliveries based on historical data to demonstrate how transport network optimization could have improved the outcome.

A total of 27 customers across various cities in the Netherlands were registered for the considered horizon.

Some orders had time windows defining when customers were ready to accept deliveries.

The company has 3 distribution centers from which deliveries to customers will be made. The warehouses are equipped with two types of vehicles with their own capacities and speeds.

For this task, we assume that loading vehicles for shipment from the warehouse takes 10-15 minutes.

Goals

Obtain an optimal shipment schedule relative to delivery time and distance traveled by vehicles, as well as loadings and unloadings of registered orders for customers across the country.

Solution

To create the required scenario, we perform the following steps:

  • Define customer demand as a Historic demand in the Demand table. Each customer generates demand daily for 3-4 days.
  • Create two types of vehicles:

  • Create a fleet for the distribution centers for each vehicle type (Fleets table):

  • Add necessary paths between all points on the map so that vehicles can move not only from distribution centers to customers but also between customers. These paths will be used for optimization (Paths table).
  • Add registered customer time windows during which they are ready to accept orders (Time Windows table).
  • Add loading and unloading gates to model the required processes of loading vehicles for delivery (Loading and Unloading Gates table). To simulate the stochastic nature of loading time, we use triangular distribution:

Running the Simulation experiment<

Let us run the Simulation experiment. Observing received result, we can see the following KPI metrics:

We can observe the complete fulfillment of all orders, as well as transportation costs according to the specified calculation policies. Additional statistics pages provide a more detailed overview of the run results.

It is important to note that LTL shipping policies were used in the Shipping table to model uncontrolled shipments. Because of this, couriers delivered one order at a time and waited at the customer's location until their time window for accepting goods opened. This scheme was used to demonstrate unorganized deliveries without centralized planning.

Setting up the Last Mile Optimization experiment

Last Mile Optimization essentially implements the CVRPTW, where:

  • Customers and distribution centers are defined.
  • Customers have their individual orders for specific product in certain amount.
  • There are time windows for distribution center/customer operations.
  • Vehicles have capacity limitations.
  • Various business constraints exist, such as mandatory return to the distribution center, maximum vehicle waiting time, etc.
  • The optimization goal is to build routes for each vehicle such that:
    • Each order is fulfilled exactly once.
    • Vehicle capacity constraints are respected.
    • Time windows for locations are not violated.
    • The total travel time is minimized.

Opening the Last Mile Optimization experiment settings panel allows us to define the planning horizon, vehicle types participating in the optimization (optimal ones will be selected for delivering specific sets of orders by a courier in a single trip), maximum shipment duration, maximum vehicle idle time, the enabled parameter for returning vehicles to the distribution center, and many others, which can be explored on the experiment settings page.

Preview Orders table suggests that all our customer orders registered for this day will be taken as input data for the optimizer:

Running the Last Mile Optimization experiment

After the allotted 60 seconds for optimization, the following result will be obtained:

In the Milk Runs dashboard page, all found routes can be seen, with the optimized delivery time by delivering orders to multiple customers at once.

Updating current scenario with the obtained solution

After obtaining the optimal solution, we apply it to the current scenario via the Shipments Table dashboard page in the Last Mile Optimization experiment statistics, selecting Update current scenario with the Keep the current structure setting enabled:

The entire structure of shipments, loadings, and unloadings will be imported into the current scenario in the form of scheduled shipping policies (Shipping table):

Next, we remove the old LTL policy records from here to ensure all customer shipments follow the optimally found schedule exclusively.

Re-running the Simulation experiment with the optimal schedule

Running the simulation experiment again, we can see the statistics:

In the current run, the Shipments dashboard page shows the history of all orders. The optimizer adjusted the shipment schedule so that each courier delivers as many orders as possible on a single trip, thereby minimizing the total distance traveled, which decreased by almost 50% compared to the unoptimized version.

Now, vehicles do not leave early but try to align with the customers' order acceptance schedules, departing when the customer is ready to accept the order. And in perspective, while delivering to the first, another customer will be ready to accept an order that the courier is also carrying. This creates milk runs, each of which can be seen in detail in the Last Mile Optimization experiment statistics:

Conclusion

The Last Mile Optimization experiment significantly improves delivery efficiency by intelligently planning routes considering time windows and fleet constraints, based on solving the CVRPTW problem.

Unlike scenarios with uncontrolled deliveries, using this optimization approach:

  • Reduces the total distance traveled by consolidating orders into routes.
  • Increases vehicle load rates, minimizing empty runs.
  • Lowers logistics costs by ensuring better resource allocation.
  • Allows importing found solutions into the scenario for further integration into supply chains.

Last Mile Optimization becomes a powerful tool for tactical planning in urban logistics, especially with high order density and strict time constraints. Its application enables data-driven decisions daily and easily scales the approach to other regions or time horizons.

How can we improve this article?