Piecewise linear functions can be modeled using variables that satisfy what
is known as a special order set (SOS) constraint of type 2.
Consider the following example of a continuous piecewise linear function:
We introduce four nonnegative continuous variables x1, x2, x3, and x4.
We require
| x = 0x1 + 2x1 + 3x2 + 7x3, | (1) |
| x1+x2+x3+x4 = 1, | (2) |
| z = 3x1+11x2+9x3+13x4 | (3) |
The calculated value of z is not accurate if, for example, x1=0.5 and x4=0.5. The restriction we need to impose is that at most two of the xi can be nonzero, and the two nonzero xi must be adjacent. This is known as a SOS-2 constraint, that is, a special order set of type 2 constraint.
The SOS-2 restriction can be modeled using binary variables yi,
:
| John Mitchell | |
| mitchj@rpi.edu |