Product

Route Optimization is Eventually Cost Optimization | Part 1

Yuzhe YanYuzhe Yan
Route Optimization is Eventually Cost Optimization | Part 1

The ultimate goal of the route optimization API is to reduce last-mile delivery costs. The last-mile delivery model varies from one business to another. Route optimization API/tools that only optimize travel duration and distance may not fully meet the growing needs of real-world last-mile operations. LogisticsOS provides a highly detailed and customizable costing model in its route optimization engine. Users can optimize routes based on defined costs instead of just optimizing duration or distance. Keep reading to learn more about the benefits of choosing the best route optimization API - LogisticsOS.

Common costs in traditional last-mile delivery

A traditional delivery company usually has its own fleet of vehicles and employs drivers. There may be different types of vehicles operating in the fleet, such as vans, trucks, motorcycles, etc. Additionally, drivers may be paid differently based on their years of experience, types of vehicles they drive, employment status (part-time/full-time), etc. The cost can be broken down into three categories:

  1. Cost of fuel and vehicle maintenance (usually calculated based on the total distance traveled).
  2. Cost of labor (usually calculated based on the total working time).
  3. Cost of operations (including payroll, vehicle management/rental, insurance, etc.)

The scenario

Here is a real example of a delivery company that operates in North America and is also a customer of LogisticsOS. The company's Dallas branch has a fleet consisting of two different types of vehicles: 45 minivans and 15 trucks. The company employs 60 full-time drivers who receive a fixed yearly salary. The objective is to minimize delivery costs while ensuring that no driver works more than 9 hours per day. If any driver works more than 8 hours, the company must pay an overtime rate. See the JSON below for more details.

"vehicle_types": [
  {
    "id": "minivan",
    "count": 45,
    "capacity": 5000,
    "use_all_vehicles": false,
    "dispatch_after": 9,
    "dismiss_before": 18,
    "cost_params": {
      "cost_per_unit_distance": 0.35,
      "cost_per_unit_time": 0.0,
      "cost_per_unit_overtime": 50,
      "overtime_start": 8
    }
  },
  {
    "id": "truck",
    "count": 15,
    "capacity": 10000,
    "use_all_vehicles": false,
    "dispatch_after": 9,
    "dismiss_before": 18,
    "cost_params": {
      "cost_per_unit_distance": 0.65,
      "cost_per_unit_time": 0.0,
      "cost_per_unit_overtime": 40,
      "overtime_start": 8
    }
  }
],
"units": {
  "distance": "mile",
  "duration": "hour"
}

On a non-busy day

There are 2061 orders that need to be delivered by the fleet. We submitted the vehicle routing request to LogisticsOS backend, and the solver took 120 seconds to return an optimized solution. The summary of the solution is shown below.

"plan_summary": {
  "distance": 3066.47383399406,
  "total_time": 452.1644444444444,
  "travel_time": 122.40444444444445,
  "wait_time": 0.0,
  "late_time": 0.0,
  "service_time": 329.76,
  "num_routes": 57,
  "unassigned": 0,
  "assigned": 2061,
  "assigned_pairs": 0,
  "average_speed": "40.31 km/h",
  "total_cost": 1921.7435160790549
}

As we can see, the solver dispatched only 57 vehicles (45 minivans and 12 trucks) to deliver all the orders. Since the company employs 60 full-time drivers, this means that 3 of them would not have any work on that day. However, this is not an ideal scenario. The company wants to dispatch all the drivers to reduce the total delivery completion time, since they have to pay the annual salary to all of the drivers anyway. We set 'use_all_vehicles' to true for both trucks and minivans, and solve again. The new cost is higher since we forced the solver to dispatch all the vehicles. However, we see a reduction in the average route duration (see below).

"plan_summary": {
    "distance": 3168.6331042539177,
    "total_time": 454.06444444444446,
    "travel_time": 124.30444444444444,
    "wait_time": 0.0,
    "late_time": 0.0,
    "service_time": 329.76,
    "num_routes": 60,
    "unassigned": 0,
    "assigned": 2061,
    "assigned_pairs": 0,
    "average_speed": "41.02 km/h",
    "total_cost": 2064.619759169736
  }

On a busy day

There are 2622 orders that need to be delivered by the fleet, but they are facing a driver shortage. Even if they dispatch all the available vehicles, there will still be orders that remain unassigned. On busy days, the company outsources some of the deliveries to third-party logistics companies to help fulfill all the orders. The outsourced trucks have an hourly rate of $50 and a booking cost of $20, while the outsourced minivans are commission-based, with a rate of $7 for each successful delivery and an additional $0.2 per mile traveled. Now the fleet consists of both full-time employee drivers and third-party logistics drivers.

"vehicle_types": [
    {
      "id": "minivan",
      "count": 45,
      "capacity": 5000,
      "use_all_vehicles": true,
      "dispatch_after": 9,
      "dismiss_before": 18,
      "cost_params": {
        "cost_per_unit_distance": 0.35,
        "cost_per_unit_time": 0.0,
        "cost_per_unit_overtime": 50,
        "overtime_start": 8
      }
    },
    {
      "id": "truck",
      "count": 15,
      "capacity": 10000,
      "use_all_vehicles": true,
      "dispatch_after": 9,
      "dismiss_before": 18,
      "cost_params": {
        "cost_per_unit_distance": 0.65,
        "cost_per_unit_time": 0.0,
        "cost_per_unit_overtime": 40,
        "overtime_start": 8
      }
    },
    {
      "id": "out-sourced minivan",
      "count": 100,
      "capacity": 5000,
      "use_all_vehicles": false,
      "dispatch_after": 9,
      "dismiss_before": 18,
      "cost_params": {
        "cost_per_order": 8,
        "cost_per_unit_distance": 0.2
      }
    },
    {
      "id": "out-sourced truck",
      "count": 100,
      "capacity": 5000,
      "use_all_vehicles": false,
      "dispatch_after": 9,
      "dismiss_before": 18,
      "cost_params": {
        "cost_per_unit_time": 50,
        "fixed_cost": 20
      }
    }
  ]

We generated the JSON and passed it to LogisticsOS backend. It took the solver 150 seconds to return an optimized solution, utilizing all the full-time drivers and five outsourced minivans. The solver found that outsourcing minivans is cheaper in this case than outsourcing trucks.

"plan_summary": {
    "distance": 3340.945977854276,
    "total_time": 555.7683333333333,
    "travel_time": 136.24833333333333,
    "wait_time": 0.0,
    "late_time": 0.0,
    "service_time": 419.52,
    "num_routes": 65,
    "unassigned": 0,
    "assigned": 2622,
    "assigned_pairs": 0,
    "average_speed": "39.46 km/h",
    "total_cost": 4191.848702242327
  }

Summary

The costing model in real-world delivery operations can be very complicated. However, with the powerful cost optimization feature provided by LogisticsOS route optimization API, companies can model their real costs into the optimization process and achieve the goal of cost savings.

Optimization Result

About LogisticsOS

LogisticsOS is the most powerful route optimization system on the market. Our flexible, hosted route optimization and planning/replanning APIs require no knowledge of optimization techniques. High-quality results are returned within seconds— even at scale. From time reduction and vehicle capacity to depot automation and cost customization, our feature-rich software can create the efficiency and cost-savings that you need. Contact us today for a free product demo.