# JuMP COPT does not solve LP relaxation of MILP with SOS1 constraints

**URL:** https://discourse.julialang.org/t/jump-copt-does-not-solve-lp-relaxation-of-milp-with-sos1-constraints/102373
**Category:** Optimization (Mathematical)
**Tags:** jump
**Created:** [August 1, 2023, 9:00pm UTC](https://discourse.julialang.org/t/jump-copt-does-not-solve-lp-relaxation-of-milp-with-sos1-constraints/102373 "2023-08-01T21:00:15Z")
**Posts on this page:** 2
**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: [August 1, 2023, 9:00pm UTC](https://discourse.julialang.org/t/jump-copt-does-not-solve-lp-relaxation-of-milp-with-sos1-constraints/102373/1 "2023-08-01T21:00:15Z")

</div>

When I use COPT through JuMP to solve the LP relaxation of a MILP with SOS1 constraints, the MILP rather than its LP relaxation is solved. If the SOS1 constraints are removed, then COPT solves the LP relaxation.

Output:

$ julia JuMP\_solve.jl  
Cardinal Optimizer v6.5.7. Build date Jul 28 2023  
Copyright Cardinal Operations 2023. All Rights Reserved  
Setting parameter ‘LogToConsole’ to 1  
Setting parameter ‘LpMethod’ to 2  
Model fingerprint: aa3dc1e0

Using Cardinal Optimizer v6.5.7 on Linux  
Hardware has 24 cores and 48 threads. Using instruction set X86\_NATIVE (1)  
Minimizing a MIP problem

The original problem has:  
294515 rows, 299698 columns and 888526 non-zero elements  
100 SOSs

Presolving the problem

The presolved problem has:  
294515 rows, 299698 columns and 888526 non-zero elements  
294414 binaries

Starting the MIP solver with 32 threads and 64 tasks

```
 Nodes Active LPit/n IntInf BestBound BestSolution Gap Time
     0 1 -- 0 0.000000e+00 -- Inf 184s

```

H 0 1 – 0 0.000000e+00 1.280000e+06 100.0% 184s  
H 0 1 – 0 0.000000e+00 4.053610e+05 100.0% 184s  
0 1 – 197 1.722190e+05 4.053610e+05 57.5% 199s  
H 0 1 – 197 1.722190e+05 2.002380e+05 14.0% 201s  
0 1 – 291 1.722675e+05 2.002380e+05 14.0% 221s  
0 1 – 271 1.722696e+05 2.002380e+05 14.0% 238s  
0 1 – 293 1.723109e+05 2.002380e+05 13.9% 255s  
0 1 – 289 1.723154e+05 2.002380e+05 13.9% 273s

Julia code in JuMP\_solve.jl:

using JuMP  
#using SCIP  
#using HiGHS  
using COPT

MPS\_fn = “/data/stuart/gen\_MPS\_files/p12\_fix0\_MILP\_binary\_SOS1\_x.mps”  
model = read\_from\_file(MPS\_fn)

#opt = SCIP.Optimizer  
#opt = HiGHS.Optimizer  
opt = COPT.Optimizer

relax\_integrality(model)  
set\_optimizer(model,opt)  
set\_attribute(model,“LpMethod”,2)

@time optimize!(model)

---

<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: [August 1, 2023, 9:47pm UTC](https://discourse.julialang.org/t/jump-copt-does-not-solve-lp-relaxation-of-milp-with-sos1-constraints/102373/2 "2023-08-01T21:47:48Z")

</div>

Per the docstring of `relax_integrality`, it does not remove SOS constraints: [JuMP · JuMP](https://jump.dev/JuMP.jl/stable/api/JuMP/#JuMP.relax_integrality)
