Skip to content

OR-Tools v9.9 regression: incorrect negative transit variables (with modulo > capacity) handling in heterogeneous VRP #4133

@Yamp

Description

@Yamp

What version of OR-Tools and what language are you using?
Version: v9.9 only.
Language: Python

Routing Solver

Macos 13.4

I am using code like this to solve heterogeneous VRP with reloads. Like in this example
https://github.com/google/or-tools/blob/stable/ortools/constraint_solver/samples/cvrp_reload.py
But my problem has different capacities for different vehicles.

  self.r.AddDimensionWithVehicleCapacity(
      evaluator_index=self.c[name],
      slack_max=int(self.p.max_c[index]),  # we are unloading max_cap but adding some slack
      vehicle_capacities=self.p.max_capacities[:, index].astype(int).tolist(),
      fix_start_cumul_to_zero=True,
      name="max_capacities" + str(index),
  )

Making negative capacities at reloads equal to the biggest possible capacity of my vehicle and then adding slack to landfills.
At version 9.8 it works, but at 9.9 it does not accept the initial solution and does not use landfills for vehicles with non-maximum capacities.

After some debugging, I realized that reload capacities say -100 are considered out of bounds for vehicles with maximum capacity say 80. So it cannot use reloads and ignores the initial solution. How to solve the same problem in the 9.9 version I don't know. I would consider this a bug.

Metadata

Metadata

Assignees

Labels

BugLang: PythonPython wrapper issueSolver: RoutingUses the Routing library and the original CP solver

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions