Skip to content

How are vehicle costs (fixed, per_km) actually used in route assignment and route cost calculation? #1344

Description

@akira-ito

Hi,

I'm trying to better understand how VROOM (v1.14) uses vehicle costs (fixed, per_km, etc.) when building a solution.

I created a simplified scenario with 2 vehicles and 2 shipments.

Scenario

  • Vehicle 5 already has a preassigned shipment through steps.
  • Shipment A can only be served by Vehicle 5 because of skills.
  • Shipment B can be served by either Vehicle 5 or Vehicle 6.

Vehicle costs:

{
  "id": 5,
  "costs": {
    "fixed": 0,
    "per_km": 2
  }
}
{
  "id": 6,
  "costs": {
    "fixed": 0,
    "per_km": 2000
  }
}

So Vehicle 6 is intentionally configured to be much more expensive.

VROOM returns:

{
  "summary": {
    "cost": 5627
  },
  "routes": [
    {
      "vehicle": 5,
      "cost": 1193,
      "distance": 11464
    },
    {
      "vehicle": 6,
      "cost": 4434,
      "distance": 2107
    }
  ]
}

Vehicle 6 gets the order shipment even though its route cost is much higher:

  • Vehicle 5 cost = 1193
  • Vehicle 6 cost = 4434

My expectation was that VROOM would assign the order shipment to Vehicle 5, since:

  • Vehicle 5 is already active because of the preassigned shipment.
  • Vehicle 5 can satisfy all required skills.
  • Vehicle 5 has a much lower per_km cost.
  • The resulting route cost for Vehicle 5 appears significantly lower than Vehicle 6.

I would like to understand how VROOM uses vehicle costs during route optimization.
My expectation was that Vehicle 5 would receive the shipment since it is already active, compatible with the shipment, and appears to produce a lower overall cost.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions