Lecture 3 Slides
Lecture 3 Slides
Decision Variables
Objective Function
Constraints
EXAMPLE: EATING CONTEST
• John is in a pie eating contest that lasts 1 hour. Each tart that he
eats takes 2 minutes. Each apple pie that he eats takes 3
minutes. He receives 4 points for each tart and 5 points for each
pie. What should John eat so as to get the most points?
• the number of tart eaten by John: let it be x
• the number of pies eaten by John: Let it be y
Maximize z = 4x + 5y (objective function)
subject to 2x + 3y ≤ 60 (constraint)
x ≥ 0 ; y ≥ 0 (non-negativity constraints)
INTRODUCTION TO GRAPHICAL SOLUTION
GRAPHICAL SOLUTION TO AN
LP PROBLEM
The easiest way to solve a small LP problems is with the graphical
solution approach
The graphical method only works when there are just two decision
variables
When there are more than two variables, a more complex approach
is needed as it is not possible to plot the solution on a two-
dimensional graph
REPRESENTING LINEAR EQUATIONS
5
• Represent the following
straight line 4
4𝑥 + 2𝑦 = 8 3
2𝑥 + 2𝑦 = 8 2
4𝑥 + 4𝑦 = 8 0
•The coefficients -2 -1 0 1 2 3 4 5
of the variables -1
represent the -2
slope
REPRESENTING LINEAR EQUATIONS
CONT’D
• Represent the following 6
straight line 5
4𝑥 + 2𝑦 = 8
4
4𝑥 + 2𝑦 = 10 3
2
4𝑥 + 2𝑦 = 12
1
slope -1
inequality
4
3𝑥 + 2𝑦 ≥ 6 3
3𝑥 + 2𝑦 ≤ 6
1
0
-2 -1 0 1 2 3 4 5
-1
-2
REPRESENTING LINEAR FUNCTION
5
• Represent the function
Direction of increase
4
𝑧 = 4𝑥 + 3𝑦 3
coefficient) 0
-2 -1 0 1 2 3 4 5
• The direction of Direction of decrease
-1
increase and decrease
-2
FLAIR FURNITURE COMPANY
8–
–
6–
–
4– Region Satisfying
– Third Constraint
2–
–
0– | | | | | | | | | |
2 4 6 8 X1
Region Satisfying First Two Constraints
UNBOUNDED SOLUTION
• Sometimes a linear program will not have a finite solution
• In a maximization problem, one or more solution
variables, and the profit, can be made infinitely large
without violating any constraints
• In a graphical solution, the feasible region will be open
ended
• This usually means the problem has been formulated
improperly
ILLUSTRATION OF
UNBOUNDEDNESS
• A solution region unbounded to the right
X2
15 –
X1 ≥ 5
10 – X2 ≤ 10
Feasible Region
5–
X1 + 2X2 ≥ 15
0 |– | | | |
5 10 15 X1
REDUNDANCY
• A redundant constraint is one that does not affect the feasible
solution region
• One or more constraints may be more binding
• This is a very common occurrence in the real world
• It causes no particular problems, but eliminating redundant
constraints simplifies the model
ILLUSTRATION
OF
X2
30 –
REDUNDANCY
• A problem with a redundant 25 –
2X1 + X2 ≤ 30
constraint 20 –
Redundant
Constraint
15 –
X1 ≤ 25
10 –
X1 + X2 ≤ 20
Feasible
5–
Region
0– | | | | | |
5 10 15 20 25 30 X1
ALTERNATE OPTIMAL SOLUTION
• Occasionally two or more optimal solutions may exist
• Graphically this occurs when the objective function’s isoprofit or
isocost line runs perfectly parallel to one of the constraints
• This actually allows management great flexibility in deciding which
combination to select as the profit is the same at each alternate
solution
ALTERNATE OPTIMAL SOLUTION
X
2
CONT’D
8–
7–
• Example of alternate 6–
optimal solutions 5–
A
Optimal Solution Consists of All
Combinations of X1 and X2 Along the
4– AB Segment
3–
Isoprofit Line for $8
2–
B Isoprofit Line for $12 Overlays
1 – Feasible Line Segment AB
Region
0– | | | | | | | |
1 2 3 4 5 6 7 8 X1
PAINT FACTORY PRODUCTION
• The Reddy Mikks company owns a small paint factory that produces both interior and exterior
house paints. Two basic raw materials, A and B, are used to manufacture the paints.
• The maximum availability of A is 6 tons a day; that of B is 8 tons a day. The daily requirements
of the raw materials per ton of interior and exterior paints are summarized in the following table.
Tons of Raw Material per Ton of Paint
Exterior Interior Maximum Availability (tons)
Raw Material A 1 2 6
Raw Material B 2 1 8
• A market survey has established that the daily demand for the interior paint cannot exceed that
of exterior paint by more than 1 ton. The survey also showed that the maximum demand for the
interior paint is limited to 2 tons daily.
• The wholesale price per ton is $3000 for exterior paint and $2000 per interior paint. How
much interior and exterior paint should the company produce daily to maximize gross income?
PAINT FACTORY CONT’D
Define:
XE = Tons of exterior paint to be produced
XI = Tons of interior paint to be produced
Subject to:
XE + 2XI 6 (1) (availability of raw material A)
2XE + XI 8 (2) (availability of raw material B)
-XE + XI 1 (3) (Restriction in production)
XI 2 (4) (Demand Restriction)
XE , XI 0
XE PAINT FACTORY PRODUCTION
8
GRAPHICAL SOLUTION
Alternative solutions Constraint 2: 2XE + XI 8
XE XI z 7
0 0 0
6
0 1 2
Constraint 3: -XE + XI 1
1 2 7
5
2 2 10
3.3 1.35 12.6
4
4 0 12
3 Constraint 4: XI 2
Optimal
solution 2
1 Constraint 1: XE + 2XI 6
0 XI
-1 0 1 2 3 4 5 6
COMPACT FORMULATION OF LP EXAMPLE
COMPACT FORMULATION OF LP
To solve the problem, you first need to know
• The cost of one package of each meal
• The required amount for each nutrient
• How much of each nutrients is in one package of each food
Beef Chicken Macaroni w/ Cheese Required
Protein 60 55 20 700
Vitamin C 0 10 35 250
Iron 20 15 10 300
Cost 2.98 2.09 1.49
FORMULATION OF LP
• Let i be the index for food
• 1 – beef, 2 – chicken, 3 – macaroni w/ cheese
• Let j be the index for the nutrients
• 1 – Protein, 2 – Vitamin C, 3 – Iron
QUESTIONS?