-
Notifications
You must be signed in to change notification settings - Fork 87
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
Improve performance of adding variables with bounds #2564
Comments
One of the problems related to this is that we should be able to query the bounds separately afterward and possibly we would like to query duals related to one of the bounds. There is some discussion about this on this issue jump-dev/JuMP.jl#3023 |
I would expect this, since there are three things we need to do: add a variable, add a lower bound, add an upper bound. Note that if you use Do you have a real-world example where this operation is a performance problem? |
It seems like we could also make a more efficient method in HiGHS' C API to modify a single bound, instead of the iterator that they currently do. (We shouldn't need |
|
I think this is asking for a more efficient method in the C API, not JuMP |
Okay... but how much time does this actually take |
21% of the total running time (which includes loading data, building models, updating models, LP solving models) |
And how long in wall time is that? |
Depends on the problem size... larger problems run for 10 hours, so 2 hours just adding variables. The example I posted runs for 100s so 20s of adding variables. |
This should be fixed in HiGHS then. There's no way that this overhead is because of JuMP. |
I don't disagree HiGHS could do it better. But, this is an issue in Xpress as well. |
I opened 3 PRs to clarify: Does not look like a big change, code itself is less than 100 lines summing all 3 PRs |
What's the difference with |
Closed by #2574 |
From this simple example:
we get:
So, almost 2/3 of the time is spent on adding the bounds.
But, similar to many other solvers, HiGHS would be able to do both in a single call:
Highs_addCol(model, 0.0, -Inf, Inf, 0, C_NULL, C_NULL)
One idea would be:
Create the function(s):
MOI.Utilities.add_variable(s)_and_bounds_constraints
The fallback would be
add_variable(s)
+add_constraint(s)
But solvers could choose to implement this function, and JuMP would always use it (which would work, thanks to the fallback).
The text was updated successfully, but these errors were encountered: