← Back to Handbooks

Vehicle Routing Problem (VRP) - Handbook

Type: IP (Integer Programming)

This handbook explains the Vehicle Routing sample problem in the LP Black Box platform.

The Vehicle Routing Problem (VRP) determines optimal routes for a fleet of vehicles.


The Problem

Scenario

A delivery company has 1 vehicle with capacity 50, and must deliver to 4 customers.

CustomerDemandDistance from Depot
Customer A1510 km
Customer B2015 km
Customer C108 km
Customer D2520 km

Vehicle Capacity: 50 units
Max Distance: 100 km

Your Goal

Maximize total deliveries (or minimize distance) while respecting vehicle capacity and max distance.

The Variables

VariableTypeMeaning
deliver_AInteger ≥ 0Units delivered to Customer A
deliver_BInteger ≥ 0Units delivered to Customer B
deliver_CInteger ≥ 0Units delivered to Customer C
deliver_DInteger ≥ 0Units delivered to Customer D
route_ABinaryVisit Customer A? (0 or 1)
route_BBinaryVisit Customer B?
route_CBinaryVisit Customer C?
route_DBinaryVisit Customer D?

The Constraints

  1. Vehicle Capacity: Total deliveries cannot exceed 50

    • deliver_A + deliver_B + deliver_C + deliver_D ≤ 50
  2. Distance Limit: Total route distance ≤ 100 km

    • 10×route_A + 15×route_B + 8×route_C + 20×route_D ≤ 100
  3. Delivery Requirement: Can only deliver if visiting (linking constraint)

    • deliver_A ≤ 50 × route_A
    • deliver_B ≤ 50 × route_B
    • deliver_C ≤ 50 × route_C
    • deliver_D ≤ 50 × route_D
  4. Minimum Deliveries: Must deliver to at least 3 customers

    • route_A + route_B + route_C + route_D ≥ 3
  5. Non-negativity: deliver_X ≥ 0

The Objective

Maximize total demand served:

Or Minimize distance:


How to Use

Step 1: Load the Sample

Select Vehicle Routing from the dropdown.

Step 2: Solve

The solver determines which customers to serve and how much to deliver to each.

Step 3: Interpret Results


Try It Yourself


VRP Variants

VariantDescription
CVRPCapacitated VRP (vehicle capacity limits)
VRPTWVRP with Time Windows
VRP with PickupDelivery + Pickup
Multi-depot VRPMultiple warehouses

Real-World Applications


This demonstrates how Integer Programming solves routing and delivery optimization.