Binary variables
Binary Variables
Binary variables are integer variables that can only be zero or one.
Definition
A binary variable satisfies:
\[y\in\{0,1\}.\]It is also written as:
\[y\in\mathbb{B}.\]Meaning
Usually:
\[y=1\]means the decision is selected, active, open, installed, or true.
\[y=0\]means the decision is not selected, inactive, closed, not installed, or false.
Selection Example
If project $j$ can either be chosen or not chosen, define:
\[y_j=\begin{cases} 1, & \text{if project }j\text{ is chosen},\\ 0, & \text{otherwise}. \end{cases}\]Fixed-Charge Pattern
Suppose producing a product requires activating a machine. Let $x$ be the production quantity and $y$ binary.
A common linking constraint is:
\[x\le My.\]If $y=0$, then $x=0$. If $y=1$, production is allowed up to $M$.
Either-Or Decisions
Binary variables can model choices such as:
- choose at most one option
- choose at least one option
- open or close a facility
- use or do not use a route
- include or exclude an item
Checklist
Whenever the problem says choose, include, open, activate, assign, yes/no, or either/or, look for a binary 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.