# \#integer-programming

**URL:** https://discuss.ampl.com/tag/integer-programming/5.md

[Latest](https://discuss.ampl.com/latest.md) · [Categories](https://discuss.ampl.com/categories.md) · [Tags](https://discuss.ampl.com/tags.md)

---

## [How do I relax the integrality of only some of a model’s integer variables?](https://discuss.ampl.com/t/how-do-i-relax-the-integrality-of-only-some-of-a-model-s-integer-variables/48)

<div class="topic-metadata">

**Author:** [@megrobert](https://discuss.ampl.com/u/megrobert)\
**Replies:** 0\
**Last updated:** [December 15, 2021, 5:23pm UTC](https://discuss.ampl.com/t/how-do-i-relax-the-integrality-of-only-some-of-a-model-s-integer-variables/48 "2021-12-15T17:23:51Z")

</div>

For each variable whose integrality you want to relax, assign a positive value to variable-name.relax . For example, if your model has var X {1..n} integer \>= 0; var Y {1..m} integer \>= 0; then to relax the integralit…

---

## [Why does my solver’s relax directive sometimes give a higher objective value than AMPL’s relax\_integrality option?](https://discuss.ampl.com/t/why-does-my-solver-s-relax-directive-sometimes-give-a-higher-objective-value-than-ampl-s-relax-integrality-option/47)

<div class="topic-metadata">

**Author:** [@megrobert](https://discuss.ampl.com/u/megrobert)\
**Replies:** 0\
**Last updated:** [December 15, 2021, 5:22pm UTC](https://discuss.ampl.com/t/why-does-my-solver-s-relax-directive-sometimes-give-a-higher-objective-value-than-ampl-s-relax-integrality-option/47 "2021-12-15T17:22:45Z")

</div>

These two ways of relaxing integrality can give different results because they interact differently with AMPL’s presolve phase. Under option relax\_integrality 1 , all integer variables are changed to continuous before A…

---

## [How can I “break” a run of an integer programming solver and get back the best integer solution found so far?](https://discuss.ampl.com/t/how-can-i-break-a-run-of-an-integer-programming-solver-and-get-back-the-best-integer-solution-found-so-far/46)

<div class="topic-metadata">

**Author:** [@megrobert](https://discuss.ampl.com/u/megrobert)\
**Replies:** 0\
**Last updated:** [December 15, 2021, 5:21pm UTC](https://discuss.ampl.com/t/how-can-i-break-a-run-of-an-integer-programming-solver-and-get-back-the-best-integer-solution-found-so-far/46 "2021-12-15T17:21:40Z")

</div>

The “break” signal (Ctrl-C for many computers) stops the solver and returns control to AMPL, but does not necessarily return any solution from the solver. Some solvers may make provision to “catch” the break signal and r…

---

## [How can I use the solver’s “special ordered sets” feature?](https://discuss.ampl.com/t/how-can-i-use-the-solver-s-special-ordered-sets-feature/45)

<div class="topic-metadata">

**Author:** [@megrobert](https://discuss.ampl.com/u/megrobert)\
**Replies:** 0\
**Last updated:** [December 15, 2021, 5:18pm UTC](https://discuss.ampl.com/t/how-can-i-use-the-solver-s-special-ordered-sets-feature/45 "2021-12-15T17:18:19Z")

</div>

There are two kinds of formulations that cause special ordered sets to be set up by AMPL and used by your solver automatically. For other situations you can explicitly identify special ordered sets of types 1 and 2 using…
