You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have running into an AssertError when querying dual_objective_value for an unbounded model with at least one unbounded variable.
The code blow was executed on Julia 1.11.1, JuMP 1.23.5 and HiGHS v1.12.1
julia>using JuMP, HiGHS
julia> model =Model(HiGHS.Optimizer);
julia>@variable(model, x); # unbounded variable
julia>@objective(model, Min, x);
julia>optimize!(model) # unbounded, as expected
Running HiGHS 1.8.1 (git hash:4a7f24ac6): Copyright (c) 2024 HiGHS under MIT licence terms
Coefficient ranges:
Cost [1e+00, 1e+00]
Bound [0e+00, 0e+00]
Solving LP without presolve, or with basis, or unconstrained
Solving an unconstrained LP with 1 columns
Model status : Unbounded
Objective value :0.0000000000e+00
Relative P-D gap :1.0000000000e+00
HiGHS run time :0.00
julia>dual_objective_value(model)
ERROR: AssertionError:isfinite(u)
Stacktrace:
[1] _active_bound
@ ~/.julia/packages/HiGHS/P0qbU/src/MOI_wrapper.jl:2275 [inlined]
[2] get(model::HiGHS.Optimizer, attr::MathOptInterface.DualObjectiveValue)
@ HiGHS ~/.julia/packages/HiGHS/P0qbU/src/MOI_wrapper.jl:2228
[3] get
@ ~/.julia/packages/MathOptInterface/gLl4d/src/Bridges/bridge_optimizer.jl:889 [inlined]
[4] _get_model_attribute(model::MathOptInterface.Utilities.CachingOptimizer{…}, attr::MathOptInterface.DualObjectiveValue)
@ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/gLl4d/src/Utilities/cachingoptimizer.jl:847
[5] get
@ ~/.julia/packages/MathOptInterface/gLl4d/src/Utilities/cachingoptimizer.jl:900 [inlined]
[6] _moi_get_result(model::MathOptInterface.Utilities.CachingOptimizer{…}, args::MathOptInterface.DualObjectiveValue)
@ JuMP ~/.julia/packages/JuMP/i68GU/src/optimizer_interface.jl:1053
[7] get(model::Model, attr::MathOptInterface.DualObjectiveValue)
@ JuMP ~/.julia/packages/JuMP/i68GU/src/optimizer_interface.jl:1073
[8] dual_objective_value(model::Model; result::Int64)
@ JuMP ~/.julia/packages/JuMP/i68GU/src/objective.jl:167
[9] dual_objective_value(model::Model)
@ JuMP ~/.julia/packages/JuMP/i68GU/src/objective.jl:163
[10] top-level scope
@ REPL[6]:1
Some type information was truncated. Use `show(err)` to see complete types.
Actually this is less embarrassing than it seems. The issue is that your model is primal unbounded, and you've asked for the dual objective value (which is meaningless).
We can fix the bug, but it will return the dual objective at the dual infeasible point.
I have running into an
AssertError
when queryingdual_objective_value
for an unbounded model with at least one unbounded variable.The code blow was executed on Julia 1.11.1, JuMP 1.23.5 and HiGHS v1.12.1
The stacktrace points to this line:
HiGHS.jl/src/MOI_wrapper.jl
Line 2275 in 6914b62
which I believe is only triggered when hitting an unbounded variable
The text was updated successfully, but these errors were encountered: