-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
Column generation #2004
Comments
Without meaning to speak for the others, I don't think anyone has invested much time into thinking about what a nice column-generation syntax would look like at the JuMP level. If you want to sketch some ideas, that would be great. No need to stick to the old syntax if you can think of something better. It would be nice to be able to add a column, then set the coefficients, as well as add a column with coefficients. |
From the docs you pointed to,
I believe that no solver interfaces currently implement this "modification queuing" approach, so column generation goes through the same pathway as coefficient modifications. We haven't done benchmarks to verify that this is a reasonable thing to do. But anyway you can already do the following: @variable(model, 0 <= z <= 1)
set_objective_function(model, objective_function(model) + 10z) # This probably should be replaced with set_objective_coefficient.
set_coefficient(con, z, 1.0) I would prefer to not add extra bells and whistles to the macros when functions work instead. |
This makes me think: the objective might be quadratic (I guess that, if the objective is a convex function, it should be represented by a simple variable in the objective and at least one conic constraint?). So, your opinion is: column generation is sufficiently implemented right now in MOI/JuMP (except for something like (Pyomo seems to do something very similar, when I look at the code many people use in my team -- I could not find a "standard" way of doing column generation in Pyomo.) |
Yes. The solution could be as simple as implementing |
AFAIK solvers don't have any special interface for adding variables and setting quadratic objective coefficients at the same time, so this would be processed as a regular modification. |
@dourouc05, my experience with doing column-generation is the following: If you're using MOI, use the # Add the column
vidx = MOI.add_variable(model)
MOI.add_constraint(model, MOI.SingleVariable(vidx), MOI.GreaterThan(0.0))
# Set column Coefficients
# `col` is a sparse vector
for (i, v) in zip(col.nzind, col.nzval)
MOI.modify(model, constr[i], MOI.ScalarCoefficientChange(vidx, v))
end where In terms of pure performance, it's probably not optimal, but I haven't had to complain so far. If you're using JuMP, I'd say Miles' solution is the most practical. |
Thanks for mentioning us. About the modeling language, Coluna uses BlockDecomposition which is a package built on top of JuMP. BlockDecomposition annotates each variable and constraint to indicate whether it is in the master or subproblems. The user writes the compact formulation, describes the decomposition with BlockDecomposition, and then Coluna reformulates the problem using BlockDecomposition annotations. Coluna has data structures to store its formulations, it interacts with MOI to update formulations when master or subproblems are solved with LP/MIP solvers. If the user wants to model the problem with explicit column generation, I think it will be best that JuMP provides a callback like what was done for cut generation. |
Addressed by #2010, until we have evidence that this approach isn't efficient enough. |
For now, if you want to use column generation, the common advice seems to be staying on JuMP 0.18. I will need this feature in the near future, and I'm not willing to go back to an old JuMP.
In MOI, everything seems plumbed (https://github.com/JuliaOpt/MathOptInterface.jl/blob/master/docs/src/apimanual.md#column-generation). If I'm not mistaken, what would be required in JuMP? The old interface was just inside
@variable
(https://github.com/JuliaOpt/JuMP.jl/blob/v0.18.6/doc/probmod.rst):Would there be any problem to carry over this notation? Maybe
inconstraints
andcoefficients
could be merged in a dictionary, so that the generation of the coefficients would be simpler (you would havedict[constraint] = coeff
instead of updating two lists:push!(ls, constraint)
andpush!(lc, coeff)
).Is there any design considerations before I sketch something? I could not find anything in this repository or on Discourse.
The text was updated successfully, but these errors were encountered: