# OptimizationMOI Ipopt violating inequality constraint

**URL:** <https://discourse.julialang.org/t/optimizationmoi-ipopt-violating-inequality-constraint/92608>\
**Category:** Optimization (Mathematical)\
**Tags:** optimization, ipopt\
**Created:** [January 6, 2023, 4:36pm UTC](https://discourse.julialang.org/t/optimizationmoi-ipopt-violating-inequality-constraint/92608 "2023-01-06T16:36:48Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dpo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpo/32/3335_2.png) [@dpo](https://discourse.julialang.org/u/dpo)\
**Post date:** [January 6, 2023, 5:37pm UTC](https://discourse.julialang.org/t/optimizationmoi-ipopt-violating-inequality-constraint/92608/2 "2023-01-06T17:37:27Z")

</div>

> [@ForceBru](#):
>
> I’m specifically using IPOPT because it’s an _interior_ point optimizer, so it should never violate constraints, AFAIK.

That is a frequent misconception. If a problem has a constraint g(x) \leq 0, for an interior-point method to ensure satisfaction of the constraint throughout, it would have to penalize g(x) in the logarithmic barrier. However, that’s not what IPOPT does. Firstly, IPOPT adds slack variables s to transform the constraint to g(x) + s = 0 and s \geq 0. Secondly, the inequality on s is penalized via the log barrier, i.e., s \> 0 (strictly) is maintained throughout. BUT g(x) + s = 0 is NOT maintained; that constraint is linearized at each iteration to compute a step and is penalized overall to ensure (approximate) satisfaction in the end.

I don’t know of a reliable large-scale interior-point solver that penalizes g directly (it would be doable).

KNITRO has an option such that as soon as a point satisfying g(x) \< 0 has been found, then g(x) \< 0 is maintained at all subsequent iterations. In particular, if you can provide a starting point that satisfies g(x) \< 0, you should be all set. IPOPT has no such option.

---

_[View the full topic](https://discourse.julialang.org/t/optimizationmoi-ipopt-violating-inequality-constraint/92608)._
