# Infeasible integer - solution CPLEX

**URL:** https://discourse.julialang.org/t/infeasible-integer-solution-cplex/22502
**Category:** Optimization (Mathematical)
**Created:** [March 29, 2019, 2:31pm UTC](https://discourse.julialang.org/t/infeasible-integer-solution-cplex/22502 "2019-03-29T14:31:56Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![angeloaliano1](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)
#### Post date: [March 29, 2019, 2:31pm UTC](https://discourse.julialang.org/t/infeasible-integer-solution-cplex/22502/1 "2019-03-29T14:31:56Z")

</div>

Hello Julia’s users,  
I have a little question.  
I am solving a complex integer problem using CPLEX. Many times, a long computation time does not provide an integer feasible solution.  
If I limit the CPU time (for example, 1 hour), there is a way to say for the cplexsolver return this information, for example, “not found integer feasible solution”?  
Because in these intances, I set the objective value to -1.  
Best regards.  
Thanks a lot.

---

<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: [March 29, 2019, 4:45pm UTC](https://discourse.julialang.org/t/infeasible-integer-solution-cplex/22502/2 "2019-03-29T16:45:47Z")

</div>

You can query `termination_status` to check that a time limit was reached:

```julia
JuMP.termination_status(model) # should be MOI.TIME_LIMIT

```

and then `primal_status` to check the primal result. If CPLEX found a solution it will be

```julia
JuMP.primal_status(model) # should be MOI.FEASIBLE_POINT

```

if no integer feasible solution was found, CPLEX should report:

```julia
JuMP.primal_status(model) # should be MOI.NO_SOLUTION

```

The JuMP documentation contains more information: [Query Solutions · JuMP](http://www.juliaopt.org/JuMP.jl/v0.19/solutions/)

---

<div class="post-metadata">

### Author: ![angeloaliano1](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)
#### Post date: [March 29, 2019, 6:15pm UTC](https://discourse.julialang.org/t/infeasible-integer-solution-cplex/22502/3 "2019-03-29T18:15:48Z")

</div>

Thank you very much for your response.  
But, when I call  
JuMP.termination\_status(model)  
I have an error:  
UndefVarError: termination\_status not defined  
getproperty(::Module, ::Symbol) at sysimg.jl:13  
top-level scope at none:0

My version is 0.7 and JuMP.  
Are you telling me why this problem? The version of my Julia? How can I enable this function?

---

<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: [March 29, 2019, 6:38pm UTC](https://discourse.julialang.org/t/infeasible-integer-solution-cplex/22502/4 "2019-03-29T18:38:35Z")

</div>

This only works on Julia 1.0 and JuMP 0.19. This case was one of the motivations for releasing the new version of JuMP.

---

<div class="post-metadata">

### Author: ![angeloaliano1](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)
#### Post date: [March 29, 2019, 6:46pm UTC](https://discourse.julialang.org/t/infeasible-integer-solution-cplex/22502/5 "2019-03-29T18:46:12Z")

</div>

I thought that in version 0.7 it worked!  
So I’ll have to install version 1.0.  
If I install this version, and calling Pkg.add (“JuMP”), will it install version JuMP v0.19?

---

<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: [March 29, 2019, 6:57pm UTC](https://discourse.julialang.org/t/infeasible-integer-solution-cplex/22502/6 "2019-03-29T18:57:34Z")

</div>

Julia versions 0.6 and 0.7 are no longer supported.

> If I install this version, and calling Pkg.add (“JuMP”), will it install version JuMP v0.19?

Yes.
