Integer variables
Integer Variables
Integer variables are decision variables that must take whole-number values.
Definition
A variable $x_j$ is integer if:
\[x_j\in\mathbb{Z}.\]If it also cannot be negative:
\[x_j\in\mathbb{Z}_+.\]When to Use Them
Use integer variables for countable objects such as:
- workers
- machines
- trucks
- products that cannot be split
- projects
- courses
- shifts
- purchased units
Example
If $x_1$ is the number of researchers of first level to hire, then:
\[x_1\in\mathbb{Z}_+.\]A value such as $x_1=6.5$ is not meaningful.
Continuous vs Integer
A continuous variable can represent quantities like kilograms, money, hours, or hectares when fractional values make sense.
An integer variable represents indivisible quantities.
Bounds
Integer variables often have lower and upper bounds:
\[L_j\le x_j\le U_j,\] \[x_j\in\mathbb{Z}.\]Bounds make the model clearer and can help solvers.
Checklist
Ask: can this quantity be fractional in the real problem?
If not, use an integer variable.
See Also
Exam checkpoint
For ILP questions, state clearly which variables are integer or binary. Do not use the LP relaxation answer as the integer answer unless it is already integral.