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

02 LP Introduction (20241015)

Uploaded by

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

02 LP Introduction (20241015)

Uploaded by

dhvani.1710
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

Introduction to

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:

• Supply Chain Management: Linear programming is used to


optimize transportation, distribution, and production scheduling in
supply chains.

• Production Planning: It helps in determining the optimal


allocation of resources (e.g., labor, machines, and raw materials) to
maximize production output while minimizing costs.

• Portfolio Optimization: In finance, linear programming is used for


portfolio selection to maximize returns while minimizing risk.

• Blending Problems: Linear programming is used to determine the


optimal mix of ingredients in manufacturing, like finding the best
combination of ingredients for a food product.

• Agriculture: Linear programming helps in making decisions


related to crop selection, land use, and resource allocation in
farming.

• Advertising and Marketing: It's used to allocate advertising


budget across various media channels to maximize exposure or
sales.

2
https://www.vitral.in/post/branding-vs-marketing-vs-advertising
Linear Programming: Concepts & Solutions

• Linear Programming Problem


• Problem Formulation
• A Maximization Problem
• Graphical Solution Procedure
• Extreme Points and the Optimal Solution
• Computer Solutions
• A Minimization Problem
• Special Cases

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

• Interpretation and Sensitivity Analysis

5
Problem Formulation

• Problem formulation or modeling is the process


of translating a verbal statement of a problem
into a mathematical statements

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:

A carpenter told that he, solely, makes tables and chairs,


sells all tables and chairs at a marketplace. He does not
have a stable income and wishes to do his best. The unit
profit for a table is Rs. 1000 and for a chair is Rs. 700. He
uses two types of resources to produce tables and chairs,
they are wood (cubic feet) and labour (hours). It takes 15
cu. ft. of wood and 4 hours labour to make a table, and 10
cu. ft. of wood and 5 hours labour to make a chair. There
are 140 cu. ft. of wood available and 56 hours of labour
time available. Find the optimal mix of products to
maximize the profit.
8
Model Formulation
1. Study the problem and decide on objective
• Carpenter has an objective of maximizing profit and there are restrictions on
wood availability and labour hours….Hence constrained optimization problem… LP
• The unit profit for a table is Rs. 1000 and for a chair is Rs. 700
• The carpenter wants to know the quantities of tables and chairs to be produced to
maximize his profit
• 140 cu. ft. of wood & 56 labour hours are available (constraints)
• Table requires15 cu. ft. of wood and 4 hours labour
• Chair requires 10 cu. ft. of wood and 5 hours labour

2. Define decision variables To get decision variables ask…


Let, • What choices are available to the
X1 – number to tables to produce decision-maker to meet the
X2 – number of chairs to produce objective?
• What actions or decisions are to
3. Define objective function: be taken to meet the objective?
Max. 1000 X1 + 700 X2
or
Max. 10 X1 + 7 X2 (in 100 of rupees)
(It is scaled down to make it suitable for plotting in the graph paper)

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

5. Summarizing 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)

10
Components of an LP model

Objective (profit)
Objective function:

Maximize Z = 1000 X1 + 700 X2

Subject to: Decision variables

15 X1 + 10 X2 <= 140 (wood constraint)


4 X1 + 5 X2 <= 56 (labour hours constraint) Constraints
X1 & X2 >= 0 (non-negativity constraints)

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

Limited to maximum 2 variables. Though it is possible to


construct 3 dimensional graphs for 3 variables, normally this
method is restricted to 2 variables

• Simplex method
Extreme points method, more than >= 2 variables

• Karmarkar’s method (Projective Scaling Algorithm),


more than >= 2 variables

• Solver based approach to LP problems

14
The Simplex Algorithm For Linear Optimization

A pictorial representation of a simple


Exploits special properties of linearity to find optimal linear program with two variables and
solutions. six inequalities. The set of feasible
solutions is depicted in yellow and
forms a polygon, a 2-dimensional
polytope. The optimum of the linear
Imagine the surface of a diamond which represents cost function is where the red line
feasible decision variables: intersects the polygon. The red line is
1. Starts with a feasible set of decision variables that corresponds to a a level set of the cost function, and the
corner on a diamond. arrow indicates the direction in which
we are optimizing.
2. Checks to see if a feasible neighboring corner point is better.
3. If not, stops; otherwise moves to that better neighbor and return to
step 2.

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

• Graphing an LP model helps provide insight


into LP models and their solutions

• While this can only be done in two


dimensions, the same properties apply to all
LP models and solutions.

17
Steps in solving an LP problem graphically
1. Formulate the LP problem

2. Construct a graph and plot each of the constraints (including non-negativity


constraints)

3. Determine the valid side of each constraint line


If the line has inequality constraint “<=” then the region below the line in the
first quadrant is the valid side.
If the line has inequality constraint “>=” then the region above the line in the
first quadrant is the valid side.
If the constraint is “=” then the line itself a valid line (there is no valid region)

4. Identify the feasible solution region


It is the area which satisfies all the constraints

5. Plot the objective function line and determine direction of improvement


Or
Find the most attractive corner which satisfies the objective function

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:

Maximize 1000 X1 + 700 X2 (profit)

Subject to:

15 X1 + 10 X2 <= 140 (wood constraint)


4 X1 + 5 X2 <= 56 (labour hours constraint)
X1 & X2 >= 0 (non-negativity constraints)

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)

Assume X1 = 0, then X2 = 140/10 = 14


The other intercept point is (0, 14)

Using these two points draw the straight line 21


which represents 15 X1 + 10 X2 = 140
Graphical solution: Steps 2 to 4

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)

Intercepts (Iso-profit line Z = 78)


10 X1 + 7 X2 = 78
(X2 = 0, X1 = 7.8)
(X1 = 0, X2 = 11.14)

A feasible solution satisfies all the Optimal Solution:


problem's constraints. X1 = 4 (tables)
An optimal solution is a feasible solution X2 = 8 (chairs)
that results in the largest possible
objective function value when maximizing Max. Profit = 10*4 + 7*8 = 96 (in 100 of rupees)
(or smallest when minimizing). = Rs. 9600
23
NOTE: For minimization problem, the objective function line is called Iso-cost line.
Steps 5 to 6 – Optimal Solution by “Extreme Points
method”
• The corners or vertices of the feasible region are referred to as the
extreme points.
• An optimal solution to an LP problem can be found at an extreme point
of the feasible region.
• When looking for the optimal solution, you do not have to evaluate all
feasible solution points.
• You must consider only the extreme points of the feasible region.

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.

Equal to (“=”) constraints will never have slack or surplus.

If slack or surplus variables are added to constraints, they become equalities.

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.

Multiple Optimal Solutions:


If the objective function line is
parallel to a boundary constraint in
the direction of optimization, there
are alternate optimal solutions with
all points on this line segment being
optimal.

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:

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)
Input Screen for the Carpenter’s Problem

Go to file: Carpenter's Problem - Solver.xls


Solver Dialog Box

31
Solver Options

32
Answer Report

Optimal value of the objective


function

Optimal values of the


decision variables - how
much we should make

If an inequality constraint holds with equality at the optimal


point, the constraint is said to be binding, as the
point cannot be varied in the direction of the constraint. If 33
you change it, the optimal solution will have to change.
A CASE STUDY: THE WYNDOR GLASS CO. PRODUCT-MIX PROBLEM

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.

Table below summarizes the data now gathered.

Data for the Wyndor Glass Co. Product-Mix Problem

Production Time Used for Each Unit Produced


Plant Doors Windows Available per Week
1 1 hour 0 4 hours
2 0 2 hours 12 hours
3 3 hours 2 hours 18 hours
Unit profit $300 $500

Management now needs to address the following issue: 34


What should be the product mix—the number of units of each produced per week—for the two new products?
Model Formulation

1. Study the problem and decide on objective

• To maximize the profit (What should be the product mix?)

2. Define decision variables

Let
D = the number of doors to produce
W = the number of windows to produce

3. Define objective function:

Maximize P = $300D + $500W

4. Identify constraints:

D≤4
2W ≤ 12
3D + 2W ≤ 18
and
D ≥ 0, W ≥ 0. 35
Model Formulation

5. Summarizing the model:

Let D = the number of doors to produce


W = the number of windows to produce

Maximize P = $300D + $500W


subject to
D≤4
2W ≤ 12
3D + 2W ≤ 18
and
D ≥ 0, W ≥ 0.
36
Algebraic Model for Wyndor Glass Co.

Let D = the number of doors to produce


W = the number of windows to produce

Maximize P = $300D + $500W


subject to
D≤4
2W ≤ 12
3D + 2W ≤ 18
and
D ≥ 0, W ≥ 0.
Graph Showing Constraints: D ≥ 0 and W ≥ 0

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

P = 3600 = 300D + 500W


Optimal solution

P = 3000 = 300D + 500W 6


(2, 6)

Feasible
4
region
P = 1500 = 300D + 500W

0 2 4 6 8 10 D
Production rate for doors
Algebraic Model for Wyndor Glass Co.

Let D = the number of doors to produce


W = the number of windows to produce

Maximize P = $300D + $500W


subject to
D≤4
2W ≤ 12
3D + 2W ≤ 18
and
D ≥ 0, W ≥ 0.
Finding the Optimal Solution - Solver

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

Objective Function: Total Profit


300 500 3600

Constraints: LHS Type RHS Units


Plant 1 1 0 2 <= 4
Plant 2 0 2 12 <= 12
Plant 3 3 2 18 <= 18

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.

Find the optimal solution to the following problem using:


a) Graphical approach (manually draw the graph and find solution)
b) Solver approach.

Upload the scanned copy of the file on Moodle. The deadline for submission is given on Moodle.

Minimization Problem

A regional fuel company operates two processing facilities.


Facility X has a daily operating expense of $18,000 and produces
500 barrels of top-quality oil, 250 barrels of regular oil, and 150
barrels of economical oil each day. Facility Y, which is newer and
more efficient, costs $30,000 per day to operate and can produce
400 barrels of top-quality oil, 350 barrels of regular oil, and 600
barrels of economical oil daily.
The company has customer orders totalling 30,000 barrels of top-
quality oil, 25,000 barrels of regular oil, and 35,000 barrels of
economical oil. How many days should each facility operate to
minimize overall costs while fulfilling the required oil orders? 48
Backup

49

You might also like