-
Notifications
You must be signed in to change notification settings - Fork 343
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
Unassigned job when using skills on small dataset #778
Comments
Thanks for the comprehensive report. First I can confirm all statements, and especially that the solution you detail assigning all jobs is valid.
That's just because different costs lead to a different search paths, in this case not triggering the initial problem any more.
Kind of. What happens here is that vehicles 1 and 3 are identical regarding skills (can do any job) but the This is really related to the order in which vehicles are initially filled and if you reverse the capacity comparison in the sort mentioned above, then you get a solution without unassigned jobs. In this respect, it's a bit similar to #671, though in this case #671 (comment) would probably not solve the problem. |
Ok, thanks for looking into it! |
I'd just like to confirm this general behavior in all VROOM versions from 1.8 - 1.13. It happens very frequently that vehicles with skills are filled up with non-skilled jobs and as a result there are jobs with skills left unassigned. However, and strangely, it is almost always precisely 1 job left over which seems a little odd. If it was a varying number it would be in line with Julien's answer above but in this way, might the reason be somewhere else? If you need some more examples, I can collect them in the next weeks but they are all pretty similar to @steveharenberg 's example. |
@do-me thanks for reporting. It's always good to have some examples, at least to get a consistent testing base for a potential fix. Also maybe worth looking at if you think you're not hitting the same kind of heuristic bias as above. |
https://github.com/do-me/Test/blob/main/vroom-problem-336-jobs.json (couldn't attach the file in this comment) Here is one of the instances where the described problem happens. Even though it's not a "small" instance anymore it's still apparent to the human observer, that the distribution of jobs is suboptimal in this case, and that an easy solution for all jobs could be found. Some notes/feedback:
It's worth noting that we tested v1.13 with large and small instances and from my experience for larger instances >2000 jobs, >50 vehicles it's usually way faster (4 times) and yields better results than earlier VROOM versions. For smaller instances however, sometimes v1.8/v1.11 in fact - like in this case - yield better results. |
@do-me thanks for sharing! I can reproduce the 3 unassigned jobs with v1.13.
Well since you stripped all locations, it rules out any geometric intuition. So it is not so trivial to see which routes to adjust in order to reshuffle and insert the unassigned jobs in a valid way.
That would be much appreciated! You can attach a solution file (just use another file format than json, for some reason GH does not allow it), or simply provide the list of ordered job ids associated with each vehicle id. On a side note: your matrix looks heavily customized (lots of zero and identical rows), is there a reason for this? Asking since it may have an impact on the solving side. |
Since #982, compatibility is taken into account in a way that will impact:
This seems enough to solve the problem reported here, running from current
I'm not saying this kind of suboptimal result can't happen any more, just that it should be less likely. In any case, I'm closing this ticket as the behavior is now as expected for all reported instances. |
Thanks a lot, we'll go ahead and come back here after testing! |
I have a small example where I am getting an unassigned job when using skills, despite there being a simple solution.
input json
vehicle 1 has capacity 10
vehicle 2 has capacity 11
vehicle 3 has capacity 12
If you run without skills (vehicles can service all jobs), you can solve the problem with 3 routes:
vehicle 1: 5, 4 (uses 9 of 10 capacity)
vehicle 2: 6, 8 (uses 11 of 11 capacity)
vehicle 3: 1, 2, 3, 7 (uses 9 of 12 capacity)
If we make it such that vehicle 2 can only service jobs 4 and 5, then a valid solution is simply:
vehicle 1: 1, 2, 3, 7 (uses 9 of 10 capacity)
vehicle 2: 5, 4 (uses 9 of 11 capacity)
vehicle 3: 6, 8 (uses 11 of 12 capacity)
However, the solution I get from vroom (on the input json given above) is:
vehicle 1: 6 (uses 9 of 10 capacity)
vehicle 2: 4, 5 (uses 9 of 11 capacity)
vehicle 3: 7, 3, 2, 1 (uses 9 of 12 capacity)
with job 8 being unassigned.
Interestingly, if I remove the cost matrix and only use the duration matrix it finds the solution with no unassigned
I am using vroom 1.12 and simply running:
Is this just a case of bad luck with the heuristics?
The text was updated successfully, but these errors were encountered: