# JuMP SCIP Error: no shadow price for LP

**URL:** <https://discourse.julialang.org/t/jump-scip-error-no-shadow-price-for-lp/101138>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [July 3, 2023, 6:29pm UTC](https://discourse.julialang.org/t/jump-scip-error-no-shadow-price-for-lp/101138 "2023-07-03T18:29:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stuart\_Rogers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stuart_rogers/32/10694_2.png) [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Post date:** [July 3, 2023, 6:29pm UTC](https://discourse.julialang.org/t/jump-scip-error-no-shadow-price-for-lp/101138/1 "2023-07-03T18:29:30Z")

</div>

I get an error about a missing shadow price when I try to use SCIP to solve a simle LP in JuMP. I don’t get the error if I use HiGHS or COPT. I use Julia v1.9.1 and the following packages:

pkg\> status  
Status `~/.julia/environments/v1.9/Project.toml`  
[227a2e2d] COPT v1.1.1  
[87dc4568] HiGHS v1.5.2  
[4138dd39] JLD v0.13.3  
[4076af6c] JuMP v1.12.0  
[82193955] SCIP v0.11.13

The source code is:  
using JuMP  
using SCIP  
model = Model(SCIP.Optimizer)  
@variable(model, x \>= 0)  
@variable(model, 0 \<= y \<= 3)  
@objective(model, Min, 12x + 20y)  
@constraint(model, c1, 6x + 8y \>= 100)  
@constraint(model, c2, 7x + 12y \>= 120)  
print(model)  
optimize!(model)  
@show termination\_status(model)  
@show primal\_status(model)  
@show dual\_status(model)  
@show objective\_value(model)  
@show value(x)  
@show value(y)  
@show shadow\_price(c1)  
@show shadow\_price(c2)

$ julia Wotan.jl  
Min 12 x + 20 y  
Subject to  
c1 : 6 x + 8 y ≥ 100  
c2 : 7 x + 12 y ≥ 120  
x ≥ 0  
y ≥ 0  
y ≤ 3  
feasible solution found by trivial heuristic after 0.0 seconds, objective value 1.200060e+06  
presolving:  
(round 1, fast) 0 del vars, 0 del conss, 0 add conss, 2 chg bounds, 0 chg sides, 0 chg coeffs, 0 upgd conss, 0 impls, 0 clqs  
(round 2, fast) 0 del vars, 0 del conss, 0 add conss, 3 chg bounds, 0 chg sides, 0 chg coeffs, 0 upgd conss, 0 impls, 0 clqs  
(0.0s) running MILP presolver  
(0.0s) MILP presolver found nothing  
(0.0s) symmetry computation started: requiring (bin +, int +, cont +), (fixed: bin -, int -, cont -)  
(0.0s) no symmetry present  
presolving (3 rounds: 3 fast, 1 medium, 1 exhaustive):  
0 deleted vars, 0 deleted constraints, 0 added constraints, 3 tightened bounds, 0 added holes, 0 changed sides, 0 changed coefficients  
0 implications, 0 cliques  
presolved problem has 2 variables (0 bin, 0 int, 0 impl, 2 cont) and 2 constraints  
2 constraints of type   
Presolving Time: 0.00

time | node | left |LP iter|LP it/n|mem/heur|mdpt |vars |cons |rows |cuts |sepa|confs|strbr| dualbound | primalbound | gap | compl.  
t 0.0s| 1 | 0 | 0 | - | trivial| 0 | 2 | 2 | 0 | 0 | 0 | 0 | 0 | 1.520000e+02 | 2.657143e+02 | 74.81%| unknown

- 0.0s| 1 | 0 | 2 | - | LP | 0 | 2 | 2 | 2 | 0 | 0 | 0 | 0 | 2.050000e+02 | 2.050000e+02 | 0.00%| unknown  
0.0s| 1 | 0 | 2 | - | 578k | 0 | 2 | 2 | 2 | 0 | 0 | 0 | 0 | 2.050000e+02 | 2.050000e+02 | 0.00%| unknown

SCIP Status : problem is solved [optimal solution found]  
Solving Time (sec) : 0.00  
Solving Nodes : 1  
Primal Bound : +2.05000000000000e+02 (3 solutions)  
Dual Bound : +2.05000000000000e+02  
Gap : 0.00 %  
termination\_status(model) = MathOptInterface.OPTIMAL  
primal\_status(model) = MathOptInterface.FEASIBLE\_POINT  
dual\_status(model) = MathOptInterface.NO\_SOLUTION  
objective\_value(model) = 205.0  
value(x) = 14.999999999999993  
value(y) = 1.2500000000000047  
ERROR: LoadError: The shadow price is not available because no dual result is available.  
Stacktrace:  
[1] error(s::String)  
@ Base ./error.jl:35  
[2] shadow\_price(con\_ref::ConstraintRef{Model, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, ScalarShape})  
@ JuMP ~/.julia/packages/JuMP/H2SWp/src/constraints.jl:1149  
[3] top-level scope  
@ show.jl:1128  
in expression starting at /home/stuart/julia\_code/Wotan/Wotan.jl:24

---

<div class="post-metadata">

**Author:** ![joaquimg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joaquimg/32/223_2.png) [@joaquimg](https://discourse.julialang.org/u/joaquimg)\
**Post date:** [July 3, 2023, 10:59pm UTC](https://discourse.julialang.org/t/jump-scip-error-no-shadow-price-for-lp/101138/2 "2023-07-03T22:59:57Z")

</div>

Since `dual_status(model)` returns `MathOptInterface.NO_SOLUTION` the error is expected.

Note that the MIP solver that is the one being used:

```julia
(0.0s) running MILP presolver
(0.0s) MILP presolver found nothing

```

According to [https://www.scipopt.org/](https://www.scipopt.org/)

> SCIP is currently one of the fastest non-commercial solvers for mixed integer programming (MIP) and mixed integer nonlinear programming (MINLP).

It might be possible to use its LP solver.  
However, an LP solver is recommended. HiGHS and COPT are reasonable choices.

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [July 13, 2023, 10:26pm UTC](https://discourse.julialang.org/t/jump-scip-error-no-shadow-price-for-lp/101138/3 "2023-07-13T22:26:56Z")

</div>

SCIP.jl does not support returning dual solutions. Use a different solver.
