-
Notifications
You must be signed in to change notification settings - Fork 346
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
Refactor/try job additions #427
Refactor/try job additions #427
Conversation
Sounds great! From what I can tell from the current commits, this already covers the scope of #392. I'd like to run some benchmarking on my side too, but maybe I should wait as you listed more todo items? Or if the other items are not directly related to this refactoring, maybe we can move on with the current change and have them in a separate PR? |
You're right, #392 is basically done. Getting rid of the allocations in I'd still like to add a few comments and format the code in a future commit, but feel free to benchmark and review this as is. |
Yes, I took a look at the PR with incremental diffs. Thanks for cutting out the changes in a few commits like you did, makes it really easy to follow on the overall logic. I'll just fire a few solving rounds on the usual benchmarks which should provide a ballpark figure on the speedup anyway. Take the time you need to go on and I'll simply review the current state for a couple comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropped a couple comments. Also ./scripts/format.sh
generates a lot of changes, mostly indenting stuff.
The following table shows the difference between 24a6dd5 (
When I spotted the problem and wrote the ticket, I though we'd get nice improvements but I did not suspect this order of magnitude. Especially for instances where there are actually no unassigned jobs (all except for a few CVRP instances here). So the good news is: this already has a significant impact on computing times for the use of Instances with shipments (Li & Lim classes) see a much bigger gain, which is in line with the fact that the insertion checks have a higher complexity than for regular jobs, so skipping the unnecessary checks is even more profitable. Todo: I'll benchmark this at some point on instances with more unassigned jobs and we should see an even bigger impact. |
@krypt-n all the more interested to see the improvements you have in store for |
I briefly looked into the performance of the homberger instances with exploration level 0, but could not find a reliable slowdown on my machine on any instance. Do you know of any instance that performs worse on with this PR, or is the 2.7% just noise? Other than that, I formatted this PR and applied the changes you suggested during the review |
Great! Looks like this is ready to merge. My mistake on the Homberger 200 instances: I reported the difference for the computing time on the last instance only (364 ms vs 374 ms). The average is 228 ms for both runs. I just updated the table above. Last question: you crossed the first two items in the list, does it mean you did not look into them for this PR, or that you did not find any interesting improvements? |
Ah great. I wasn't sure about that since the running time varies quite a bit from run to run and I didn't do enough benchmark runs to determine if the distribution changed. I crossed them from the list because I don't feel they need to be part of this PR. I will most likely open new PRs for them, if I get any noteworthy results. Yep, looks ready to merge for me as well. |
For completeness, I've generated random problems with time windows and 600 tasks using only 10 vehicles so more or less half the tasks end up unassigned.
Of course that's only a couple instances but modulo computing time variations across runs, this is pretty much in line with previous tests and expectations. |
@krypt-n about the other potential optimizations you first listed, feel free to open a dedicated ticket if it makes sense, if only as a way to track the idea. |
Issue
Closes #392
Tasks
Apply some more micro optimisations I have an a local branch somewhereLook into allocations incompute_best_insertion_pd
CHANGELOG.md
(remove if irrelevant)This is my current progress on #392, the results so far seem promising. For comparison, the li_lim_100 benchmarks:
Baseline, current master@24a6dd5:
This branch:
Additionally I verified that the solutions for a range of different selected benchmarks are exactly the same. This makes me quite confident that my refactoring is correct. I'm going to continue working on this some time in the next couple of days.