Chapter 2 - Linear Programming (Part 2 - Excel Solver)
Chapter 2 - Linear Programming (Part 2 - Excel Solver)
nzah@utm.my-20232024(S1)
3
Setting up the Problem in Excel
4
Solver and Its Features
5
The Simplex Method
6
Solver Add-Ins
1
The Solver Add-In must be added to the Tools menu by carry
out the following steps (once-only):
o Select the menu: File > More > Options > Add-ins > Excel
Add-ins (this will take a few moments to load the
necessary file).
o From the dialogue box presented, check the box for
Solver Add-In.
o After clicking OK, you will then be able to access the
Solver option from the Data tab.
7
Example: Reddy Mikk Company Case Study
Variables:
X1 = tons produced daily of exterior paint
X2 = tons produced daily of interior paint
Z = total daily profit (in thousands of dollars)
Objective: Maximize, Z = 5X1 + 4X2
Constraints:
1. 6𝑋! + 4𝑋" ≤ 24 (raw material M1)
2. 𝑋! +2𝑋" ≤ 6 (raw material M2)
3. 𝑋" − 𝑋! ≤ 1
4. 𝑋" ≤ 2
5. 𝑋! ≥ 0; 𝑋" ≥ 0
8
8
Example: Reddy Mikk Company Case Study
Formulating the Model on a Spreadsheet
Three types of information required to begin the process of using the spreadsheet to formulate
a linear programming model for the problem.
(1) Input data cells (B5:C9 and F6:F9)
(2) Cells representing the variables and the objective function (B13:D13)
(3) Algebraic definitions of the objective function and the left-hand side of the constraints
(cells D5:D9)
9
Example: Reddy Mikk Company Case Study
Algebraic Definition
§ Place the resulting formulas appropriately in cells D5:D9, as the following table shows:
§ Actually, you only need to enter the formula for cell D5 and then copy it into cells D6:D9
§ To do so correctly, it is necessary to use fixed referencing of the cells representing X1 and X2
($B$13 and $C$13).
§ The explicit formulas just described are impractical for large LPs. Instead, the formula in
cell D5 can be written compactly as = SUMPRODUCT(B5:C5,$B$13:$C$13)
10
Example: Reddy Mikk Company Case Study
Apply Excel Solver
§ Click Solver from the spreadsheet menu bar to access Solver parameters dialogue box.
Choose cells of
decision variables
Define Constraints
11
Example: Reddy Mikk Company Case Study
Apply Excel Solver (cont’d)
1
2
12
Example: Reddy Mikk Company Case Study
Apply Excel Solver (cont’d)
§ A new dialogue box ”Solver Results” will prompt. Then, it show the status of the solution.
§ The optimum value of Z will appear in cell D5 and the values of X1 and X2 will go to cells B13 and
C13, respectively.
§ For convenience, cell D13 exhibits the optimum value of Z by entering the formula = D5 in cell
D13, thus displaying the entire optimum solution in contiguous cells.
13
Solution from Solver
14
Solution from Solver (cont’d)
§ A range is created by highlighting the desired cells (Example: D5), typing the range name in the
top left box of the sheet, and then pressing Return.
15
EXERCISES
Use Excel Solver to solve the following problem.
#1: The Alex Garment Company manufactures men’s shirts and women’s blouses. The production process includes cutting,
sewing, and packaging. The company employs 25 workers in the cutting department, 35 in the sewing department, and 5 in
the packaging department. The factory works one 8-hr shift, 5 days a week. The following table gives the time requirements
and profits per unit to produce the two garments. Determine the optimal weekly production schedule for Alex Garment
Company.
#2: In Hamid grocery store, shelf space is limited and must be used effectively to increase profit. Two cereal items, Grano
and Wheatie, compete for a total shelf space of 60 ft2 . A box of Grano occupies 0.2 ft2 and a box of Wheatie needs 0.4 ft2 . The
maximum daily demands of Grano and Wheatie are 200 and 120 boxes, respectively. A box of Grano nets $1.00 in profit and a
box of Wheatie $1.35. Hamid thinks that because the unit profit of Wheatie is 35% higher than that of Grano, Wheatie should be
allocated 35% more space than Grano, which amounts to allocating about 57% to Wheatie and 43% to Grano. Determine the
optimal value for the items to be allocated on the shelf to maximise the profit.
16
EXERCISES
Use Excel Solver to solve the following problem.
#3: A firm has two bottling plant. One plant located at Coimbatore and other plant located at
Chennai. Each plant produces three types of drinks; Coca-Cola , Fanta and Thumps-up. The
following table show the data.
Number of bottles produced per day by plant at
Product Coimbatore Chennai
Coca-Cola 15000 15000
Fanta 30000 10000
Thumps-Up 20000 50000
Market survey indicates that during the month of April there will be a demand of 200,000 bottles of
Coca-cola , 400,000 bottles of Fanta and 440,000 bottles of Thumps-up. For how many days each
plant be run in April to minimize the production cost, while still meeting the market demand?
17