Using Linear Programming
to Solve a Makevs.Buy Decision Problem

Here we present a simple hypothetical example to demonstrate basic Linear Programming optimization concepts.
The example involves a company that assembles three types of electric motor. Assembly involves two major
steps: winding the motor's armature (winding copper wire repeatedly around a solid iron core), which requires
specially trained labor to accomplish properly; and then assembling the completed armature and other parts
(field magnet, commutator, brushes, etc.) into a finished motor, which also requires specialized training.
The company has just received an order that is too large to fill using only the company's own labor
resources. Therefore it must subcontract one of its competitors to fill the remaining portion of the
order.
The following table shows the basic setup of the problem. Our objective is to fulfill the
order at the lowest possible total cost. The cells containing zeroes are the initially unknown
quantities that will be adjusted using Linear Programming. Decision variables are shown
in green, constrained variables in red, and the objective in blue:
Several things can be determined from the project setup table above:
 Motor model 1 is the least expensive to assemble; model 3 is the most expensive
 Outsourcing the labor to the subcontractor is more costly than using inhouse labor, and the labor cost
differential varies slightly from one motor model to the next
 A total of 5,700 finished motors are needed: 2,800 of model 1; 1,900 of model 2; and 1,000 of model 3
 Because of design differences, each of the motor models requires somewhat different numbers of hours for
the armature winding task and the final parts assembly task
 There are a total of 9,500 labor hours available for armature wiring and 4,900 labor hours available for
parts assembly in the company that was awarded the contract. (The cost to buy motors from the
subcontractor is a fixed price per motor, and the subcontractor has said they can meet whatever demand the
contracting company can't fulfill; so we don't need to worry about the subcontractor's labor hours.)
Because each of the two assembly tasks is quite different and requires specialized training, specialists are
assigned to each task, and one type of specialist can perform only the task for which they were trained
And here is the optimal solution determined by Linear Programming:
The above table tells us several things, not all of which are necessarily intuitively obvious beforehand:
 The contracting company will assemble all of the model 1 and model 3 motors in house; and it will
subcontract the assembly of 1,167 model 2 motors to its competitor, while assembling 733 of the model 2 motors
in house, at a total project cost of $430,033
 This will completely fulfill the order, using 7,433 of the contracting company's 9,500 available armature
wiring labor hours and all 4,900 available parts assembly labor hours
 Perhaps somewhat counterintuitively, although the makevs.buy cost differential per completed motor is
only $9 for motor model 1, but is $11 for motor model 2, the company nevertheless can minimize total cost
by assembling all model 1 motors in house and outsourcing the assembly of 1,167 model 2 motors
Solution Report
Here is a brief report summarizing the results of the optimization:
The first two sections of the table above confirm the results we saw previously for the final total
cost and the number of motors made inhouse and the number bought from the subcontractor. The third section
presents results for the model's constraints.
In this third section, the "Cell Value" column confirms the numbers we saw previously. The
"Status" column indicates whether or not a particular constraint is binding or not. For the optimal solution,
binding constraints are satisfied as strict equalities, whereas nonbinding constraints are not stict
equalities. For example, the values for the three electric motor models are all binding, because the
customer's order has been filled exactly: the number of motors available as a result of the assembly process is
equal to the number needed.
Similarly, the number of hours of specialized labor involved in the parts assembly is binding,
because all 4,900 hours of the available specially trained labor will be used. In contrast, only 7,433 of the
available 9,500 hours of specialized armaturewinding labor will be used if the modeled solution is
implemented.
The "Slack" column shows the difference, if any, between the resource constraints and the capacity
utilization. The slack value for Armature Winding is 2,067, which is the difference between the number of
labor hours used and the number available. The slack value for Parts Assembly is zero, because all 4,900
available labor hours have been used.
Moving farther down in the table to the nonnegativity conditions imposed on the model (i.e., we
cannot use fewer than zero labor hours, and we cannot assemble fewer than zero motors), the slack values indicate
how much the decision variables exceed their lower bounds of zero.
Sensitivity Analysis
Shown below is a sensitivity report for the electric motor solution. This report allows us to
determine how sensitive the optimal solution is to adjustments to various model coefficients.
For example, we can check to see how much each of the various coefficients could change without changing the
optimal solution. Let's examine some of the table columns in the top half of the table (the "Variable Cells")
to see how that would work. The first column shows the decision variables; the second column shows the final
number of motors assembled to fill the demand; the "Objective Coefficient" column lists the decision
variable coefficients as specified in the initial optimization problem setup.
The "Allowable Increase" and "Allowable Decrease" column entries show us how much the coefficients could be
increased or decreased without changing the optimal solution, assuming no change in any other
coefficients. For example, we could increase the inhouse assembly cost of motor model 1 by $2 or decrease it
by $59 without changing the optimal solution. And we could increase the subcontractor cost of assembling
motor model 2 by $3 or decrease it by $11 without changing the optimal solution.
Next we'll examine the bottom half of the table ("Constraints"). The "Final Value" column shows us how
much of each available resource was used in the motor assembly process. Because we assembled all needed
motors, the first three entries confirm that the final value matches the "Constraint Right Hand (R.H.) Side"
value.
And the "Allowable Increase" column value for the "Parts Assembly Used" row tells us that if we had
1,750 hours of additional inhouse labor available, we could make all of the motors inhouse instead of having
to subcontract any of the motor assembly. If we could do this, then we would use 6,650 inhouse Parts
Assembly labor hours and 8,600 inhouse Armature Winding labor hours. We could fulfill the customer's order
at a total cost of $417,200. This represents a cost savings of about $12,833.
The "Shadow Price" column entries tell us how much the objective function value changes given a oneunit change
in the value of the Right Hand value of the constraint, assuming all other constraints remain unchanged. In
this column the 7.333 value for "Parts Assembly Used" tells us that for each hour of inhouse Parts Assembly labor
we add to the project, we would reduce costs by $7.333. So if we multiply $7.333 X 1,750 we arrive
at the $12,833 total cost savings noted above.
Back to Top
Return to Optimization Programming main page
