
Thus, we can accommodate logical constraints among related variables within the
framework of linear programming with binary variables. The Newton Corporation
example illustrates how we might incorporate counting constraints, such as “at most
2,” or qualitative information, such as contingency or mutual exclusivity. Such
relationships usually require some specialized constraints in the model in addition
to the use of binary variables. In the remainder of this chapter, we elaborate on
models containing other logical constraints by examining a series of illustrative
problem types.
7.2. LINKING CONSTRAINTS: THE FIXED
COST PROBLEM
Linear objective functions assume strict proportionality: In particular, the cost
incurred by an activity is proportional to the activity level. However, we commonly
encounter situations in which an activity cost is compo sed of a fixed component
and a variable component, where only the variable cost is proportional to the level
of activity. Using a binary variable, we can represent the fixed cost as part of the objec-
tive function and still work with a linear model.
Suppose that we have already built a linear programming model, but one variable
(x) has a fixed cost that we want to represent in the objective function. To incorporate a
fixed cost into the model, we first separate the fixed and variable components of cost.
In algebraic terms, we write total cost in the following form
Total cost = Fixed cost + Variable cost
BOX 7.1
Excel Mini-Lesson: Binary Variables and the IF Function
Experienced users of Excel will see little difficulty in modeling a contingency constraint
if they are familiar with the IF function. A logical statement of the contingency between
P3 and P5 could include the recalculation P5 in light of P3. Once P3 and P5 have initial
values, we could recalculate P 5 in cell F6 according to the contingency by using the
formula
¼ IF(P3¼ 1,P5,0)
This formula would take the original value of P5ifP3 ¼ 1, but it would become zero other-
wise (i.e. if P3 ¼ 0). The objective function can then be expressed with the formula
¼ SUMPRODUCT ($B$5:$E$5,B8:E8)+$F$6
∗
F8
A similar function can represent the left-hand side of each of the constraints. However, the
IF function is not a linear function. If the Nonsmooth Transformation option is set to Never
and we specify the linear solver, we encounter an error message stating that the model does
not satisfy the linearity conditions. To use Solver reliably for integer programming, the IF
function should be avoided.
7.2. Linking Constraints: The Fixed Cost Problem
255