Introduction To Linear Programming
Introduction To Linear Programming
Chapter -2
2
Classification of Different Programming
LP IP NLP
Variables Continuous Discrete Continuous or
(e.g. 0 x1) (e.g.x=0 or 1) Discrete
3
Two Variable LP Model
4
Model Development / Mathematical Formulation
5
Model Development / Mathematical Formulation
1.
2.
Data
6
Model Development / Mathematical Formulation
3.
Data
7
Model Development / Mathematical Formulation
3. Demand Constraints:
Daily demand of the interior paint is 2 tons
x2<= 2
Data
8
Model Development / Mathematical Formulation
Data
9
➢ Feasible: one that satisfy all the constraints
➢ Optimal: in addition to feasible, it gives the best answer or solution
➢ Infeasible: does not satisfy one or more than one of the
constraints
10
What Is a Linear Programming Problem?
11
Assumptions of Linear Programming
12
Assumptions of Linear Programming
13
Assumptions of Linear Programming
Divisibility Assumption
14
Assumptions of Linear Programming
15
Problem Set 2.1 A
Data
16
Solution: Reddy Mikks Problem
First Constraint Graphed
x2
8 (0, 6)
7
6
6x1 + 4x2 = 24
5 Shaded
4 region contains
all feasible points
3
for this constraint
2
(4, 0)
1
x1
1 2 3 4 5 6 7 8 9 10
17
Reddy Mikks Problem
Second Constraint Graphed
x2
8
7
6
5 Shaded
x1 + 2x2 = 6
4 (0, 3) region contains
all feasible points
3
for this constraint
2
(6, 0)
1
x1
1 2 3 4 5 6 7 8 9 10
18
Solution: Reddy Mikks Problem
First and second Constraint Graphed together
x2
8 (0, 6)
7
Common Shaded
6 region contains
6x1 + 4x2 = 24 all feasible points
5
for both constraints
(0, 3)
4 x1 + 2x2 = 6
3
2
(6, 0)
1
x1
1 2 3 4 5 6 7 8 9 10
(4, 0)
Reddy Mikks Problem
Third Constraint Graphed
x2
8
7
Shaded
(0, 1) 6 -x1 + x2 = 1 region contains
all feasible points
5
for this constraint
4
3
2
1
x1
(-1, 0) 1 2 3 4 5 6 7 8 9 10
20
Solution: Reddy Mikks Problem
First, second, Third Constraint Graphed together
x2
8
(0, 6)
7
6x1 + 4x2 = 24 Common Shaded
6 region contains
x1 + 2x2 = 6 all feasible points
5
for three constraints
4 -x1 + x2 = 1
(0, 3)
3
(0, 1) 2
(6, 0)
1
x1
(-1, 0) 1 2 3 4 5 6 7 8 9 10
(4, 0)
Reddy Mikks Problem
Fourth Constraint Graphed
x2
8
7
6
5 Shaded
x2 = 2
4 (0, 2) region contains
all feasible points
3
for this constraint
2
1
x1
1 2 3 4 5 6 7 8 9 10
22
Solution: Reddy Mikks Problem
All Constraint Graphed together
x2
8
(0, 6)
7
6x1 + 4x2 = 24 Common Shaded
6 region contains
x1 + 2x2 = 6 all feasible points
5
for all constraints
4 -x1 + x2 = 1
(0, 3)
(0, 2) 3 x2 = 2
(0, 1) 2
(6, 0)
1
x1
(-1, 0) 1 2 3 4 5 6 7 8 9 10
(4, 0)
Reddy Mikks Problem
All Constraint Graphed
Shaded
-x1 + x2 = 1
region contains
x2 x2 = 2 all feasible points
x1 + 2x2 = 6 for all the constraint
3
2 E D 6x1 + 4x2 = 24
C
F
1
B x1
A
1 2 3 4 5
24
Reddy Mikks Problem
All Constraint Graphed
Max Z = 5x1+4x2=10
Max Z = 5x1+4x2=15
Max Z = 5x1+4x2=21…
Z=21
-x1 + x2 = 1 Z=15
Z=10 x2 x2 = 2 C=(3,1.5)
x1 + 2x2 = 6
3
2 E D 6x1 + 4x2 = 24
C
F
1
B x1
A
1 2 3 25
4 5
Reddy Mikks Problem
x2
3
2 E D
C
Extreme Point coordinates Z
F
1 A (0,0) 0
B B (4,0) 20
A x1
C (3,1.5) 21
1 2 3 4 5 D (2,2) 18
E (1,2) 13
F (0,1) 4
26
Convex Set
Theorem - I
A set of feasible solutions of a linear programming problem
is a convex set such that, If we take two points in the set,
then the line joining these points also lies within the set
x2
x2
x1
x1
27
Convex Set
Theorem - II
Extreme points in a convex set are one that can not be represented by
the linear combination of any two points of the feasible set…
28
Extreme Points and the Optimal Solution
29
Problem Set 2.2 A
3.(a)
Determine the solution space and the optimum solution of the Reddy Mikks Model
When The maximum daily demand for interior paint is 1.9 tons and that for exterior
paint is at the most 2.5 tons
x2
3
2 E D
C
F
1
B x1
A
1 2 3 30 4 5
Problem Set 2.2 A
x2
3
x2 <=1.9 x1<=2.5
2
1
x1
1 2 3 4 5
31
Problem Set 2.2 A
x2
3
x2 <=1.9 x1<=2.5
2
1
x1
1 2 3 4 5
32
Problem Set 2.2 A
33
Minimization LP Model
34
Three Basic Elements
35
First Element
1. Decision Variable Elements
36
Second Elements
2. Objective / Goal
37
Third Elements
3. Constraints
x1 + x2>=800 {total feed requirement}
0.09x1+0.6x2>=0.3 (x1 + x2) {Protein requirement}
0.02x1+0.06x2<=0.05 (x1 + x2) {Fiber requirement}…
x1 and x2 >=0 {Non-negativity requirement}
38
Summary of the Model
39
Solution of the LP Model
B A = (470.6,329.4), Z=437.64
B = (200,600), Z=600
A
40
Problem Set 2.2 B
to 400 lb.
41
Problem Set 2.2 B
X1<=400
400
42
Problem Set 2.2 B
X1<=400
B
A
400
43
Problem Set 2.2 B
X1<=400
400
44
Special Cases in LP : Graphical Method
45
Special Cases
Infeasibility
• No solution to the LP problem satisfies all the constraints,
including the non-negativity conditions.
• Graphically, this means a feasible region does not exist.
• Causes include:
• A formulation error has been made.
• Management’s expectations are too high…
• Too many restrictions have been placed on the problem
(i.e. the problem is over-constrained).
46
Example: Infeasible Problem
x1, x2 > 0
47
Example: Infeasible Problem
◼ There are no points that satisfy both constraints, so there
is no feasible region (and no feasible solution, hence
infeasible).
Max 2x1 + 6x2
x2 s.t. 4x1 + 3x2 < 12
10 2x1 + x2 > 8
8 x1, x2 > 0
6
4x1 + 3x2 < 12
4
x1
2 4 6 8 10
48
Example: Infeasible Problem
◼ There are no points that satisfy both constraints, so there
is no feasible region (and no feasible solution, hence
infeasible).
x2
10
2x1 + x2 > 8
8
6
4x1 + 3x2 < 12
4
x1
2 4 6 8 10
49
Special Cases
Unbounded
• The solution to a maximization LP problem is
unbounded, if the value of the solution may be
made indefinitely large without violating any of
the constraints.
• For real problems, this is the result of improper
formulation. (Quite likely, a constraint has been
inadvertently omitted.)
50
Example: Unbounded Solution
◼ Consider the following LP problem.
s.t. x1 + x2 > 5
3x1 + x2 > 8
x1, x2 > 0
51
Example: Unbounded Solution
◼ The feasible region is unbounded and the objective function line can be
moved outward from the origin without bound, infinitely increasing
the objective function.
4
x1 + x2 > 5
2
x1
2 4 52
6 8 10
Example: Unbounded Solution (one direction)
s.t. x1 + x2 > 5
3x1 + x2 > 8
x1 ≤ 4
x1, x2 > 0
53
Example: Unbounded Solution (one direction)
◼ The feasible region is unbounded in x2 direction and the objective
function line can be moved outward from the origin without bound in
the x2 direction, infinitely increasing the objective function.
Max 4x1 + 5x2
s.t. x1 + x2 > 5
x2 x1 ≤ 4 3x1 + x2 > 8
3x1 + x2 > 8 x1 ≤ 4
10 x1, x2 > 0
4
x1 + x2 > 5
2
x1
2 4 54
6 8 10
Example: Unbounded Solution (one direction)
◼ The feasible region is unbounded in x2 direction and the objective
function line can be moved outward from the origin without bound in
the x2 direction, infinitely increasing the objective function.
6
Final feasible solution space
4
x1 + x2 > 5
2
x1
2 4 55
6 8 10
Special Cases
Example: x < 10
x < 12
Max 2T + 2C
Subject to:
T + C < 10
T < 5
C< 6
T, C > 0
Special Cases
Alternate Optimal Solutions – when there are more than one
optimal solutions
C
Max 2T + 2C 10
All points on
Subject to:
Red segment
6
T + C < 10 are optimal
T < 5
C< 6
T, C > 0
0
0 5 10 T
When the slope of Objective function is the same as the slope of one
of the constraints
Formulation of LP: Examples
59
Diet Problem Formulation
60
Diet Problem Formulation
Decision variables Objective Function
x1= Quantity of milk (Gallons)
Minimize z = 2x1+ 0.2x2 + 0.25x3
x2= Quantity of Beans (Cups)
x3= Quantity of Oranges (Numbers)
Constraints
3.20x1+ 4.9x2 + 0.80x3≥ 13.0 (Niacin)
1.12x1+ 1.3x2 + 0.19x3≥ 1.50 (Thiamin)
32.0x1+ 0.0x2 + 93.0x3≥ 45.0 (Vitamin C)…
x1≥0 , x2 ≥0 , x3 ≥0 (Non-negativity)
61
Scheduling / Man Power Planning Formulation
62
Scheduling / Man Power Planning Formulation
Decision variables
Objective Function
Minimize z = x1+x2+x3+x4+x5+x6
63
Scheduling / Man Power Planning Formulation
Objective Function
Minimize z = x1+x2+x3+x4+x5+x6
Constraints
x1 + x2 ≥ 5
x2 + x3 ≥ 7
x3 + x4 ≥ 15
x4 + x5 ≥ 8
x5 + x6 ≥ 12
x6 + x1 ≥ 9….
x1 ≥ 0, x2 ≥ 0
64
Bank Loan Model
Bank One
65
Bank Loan Model
Decision variables
66
Bank Loan Model
Objective Function
z=Total interest (Revenue) – Bad Debt (loss in revenue)
Interest revenue generated from the good standing of loan.
In case of personal loan bad debt is 0.1 , hence loan with good standing will be 0.9
Total Interests = .14 (0.9) x1+ .13 (0.93) x2+ .12 (0.97) x3+.125(.95)x4+ .1 (0.98) x5
Bad debt =0.1 x1+ 0.07 x2+ 0.03 x3+0.05 x4+ 0.02 x5
67
Bank Loan Model
Constraints
x1 ≥ 0, x2 ≥ 0, x3 ≥ 0, x4 ≥ 0, x5 ≥ 0 {non-negativity)
68
Blending Problem formulation
An oil company makes two blends of fuel by mixing three oils.
The costs and availability (daily) is given below:
Each liter of blend 1 can be sold for $1.1 and each liter of blend 2 can be sold at $1.2
69
Blending Problem formulation
Decision variables
x1 = Amount of A oil used in Blend 1
x2 = Amount of B oil used in Blend 1
x3 = Amount of C oil used in Blend 1
x4 = Amount of A oil used in Blend 2
x5 = Amount of B oil used in Blend 2…
x6 = Amount of C oil used in Blend 2
70
Blending Problem formulation
Objective Function
Maximize Z (Profit) = Revenue (R) – Cost (C)
Revenue (R)= 1.1 (x1+ x2+ x3) + 1.2 (x4+ x5+ x6)
Cost (C)= 0.3 (x1+ x4) + 0.4 (x2+ x5) + 0.48 (x3+ x6)
Each liter of blend 1 can be sold for $1.1 and each liter of blend 2 can be sold at $1.2
71
Blending Problem formulation
Constraints
Amount of Oil available Production Requirement
(x1+ x4) ≤ 6000 (1) (x1+ x2 + x3) ≥ 10000 (4)
(x2+ x5) ≤ 10000 (2) (x4+ x5 + x6) ≥ 10000 (5)
(x3+ x6) ≤ 12000 (3)
Blend 1 requirement Blend 2 requirement
{x1 /( x1 + x2 + x3 )} ≥ 0.3 (6) {x 4 /( x 4 + x5 + x6 )} ≤ 0.40 (9)
{x2 /( x1 + x2 + x3 )} ≤ 0.5 (7) {x5 /( x4 + x5 + x6 )} ≥ 0.35 (10)
{x3 /( x1 + x2 + x3 )} ≥ 0.3 (8) {x6 /( x 4 + x5 + x6 )} ≤ 0.40 (11)
x1 ≥ 0, x2 ≥ 0, x3 ≥ 0, x4 ≥ 0, x5 ≥ 0, x6 ≥ 0 {non-negativity)
Each liter of blend 1 can be sold for $1.1 and each liter of blend 2 can be sold at $1.2
Also, at least 10,000 liter of each blend is to be produced.
72
Media selection problem formulation
Example
A company has budget up to $8000 per week for local advertisement.
73
Media selection problem formulation
The following table presents the number of potential customers reached by making
use of advertisement in each of the four media. It also provides the cost per
advertisement placed and the maximum number of ads than can be purchased per
week.
The company arrangements require that at least 5 radio spots be placed each
week. To ensure a board-scoped promotional campaign, management also insists
that no more than $1800 be spent on radio advertising every week.
74
Media selection problem formulation
Decision variables
X1 = number of 1-minute TV spots taken Each week
X2 = number of full-page daily newspaper ads taken each week.
X3 = number of 30-second prime-time radio spots taken each week.
X4 = number of 1-minute afternoon radio spots taken each week.
Objective Function
The company goal is to reach the largest possible high-potential
audience through the various media.
The company arrangements require that at least five radio spots be placed each week. To
ensure a board-scoped promotional campaign, management also insists that no more than
$1800 be spent on radio advertising every week. 77
Trim Loss / Cutting Stock problem formulation
78
Trim Loss / Cutting Stock problem formulation
However, there may be more settings by which the rolls can be cut
79
Trim Loss / Cutting Stock problem formulation
The feasible cut setting of the rolls. Note that there must not be any setting
That produces the waste equal to or greater than 5 feet width. As the
Minimum size of the roll requirement is 5 feet.
80
Trim Loss / Cutting Stock problem formulation
Decision variables
x1= number of rolls to cut as per setting 1
x2= number of rolls to cut as per setting 2
x3= number of rolls to cut as per setting 3
x4= number of rolls to cut as per setting 4
x5= number of rolls to cut as per setting 5
x6= number of rolls to cut as per setting 6
81
Trim Loss / Cutting Stock problem formulation
Objective Function
Minimize the total waste
z =4x1+ 3x2 + 1x3 + 0x4 + 1x5 + 2x6
Constraints
0x1+ 2x2 + 2x3 + 4x4 + 1x5 + 0x6 ≥ 150 (Number of rolls of size 5 feet)
1x1+ 1x2 + 0x3 + 0x4 + 2x5 + 0x6 ≥ 200 (Number of rolls of size 7 feet)
1x1+ 0x2 + 1x3 + 0x4 + 0x5 + 2x6 ≥ 300 (Number of rolls of size 9 feet)
x1, x2, x3, x4, x5, x6 0
82