Closed piaulous closed 3 years ago
The feature has been added. The argument is called use_all_vehicles
(example in the docs here). Will make new relase by tomorow.
Thank your very much!
in some cases I now get an 'empty' route: ['Source', 'Sink']
Aha, this is interesting...re opening.
Ortools users have ran into this problem already : https://github.com/google/or-tools/issues/1351 :
This is generally a bad idea to add min values to cumul vars (e.g., number of used vehicles). You can easily run into infeasible problems. It would be better to constraint the max number of visits per vehicle.
If you want to model fairness, it should be reflected in the objective, not in hard constraints.
So @lperron basically suggests 3 options:
minimize_global_span
argument: https://github.com/Kuifje02/vrpy/blob/96cc5501d05c341cc50f4377d15f27fbf422584a/vrpy/vrp.py#L74
But this changes the formulation and may lead to slower convergence. We can hard code the use_all
option to enforce at least one visit with a warning that it is probably a bad approach and may lead to infeasible configurations. Or add an empty route cost, I think this is the way to go.
@piaulous routes ["Source","Sink"]
how have a very high cost and should not be part of the solution. I am closing the issue for now. Feel free to re open it if the next release is not satisfactory.
Having an option to force the number of vehicles is something I would be interested in. This could be done by extending the
num_vehicles
command with something likeuse_all
, or setting upmin
/max
values for the number of vehicles.