Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
60 views

Linear Programming - Solver

This document discusses linear programming and how to solve linear programming problems using Excel Solver. It begins by defining linear programming and describing typical applications. It then outlines the steps to formulate a linear programming problem and demonstrates solving a sample problem graphically. Finally, it discusses using Excel Solver to compute a solution and perform sensitivity analysis on the optimal solution. The key lessons are how to set up linear programming models and solve them using Excel to help with resource allocation and optimization decisions.

Uploaded by

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

Linear Programming - Solver

This document discusses linear programming and how to solve linear programming problems using Excel Solver. It begins by defining linear programming and describing typical applications. It then outlines the steps to formulate a linear programming problem and demonstrates solving a sample problem graphically. Finally, it discusses using Excel Solver to compute a solution and perform sensitivity analysis on the optimal solution. The key lessons are how to set up linear programming models and solve them using Excel to help with resource allocation and optimization decisions.

Uploaded by

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

Linear Programming using Excel

Solver

Dr. P.K. Viswanathan


Professor(Analytics)
Great Lakes Institute of Management
Chennai, India
Learning Objectives

After completing this module, you will be able to:

• Know what is Linear Programming (LP)


• Formulate Linear Programming Problems
• Use Graphical Method to Solve LP
• Formulate and Solve LP Models using Excel Solver
• Perform Sensitivity Analysis
Introduction

• An economist faces the problem of making an optimum


allocation of resources among competing projects. A
business-planning manager has to decide how many units of
each product be produced to maximize profit subject to
constraints on production capacity and demand for these
products. We need a model that can help us find the best
solution in the context of constraints that impact the
problem. Linear programming provides solutions to such
problems. Here, the word programming implies planning.
What is Linear Programming?
• Linear Programming (LP) is concerned with the best way of
allocating scarce resources among competing ends. The word
optimization is used in the context of either maximizing or
minimizing an objective function. Organizations do have
problems such as minimizing cost of production, or maximizing
the profit. The resources that are available in limited quantities
are called constraints and the optimization will have to take
place subject to the constraints the organization has.

• Linear implies that the the variables in the objective function and
constraints are raised to the power 1 only.
Typical Applications

• An advertising company wants to maximize exposure of a


client’s product and has a choice of advertising in different
media that include TV, Radio, and magazines. These media
charge different advertising costs. The ad company has to
achieve its objective of maximizing exposure subject to the
constraints of ad budget, minimum and maximum number of
ads in the various media. LP can help the company solve this
problem.
Typical Applications, Cont.
• A furniture manufacturer producing a number of items would
like to maximize his profit. He has certain commitments to his
customers in the form of minimum and maximum quantities to
be supplied for each item. Also in his plant, the available
production time in each of the 3 departments is limited. LP can
help him find an optimum product mix that can maximize his
total profit.
Typical Applications, Cont.
• Applications of linear programming are plenty. Product mix
problem, media planning, transportation problem, blending
problem, scheduling of nurses and doctors to the patients in a
hospital, and capital investment are among the many where
linear programming can be applied.
Steps in LP Problem Formulation
• Identify the decision variables.
• Formulate the objective function in terms of the decision
variables.
• Formulate the constraints in terms of the decision
variables.

Note: In any LP problem, all decision variables are


positive or zero(Non-negative)
Graphical Method to get insight into LP formulation and
solution
Example: One of the divisions of a small-scale unit manufactures two products.
Both the products require two raw materials and the consumption (kg) per unit
production is given below:
Product 1 Product 2 Maximum
Availability
per day
Raw Material 2 3 18
1
Raw Material 1 1 8
2

The profit per unit of product 1 is $ 15, and product 2 is $ 21. The maximum
quantity of product 1 that can be sold is 4 units. You will have to help this small-
scale unit decide how many units of product 1 and product 2 to produce so as to
maximize the total profit.
Graphical Method Example Cont.
Formulation

• Identify the decision variables:


Let x1 be the number of units of product 1 to be produced per day
Let x2 be the number of units of product 2 to be produced per day

• Formulate the objective function in terms of the decision variables:


The profit per unit of product 1 is $15 and product 2 is $21. If you produce x1 units of
product 1 and x2 units of product 2, then the total profit =15x1 + 21x2. This has to be
maximized. In linear programming terminology, we write the objective function as Z =
15x1 + 21x2. Z is to be maximized.

• Formulate the constraints in terms of the decision variables:


The maximum quantity of product 1 that can be sold is 4 units. So
x1  4 (Sales constraint)

The maximum availability of raw material 1 is 18 kg. To produce x1 units of product1 and x2
units of product 2, you need 2x1 + 3x2 kg. So, 2x1 + 3x2  18 (raw material 1 availability)

Similarly we can work out the raw material availability constraint for raw material 2. And
it is x1 + x2  8 (raw material 2 availability)
Graphical Method Formulation at a glance

Maximize Z = 15x1 + 21x2

Subject to:

x1  4

2x1 + 3x2  18

x1 + x2  8

And x1, x2  0(non-negativity)


Example Problem: Graphical Solution
• Constraint #1 Line Drawn
x2

6
x1 = 4

1 (4, 0)
x1
1 2 3 4 5 6 7 8 9 10
Example Problem: Graphical Solution
• Constraint #2 Line Drawn
x2

8
(0, 6 )
7

6 2x1 + 3x2 = 18
5

4
3

1 (9 , 0)

x1
1 2 3 4 5 6 7 8 9 10
Example Problem:Graphical Solution
• Constraint #3 Line Drawn
x2
(0, 8)
8

7
x1 + x2 = 8
6

1 (8, 0)

x1
1 2 3 4 5 6 7 8 9 10
Example Problem: Graphical Solution
Constraint Lines and Feasibility Region Drawn in
a combined manner
x2
x1 + x2= 8
8

6 A(0,6) X1=4

4
B (4, 3 1/3)
3 Feasibility Region
2x1 + 3x2 =18
2

D(0,0) C(4,0) x1
1 2 3 4 5 6 7 8 9 10
Optimal Solution

In any linear programming problem the optimum solution


when it exists is always one of the corner points in the
feasibility region. Select that corner point which gives the
maximum Z value. (Note: For minimization case select that
corner point that gives the minimum Z value). In our case
we need to select the maximum Z value.
Corner Point Z Value : Z= 15x1 + 21x2
A(0,6) 126
B(4, 3 1/3) Optimum 130
C(4,0) 60
D(0,0) 0
Sensitivity Analysis
Sensitivity Analysis
Finding the solution to a linear programming model is only the first step. Any
manager would like to know how sensitive the solution is to changes in inputs
and assumptions. Let us interpret the sensitivity analysis output given by
solver for the LP problem just solved.
Sensitivity Analysis Cont.

• Shadow Price

The shadow price gives the incremental increase in profit


when the right hand side value of a constraint is increased
by one unit, and the decrease in profit when the right
hand side value of a constraint is decreased by one unit.
Shadow prices play a key role in evaluating the worth of
increasing the resources and also new product evaluation.
Let us interpret the shadow prices for our example.
Sensitivity Analysis Cont.
• Shadow Price Interpretations for the Example:
Shadow price corresponding to constraint 1 namely Sales for Product 1 is seen
to be =1. This means that the objective function (total profit) will increase or
decrease by $1 if the sale quantity for product 1 is increased or decreased by 1
unit. From a marketing angle every additional unit sold on product 1 will
increase the profit by $1.

Shadow price corresponding to constraint 2 is 7. This means that an increase


or decrease of 1 kg in availability of raw material 2 will produce an increase or
decrease of $7 in the objective function. So, the moral of the story is that
every additional kg of raw material 2 made available will increase the profit by
$7.

Shadow price for raw material 2 is 0. It does not make any impact on the
objective function.

Thus shadow prices for Sale of Product 1, Raw Material 1, and Raw Material 2
are $1, $7, and $0 respectively.

The allowable increase and allowable decrease shown in the output indicates
the range for which the shadow prices will hold true.
Computer Solution

• The key is your ability to formulate a linear programming


model for a given problem. You can then solve it using
“Solver” of Microsoft Excel.
• The technical terms associated with linear programming
purely from a mathematical perspective are not needed.
• For a manager, a problem well formulated is half solved.
• The simple slogan I would popularize is “Excel in formulating
any LP problem and solve it using Excel”.
Investment Problem
• An investor has Rs. 2 lakhs with him. The investment climate is
such that if Rs 2 is invested as fresh investment on day 1 followed
by Rupee 1 as one time compulsory investment on day 2, then
you will get Rs. 4 on day 3. The investor wants to have maximum
cash with him on Saturday. He would quit the market on
Saturday. In other words, the action starts with Monday and ends
on Saturday. The receipt that one gets on day three can be
assumed to be credited into the bank account in the morning
itself so that it can be deployed for making investment.

• What should be the fresh investment that should be made on


each day starting with Monday on all days so that the cash
balance is the highest on Saturday?
Portfolio Optimization
Mr. Joseph, investment manager of Wizard Finance has $120000 to
invest in new IT stocks. Data on four chosen stocks are given below:

Stock Dividend Growth Price per


% Share
1 1.50 30 35

2 0.75 25 45

3 2.00 28 40

4 0.50 35 55
Portfolio Optimization Cont.
Mr. Joseph has been asked to maximize growth in $ value excluding
dividends of this portfolio of shares in the coming year. It is Wizard’s
policy to get at least $2500 as annual dividend from this portfolio of
shares. Wizard also wants to play safe by stipulating the following
conditions. Amount invested in stock 4 cannot be more than 55% of
amount invested in stock 1. Further the company requires that at least
15% of total investment be in stock 2.

Formulate and solve this case as a linear programming problem and


obtain the optimum solution-using Solver.
Assumptions in Linear Programming
1) Proportionality: Because we assume linear relationship among variables in LP,
proportionality is inevitable. Suppose you need 5 kg of input to produce one unit. Then
to produce two units, you need 10 kg of input. This is not necessarily true.

2) Additivity: When we formulate the constraints, we add resource requirements of the


decision variables. We ignore the interaction term in the expression. Interaction
measures the effect of any combination of decision variables.

3) Divisibility: Divisibility does not guarantee integer solutions. In a particular problem,


fractional solution does not make sense. For example, in a product mix problem, you
may get a solution that says produce 10.3 units of model 1 and 14.4 units of model 2. It
does not make sense. Rounding to the whole number sometimes may vitiate the
solutions.

4) Certainty: In linear programming, you assume all variables are known without any
doubt. Thus, you assume a deterministic or certainty scenario. But in reality, you may
have to assess carefully the magnitude of uncertainty.
Programmers Recruitment Planning
A Case Study

A software company conducts a short applied certificate course in computer


programming for trainee programmers. Trained programmers are used as
instructors in the certificate course in the ratio of one for every ten trainee
programmers recruited. The certificate course lasts for one month. From
past experience, it has been found that out of ten trainee programmers
hired, only six complete the certificate course successfully (the unsuccessful
trainee programmers are sent out).

Trained programmers are also needed for company's computer assignments


and the company's requirements for the next three months are as follows:
Month 1 200
Month 2 300
Month 3350
In addition, the company requires 400 trained programmers in the beginning
of Month 4. There are 230 trained programmers available as of now.
Case Study Cont.
Salary Details are:

Each Trainee Programmer $4000

Each Trained Programmer $7000


(Doing company’s computer
assignments or as instructor)

Each Trained Programmer


who remains idle $5000
(Union agreement prevents firing
Trained Programmers)

Decide and set up the hiring and training schedule of programmers, which will
meet the company's requirements at minimum cost
Problem Formulation for the Case

• Identify the decision variables


Let X1 =Trained programmers functioning as instructors in Month 1
Let X2 =Trained programmers who remain idle in Month 1
Let X3= Trained programmers functioning as instructors in Month 2
Let X4= Trained programmers who remain idle in Month 2
Let X5= Trained programmers functioning as instructors in Month 3
Let X6 =Trained programmers who remain idle in Month 3
Problem Formulation for the Case
• Formulate the objective function
Minimize
Z = 4000(10X1+10X3+10X5) +7000(X1+X3+X5)+5000(X2+X4+X6)

Z = Total Variable Cost. The salary to be paid to programmers in Month 1,


Month 2, and Month 3 are fixed cost that cannot be reduced. Hence, in the
objective function, it is not included. Simplifying Z =
47000X1+5000X2+47000X3+5000X4+47000X5+5000X6

Note: Because trained programmers are used as instructors in the course in


the ratio of one for every 10 trainee programmers recruited, the following are
true:
10X1 trainee programmers are recruited in Month 1
10X3 trainee programmers are recruited in Month 2
10X5 trainee programmers are recruited in Month 3
Problem Formulation for the Case
• Formulate the constraints Upon simplification, the constraints are:
Month 1 X1+X2 = 30
230 = 200+X1+X2 Month 2 6X1-X3-X4 = 70
(Month 1 constraint) Month 3 6X1+6X3-X5-X6 = 120
Month 4 6X1+6X3+6X5 = 170
230+6X1 =300+X3+X4
X1,X2,X3,X4,X5,X6 are  0 (Non-negativity)
(Month 2 constraint -

230+6X1+6X3 =350+X5+X6 (Month 3 Note: Out of 10X1 trainee programmers


constraint) recruited, 6X1 are successful in the course in
Month 1 and are available for company’s
computer assignments or functioning as
230+6X1+6X3+6X5 = 400
instructors in Month 2. Similarly those who are
(Month 4 constraint)
successful in completing the course in Month 2,
and Month 3 are available in the subsequent
month for company’s computer assignments or
functioning as instructors.
Complete Formulation at a Glance
• Complete LP Formulation for the Example:

Minimize Z=47000X1+5000X2+47000X3+5000X4+47000X5+5000X6

Subject to constraints:

X1+X2 = 30(Month 1)
6X1-X3-X4 = 70(Month 2
6X1+6X3-X5-X6 = 120(Month 3)
6X1+6X3+6X5 = 170(Month 4)
X1, X2, X3, X4, X5, X6 are  0 (Non-negativity)
Spreadsheet Displaying Model
formulation for the Case
Spreadsheet Displaying Optimum Solution for the Case
Computer Solution from Solver

As you can see that the minimum cost is $1416531. The optimum values of the
decision variables are:

X1 =Trained programmers functioning as instructors in Month 1 = 13


X2 =Trained programmers who remain idle in Month 1 = 17
X3= Trained programmers functioning as instructors in Month 2 = 8
X4= Trained programmers who remain idle in Month 2 = 0
X5= Trained programmers functioning as instructors in Month 3 = 7
X6 =Trained programmers who remain idle in Month 3 = 0

We have rounded the values of the decision variables to integers as fractional


values of programmers are not possible. Please note that all constraints are
fully satisfied when you take the fractional values.
HAPPY LEARNING !

9-Aug-17 34

You might also like