# JuMP --\> Cbc infeasibility due to too many (valid) constraints?

**URL:** https://discourse.julialang.org/t/jump-cbc-infeasibility-due-to-too-many-valid-constraints/6895
**Category:** Optimization (Mathematical)
**Created:** [November 5, 2017, 3:25pm UTC](https://discourse.julialang.org/t/jump-cbc-infeasibility-due-to-too-many-valid-constraints/6895 "2017-11-05T15:25:55Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Rafal\_Machalica](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafal_machalica/32/8207_2.png) [@Rafal\_Machalica](https://discourse.julialang.org/u/Rafal_Machalica)
#### Post date: [November 5, 2017, 3:25pm UTC](https://discourse.julialang.org/t/jump-cbc-infeasibility-due-to-too-many-valid-constraints/6895/1 "2017-11-05T15:25:55Z")

</div>

Hello,

I’m solving a numeric crosswords (something like [this](http://www.wydawnictwologi.pl/krzyzowki-logiczne)), and I run into an odd issue. I’m using integer programming and Cbc solver. If I type in all the constraints resulting from the given clues (sums of digits in all given groups), I receive following error:

> WARNING: Not solved to optimality, status: Infeasible  
> WARNING: Infeasibility ray (Farkas proof) not available  
> WARNING: Variable value not defined for x. Check that the model was properly solved.

If I remove a few clues randomly, then the problem gets solved correctly. Some clues are more sensitive than others. I found a single clue, which can be omitted and solution is found. If I add that specific clue, I need to remove about 5 other clues in order to don’t have the above quoted error. All the clues are perfectly valid and not contradicting themselves. Even typing a few obvious hints, like “put 4 in this cell”, which theoretically should simplify the problem, causes above error.

Question: what exactly the error means and how can I get better insight into what is actually wrong? Or is it Cbc bug?

Regards  
Rafal

---

<div class="post-metadata">

### Author: ![miles.lubin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/miles.lubin/32/279_2.png) [@miles.lubin](https://discourse.julialang.org/u/miles.lubin)
#### Post date: [November 5, 2017, 4:27pm UTC](https://discourse.julialang.org/t/jump-cbc-infeasibility-due-to-too-many-valid-constraints/6895/2 "2017-11-05T16:27:58Z")

</div>

It wouldn’t be surprising if Cbc incorrectly declared the problem infeasible. Try another solver like GLPK to debug.

---

<div class="post-metadata">

### Author: ![Rafal\_Machalica](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafal_machalica/32/8207_2.png) [@Rafal\_Machalica](https://discourse.julialang.org/u/Rafal_Machalica)
#### Post date: [November 5, 2017, 4:53pm UTC](https://discourse.julialang.org/t/jump-cbc-infeasibility-due-to-too-many-valid-constraints/6895/3 "2017-11-05T16:53:15Z")

</div>

Yes, I figured I’d try GLPK. Just running it now, but it seems to be much slower. Cbc took max 1 minute, whereas GLPK is running already ~30 minutes and still didn’t finish. Not sure if it will finish in reasonable time at all. The good point is, that it didn’t claim “infeasible” till now.

---

<div class="post-metadata">

### Author: ![Rafal\_Machalica](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafal_machalica/32/8207_2.png) [@Rafal\_Machalica](https://discourse.julialang.org/u/Rafal_Machalica)
#### Post date: [November 5, 2017, 7:17pm UTC](https://discourse.julialang.org/t/jump-cbc-infeasibility-due-to-too-many-valid-constraints/6895/4 "2017-11-05T19:17:16Z")

</div>

\*\*\* UPDATE \*\*\*  
GLPK solved correctly without errors. The only issue is, that it took 80 minutes for him, vs 1 minute from Cbc.

---

<div class="post-metadata">

### Author: ![miles.lubin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/miles.lubin/32/279_2.png) [@miles.lubin](https://discourse.julialang.org/u/miles.lubin)
#### Post date: [November 5, 2017, 10:01pm UTC](https://discourse.julialang.org/t/jump-cbc-infeasibility-due-to-too-many-valid-constraints/6895/5 "2017-11-05T22:01:29Z")

</div>

Well, anyone can give you an incorrect answer quickly…

---

<div class="post-metadata">

### Author: ![ccoffrin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ccoffrin/32/400_2.png) [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)
#### Post date: [November 6, 2017, 5:06am UTC](https://discourse.julialang.org/t/jump-cbc-infeasibility-due-to-too-many-valid-constraints/6895/6 "2017-11-06T05:06:19Z")

</div>

You might want to give a CP solver a try, these solvers are idea for combinatorial puzzles like the one you mention. MiniZinc is an easy way to get started with such solvers.

---

<div class="post-metadata">

### Author: ![Rafal\_Machalica](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafal_machalica/32/8207_2.png) [@Rafal\_Machalica](https://discourse.julialang.org/u/Rafal_Machalica)
#### Post date: [November 8, 2017, 7:36pm UTC](https://discourse.julialang.org/t/jump-cbc-infeasibility-due-to-too-many-valid-constraints/6895/7 "2017-11-08T19:36:46Z")

</div>

MiniZinc looks interesting. It provides conditional constraints out of the box and takes care of translating it into regular set of linear equations. Thank you for this tip.
