You are on page 1of 54

• Many complex problems can be modeled using 0–1 variables and other

variables that are constrained to have integer values.


• A 0–1 variable is a decision variable that must equal 0 or 1. Usually a 0–1
variable corresponds to an activity that either is or is not undertaken.
• If the 0–1 variable corresponding to the activity equals 1, the activity is
undertaken; if it equals 0, the activity is not undertaken.
• A 0–1 variable is also called a binary variable.
• Optimization models in which some or all of the variables must be integers are
known as integer programming (IP) models.
• Any optimization software, including Excel’s Solver, typically has a much
harder time solving an IP problem than an LP problem.
• When Excel’s Solver solves a linear model without integer constraints, it uses a very
efficient algorithm, the simplex method, to perform the optimization.
• The simplex method is efficient because it typically examines only a very small fraction
of the hundreds, thousands, or even millions of possible corner points before
determining the best corner point.
XPs produced Basics=x1
6 XPs=x2

5 Maximize 6x1 + 7x2 {Net Profit}

4 subject to:
4x1 + 5x2 < 20
10x1 + 7x2 < 35
3 3x1 + 4x2 > 6
x1, x2 > 0 {non-negativity}
2
FEASIBLE
1 REGION

0 1 2 3 4 5
Basics Produced
XPs produced Basics=x1
6 XPs=x2

5 Maximize 6x1 + 7x2 {Net Profit}

4 subject to:
x1 = 1.59 4x1 + 5x2 < 20
x2 = 2.73 10x1 + 7x2 < 35
3 3x1 + 4x2 > 6
x1, x2 > 0 {non-negativity}
2
FEASIBLE
1 REGION

0 1 2 3 4 5
Basics Produced
XPs produced Basics=x1
6 XPs=x2

5 Maximize 6x1 + 7x2 {Net Profit}


Optimal Solution
x1 = 0 4 subject to:
x2 = 4 x1 = 1.59 4x1 + 5x2 < 20
x2 = 2.73 10x1 + 7x2 < 35
Profit=28 3 3x1 + 4x2 > 6
x1, x2 > 0 AND INTEGER
2 (ALL INTEGER PROBLEM)

0 1 2 3 4 5
Basics Produced
Basics=x1
Advertising
6 XPs=x2

5 Maximize 6x1 + 7x2 {Net Profit}


Optimal Solution
4 x1 = 1 subject to:
x2 = 3.2 4x1 + 5x2 < 20
Profit=28.4 10x1 + 7x2 < 35
3 3x1 + 4x2 > 6
Only x 1, x 2 > 0
vertical 2 ONLY x1 IS INTEGER
(MIXED INTEGER PROBLEM)
lines are 1
the
feasible 0 1 2 3 4 5
Basics Produced
solutions
Basics=x1
Advertising
6 XPs=x2

5 Maximize 6x1 + 7x2 {Net Profit}


Optimal Solution
4 x1 = 1 subject to:
x2 = 3.2 4x1 + 5x2 < 20
Profit=28.4 10x1 + 7x2 < 35
3 3x1 + 4x2 > 6
Only x 1, x 2 > 0
vertical 2 ONLY x1 IS INTEGER
(MIXED INTEGER PROBLEM)
lines are 1
the
feasible 0 1 2 3 4 5
Basics Produced
solutions
XPs produced Basics=x1
6 XPs=x2

5 Maximize 6x1 + 7x2 {Net Profit}

4 subject to:
x1 = 1.59 4x1 + 5x2 < 20
x2 = 2.73 LP Relaxation: Gives the 10x1 + 7x2 < 35
3 3x1 + 4x2 > 6
Profit = 28.65 upper bound of the
x1, x2 > 0 AND INTEGER
2 integer optimal solution (ALL INTEGER PROBLEM)

0 1 2 3 4 5
Basics Produced
XPs produced Basics=x1
6 XPs=x2

5 Is it true for Maximize 6x1 + 7x2 {Net Profit}


x1 = 1.59 ROUNDING Minimization IP?
4 x2 = 2.73 subject to:
UP
4x1 + 5x2 < 20
x1 = 2 10x1 + 7x2 < 35
3 x2 = 3 3x1 + 4x2 > 6
In Maximization IP, rounding
down gives a feasible solution x1, x2 > 0 {non-negativity}
2
x1 = 1
1 x2 = 2
ROUNDING
DOWN 0 1 2 3 4 5
Basics Produced
XPs produced
6

5
ROUNDING
4 UP

3
In Minimization IP, rounding up
2 gives a feasible solution

1
ROUNDING
DOWN 0 1 2 3 4 5
Basics Produced
• The solution procedure used by Solver is called branch and bound.
• Consider a model with 100 changing cells, all constrained to be binary. Because there
are only two values for each binary variable - 0 and 1 - there are potentially 2100
feasible solutions, although many of these might not satisfy all of the constraints.
• Unfortunately, 2100 is an extremely large number, so it would take even a very fast
computer a long time to check each one of them. Therefore, the naive method of
complete enumeration of all possible solutions - look at each solution and select the
best - is usually impractical.
• However, implicit enumeration is often very practical. This approach
examines only a fraction of all 2100 potential solutions and guarantees that
solutions not examined have no chance of being optimal.
• A general idea is the essence of the branch and bound method used by
Solver in IP models.
• The branching part means that the algorithm systematically searches through the set
of all feasible integer solutions, creating branches, or subsets, of solutions as it goes.
• The key, however, is the bounding part of the algorithm. Every time the best feasible
solution is found, it is called the incumbent solution – the best so far. It is the easy part
of the bounding procedure, and the solution represents a lower bound on the optimal
solution (for a maximize objective).
• The upper bound is more difficult to find, and the procedures used to find upper bounds
are beyond the level of this course.
• The Solver Options dialog box
contains a Tolerance setting,
which is relevant for integer-
constrained models.
• Excel’s default tolerance is 1%
or 5%. In Excel 2010, this
setting, listed as Integer
Optimality (%), is found under
Solver Options in the dialog box
shown here.
• The Tolerance option, relates to the LP relaxation of an IP model.
• This is the same model as the IP model, except that all integer constraints
are omitted.
• In particular, cells that are originally constrained to be binary are allowed under
the LP relaxation to have any fractional values between 0 and 1 (including 0 and 1).
• The LP relaxation is typically easy to solve (using the simplex method), and
it provides a bound for the IP model.
• A tolerance setting of 5% means that Solver stops as soon as it finds a
feasible (integer) solution to the IP model that is within 5% of the
current upper bound.
• Initially, the optimal objective value of the LP relaxation serves as the
upper bound. As Solver proceeds to find solutions that satisfy the
integer constraints, it keeps updating the upper bound.
• The important point is that when Solver stops, it guarantees an integer
solution that is within at least 5% of the optimal integer solution.
• The implication is that if you set the tolerance to 0%, Solver will (in theory)
run until it finds the optimal integer solution. So why isn’t a tolerance setting
of 0% always used?
• The reason is that for many IP models, especially large models, it can take
Solver a long time to find the optimal solution (or guarantee that the best
solution found so far is optimal).
• On the other hand, a solution that is close to optimal - within 5%, say - can
often be found quickly.
• When you run Solver on some of the difficult problems, you might get
different messages, shown below.

• You have two options:


1. Change the options in Solver settings
2. Click on Continue to let Solver run longer. The second option is recommended.
• The Tatham Company is considering seven investments. The cash required for each investment and
the net present value (NPV) each investment adds to the firm are given in the table shown here.
• The cash available for investment is $15,000.
• The crucial assumption here is that if Tatham wishes to take part in any of these investments, it
must go “all the way.” It cannot, for example, go halfway in investment 1 by investing $2500 and
realizing an NPV of $8000.
Investment Cash Required NPV
1 $5,000 $16,000
2 $2,500 $8,000
3 $3,500 $10,000
4 $6,000 $19,000
5 $7,000 $22,000
6 $4,500 $12,000
7 $3,000 $7,500

• Objective: Develop an IP model to maximize the NPV.


Variables and Constraints
• The solution of this problem is quite straightforward. Tatham must keep
track of:
• Investments chosen
• Total cash required for the chosen investments
• Total NPV from the chosen investments
Input Variables Initial cash required for investments, NPVs from investments, budget
Decision Variables (Changing Cells) Whether to invest (binary variables)
Objective Cell Total NPV
Other Calculated Variables Total initial cash required
Constraints Total initial cash required ≤ Budget
Developing the model
• To keep track of which investments are chosen, we use a 0-1 variable for each
investment. If a particular investment is chosen, the 0-1 variable for this investment
will equal 1; if it is not chosen, the 0-1 variable will equal 0.
Developing the model
• To develop this model, proceed as follows.
1. Inputs. Enter the initial cash requirements, the NPVs, and the budget in the shaded
ranges.
2. 0-1 values for investments. Enter any trial 0-1 values for the investments in the
Investment_levels range. (Even fractional values such as 0.5 can be entered in these
cells. The Solver constraints will eventually force them to be 0 or 1.
3. Cash invested. Calculate the total cash invested in cell B14 with the formula
=SUMPRODUCT(B5:H5,Investment_levels). Note that this formula “picks up” the
NPV only for those investments with 0-1 variables equal to 1.
4. NPV contribution. Calculate the NPV contributed by the investments in cell B17
with the formula =SUMPRODUCT(B6:H6,Investment_levels). Again, this picks up
only the NPVs of the investments with 0–1 variables equal to 1.
Developing the model
Tatham capital budgeting model Range names used:
Amount_invested =Model!$B$14
Input data on potential investments Budget =Model!$D$14
Investment 1 2 3 4 5 6 7 Investment_levels =Model!$B$10:$H$10
Investment cost $5,000 $2,500 $3,500 $6,000 $7,000 $4,500 $3,000 Total_NPV =Model!$B$17
NPV $16,000 $8,000 $10,000 $19,500 $22,000 $12,000 $7,500
NPV per investment dollar 3.20 3.20 2.86 3.25 3.14 2.67 2.50

Decisions: whether to invest


Investment levels 1 1 0 0 1 0 0

Budget constraint
Amount invested Budget
$14,500 <= $15,000

Objective to maximize
Total NPV $46,000
Using Solver
• We want to maximize the
total NPV, subject to staying
within the budget.
• However, we also need to
constrain the changing cells to
be 0-1.
• With the Solver this is simple,
as shown in the dialog box
here.
Using Solver
• We add a constraint with Investments in the
left box and choose the “bin” option in the
middle box.
• The “binary” in the right box is added
automatically.
• Note that if all changing cells are binary, we
do not need to check Solver’s Assume Non-
Negative option, but we should still choose
the Simplex LP method if the model is linear,
as it is here.
The Solution
• The optimal solution that was shown indicates that Tatham can obtain a
maximum NPV of $46,000 by selecting investments 1, 2, and 5.
• These three investments use up only $14,500 of the available budget, with
$500 left over. However, this $500 is not enough – investing all the way is
required – to invest in any of the remaining investments.
• If we rank Tatham’s investments on the basis of NPV per dollar invested, the
ranking from best to worst is 4, 1, 2, 5, 3, 6, 7.
• Using your economic intuition, you might expect the investments to be chosen
in this order, until the budget runs out.
• However, the optimal solution does not do this. It selects the 2nd , 3rd and 4th
best investments but ignores the best.
The Solution
• To understand why this is the case, suppose Tatham invests in the three
highest-ranking investments: 4, 1, and 2.
• This uses up $13,500 of the budget, with $1500 left over and unusable. This
strategy provides an NPV of $43,500.
• The optimal solution gains you an addition $2,500 NPV.
Oneway analysis for Solver model in Model worksheet Sensitivity of Total_NPV

Sensitivity Analysis Budget (cell $D$14) values along side, output cell(s) along top Data for chart

• We select the Budget cell as the single

Investment_levels_1

Investment_levels_2

Investment_levels_3

Investment_levels_4

Investment_levels_5

Investment_levels_6

Investment_levels_7

Amount_invested
input cell, allow it to vary from $15,000

Total_NPV

Total_NPV
to $25,000 in increments of $1000, and 9

keep track of the total NPV, the amount $15,000


$16,000
1
0
1
1
0
0
0
1
1
1
0
0
0
0
$14,500
$15,500
$46,000
$49,500
46000
49500
$17,000 1 1 1 1 0 0 0 $17,000 $53,500 53500
of the budget used, and the binary $18,000 1 0 0 1 1 0 0 $18,000 $57,500 57500
$19,000 0 1 1 1 1 0 0 $19,000 $59,500 59500
variables. $20,000
$21,000
0
1
1
1
0
0
1
1
1
1
1
0
0
0
$20,000
$20,500
$61,500
$65,500
61500
65500

• Here we see the total NPV varies as the $22,000


$23,000
1
1
0
0
1
0
1
1
1
1
0
1
0
0
$21,500
$22,500
$67,500
$69,500
67500
69500
$24,000 1 1 1 1 1 0 0 $24,000 $75,500 75500
budget increases. $25,000 1 1 0 1 1 1 0 $25,000 $77,500 77500

• Tatham can achieve a larger NPV with a 90000


Sensitivity of Total_NPV to Budget

larger budget, but as the numbers and 80000


This is with Solver's
70000
the chart show, each extra $1000 of 60000
tolerance at 0.

budget does not have the same effect on 50000


40000

total NPV. 30000


20000
10000
0

Budget ($D$14)
Oneway analysis for Solver model in Model worksheet Sensitivity of Total_NPV

Budget (cell $D$14) values along side, output cell(s) along top Data for chart

Sensitivity Analysis

Investment_levels_1

Investment_levels_2

Investment_levels_3

Investment_levels_4

Investment_levels_5

Investment_levels_6

Investment_levels_7

Amount_invested
• Note also how selected

Total_NPV

Total_NPV
investments vary wildly as the $15,000 1 1 0 0 1 0 0 $14,500 $46,000
9
46000

budget increases. This somewhat $16,000


$17,000
0
1
1
1
0
1
1
1
1
0
0
0
0
0
$15,500
$17,000
$49,500
$53,500
49500
53500

strange behavior is due to the all- $18,000


$19,000
1
0
0
1
0
1
1
1
1
1
0
0
0
0
$18,000
$19,000
$57,500
$59,500
57500
59500

or-nothing nature of the problem. $20,000


$21,000
0
1
1
1
0
0
1
1
1
1
1
0
0
0
$20,000
$20,500
$61,500
$65,500
61500
65500
$22,000 1 0 1 1 1 0 0 $21,500 $67,500 67500
$23,000 1 0 0 1 1 1 0 $22,500 $69,500 69500
$24,000 1 1 1 1 1 0 0 $24,000 $75,500 75500
$25,000 1 1 0 1 1 1 0 $25,000 $77,500 77500

Sensitivity of Total_NPV to Budget


90000
80000
This is with Solver's
70000
tolerance at 0.
60000
50000
40000
30000
20000
10000
0

Budget ($D$14)
Oneway analysis for Solver model in Model worksheet Sensitivity of Total_NPV to Budge

Budget (cell $D$14) values along side, output cell(s) along top Data for chart

• Sensitivity Analysis When you s

Investment_levels_1

Investment_levels_2

Investment_levels_3

Investment_levels_4

Investment_levels_5

Investment_levels_6

Investment_levels_7
dropdown l

Amount_invested
will adapt to

• To illustrate the effect of

Total_NPV

Total_NPV
9
Solver Tolerance setting, $15,000
$16,000
1
0
1
1
0
0
0
1
1
1
0
0
0
0
$14,500
$15,500
$46,000
$49,500
46000
49500

compare the SolverTable $17,000


$18,000
$19,000
1
1
0
1
0
1
1
0
1
1
1
1
0
1
1
0
0
0
0
0
0
$17,000
$18,000
$19,000
$53,500
$57,500
$59,500
53500
57500
59500

results here (tolerance = $20,000


$21,000
1
1
0
1
1
0
0
1
1
1
1
0
0
0
$20,000
$20,500
$60,000
$65,500
60000
65500
$22,000 1 1 0 1 1 0 0 $20,500 $65,500 65500
5%) with those before $23,000
$24,000
0
1
1
1
0
1
1
1
1
1
1
0
1
0
$23,000
$24,000
$69,000
$75,500
69000
75500

(tolerance = 0%). $25,000 1 1 0 1

This is with Solver's tolerance at 5%.


1 1 0 $25,000 $77,500 77500

The three gray cells are larger than on


the previous sheet, which indicates that
they are not optimal.

Sensitivity of Total_NPV to Budget


90000
80000
70000
60000
50000
40000
30000
20000
10000
0

Budget ($D$14)
• Sensitivity Analysis
• The latter figure uses Solver’s default tolerance, whereas the former uses a
tolerance of 0%.
• The three shaded cells in the figure on the previous slide indicate lower NPV
than the corresponding cells in the figure for 0% tolerance setting.
• This is because in these three settings, Solver stopped short of finding the
true optimal solutions because it found solutions within the 5% tolerance
and then quit.
• In many situations, a cost is incurred if an activity is undertaken at any positive level. This
cost is independent of the level of the activity and is known as a fixed cost (or fixed
charge).
• Here are three examples of fixed costs:
• The construction of a warehouse incurs a fixed cost that is the same whether the warehouse is
built with a low- or a high-capacity level.
• A cash withdrawal from a bank incurs a fixed cost, independent of the size of the withdrawal.
• A machine that is used to produce several products must be set up for the production of each
product. Regardless of the batch size produced, the same fixed cost (lost production due to the
setup time) is incurred.
• In these examples, a fixed cost is incurred if an activity is undertaken at any positive level,
whereas no fixed cost is incurred if the activity is not undertaken at all.
• Although it might not be obvious, this feature makes the problem inherently nonlinear,
which means that a straightforward application of LP is not possible.
• However, a clever use of 0–1 variables can result in a model with linear constraints and a
linear objective.
• It is important to realize that you do not simply create an LP model and then add
integer constraints.
• Instead, you use 0-1 variable to model the logic.
• The logic in this section is that if a certain activity is done on any positive level, a fixed
cost is incurred.
• No fixed cost is incurred if the activity is not done at all.
• Solver is able to handle linear models with binary variables, so this is the approach you
should take whenever possible.
• The Great Threads Company is capable of manufacturing shirts, shorts, pants, skirts, and jackets.
• Each type of clothing requires that Great Threads have the appropriate type of machinery available.
• The machinery needed to manufacture each type of clothing must be rented at the following rates.
Each type of clothing requires the amounts of cloth and labor given in the following table. This table
also shows the unit variable cost and selling price for each type of clothing.
Rental Cost Labor Hours Cloth (sq yd) Selling Price Unit Variable Cost
Shirts $1500 2.0 3.0 $35 $20
Shorts $1200 1.0 2.5 $40 $10
Pants $1600 6.0 4.0 $65 $25
Skirts $1500 4.0 4.5 $70 $30
Jackets $1600 8.0 5.5 $110 $35
• There are 4000 hours and 4500 square yards of cloth available in a given week.
• Objective: The company wants to find a solution that maximizes its weekly profit.
Variables and Constraints
• The cost of producing x shirts during a week is 0 if x=0, but it is 1500+20x if x>0.
• The cost structure violates the proportionality assumption that is needed for a linear model.
• If proportionality were satisfied, then the cost of making, say, 10 shirts would be double the cost of
making 5 shirts. However, because of the fixed cost, the total cost of making 5 shirts is $1600, and
the cost of making 10 shirts is only $1700. This violation of proportionality requires us to resort 0-1
variables to obtain a linear model.
Input Variables Fixed rental costs. Resource availabilities (labor, cloth) per unit, selling prices, unit variable
costs
Decision Variables (Changing Cells) Whether to produce (binary), how much to produce any of each type of clothing
Objective Cell Profit
Other Calculated Variables Resources used, upper limits on amounts to produce, total revenue, total variable cost,
total fixed cost
Constraints Amounts produced ≤ Logical upper limit (capacity)
Resources used ≤ Resources available
Developing the model
• To model the Great Threads problem, we need to keep track of the following:
• Number of shirts, shorts, pants, skirts, and jackets produced
• 0-1 variable for each type of clothing that indicates whether any of that type of clothing
is produced
• Resource usage of labor and cloth
• Total profit, which equals revenue from sales minus the cost of renting machines minus
the variable cost of producing clothing
• We must also ensure that if any of a given type of clothing is produced, then its 0-1 variable
equals 1.
Developing the model
To formulate the model, follow these steps:
1. Inputs. Enter the given inputs in the blue ranges.
2. Binary values for clothing types. Enter any trial values for the 0-1 variables for the various
clothing types in the Units_produced range.
3. Production quantities. Enter any trial values for the numbers of the various clothing types
produced in the Units_produced range.
4. Labor and cloth used. In cell B22 enter the formula =SUMPRODUCT(B5:F5, Units_produced).
Then copy this to cell B23 to calculate the amount of cloth used.
5. Effective capacities. We need to ensure that if any of the given type of clothing is produced,
then its 0-1 variable equals 1. This ensures that the model incurs the cost of renting a machine
for this type of clothing. Excel’s Solver is unable to deal with IF Functions accurately. Therefore,
we instead model the fixed cost constraint as follows:
Shirts produced  Maximum capacity X (0-1 variable for shirts). Of course, there are similar
inequalities for other clothings.
Developing the model
The logic behind inequality:
• If the 0-1 variable for shirts is 0, then the right side of the inequality is 0, which means that the left
side must be 0 – no shirts can be produced. That is, if the 0-1 variable for shirts is 0, so that no
fixed cost for shirts is incurred, then the inequality does not allow Great Threads to “cheat” and
produce a positive number of shirts.
• On the other hand, if the 0-1 variable for shirts is 1, then the inequality is certainly true. It simply
says that the number of shirts produced must be no greater than the maximum number that can
be produced.
• The inequality rules out the one case we want to rule out, namely, that Great Threads produces
shirts but avoids the fixed cost. However, it will allow the 0-1 variable to be 1 even if Great Threads
plans to produce no shirts.
Developing the model
To implement the inequality, we need an upper limit on the number of shirts that could be
produced. To obtain this, observe that the number of shirts that could be produced is
limited by the smaller of
𝐴𝑣𝑎𝑖𝑙𝑎𝑏𝑙𝑒 𝐿𝑎𝑏𝑜𝑟 𝐻𝑜𝑢𝑟𝑠
𝐿𝑎𝑏𝑜𝑟 ℎ𝑜𝑢𝑟𝑠 𝑝𝑒𝑟 𝑠ℎ𝑖𝑟𝑡
and
𝐴𝑣𝑎𝑖𝑙𝑎𝑏𝑙𝑒 𝑠𝑞𝑢𝑎𝑟𝑒 𝑦𝑎𝑟𝑑𝑠 𝑜𝑓 𝑐𝑙𝑜𝑡ℎ
𝑆𝑞𝑢𝑎𝑟𝑒 𝑦𝑎𝑟𝑑𝑠 𝑜𝑓 𝑐𝑙𝑜𝑡ℎ 𝑝𝑒𝑟 𝑠ℎ𝑖𝑟𝑡

Therefore, the smaller of these can be used as the maximum needed in the inequality. So, in
cell B18, calculate the “effective capacity” for shirts with the formula
=B14*MIN($D$22/B5,$D$23/B6). Then copy this formula to the range C18:F18 for the
other types of clothes.
Developing the model
6. Monetary values. Calculate the total sales revenue and the total variable cost
by entering the formula =SUMPRODUCT(B8:D8,Units_produced) in cell B26 and
copying it to cell B27. Then calculate the total fixed cost in the cell B28 with the
formula =SUMPRODUCT(B10:F10,Rent_equipment). Note that this formula
picks up the fixed costs only for those products with 0-1 variables equal to 1.
Finally, calculate the total profit in the Profit cell with the formula =B26-B27-
B28.
Great Threads fixed cost clothing model Range names used:
Effective_capacity =Model!$B$18:$F$18
Developing the Input data on products
Shirts Shorts Pants Skirts Jackets
Rent_equipment
Profit
=Model!$B$14:$F$14
=Model!$B$29
model Labor hours/unit
Cloth (sq. yd.)/unit
2
3
1
2.5
6
4
4
4.5
8
5.5
Resource_available
Resource_used
=Model!$D$22:$D$23
=Model!$B$22:$B$23
Units_produced =Model!$B$16:$F$16
Selling price/unit $35 $40 $65 $70 $110
Variable cost/unit $20 $10 $25 $30 $35
Fixed cost for equipment $1,500 $1,200 $1,600 $1,500 $1,600

Production plan, constraints on capacity


Shirts Shorts Pants Skirts Jackets
Rent equipment 0 1 0 0 1

Units produced 0 965.52 0 0 379.31


<= <= <= <= <=
Effective capacity 0.00 1800.00 0.00 0.00 500.00

Constraints on resources
Resource used Available
Labor hours 4000.00 <= 4000
Cloth 4500.00 <= 4500

Monetary outputs
Revenue $80,345
Variable cost $22,931
Fixed cost for equipment $2,800
Profit $54,614 Objective to maximize
Using Solver
• We maximize the profit, subject to not using
more hours or cloth than is available, and
we ensure that production is no greater
than effective capacity.
• The key is that this effective capacity is 0 if
we decide not to produce any of a given
product.
• Also, make sure to check the Assume Linear
Model and Assume Non-Negative boxes
under Solver options, and set the tolerance
to 0%.
The Solution
• From the optimal solution shown before, we see that Great Threads should produce about
966 shorts and 379 jackets, but no shirts, pants or skirts.
• The total profit is $54,614. Note that the 0-1 variables for shirts, pants, and skirts are 0,
which forces production of these products to be 0.
• However, the 0-1 variable for shorts and jackets, the products that is produced is 1. This
ensures that the fixed cost of producing shirts is included in the total cost.
• It may be helpful to think of this solution as occurring in two stages.
• In the first stage the Solver determines which products to produce – in this case, shorts and
jackets only.
• Then in the second stage, the Solver specifies how many shorts and jackets to produce.
The Solution
• Of course, these two stages are interrelated, and the Solver considers both of
them in its solution process.
• The Great Threads management might not be very excited about being a shorts
and jackets only shop.
• Suppose the company wants to ensure that at least three types of clothing are
produced at positive levels.
• One approach is to add another constraint, namely, that the sum of the 0-1
values in row 14 is greater than or equal to 3.
• You can check, however, that when this constraint is added and the Solver is
rerun, the 0-1 variable for skirts becomes 1, but no skirts are produced.
The Solution
• Shorts and jackets are more profitable than skirts, so only shorts and jackets are
produced.
• The new constraint forces Great Threads to rent an extra piece of machinery,
but it doesn’t force the company to use it.
• To force the company to produce some shirts, we would also need to add a
constraint on the value in E16, such as E16>=100.
• Any of these additional constraints will cost Great Threads money, but if they
want to produce more than two types of clothing, this is their only option.
Sensitivity Analysis
• Because the optimal solution currently calls for only shorts and jackets to be
produced, an interesting sensitivity analysis is to see how much “incentive” is
required for other products to be produced.
• One way to check this is to increase the sales prices for a nonproduced product
such as skirts in a one-way Solver Table.
Oneway analysis for Solver model in Model worksheet Sensitivity of Profit to Selling price skirts

Selling price skirts (cell $E$8) values along side, output cell(s) along top Data for chart

Sensitivity Analysis

Rent_Equipment_1

Rent_Equipment_2

Rent_Equipment_3

Rent_Equipment_4

Rent_Equipment_5
When you select an
dropdown list in cell
will adapt to that ou

• When the sales price for skirts

Profit

Profit
6

is $85 or less, the company $70


$75
0
0
1
1
0
0
0
0
1
1
$54,614
$54,614
54613.79
54613.79

continues to produce only $80


$85
$90
0
0
0
1
1
0
0
0
0
0
0
1
1
1
0
$54,614
$54,614
$58,500
54613.79
54613.79
58500

shorts and jackets. $95


$100
0
0
0
0
0
0
1
1
0
0
$63,500
$68,500
63500
68500

• However, when the sales 80000


Sensitivity of Profit to Selling price skirts

price is $90 or greater, the 70000

60000

company stops producing 50000

shorts and jackets and


40000

30000

produces only skirts. 20000

10000

0
$70 $75 $80 $85 $90 $95 $100
Selling price skirts ($E$8)
• A model with IF functions
• In case you are doubtful if binary variable approach is required, and you think
IF functions could be used instead, prepare a new model with the following
changes:
• The resulting model will look the same, but it incorporates the following
changes:
• We no longer use the binary range as part of the changing cells range. Instead, we enter
the formula =IF(B16>0,1,0) in cell B14 and copy it across to cell F14.
• We model the effective capacities in row 18 with IF functions. Specifically, we enter the
formula =IF(B16>0,MIN($D$22/B5,$D$23/B6),0) in cell B18 and copy it across to cell F18.
• A model with IF functions
• Change the Solver dialog box so
that it appears as shown below.
The Rent_equipment range is not
part of the changing cells range,
and there is no binary constraint.
• A model with IF functions
• What do you find?

You might also like