0% found this document useful (0 votes)
15 views

Week 5 - Linear Programming

Uploaded by

leahownes07
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Week 5 - Linear Programming

Uploaded by

leahownes07
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 73

Comm.

2DA3
Decision Making with
Analytics
WEEK 5: LINEAR PROGRAMMING 1
INSTRUCTOR: ZAHRA MASHAYEKHI

1
Introduction to Prescriptive Analytics

2
ILOs
•At the end of this course, you will be able to
• define mathematical programming and linear programming concepts.
• solve simple 2 variable questions with ‘graphical method’.
• model LP questions on excel and solve by using an add-in called solver.

3
Chapter 12
Linear Optimization Models

4
Introduction
Optimization Problems:
◦ Can be used to support and improve managerial decision making.
◦ Optimization is the process of finding the optimal (min/max)
objective function by changing decision variables with respect to
restrictions known as constraints.
◦ Can be linear or nonlinear.

“In nutshell, Businesses have limited resources; Optimization problems are to


identify optimal resource allocation to achieve most favorable results.”

5
Introduction
Typical Applications:
o Production scheduling and inventory planning that satisfies demand in
future periods, while minimizing the total production, transportation and
inventory costs.
o Investment portfolio identification from a variety of stock and bond
investment alternatives that maximizes the return on investment.
o In marketing, the optimal advertising budget allocation among alternative
advertising media such as web, radio, television, newspaper, and magazine
to maximize advertising effectiveness.

6
Introduction
Real world examples:

o GE (General Electric) uses linear optimization to determine


optimal expansion plan for its Solar energy project, taking into
account the inventory, production capacity, and budgets.

o Marathon Oil Company uses linear programming for gasoline


blending and to evaluate the economics of a new terminal or
pipelines.

** Terms “Linear optimization models” and “linear programs” can be used interchangeably.

7
First Example of LP
PROBLEM FORMULATION
FLAIR COMPANY

8
Flair Company Example
oFlair Furniture Company produces tables and chairs
oThey would like to decide how many chairs and tables to produce to maximize their profits
under some constraints.

To obtain the optimal solution:


1. Model the problem (Modeling)
2. Solve the problem (Solving)

9
1. Modeling Flair Company Problem
Problem formulation or modeling: Process of translating the verbal statement of a problem
into a mathematical statement.
Mathematical model: A set of mathematical relationships

Foundational step:
• Describe the objective, decision variables, and constraints

10
Flair Company Example
Flair Furniture Company produces tables and chairs:
Per Table Per Chair
Availability
Profit ($) 7 5
Carpentry Department
(labor hours) 3 4 2,400
Painting Department
(labor hours) 2 1 1,000

Manager/Market restrictions:
◦ Make no more than 450 chairs (the on-hand inventory of chairs is high)
◦ Make at least 100 tables (the inventory of table is low)

11
Flair Company LP Model
oDecision Variables:
◦ # of tables produced : T
◦ # of chairs produced : C

oObjective function:
◦ Maximize the profit

𝑀𝑎𝑥𝑖𝑚𝑖𝑧𝑒 7𝑇 + 5𝐶

13
Flair Company LP Model
oConstraints:
◦ Carpentry hour (the number of labor hours available at the department)
3𝑇 + 4𝐶 ≤ 2,400

◦ Painting hour (the number of labor hours available at the department)


2𝑇 + 1𝐶 ≤ 1,000

◦ Maximum chair
𝐶 ≤ 450

◦ Minimum table
𝑇 ≥ 100

◦ Non-negativity
𝑇≥0
𝐶≥0

14
Why LP?
This is a linear programming model (or linear program) because the objective
function and all constraint functions are linear functions of the decision
variables.
Linear function: Mathematical function in which each variable appears in a
separate term and is raised to the first power.

15
Flair Company LP Model
𝑀𝑎𝑥𝑖𝑚𝑖𝑧𝑒 7𝑇 + 5𝐶 Objective Function

Subject to
3𝑇 + 4𝐶 ≤ 2,400
2𝑇 + 1𝐶 ≤ 1,000 RHS
(Right-hand side)
𝐶 ≤ 450
𝑇 ≥ 100
Non-negativity
𝑇≥0 Constraints
Decision Variables 𝐶≥0

16
Flair Company LP Model
𝑀𝑎𝑥𝑖𝑚𝑖𝑧𝑒 7𝑇 + 5𝐶 Maximize Profit

Subject to
3𝑇 + 4𝐶 ≤ 2,400 Carpentry

2𝑇 + 1𝐶 ≤ 1,000 Painting
Max C
𝐶 ≤ 450 production
Min T
𝑇 ≥ 100 Production
𝑇≥0 Non-negativity
Constraints
𝐶≥0

17
2. Solving Flair Company Problem
◦ Feasible solution: a setting of the decision variables that satisfies all of the
constraints of the problem.

◦ Optimal solution: is a feasible solution that has the highest objective function
value in Maximization problem and lowest objective function value in
Minimization problem.

To find the optimal solution to the problem modeled as a linear program:

◦ Search over the feasible region—a set of all feasible/possible solutions.


◦ Find the solution that gives the best objective function value.

18
2. Solving Flair Company Problem
• Graphical Solving
•Algorithm
• Simplex
• Interior-point
•…
•Computer Packages
• CPLEX
• GAMS
• Excel Solver

19
A. Graphical Solving
The Geometry of the Flair Company Problem:

When there are only two decision variables and the functions of these
variables are linear, they form lines in two-dimensional space.

There are five steps to obtain the optimal decisions

20
A. Graphical Solving
1. Draw all constraints to identify Feasible Region.
The region which consists of all points, that
2. Identify extreme points simultaneously satisfy all constraints in the problem.

3. Draw the objective function contour lines (level, or iso line).

4. Identify the direction where we obtain a better objective value.


Move the contour line (in that direction) to find the last corner point (of the feasible
region) that contour lines pass.
The point is called the Optimal Solution.
5. Find the value of the objective function for the optimal solution found.

21
Step 1: Draw the Feasible Region
If constraints are inequalities, the constraint cuts the space in two:
◦ The line and the area on one side of the line is the space that satisfies that constraint.
◦ These subregions are called half spaces.
◦ The intersection of the half spaces make up the feasible region.

22
𝑀𝑎𝑥𝑖𝑚𝑖𝑧𝑒 7𝑇 + 5𝐶
Subject to
3𝑇 + 4𝐶 ≤ 2,400
2𝑇 + 1𝐶 ≤ 1,000
𝐶 ≤ 450
𝑇 ≥ 100
C, 𝑇 ≥ 0

23
24
Step 1: Draw the Feasible Region
1. Convert inequality to a linear equation:
3𝑇 + 4𝐶 = 2,400
2. Find two points:
✓Normally, the two easiest points are the intersections between the linear equation and two
axes:
• If T = 0, then C = 600 ⇒ (0, 600)
• If C = 0, then T = 800 ⇒ (800, 0)
3. Draw a line through two points.

25
Step 1: Feasible Region – Flair Comp Ex.
1,000 –
– 3T + 4C ≤ 2,400
Number of Chairs (C)

800 – Use (0,0) as a specifying point:


– 3T + 2C = 0 ≤ 2,400
600 – Carpentry Constraint Line
– 3𝑇 + 4𝐶 = 2,400
Therefore, (0,0) belongs to the feasible
400 –
region.

200 –
– Non-neg. constraint
0–
| | | | | | | | | | | |
𝑇≥0
0 200 400 600 800 1,000
Non-neg. constraint
𝐶≥0 Number of Tables (T)

26
Step 1: Feasible Region – Flair Comp Ex.
1,000 –
Use (0,0) as a specifying point:

Region Satisfying
Number of Chairs (C)

800 – 3𝑇 + 4𝐶 = 0 ≤ 2,400
3𝑇 + 4𝐶 ≤ 2,400

600 – (𝑇 = 300, 𝐶 = 200)
Therefore, (0,0) belongs to the

400 – feasible region.

200 –

0–
| | | | | | | | | | | |
0 200 400 600 800 1,000

Number of Tables (T)


(𝑇 = 0, 𝐶 = 0)

27
Step 1: Feasible Region – Flair Comp Ex.
1,000 –

Number of Chairs (C)

800 –
– Painting Constraint
600 – 2𝑇 + 1𝐶 ≤ 1,000

Carpentry Constraint
400 – 3𝑇 + 4𝐶 ≤ 2,400

200 –

0–
| | | | | | | | | | | |
0 200 400 600 800 1,000

Number of Tables (T)

28
Step 1: Feasible Region – Flair Comp Ex. Painting Constraint 2𝑇 + 1𝐶 ≤ 1,000
1,000 –

Number of Chairs (C)

800 –
Minimum Tables Required Constraint 𝑇 ≥ 100

600 – Maximum Chairs Allowed Constraint 𝐶 ≤ 450

400 –
– Carpentry Constraint 3𝑇 + 4𝐶 ≤ 2,400
200 –
Feasible Infeasible Solution

Region
0–
| | | | | | | | | | | |
0 200 400 600 800 1,000

Number of Tables (T)

29
Step 2: Identify extreme points
•Extreme points are found where constraints intersect on the boundary of the feasible region.
•To solve a linear optimization problem, we only have to search the extreme points of the
feasible region to find the optimal solution.

30
Step 2: Identify extreme points
800 –
Number of Chairs (C)
– Maximum Chairs Allowed Constraint 𝐶 ≤ 450

600 – Carpentry Constraint


2𝑇 + 1𝐶 ≤ 1,000
– 2 3

400 –
4 Minimum Tables Required Constraint 𝑇 ≥ 100

200 –
Painting Constraint

3𝑇 + 4𝐶 ≤ 2,400
0– | | | | | | | | | |
0 1 200 400 5 600 800 1,000
Number of Tables (T)

31
Step 3: Objective function contour lines
800 –


Number of Chairs (C)

600 – Carpentry Constraint

– 2 3

400 –
4 𝑀𝑎𝑥𝑖𝑚𝑖𝑧𝑒 7𝑇 + 5𝐶 → 7𝑇 + 5𝐶 = 𝑍

200 –
Painting Constraint

0– | | | | | | | | | |
0 1 200 400 5 600 800 1,000
Number of Tables (T)

32
Step 4: Identify the direction for improving objective value
800 –
Optimal Level Profit Line

Number of Chairs (C)

600 – Carpentry Constraint

– 2 3
Optimal Corner Point Solution
400 –
4 𝑀𝑎𝑥𝑖𝑚𝑖𝑧𝑒 7𝑇 + 5𝐶 → 7𝑇 + 5𝐶 = 𝑍

200 –
Painting Constraint

0– | | | | | | | | | |
0 1 200 400 5 600 800 1,000
Number of Tables (T)

33
Step 5: Find the optimal values
Optimal solution:
◦ Intersection of carpentry constraint and painting constraint:

3𝑇 + 4𝐶 = 2,400
൝ ⇒ 𝑇 = 320, 𝐶 = 360
2𝑇 + 1𝐶 = 1,000

◦ Objective function value:

7𝑇 + 5𝐶 = 7 × 320 + 5 × 360 = $4,040

34
Flair Graphical LP Solution
Point 1 (T = 100, C = 0)
Profit = $7 x 100 + $5 x 0 = $700
Point 2 (T = 100, C = 450)
Profit = $7 x 100 + $5 x 450 = $2,950
Point 3 (T = 200, C = 450)
Profit = $7 x 200 + $5 x 450 = $3,650
Point 4 (T = 320, C = 360)
Profit = $7 x 320 + $5 x 360 = $4,040
Point 5 (T = 500, C = 0)
Profit = $7 x 500 + $5 x 0 = $3,500

35
Input data values,
coefficients used in the

LP Assumptions • objective function,


and
• constraints,
1. Certainty are known with certainty.
◦ All parameters are known.

2. Proportionality
◦ If the level of any activity is multiplied by a constant factor, then the contribution of that activity in the objective function or
constraints will be multiplied by the same factor.
e.g.
3. Additivity Production of 1 unit of an item uses 3 hours
◦ Total of all activities equals the sum of individual activities. of a particular resource,
→ making 10 units of that item uses 30 hours
4. Divisibility e.g. of the resource.
◦ Non-integer variables are acceptable. One product worth $8 per
unit is produced, and
and of course “ Linearity “ !
the other product worth $3
per unit is also produced,
→ the total profit will be 8
plus 3.

36
B. Solving Flair Company Problem in Excel

Let's move to Excel!

37
A Simple Maximization Problem
PROBLEM FORMULATION
MATHEMATICAL MODEL FOR THE PAR, INC. PROBLEM

38
Simple Maximization Problem
Illustration: Par, Inc.:
◦ Par, Inc. is a small manufacturer of golf equipment and supplies.
◦ Management has decided to move into the market for medium- and
high-priced golf bags.
◦ Par’s distributor has agreed to buy all of the golf bags produced over
the next three months.

39
Simple Maximization Problem
Production Requirements Per Golf Bag

Production Time (hours)


Department Standard Bag Deluxe Bag
Cutting and Dyeing 7/10 1
Sewing 1/2 5/6
Finishing 1 2/3
Inspection and Packaging 1/10 1/4

40
Simple Maximization Problem
Estimated total time available for the next three months to perform different operations:

Department Number of hours


Cutting and Dyeing 630
Sewing 600
Finishing 708
Inspection and Packaging 135

Profit contribution:
◦ Standard bag: $10/unit.
◦ Deluxe bag: $9/unit.
Simple Maximization Problem
Objective:
Develop a mathematical model of the Par, Inc. problem to determine
the number of standard bags and the number of deluxe bags to
produce to maximize total profit contribution.

Foundational step:

• Describe the objective, constraint, and decision variables

42
Simple Maximization Problem
Decision Variables:
• S = Number of standard bags to be manufactured
• D = Number of Deluxe bags to be manufactured

Objective Function:
• MAX (Total Profit Contribution) = MAX (10S + 9D)

44
Simple Maximization Problem
Constraints:
 Hours of sewing   Hours of sewing  1 5
Constraint 1:    -> S + D  600
 time used   time available  2 6

 Hours of cutting and   Hours of cutting and  7


Constraint 2:    -> S + 1D  630
 dyeing time used   dyeing time available  10

 Hours of finishing   Hours of finishing  2


Constraint 3:    -> 1S + D  708
 time used   time available  3

 Hours of inspection and   Hours of inspection and  1 1


Constraint 4:    -> S + D  135
 packaging time used   packaging time available  10 4

◦ Nonnegativity constraints: Based on the fact that the number of standard or deluxe bags produced cannot be negative.
S  0 and D  0 or S , D  0

45
Simple Maximization Problem
Constraints:
 Hours of sewing   Hours of sewing  1 5
Constraint 1:    -> S + D  600
 time used   time available  2 6

 Hours of cutting and   Hours of cutting and  7


Constraint 2:    -> S + 1D  630
 dyeing time used   dyeing time available  10

 Hours of finishing   Hours of finishing  2


Constraint 3:    -> 1S + D  708
 time used   time available  3

 Hours of inspection and   Hours of inspection and  1 1


Constraint 4:    -> S + D  135
 packaging time used   packaging time available  10 4

◦ Nonnegativity constraints: Based on the fact that the number of standard or deluxe bags produced cannot be negative.
S  0 and D  0 or S , D  0

46
Simple Maximization Problem
Final Mathematical Model for the Par, Inc. Problem:
◦ Mathematical model: Max 10 S + 9D.
7
S + 1D  630 Cutting and dyeing
10
1 5
S + D  600 Sewing
2 6
2
1S + D  708 Finishing
3
1 1
S + D  135 Inspection and packaging
10 4
S, D  0
Simple Maximization Problem
Mathematical Model for the Par, Inc. Problem (cont.):
This is a linear programming model (or linear program)

48
Solving the Par, Inc. Problem
THE GEOMETRY OF THE PAR, INC. PROBLEM
SOLVING LINEAR PROGRAMS WITH EXCEL SOLVER

49
Solving the Par, Inc. Problem
Figure 1: Feasible Region for the Par, Inc.
Problem

50
Solving the Par, Inc. Problem
Figure 2: The Optimal Solution to the Par, Inc.
Problem

• Extreme points
• Recall: Extreme points are found where constraints
intersect on the boundary of the feasible region.

51
Solving the Par, Inc. Problem
The Geometry of the Par, Inc. Problem (cont.):

The values of S and D and the objective function value are:

7,668
Solving the Par, Inc. Problem

Let's move to Excel!

53
Par, Inc. Excel Screenshots

54
Par, Inc. Excel Screenshots

55
Analyzing the Answer report
A binding constraint is one that holds as an
equality at the optimal solution.
The slack value for each less-than-or-equal-to
constraint indicates the difference between
the left-hand and right-hand values for a
constraint.

56
A Simple Minimization Problem

57
A Simple Minimization Problem
M&D Chemicals produces two products that are sold as raw materials to companies
manufacturing bath soaps and laundry detergents.

Based on the analysis of the current inventory levels and potential demand for the coming
month, M&D’s management specified certain production requirements.

58
A Simple Minimization Problem
Illustration: M&D Chemicals:
Production requirements for M&D Chemicals:
◦ The combined production for products A and B must total at least 350 gallons.
◦ Separately, a major customer’s order for 125 gallons of product A must also be satisfied.

Processing time:
◦ Product A: 2 hours/gallon.
◦ Product B: 1 hour/gallon.
◦ For the coming month, 600 hours of processing time are available.

Production cost of Product A is $2/Gallon and Product B is $3/Gallon.


Find the production quantity for A and B in which M&D will incur minimum product cost
while satisfying all the requirements.

59
A Simple Minimization Problem
Decision Variables:
• A = Number of Gallons of product A to produce
• B = Number of Gallons of product B to produce

Objective Function:
• MIN (Total costs) = MIN (2A + 3B)

Constraints:
• 1A >= 125 Demand for Product A
• 1A +1B >= 350 Total Production requirement
• 2A + 1B <= 600 Processing Time
• A,B >= 0

60
A Simple Minimization Problem

Let's move to Excel!

61
Special Cases of Linear Program
Outcomes
1. ALTERNATIVE OPTIMAL SOLUTIONS
2. I NFEASIBILITY
3. UNBOUNDED

62
Special Cases of Linear Program Outcomes
Alternative Optimal Solutions:

An alternative optimal solution is one in which the optimal objective


function contour line coincides with one of the binding constraint lines on
the boundary of the feasible region.
In these situations, more than one solution provides the optimal value for
the objective function.

63
Special Cases of Linear Program Outcomes
Illustration: Par, Inc.:
Original objective function:
10 S + 9D.
Assume the profit for the standard golf bag decreased to $6.30.
Revised objective function: 6.3S + 9D.
The optimal solution occurs at two extreme points:
◦ Extreme point 4 (S = 300, D = 420).
◦ Extreme point 3 (S = 540, D = 252).
Special Cases of Linear Program Outcomes
Figure: Par, Inc. Problem with an
Objective Function of

6.3S + 9D (Alternative
Optimal Solutions)
Special Cases of Linear Program Outcomes
Infeasibility:

Infeasibility means no solution to the linear programming problem satisfies


all the constraints, including nonnegativity conditions.

Graphically, a feasible region does not exist.


Infeasibility occurs because:
◦ Management’s expectations are too high.
◦ Too many restrictions have been placed on the problem.

66
Special Cases of Linear Program Outcomes
Figure: No Feasible Region for the Par, Inc.
Problem with Minimum Production Requirements
of 500 Standard and 360 Deluxe Bags

67
Special Cases of Linear Program Outcomes
Infeasibility (cont.):

Interpretation of Infeasibility for the Par, Inc. problem.


Let management know that the resources available are not sufficient to
make 500 standard bags and 360 deluxe bags.
Provide details to management on:
◦ Minimum amounts of resources that must be available.
◦ The amounts currently available.
◦ Additional amounts that would be required to accomplish this level of production.

68
Special Cases of Linear Program Outcomes
Table: Resources Needed to Manufacture 500 Standard Bags and 360 Deluxe Bags

69
Special Cases of Linear Program Outcomes
Infeasibility (cont.):

An infeasible problem when solved in Excel Solver:


◦ Will return a message indicating that no feasible solutions exists—indicating no solution to the linear
programming problem will satisfy all constraints.
◦ Careful inspection of your formulation is necessary to identify why the problem is infeasible.
◦ One of the approaches is to drop one or more constraints and re-solve the problem.
◦ If we find an optimal solution for this revised problem, then the constraint(s) that were omitted, in
conjunction with the others, are causing the problem to be infeasible.

70
Special Cases of Linear Program Outcomes
Unbounded:

Unbounded: The situation in which the value of the solution:


◦ May be made infinitely large—for a maximization linear programming.
◦ May be made infinitely small—for a minimization linear programming.
◦ Without violating any of the constraints.

71
Special Cases of Linear Program Outcomes
Illustration:
Consider the following linear program with two decision variables, X and Y:

Max 20 X + 10Y
s.t.
1X 2
1Y  5
X, Y  0
Special Cases of Linear Program Outcomes
Figure: Example of an Unbounded Problem

73
Special Cases of Linear Program Outcomes
Unbounded (cont.):
Solving an unbounded problem using Excel Solver returns a message
“Objective Cell values do not converge.”
In linear programming models of real problems, the occurrence of an
unbounded solution means that the problem has been improperly
formulated.
If a profit maximization problem results in an unbounded solution, the
mathematical model does not represent the real-world problem sufficiently.
In many cases, this error is the result of inadvertently omitting a constraint
during problem formulation. (Missing Constraints)

74
End of Lecture

You might also like