google / google/or-tools

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

Open
#3,121 2 comments 0 reactions 1 assignee Claimed by @Mizux View on GitHub
Bug Solver: Routing
Dominant language
C++
Stars
14.1k
Forks
2.5k
Avg merge
8h 39m
Merged PRs (30d)
72

Description

**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.

```py
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**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.