Skip to content

Distance Objective

Overview

The Distance Objective focuses on minimizing the total distance traveled by all vehicles. It is designed for routing problems where reducing mileage is the primary goal, such as cutting fuel consumption or vehicle wear.


When to Use

  • When operational costs are mostly driven by distance traveled.
  • When reducing vehicle wear and tear or environmental impact is important.
  • When timing or duration is less critical than minimizing distance.

Behavior

  • For each vehicle, only the distance cost (per_km) is considered and optimized.
  • Fixed costs (fixed) and time-based costs (per_hour) are set to zero and ignored.
  • If a vehicle does not specify a per_km cost, a default value of 1000 is assigned.
  • This behavior ensures the solver focuses purely on minimizing distance.

General Validation

  • Ensure every vehicle has a non-negative per_km cost defined (or defaults will be applied).
  • Fixed and per_hour costs must be zero to avoid unintended influences.
  • Vehicle capacity and job demand must be valid and consistent.
  • Distances between locations must be accurate or computable.