Skip to content

Linear problems duals #343

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

Closed
Tambup opened this issue May 26, 2025 · 5 comments
Closed

Linear problems duals #343

Tambup opened this issue May 26, 2025 · 5 comments

Comments

@Tambup
Copy link

Tambup commented May 26, 2025

Hello!

Is this binding able to solve linear problems? Mainly asking because I get an error when I try to get a dual for a problem.
The error is:

ERROR: MathOptInterface.GetAttributeNotAllowed{MathOptInterface.ConstraintDual}:

## Cause

Getting attribute MathOptInterface.ConstraintDual(1) cannot be performed because:

SCIP.Optimizer does not support getting the attribute MathOptInterface.ConstraintDual(1).

## Fixing this error

An `MOI.NotAllowedError` error occurs when you have tried to do something that
is not implemented by the solver.

The most common way to fix this error is to wrap the optimizer in a
`MOI.Utilities.CachingOptimizer`.

For example, if you are using `JuMP.Model` or `JuMP.set_optimizer`, do:
```julia
model = JuMP.Model(optimizer; with_cache_type = Float64)
model = JuMP.GenericModel{T}(optimizer; with_cache_type = T)
JuMP.set_optimizer(model, optimizer; with_cache_type = Float64)

Similarly, if you are using MOI.instantiate, do:

model = MOI.instantiate(optimizer; with_cache_type = Float64)

My understanding is that my problem is not solved as a linear problem, but as a MILP. But then, how can I retrieve the dual variables?

My idea was to use SCIP as the master problem in a column generation algorithm, but without the dual variables I'm a bit stuck. If something can be done similarly to the SCIP tutorial in C++ I'm happy to follow that way.

Thank you!

@matbesancon
Copy link
Member

matbesancon commented May 26, 2025 via email

@Tambup
Copy link
Author

Tambup commented May 26, 2025

Thank you!

Then, I guess there is no way to use SCIP through JuMP for column generation, right?

@matbesancon
Copy link
Member

matbesancon commented May 26, 2025 via email

@Tambup
Copy link
Author

Tambup commented May 26, 2025

Perfect, thank you and I'm closing the issue!

@Tambup Tambup closed this as completed May 26, 2025
@odow
Copy link
Collaborator

odow commented May 26, 2025

Just a comment @Tambup: when using JuMP you must always check the return of dual_status(model) before querying dual(con). You'll find that dual_status(model) returns NO_SOLUTION, so querying dual is undefined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants