Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break not taken into account with no time window #497

Closed
jcoupey opened this issue Apr 29, 2021 · 0 comments · Fixed by #565
Closed

Break not taken into account with no time window #497

jcoupey opened this issue Apr 29, 2021 · 0 comments · Fixed by #565

Comments

@jcoupey
Copy link
Collaborator

jcoupey commented Apr 29, 2021

When submitting an instance that has no time_window key for vehicles and time_windows key for any of the tasks, then it's treated as a CVRP which removes the need for all time validity checks. So far so good. But this behavior remains if a vehicle has a non-empty breaks array. Then the result of the problem being treated as a CVRP is that the breaks are not assigned at all.

One may argue that providing breaks without an actual working hour restriction is somehow an edge case (and probably the reason why this went unnoticed so far). But from the API point of view this is totally valid: not providing a vehicle time_window means "no constraints" on overall working hours but then requesting breaks can still make sense.

A current work-around is to apply a huge non-constraining time window somewhere to switch to VRPTW-based solving.

A straightforward fix would be to simply update the Input::_has_TW flag properly upon adding a new vehicle in order to consider not only its time window but the existence of potential breaks.

_has_TW = _has_TW || !vehicle.tw.is_default();

@jcoupey jcoupey changed the title Break not taken into account without time window Break not taken into account with no time window Apr 29, 2021
@jcoupey jcoupey added this to the v1.11.0 milestone Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant