Skip to content

[BUG] cuOpt VRP solver ignores min_vehicles constraint when fixed costs are included #904

@bbozkaya

Description

@bbozkaya

When vehicle costs are included in the data VRP data model and min_vehicles constraint is set, cuOpt generates a solution with fewer than min_vehicles constraint value. Likely, this arises when min_vehicles value = total number of vehicles and fixed costs are included.

The expected behavior is for the solver to use no fewer than min_vehicles vehicles and pick the least costly vehicles as dictated by fixed costs.

The following example is where total num vehicles is 3, and they all have fixed costs + min_vehicles = 3, and the resulting solution uses only 1 vehicle.

{ "cost_matrix_data": { "data": { "0": [ [0, 17, 12, 11, 10, 18, 10], [16, 0, 15, 11, 19, 15, 16], [19, 19, 0, 11, 16, 11, 17], [17, 19, 17, 0, 11, 18, 19], [10, 19, 19, 19, 0, 17, 15], [12, 18, 15, 18, 18, 0, 14], [12, 12, 11, 19, 10, 17, 0] ] } }, "fleet_data": { "vehicle_locations": [ [0, 0], [0, 0], [0, 0] ], "vehicle_fixed_costs": [10, 20, 30], "min_vehicles": 3 }, "task_data": { "task_locations": [1, 2, 3, 4, 5, 6, 0, 0, 0, 0, 0, 0], "demand": [[2, 1, 4, 2, 1, 4, -2, -1, -4, -2, -1, -4]] }, "solver_config": { "objectives": { "cost": 1, "vehicle_fixed_cost": 1 } } }

When the vehicle_fixed_cost values are set to 0, the solution uses 3 vehicles, as required by min_vehicles setting.

Metadata

Metadata

Assignees

Labels

awaiting responseThis expects a response from maintainer or contributor depending on who requested in last comment.bugSomething isn't working

Type

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions