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

Add flexibility for job time windows handling #330

Closed
jcoupey opened this issue Apr 20, 2020 · 0 comments · Fixed by #369
Closed

Add flexibility for job time windows handling #330

jcoupey opened this issue Apr 20, 2020 · 0 comments · Fixed by #369

Comments

@jcoupey
Copy link
Collaborator

jcoupey commented Apr 20, 2020

Handling time windows for jobs works by storing additional data along routes, such as earliest and latest possible arrival dates at each step. Those are used to decide whenever a possible route change is feasible wrt timing constraints, and are updated each time a route is changed.

Currently, for a given job we pick the first compatible time window based on the earliest arrival candidate, then use it to update the new job earliest date and it's latest date. This is actually way too restrictive as we could avoid choosing the time window altogether and define a potentially looser latest date by picking another time window down the line.

As a result, in a situation with many multiple time windows, we're currently setting aside doable options that we consider as invalid due to the time window choice.

Consider for example jobs A and B whose respective time_windows arrays are: [[8h, 12h], [14h, 16h]] and [[14h, 16h]]. If the heuristic process starts by adding A to an empty route, then the matching earliest date will be earliest_A = 8h (or a bit more depending on travel time from the start) and because we picked the morning time window, it's latest date will be latest_A = 12h (or a bit less depending on travel time to the end). Then A -> B is fine, but B -> A is wrongly considered invalid because the new earliest arrival at A after B is necessarily after current latest_A. We should allow picking different time windows for earliest and latest date, in which case latest_A would be 16h in the first place and B -> A would be valid.

As far as I can tell, there would be no drawback with this change (except a bit more fiddling to search the relevant time window for both values). No change in validity checks, no need to store job time window any more, it would just be decided upon route formatting when we truly set arrival times.

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