# Warmstarting variables does not work with Xpress

**URL:** <https://discourse.julialang.org/t/warmstarting-variables-does-not-work-with-xpress/60989>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [May 12, 2021, 12:31am UTC](https://discourse.julialang.org/t/warmstarting-variables-does-not-work-with-xpress/60989 "2021-05-12T00:31:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![obar](https://avatars.discourse-cdn.com/v4/letter/o/a9adbd/32.png) [@obar](https://discourse.julialang.org/u/obar)\
**Post date:** [May 12, 2021, 12:31am UTC](https://discourse.julialang.org/t/warmstarting-variables-does-not-work-with-xpress/60989/1 "2021-05-12T00:31:52Z")

</div>

Hello,

When using the xpress solver through JuMP and the Xpress.jl packages to solve a mixed-integer program, I seem to be unable to warm-start primal variable values using set\_start\_value. Is this expected?

Thanks!

---

<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:** [May 12, 2021, 2:40am UTC](https://discourse.julialang.org/t/warmstarting-variables-does-not-work-with-xpress/60989/2 "2021-05-12T02:40:41Z")

</div>

Hi there! Welcome to the forum.

Take a read of the first post of [Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757) and provide a minimal working example demonstrating the problem.

---

<div class="post-metadata">

**Author:** ![obar](https://avatars.discourse-cdn.com/v4/letter/o/a9adbd/32.png) [@obar](https://discourse.julialang.org/u/obar)\
**Post date:** [May 12, 2021, 3:36am UTC](https://discourse.julialang.org/t/warmstarting-variables-does-not-work-with-xpress/60989/3 "2021-05-12T03:36:03Z")

</div>

Sure thing:

```julia
using JuMP, Cbc, Xpress

# knapsack problem from JuMP tutorials
profit = [5, 3, 2, 7, 4]
weight = [2, 8, 4, 2, 5]
capacity = 10
model = Model()
@variable(model, x[1:5], Bin)
## Objective: maximize profit
@objective(model, Max, profit' * x)
## Constraint: can carry all
@constraint(model, weight' * x <= capacity)

# Start with Xpress
set_optimizer(model, Xpress.Optimizer)

# Find the solution and initialise the optimal solution in the JuMP model
optimize!(model)
set_start_value.(all_variables(model), value.(all_variables(model)));

# Run with Xpress again - restarts from scratch and no logs to indicate warmstarted variables
optimize!(model)

# Cbc completes instantly after warmstarting
set_optimizer(model, Cbc.Optimizer)
optimize!(model)

```

The lack of starting values can be a bit difficult to see in the logs of a small problem like this. I’m happy to provide an mps file with more obvious log outputs if needed.

---

<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:** [May 12, 2021, 4:00am UTC](https://discourse.julialang.org/t/warmstarting-variables-does-not-work-with-xpress/60989/4 "2021-05-12T04:00:19Z")

</div>

I opened an issue. It looks like they aren’t passed to the solver: [Xpress ignore LP warm starts · Issue #127 · jump-dev/Xpress.jl · GitHub](https://github.com/jump-dev/Xpress.jl/issues/127)
