02 LP Introduction (20241015)
02 LP Introduction (20241015)
Linear Programming
Mathematical modeling technique in which a linear
function is maximized or minimized when subjected
to various constraints
1
Some of the practical applications in LP are:
2
https://www.vitral.in/post/branding-vs-marketing-vs-advertising
Linear Programming: Concepts & Solutions
3
Linear Programming (LP) Problem
• Linear Programming (LP)
– A family of mathematical techniques (algorithms) that
can be used for Constrained Optimization problems
with linear relationships.
G. B. Dantzig, the
– The problems are with… father of Linear
Programming,
Single Linear objective function &
developed the use
Linear constraints of linear algebra to
solve LP (1947).
• Objective function is either maximization or minimization of some quantity
• Constraints can be internal (such as labour time, material availability etc.) and/or
external (such as labour regulation, safety etc.)
• Linear functions are functions in which each variable appears in a separate term
raised to the first power and is multiplied by a constant (which could be 0).
• Linear constraints are linear functions that are restricted to be "less than or equal
to", "equal to", or "greater than or equal to" a constant
• Programming – refers to use of algorithms Linear:
2 X, 10 Y, 15 X etc.
Non-Linear:
4
X2 , X * Y, X3 etc.
Developing a LP model
• Problem formulation
• Solution
5
Problem Formulation
6
Steps in model formulation
1. Study the problem thoroughly and decide on
objective
2. Define the decision variables
3. Determine the objective function in terms of
the decision variables
4. Identify the constraints in terms of the
decision variables
5. Summarize the model
7
The Carpenter's Problem:
4. Identify constraints:
15 X1 + 10 X2 <= 140 (wood constraint)
4 X1 + 5 X2 <= 56 (labour hours constraint)
X1 & X2 >= 0 (non-negativity constraint)
Cont…. 9
Model Formulation
Objective function:
Subject to:
10
Components of an LP model
Objective (profit)
Objective function:
Parameters
Non-negativity
11
Assumptions in an LP model
1. Proportionality or Linearity
• Decision variables must have linear impact in the objective function and in each
constraints
2. Additivity
• Terms in the objective function and in the constraints must be additive
3. Divisibility
• Non integer values for decision variables are acceptable
4. Certainty
• Model parameters are known and constant
• All relevant constraints have been identified and represented in the model
Objective function:
Maximize 1000 X1 + 700 X2
Subject to:
15 X1 + 10 X2 <= 140 (wood constraint)
4 X1 + 5 X2 <= 56 (labour hours constraint)
X1 & X2 >= 0 (non-negativity constraint)
12
Solution Methods
13
LP solution methods
• Graphical method
• Simplex method
Extreme points method, more than >= 2 variables
14
The Simplex Algorithm For Linear Optimization
Guaranteed to converge
to the global optimal solution
15
Karmarkar’s method (Projective Scaling algorithm) (1984)
50 times
faster than
the simplex
method on
large
problems
16
Graphical Solution
17
Steps in solving an LP problem graphically
1. Formulate the LP problem
6. Determine the values of the decision variables and the value of the objective
function for the optimal solution.
18
The Carpenter's Problem
Step 1
Objective function:
Subject to:
19
Graphical solution: Steps 2 to 4
X1 & X2 >= 0
(non-negativity
constraints)
20
Graphical solution: Steps 2 to 4
Wood constraint:
Constraint Line
15 X1 + 10 X2 <= 140
Intercepts
(X2 = 0, X1 = 9.33)
(X1 = 0, X2 = 14)
To find intercepts:
First make 15 X1 + 10 X2 = 140
Assume X2 =0, then X1 = 140 /15 = 9.33
Hence, one intercept point is (9.33, 0)
Labour constraint
Constraint Line
4 X1 + 5 X2 <= 56
Intercepts
(X2 = 0, X1 = 14)
(X1 = 0, X2 = 11.2)
22
Steps 5 to 6 – Optimal Solution by “Objective function line
method”
Max. Z = 1000 X1 + 700 X2
or
Max. Z = 10 X1 + 7 X2 (in 100 of
rupees)
(It is scaled down to make it suitable
for plotting in the graph paper)
Intercepts (Iso-profit line Z = 45)
10 X1 + 7 X2 = 45
(X2 = 0, X1 = 4.5)
(X1 = 0, X2 = 6.43)
D Corner X1 X2 Z = 10 X1 + 7 Y2
A 0 0 0
C B 9.2 0 92
C 4 8 96 Maximum
D 0 11.2 78.4
A B
Optimal solution
24
Slack and Surplus
Slack:
The amount resource of a constraints that is unused by the optimal solution is called
slack.
This relates to <= constraints.
Surplus:
The amount by which a constraint is exceeded by a solution is called surplus.
It relates to >= constraints.
Max. Z = 10 X1 + 7 X2 + 0 S1 + 0 S2
Subject to:
15 X1 + 10 X2 + S1 = 140
4 X1 + 5 X2 + S2 = 56
X1, X2, S1 and S2 >= 0
When all constraints are written as equalities (except non-negativity constraints), the
linear program is said to be in Standard Form.
25
All variables including slack variables must be nonnegative.
Special Cases
Infeasibility
A linear program which is over
constrained or direction
mismatches so that no point
satisfies all the constraints is
said to be infeasible.
26
Special Cases
Unbounded solutions:
In some LP model, the
objective function value can be
increased or decreased
indefinitely without any
limitation.
Redundant constraints:
A constraint does not form a unique boundary
of the feasible solution space. The constraint
can be removed from a system of linear
constraints without changing the feasible
region.
If more than two constraints pass through
the corner points of the feasible region,
excess constraints will not serve any
purpose, and therefore they act as
redundant constraints. Under such situation,
degeneracy will occur. This means that
some iteration will be carried out in simplex
method without any improvement in the 27
objective function.
Solutions by Solver
28
Carpenter’s Example
Objective function:
Subject to:
31
Solver Options
32
Answer Report
The Wyndor Glass Co. produces high-quality glass products, including windows and glass doors that feature handcrafting
and the finest workmanship. Although the products are expensive, they fill a market niche by providing the highest quality
available in the industry for the most discriminating buyers. The company has three plants that simultaneously produce the
components of its products.
• Plant 1 produces aluminium frames and hardware.
• Plant 2 produces wood frames.
• Plant 3 produces the glass and assembles the windows and doors.
Because of declining sales for certain products, top management has decided to revamp the company’s product line.
Unprofitable products are being discontinued, releasing production capacity to launch the two new products developed by Jim
Baker’s group.
The 8-foot glass door requires some of the production capacity in Plants 1 and 3, but not Plant 2. The 4-foot × 6-foot double-
hung window needs only Plants 2 and 3.
The amount of each plant’s production capacity actually used by each product depends on its production rate. 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.
By analysing the cost data and the pricing decision, the Accounting Department estimates the profit from the two products.
The projection is that the profit per unit will be $300 for the doors and $500 for the windows.
Let
D = the number of doors to produce
W = the number of windows to produce
4. Identify constraints:
D≤4
2W ≤ 12
3D + 2W ≤ 18
and
D ≥ 0, W ≥ 0. 35
Model Formulation
6
Production rate for windows
0 2 4 6 8 D
Production rate for doors
Nonnegative Solutions Permitted by D ≤ 4
W
D =4
6
Production rate for windows
0 2 4 6 8 D
Production rate for doors
Nonnegative Solutions Permitted by 2W ≤ 12
Production rate for windows
W
2 W = 12
6
0 2 4 6 8 D
Production rate for doors
Nonnegative Solutions Permitted by
3D + 2W ≤ 18
Production rate for windows
W
10
3D + 2W = 18
4
0 2 4 6 8 D
Production rate for doors
Graph of Feasible Region
Production rate for windows
W
10
3 D + 2 W = 18
8
D =4
6 2 W =12
Feasible
region
2
0 2 4 6 8 D
Production rate for doors
Objective Function (P = 1,500)
Production rate W
for windows
8
Feasible
4
region
P = 1500 = 300D + 500W
0 2 4 6 8 D
Production rate for doors
Finding the Optimal Solution
Production rate W
for windows
8
Feasible
4
region
P = 1500 = 300D + 500W
0 2 4 6 8 10 D
Production rate for doors
Algebraic Model for Wyndor Glass Co.
Wyndor's Problem
Definition of decision variables:
D = number of doors to produce
W = number of windows to produce
Decisions Variables: D W
Product 2 6
46
Finding the Optimal Solution - Solver
Nonbinding constraint –
has the Slack of 2
Binding constraints –
have the Slack of 0 47
Assignment 1: It is an individual assignment.
Upload the scanned copy of the file on Moodle. The deadline for submission is given on Moodle.
Minimization Problem
49