Skip to content

v9.1 no longer work for CVRP with number of stops visited per each vehicle route #3121

@qiannathancao

Description

@qiannathancao

What version of OR-Tools and what language are you using?
v.9.1 vs v8.0.8283

Language: C++/Java/Python/C#
Python

Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)
Routing Solver: CVRP module

What operating system (Linux, Windows, ...) and version?
Windows

What did you do?
Steps to reproduce the behavior:
In order to limit vehicle stops per each route, I added the following code before setting the first solution heuristic.

    count_stop_callback = routing.RegisterUnaryTransitCallback(lambda index: 1)
    dimension_name = 'Counter'
    routing.AddDimension(count_stop_callback, 0, 45000, True, 'Counter')
    counter_dimension = routing.GetDimensionOrDie(dimension_name)
    
    for vehicle_id in range(data['num_vehicles']):
        index = routing.End(vehicle_id)
        solver = routing.solver()
        solver.Add(counter_dimension.CumulVar(index) <= data['stops'])

What did you expect to see
Expect to the number of stops per route does not exceed the stops being set i.e. data['stops'] for example 5 stops maximum

What did you see instead?
After upgrading the version to 9.0, the routing.SolveWithParameters(search_parameters) does not exit, it runs forever.
However, after re-install version 8.0.8283, it is back to normal.
Question is what has been changed could cause such confliction

Make sure you include information that can help us debug (full error message, model Proto).

Anything else we should know about your project / environment

Metadata

Metadata

Assignees

Labels

BugSolver: 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