Avoid overloading your trucks

When you are delivering larger items, it is imperative that you consider capacity constraints of your vehicles. Otherwise, the optimized routes may assign more deliveries to a vehicle than it can handle in reality.

To enable capacity constraints, each visit must set the load parameter to a numeric value. Also, each vehicle should have a value for its capacity parameter. The values for these parameters are unit-agnostic, so they can denote whatever unit makes sense for your business operations.

For example, if you deliver small, medium, and large packages, you can specify each delivery in the smallest common denominator – in this case a small package. A medium package could be the size of 4 small packages, etc. Now you can set the maximum capacity of a vehicle to the total amount of small packages that can fit in a vehicle.

📘

Pickups and dropoffs

If you need to do same-day pickup and delivery – i.e. one order has a pickup location and a dropoff location – please have a look at the Pickup and Delivery API.

{
  "visits": {
    "order_1": {
      "location": {
        "name": "6800 Cambie",
        "lat": 49.227107,
        "lng": -123.1163085
      },
      "load": 5
    },
    "order_2": {
      "location": {
        "name": "3780 Arbutus",
        "lat": 49.2474624,
        "lng": -123.1532338
      },
      "load": 2
    },
    "order_3": {
      "location": {
        "name": "800 Robson",
        "lat": 49.2819229,
        "lng": -123.1211844
      },
      "load": 10
    }
  },
  "fleet": {
    "vehicle_1": {
      "start_location": {
        "id": "depot",
        "name": "800 Kingsway",
        "lat": 49.2553636,
        "lng": -123.0873365
      },
      "capacity": 8
    }
  }
}
{
  "status": "success",
  "total_travel_time": 16.816668,
  "total_idle_time": 0,
  "num_unserved": 1,
  "unserved": { order_3: 'cannot be visited with the current fleet' },
  "solution": {
    "vehicle_1": [
      {
        "location_id": "depot",
        "location_name": "800 Kingsway"
      },
      {
        "location_id": "order_1",
        "location_name": "6800 Cambie"
      },
      {
        "location_id": "order_2",
        "location_name": "3780 Arbutus"
      }
    ]
  }
}