-
Notifications
You must be signed in to change notification settings - Fork 42
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
Speed up computation of reduced costs #309
Conversation
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.
Ok, it is a little bit better, but still it is slow.
On the same instance gapC-10-100.txt calculation of reduced costs takes 16 seconds and allocates 5 Gb of memory. I do not understand why so much memory is allocated.
For comparison, in BapCod, calculation of reduced costs (normalized to the same number of iterations) takes 115 milliseconds. Part of the reason is that in BaPCod, we compare the length of the dual solution and the number of non-zeros of subproblem variable in the matrix. If the latter is smaller, we make a loop over these non-zeros, and not over the dual solution.
But, anyway, even if I force in BapCod to loop over the dual solution, the time increases to 760 milliseconds, which is 20 times(!) faster than Coluna.
We need to do something, this is critical for me.
Do you compute c - yA ? If yes, you need to loop over the matrix non-zeros & the dual solution. |
Yes, the first variant is to loop over the dual solution (over constraints in the dual solution) and then on every iteration to look for the coefficient of the variable in the constraint (you search in the map for this). |
I have just looked, 95% of time and almost all memory is taken in this line:
|
I just changed the code because it was an useless nested loop. |
Ok, good! Now it takes 58 milliseconds. |
Another performance issue is with function |
Code is clean. About the computations of reduced costs for a given subproblem : I guess it's the 2nd variant, we'll do it when needed. About the setprimalsol! : I opened a new issue #310 |
The code in |
Yes, it should be in DynamicSparseArrays. We leave it for later. |
Guillaume, can you merge this first, and then my pull request? |
No description provided.