Skip to content

Finite-Value Constraint

Definition

A linear expression can be restricted to one of the listed values d1,…,dNd_1,\ldots,d_N by introducing binary variables yiy_i and writing

a1x1+⋯+anxn=∑i=1Ndiyi,∑i=1Nyi=1,yi∈{0,1}.a_1x_1+\cdots+a_nx_n=\sum_{i=1}^Nd_iy_i,\qquad \sum_{i=1}^Ny_i=1,\qquad y_i\in\{0,1\}.

Interpretation

A finite-value constraint lets a linear expression take only a few listed values, such as x1+x2∈{3,5,8}x_1+x_2\in\{3,5,8\}, which linear inequalities alone cannot express. Exactly one indicator selects the allowed value, so no separate alternative constraint is needed for every possible value.

A number line for x1 + x2 with the three allowed values 3, 5 and 8 marked, one for each binary selector, and a light band of the values reachable if the selectors were fractions.

The red points are the three allowed totals, each produced by one selector: y1=1y_1=1 gives 33, y2=1y_2=1 gives 55 and y3=1y_3=1 gives 88, as in the first Example. The light band from 33 to 88 shows what the right-hand side 3y1+5y2+8y33y_1+5y_2+8y_3 could reach if the selectors were fractions; y1=y3=12y_1=y_3=\tfrac{1}{2}, for instance, gives 5.55.5.

Each part of the formulation has a role. Because the yiy_i are binary and sum to 11, they are mutually exclusive decisions of the exactly-one type: one yiy_i equals 11, the others are 00, and ∑idiyi\displaystyle \sum_id_iy_i collapses to the single selected value did_i. The values did_i are fixed data, which keeps every term diyid_iy_i linear.

A common slip is to write ∑iyi≤1\displaystyle \sum_iy_i\le1 instead. Then all selectors may be 00, and the expression may equal 00, a value that is not on the list. The parity constraint can be read as a finite-value constraint with listed values 00 and 22, written more compactly with one auxiliary variable.


Key Results

  • The sum-to-one equality ensures that a value is actually selected.
  • The did_i are fixed data, so diyid_iy_i is linear.
  • Relaxing the indicators to continuous fractions would generally allow values between the listed values.

Examples

The light band shows intermediate totals made possible by fractional selector values; the binary selectors permit only the listed totals.

  • For allowed totals 3, 5, or 8, write x1+x2=3y1+5y2+8y3x_1+x_2=3y_1+5y_2+8y_3 with y1+y2+y3=1y_1+y_2+y_3=1 and yi∈{0,1}y_i\in\{0,1\}.
  • An even number of three yes decisions can take only the values 0 and 2.

Prerequisites

Sources

Symbols: element of, sum

Last updated: 27 October 2026 11:52