Skip to content
JAOT

Route & Fleet Optimization

Overview

Route and fleet optimization finds the best set of routes for delivery vehicles to visit all required locations while minimizing total distance, time, or cost. Known in operations research as the Vehicle Routing Problem (VRP), this is one of the most widely applied optimization problems in business -- every company that moves physical goods can benefit.

Even modest route improvements of 10-15% translate directly to fuel savings, reduced driver hours, and fewer vehicles needed to serve the same customer base.

When to Use This

Best for: Logistics managers, dispatchers, and fleet operators who need to plan daily delivery routes for multiple vehicles with capacity limits, time windows, and driver constraints.

  • Scenario: You have a fleet of vehicles at a depot that must deliver to multiple customer locations, and you need to determine which vehicle visits which customers and in what order
  • Industry: Last-mile delivery, courier services, food delivery, field service, waste collection, retail distribution, e-commerce fulfillment
  • ROI: Typical reduction of 10-25% in total distance traveled, 15-30% fewer vehicles needed, and improved on-time delivery rates

Step-by-Step Walkthrough

1. Define delivery locations

List each customer or delivery point with its address (or coordinates), demand quantity (packages, weight, volume), and any time window requirements (e.g., deliver between 9 AM and 12 PM).

2. Configure your fleet

Define each vehicle's capacity (weight or volume), operating cost per mile, maximum route duration, and starting depot location. Different vehicle types may have different capacities and costs.

3. Set routing constraints

Include practical rules:

  • Vehicle capacity limits
  • Customer time windows
  • Maximum driving hours per driver
  • Lunch break requirements
  • Priority customers that must be served first

4. Choose the objective

Common goals:

  • Minimize total distance across all routes
  • Minimize total cost (fuel + driver time + vehicle depreciation)
  • Minimize the number of vehicles used

Route Optimization in JAOT Builder

5. Review and dispatch routes

The solver assigns customers to vehicles and determines visit order. Review each route for practicality, check that all time windows are met, and verify total capacity utilization. Export routes to your dispatch system or navigation tools.

Example Parameters

import httpx

API_URL = "https://api.jaot.io/api/v2"
headers = {"Authorization": "Bearer ok_live_your_key_here"}

# Route 3 vehicles to 8 delivery locations (simplified assignment)
response = httpx.post(f"{API_URL}/solve", headers=headers, json={
    "variables": [
        # assign_location_to_vehicle (1 = assigned)
        {"name": "loc1_vehicle_a", "type": "binary"},
        {"name": "loc1_vehicle_b", "type": "binary"},
        {"name": "loc2_vehicle_a", "type": "binary"},
        {"name": "loc2_vehicle_b", "type": "binary"},
        {"name": "loc3_vehicle_a", "type": "binary"},
        {"name": "loc3_vehicle_b", "type": "binary"},
        {"name": "loc4_vehicle_a", "type": "binary"},
        {"name": "loc4_vehicle_b", "type": "binary"},
        {"name": "loc5_vehicle_a", "type": "binary"},
        {"name": "loc5_vehicle_b", "type": "binary"},
        {"name": "loc6_vehicle_a", "type": "binary"},
        {"name": "loc6_vehicle_b", "type": "binary"},
    ],
    "objective": {
        "sense": "minimize",
        "coefficients": {
            "loc1_vehicle_a": 12, "loc1_vehicle_b": 18,
            "loc2_vehicle_a": 15, "loc2_vehicle_b": 8,
            "loc3_vehicle_a": 20, "loc3_vehicle_b": 14,
            "loc4_vehicle_a": 9, "loc4_vehicle_b": 22,
            "loc5_vehicle_a": 16, "loc5_vehicle_b": 11,
            "loc6_vehicle_a": 25, "loc6_vehicle_b": 13,
        },
    },
    "constraints": [
        {
            "name": "loc1_assigned",
            "coefficients": {"loc1_vehicle_a": 1, "loc1_vehicle_b": 1},
            "sense": "==",
            "rhs": 1,
        },
        {
            "name": "loc2_assigned",
            "coefficients": {"loc2_vehicle_a": 1, "loc2_vehicle_b": 1},
            "sense": "==",
            "rhs": 1,
        },
        {
            "name": "loc3_assigned",
            "coefficients": {"loc3_vehicle_a": 1, "loc3_vehicle_b": 1},
            "sense": "==",
            "rhs": 1,
        },
        {
            "name": "loc4_assigned",
            "coefficients": {"loc4_vehicle_a": 1, "loc4_vehicle_b": 1},
            "sense": "==",
            "rhs": 1,
        },
        {
            "name": "loc5_assigned",
            "coefficients": {"loc5_vehicle_a": 1, "loc5_vehicle_b": 1},
            "sense": "==",
            "rhs": 1,
        },
        {
            "name": "loc6_assigned",
            "coefficients": {"loc6_vehicle_a": 1, "loc6_vehicle_b": 1},
            "sense": "==",
            "rhs": 1,
        },
        {
            "name": "vehicle_a_capacity",
            "coefficients": {
                "loc1_vehicle_a": 15, "loc2_vehicle_a": 20,
                "loc3_vehicle_a": 10, "loc4_vehicle_a": 25,
                "loc5_vehicle_a": 12, "loc6_vehicle_a": 18
            },
            "sense": "<=",
            "rhs": 60,
        },
        {
            "name": "vehicle_b_capacity",
            "coefficients": {
                "loc1_vehicle_b": 15, "loc2_vehicle_b": 20,
                "loc3_vehicle_b": 10, "loc4_vehicle_b": 25,
                "loc5_vehicle_b": 12, "loc6_vehicle_b": 18
            },
            "sense": "<=",
            "rhs": 60,
        },
    ],
})
result = response.json()

print(f"Minimum total delivery cost: ${result['objective_value']:.0f}")
for var in result["variables"]:
    if var["value"] > 0.5:
        print(f"  {var['name']}: assigned")

Templates

Next Steps