02 Basic Linear Programming
02 Basic Linear Programming
Linear programming
– Mathematical formulation
– Basic concepts
– Excel solver
Examples
– Wyndor Glass Company
Templates: WyndorGlassCompany_template.xls
Wyndor Glass Company 3
Although the products are expensive, they fill a market niche by providing
the highest quality available in the industry for the most discriminating
buyer.
Adapted from Frederick S. Hillier and Mark S. Hillier, Introduction to Management Science: A Modeling
and Case Studies Approach with Spreadsheets, 5/e, p 23-25.
Wyndor Glass Company 4
It is estimated that each door will require one hour of production time in
Plant 1 and three hours in Plant 3.
For each window, about two hours will be needed in Plant 2 and two hours
in Plant 3.
The production facilities in Plant 1 needed for the 8-foot glass doors will
be available approximately 40 hours per week. (The rest of the time Plant 1
will continue with current products.)
The production facilities in Plant 2 will be available for the 4-foot × 6-foot
double-hung windows about 90 hours per week.
3. Model formulation
4. Solution method
5. Model validation
• Incorporated all relevant factors & interrelationship?
• Model provides reasonable solutions?
• The solution improves upon what was actually done?
• What if assumptions are changed?
7. Implementation
Structuring the Decision Problem 8
Decisions to be made
Performance measure
Decision variables:
Objective function:
Constraints:
LP Component 1: Input Parameters 10
Examples:
– whether to support an R&D project or not
– number of salespeople to hire
– production level in a given period
– amount to buy from a given supplier
– how much to bid
Excel Solver
• It is a good idea to color code these “input cells” (e.g., light blue).
16
Changing Cells
Add a cell in the spreadsheet for every decision that needs to be made.
It is a good idea to color code these “changing cells” (e.g., yellow with
border).
17
Objective Cell
Develop an equation that defines the objective of the model.
Typically, this equation involves the data cells and the changing cells in
order to determine a quantity of interest (e.g., total profit or total cost).
E7: = C7*C12+D7*D12
19
Simplification: Use the $ Sign
It is cumbersome to type
E7: = C7*C12+D7*D12
E8: = C8*C12+D8*D12
E9: = C9*C12+D9*D12
A useful trick to simplify this: type one formula
E7: = C7*$C$12 + D7 *$D$12
and copy to E8:E9.
A shortcut to add the $ sign: select cell C12 and press the F4 key once
(for Windows).
Later we will use $ sign to fix only the column/row, not both.
20
Simplification: Use sumproduct Function
We can simplify
E7: = C7*$C$12 + D7*$D$12
by using
E7: = sumproduct (C7:D7, $C$12:$D$12)
21
A Trial Solution
If 40 doors and 30 windows are produced, then all constraints are satisfied
and the total profit is $27000.
Constraints:
1. Plant Capacity: (input parameters are on the right-hand side)
E7<= G7
E8<= G8
E9<= G9
or simply
E7:E9<= G7:G9
2. Non-negativity:
C12:D12>= 0
23
Load Solver Add-in
Windows:
2. Click Add-Ins, and then in the Manage box, select Excel Add-ins,
and click Go.
3. In the Add-Ins available box, select the Solver Add-in check box,
and then click OK.
4. After you load the Solver Add-in, the Solver command is available
in the Analysis group on the Data tab.
24
Load Solver Add-in
Mac OS:
2. In the Add-Ins available box, select the Solver Add-In check box,
and then click OK.
If you get a prompt that the Solver add-in is not currently installed
on your computer, click Yes in the dialog box to install it.
3. After you load the Solver add-in, the Solver button is available on
the Data tab.
25
Solver
• Select the cell you wish to optimize in the “Set Objective” box
• To begin entering constraints, click the “Add” button to the right of the
constraints window
Choose “Max” or
“Min”