-
Notifications
You must be signed in to change notification settings - Fork 74
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Driver break discussion #63
Comments
Hi, I don't have mailing list, but github has discussions. Regarding jsprit - yes, I'm familiar with the project and I even have some MR to fix break location issue (still opened, probably outdated): If I understand correctly, you need breaks which could happen in the middle of the journey from one job (warehouse) to another if it is required legally after specific time. I don't have any immediate solution on top of my mind. I can only think about some preprocessing step which will analyze problem definition to find such long route legs and insert some artificial optional jobs (yes, except start/end, everything is a job). Anyway it is interesting requirement. Some info about current break implementation and why breaks might be skipped in some cases. In general, breaks are hard for implementation using insertion heuristics: you start from empty route and insert activities one by one. But break cannot be inserted in the beginning:
At the moment, I see two strategies to enforce break in such cases:
My current implementation interprets breaks as soft constraints and has |
Thank you for your reply :) Your interpretation of my break requirement is correct; "you need breaks which could happen in the middle of the journey from one job (warehouse) to another if it is required legally after specific time". The point I'm making is that this isn't my need, but at least a legal requirement for everyone in Europe (if not further abroad). The only sensible way for breaks to work here would be to be able to split a single leg journey That isn't possible in |
If you track the "slack" time in downstream jobs from the point of insertion, and you detect that you've crossed a threshold where a break is needed, then you might still be able to see that this insertion is invalid without parsing the entire route on every insertion position candidate? |
Sorry, just realised I switched github accounts in the meantime :/ |
The main problem is to find generic solution: we shouldn't make assumption that long time commute happens only at the beginning. If it is in the middle of the route, then any changes done naturally by metaheuristic, will invalidate previous state and the whole recalculation is needed. I think adding some extra time for long commute with a break can be also an alternative solution to |
Absolutely. I misspoke, sorry. This can happen at any time during a route, not just the first leg of the journey.
Fundamentally, it doesn't need one, because there isn't one. It just needs to see that If you have the slack stored in a state manager, will this explode the complexity of your insertion heuristic? |
In that scenario, I'm implementing a break as a "job" during the recreate phase, but it only adds its duration, not travel to/from it. Ideally, it should never be in the unassigned pool in the first place. In |
yes, there is some state which is associated with the route context. It is used to store some pre-cached values to speedup insertion analysis. If we accept that such breaks don't have locations, then the next question would be about representing break in the solution. Need to think about it. Regarding internal api: I would say it is not really ready for extension by code. I put more efforts to support more use cases using pragmatic format and implement them as part of the project. |
maybe this special break, which happens only during traveling, can be implemented as separate feature. But it should be mutual exclusive with current one and the user should have full control on them. |
Totally agree. I'm just really happy that you're thinking about it in general. I waffled a bit, but this is a major barrier to implementing the open-source solutions to any business that deals with these legal compliance issues. I'll help in any way I can. I'm trying to learn more |
At the moment, adding such break as extra time to traveling duration when necessary seems a possible solution. Besides actual implementation, I see the following challenges:
|
Thought about it over night and I think there is some potentially simple way to implement this with some constraints:
|
This sounds good, I really appreciate you taking time to think it over. I have a couple of things that have bitten me in the past when trying to handle this that might be useful to at least mention (possibly not all relevant):
|
Thanks for info! I might try to prototype very basic implementation which supposed to add break time to traveling time when necessary. However, I want first to finish my current task (heuristic refactoring) |
Please don't let me derail your existing plans; I'm glad you've taken an interest in this problem (and feel free to migrate to a discussion if that's possible; we don't have that tab internally so I didn't know it was a thing with git, sorry!). In the meantime, I'm going to try wrap this library on my side too (which will take me some time anyway) so that I can start running on some real data and give real-world feedback on prototypes. Certain details I won't be able to share, but I'm hopeful we can get to some working middle ground. It'd be awesome to close this long-standing issue |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Hi. Firstly, apologies if this belongs on a mailing list (I looked but couldn’t find one) but I wanted to have a discussion about the handling of driver breaks.
I’ve used
jsprit
now for various projects for the last 6 years and I kicked off the discussion originally that got the first iteration of breaks running there. I’m running on the assumption that you have some familiarity withjsprit
given the setup of this library, and it looks like you’re making great progress in some of the shortfalls experienced there.The one thing that causes no end of problems is driver breaks and it appears that you’ve taken the same default as
jsprit
did - the break inherits the location of the previous, tangible job and your own docsThe problem with this is that breaks are non-trivial in the solution itself. Because of things like EU regulations it simply isn’t good enough in a solution to have them modelled as soft constraints because the solution breaks the law if the break jobs get kicked out. Across
jsprit
, OR-Tools (broken for ages), VROOM and this library, I cannot find an implementation that can adequately address this.Fundamentally, this falls down on the location inheritance. If I need to travel 5 hours from the north of the UK down to Cornwall, on a 9-5 shift (for argument’s sake), with a break in the middle, it’s totally impossible for a solution to ever do this job unless there is some stepping-stone job on the way. Tough luck if you're dispatching a full truck for a single order. The stark reality is that vehicles will park up to satisfy the Tachograph at an intermediate location, but this is not possible either with a forward- or a backward-looking location inheritance.
This has led me down all sorts of paths, with instantaneous services at the warehouse immediately before a break just to try fudge this location inheritance, amongst other hacks. They never properly work. I think we need to move away from breaks being considered as a job that can be inserted into a route and, instead, have something time-based.
I’m engaged with a number of large logistics clients with complex constraints, and I have a wrapper library that calls custom and open-source solvers interchangeably, so I can test a number of very different scenarios. Given that you’re so active in your development at the moment and the fact that you’re addressing issues with the solvers that came before, I’d love to assist in testing if you have any ideas on how this long-standing problem can be fixed. Have you had any thoughts in this space and is this something you’d like to explore?
Thanks,
Josh
The text was updated successfully, but these errors were encountered: