-
Notifications
You must be signed in to change notification settings - Fork 94
Description
Querying the reduced cost of a variable is very common in linear programming (and the corresponding function is in all linear solvers' APIs), however there is no straightforward way of doing this through MOI.
Currently, to access the reduced cost of a variable x
, one has to manually query the dual value of every possible bound constraint on x
(if any), and aggregate the results.
That's very cumbersome, given that this feature is supported by all linear solvers.
Proposal:
Add a variable attribute to query the reduced cost of a variable, e.g. ReducedCost
, or (more verbose) VariableReducedCost
. For now, this would only apply to linear programming solvers (see list below).
The syntax would look like:
MOI.get(model, MOI.ReducedCost(), x)
Solvers wrappers to be updated:
If it makes sense, support could be extended to non-linear solvers as well.