LinQuadOptInterface.jl
LinQuadOptInterface.jl copied to clipboard
Farkas duals for variable bounds
Currently we only get the farkas dual for constraints:
https://github.com/JuliaOpt/LinQuadOptInterface.jl/blob/d6957f357227e692c0e15bd6c64e9d0a37b7b1f1/src/solve.jl#L58
However, linear12
needs it for variable bounds.
I talked about this with @blegat once. Part of the problem is due to the fact that xpress gurobi and cplex only return data for constraints. They ignore bounds. We can have a method for computing that.
Yes, this is the dual analogous to computing the ConstraintPrimal
s using the VariablePrimal
s and the ConstraintFunction
s
I don't really know what I'm talking about, but for the linear case, it seems we just need a matrix multiplication: https://orinanobworld.blogspot.com/2011/07/farkas-certificates-in-cplex.html
get_farkas_dual!(m, m.constraint_dual_solution)
A = get_constraint_matrix(m) # doesn't exist
m.variable_dual_solution .= m.constraint_dual_solution' * A
# plus some +/- corrections
It seems we have two options
- add a
get_constraint_matrix(model)
method - add a
get_farkas_dual_variables!(model, m.variable_dual_solution)
method 2a. with a fallback that loops through the linear constraints querying the constraint functions.
basic infra structure is on #59 should we close?