You are on page 1of 28

Quantitative Methods - 2010

Linear Programming (LP)

George Dantzig Father of Linear Programming


QM 2010 - Transcend 1

Preliminary
Programming in the OR sense means to find the values for several variables. (Not to be confused with computer coding). LP is part of a larger field called Mathematical Programming (MP) Objective of LP is to optimize (maximize or minimize) a function of several variables, subject to constraints on these variables. Huge variety of very large, practical problems can be expressed and solved as LP problems
QM 2010 - Transcend 2

Motivating Scenario (Finance)


An NBFC is considering investing in shares of 2 companies, A and B. Current price per share:
A: Rs.250, B: Rs.160

Expected annual returns per share are:


A: Rs. 45 B: Rs. 37

NBFC internal limit for this industry: Rs. 10 L SEBI limits: A 3000 shares; B 4000 shares Question: How many shares to buy in A and B?
QM 2010 - Transcend 3

Motivating Scenario (Advertizing)


A marketing manager is considering 2 different media, A and B, for promotion of a product. Cost per insertion in each is known
Medium A: Rs. 25,000; Medium B: Rs. 36,000

Expected no. of prospects per insertion


Medium A: 7 L; Medium B: 9 L

Ad budget: Rs.350,000 Ad availability


Medium A: 4 insertions; Medium B: 6 insertions

Question: How many insertions in A, B?


QM 2010 - Transcend 4

Motivating Scenario (Distribution)


Product availability (no. of cartons) at our warehouses in
Sangli: 700; Lonavla: 450; Palghar: 800

Requirements at our customers in


Vapi: 630; Nasik: 750; Bombay: 570

Transport costs from each to each are known. Question: How much to send from which warehouse to which customer?
QM 2010 - Transcend 5

General LP Problem

QM 2010 - Transcend

General Structure
We have
n decision variables: x1 --- xn An objective function to be optimized involving the decision variables: Z = c1x1 + --- +cnxn A set of constraints involving the decision variables:
a11x1 + a12x2 - - - +a1nxn b1 a21x1 + a22x2 - - - +a2nxn b2 ------- am1x1 + am2x2 - - - +amnxn bm

For solving, we have to add non-negativity constraints:


All x 0
QM 2010 - Transcend 7

Structure for 2 Decision Variables


We have
2 decision variables: x1 and x2 An objective function to be optimized involving the 2 decision variables: Z = c1x1 + c2x2 A set of constraints involving the decision variables:
a11x1 + a12x2 a21x1 + a22x2 --- am1x1 + am2x2 All x 0
QM 2010 - Transcend 8

b1 b2 --bm

For solving, we have to add non-negativity constraints:

Graphical Representation
(Maximizing Z - For 2 Decision Variables)
Z = c1x1 + c2x2 a11x1 + a12x2 b1

(x1*, x2*)
a31x1 + a32x2 b3

x2

Feasible Region
a21x1 + a22x2 b2

x1

Solution is x1 = x1*, and x2 = x2*


QM 2010 - Transcend 9

Graphical Representation
(Minimizing Z - For 2 Decision Variables)

x2

(x1*, x2*)

x1

Solution is x1 = x1*, and x2 = x2*


QM 2010 - Transcend 10

Formulating A (2 Variable) LP Problem


Identify your decision variables
Let x1 = no of shares of A; x2 = no of shares of B

Write objective function


Maximize Z = 45x1 + 37x2

Write constraints
250x1 + 180x2 10 L ---- investment constraint X1 + x2 4500 ----- SEBI constraint

Add non-negativity constraints


X1, x2 0
QM 2010 - Transcend 11

Plotting The Constraints


Estimate range of variables and draw axes
X1: 0 to 4500, x2: 0 to 6000

Take any 2 arbitrary x1 in this range, write constraints as equations, solve for x2
(1) 250(1000) + 160(x2) = 10 L; x2 = 4687 250(3000) + 160(x2) = 10 L; x2 = 1563 (2) x1 = 3000 (3) x2 = 4000

Plot the constraints lines


QM 2010 - Transcend 12

Feasible Region For NBFC Problem


6000 250(x1) + 160 (x2) = 10 L

1000 2000 3000

x2

X1 = 3000

X2 = 4000

0
0

1000 2000 3000

x1

6000

QM 2010 - Transcend

13

Plotting The Objective Function


Plot the objective function line
Take any arbitrary (x1, x2) in the range, and determine Z.
Z = 45(1000) + 40(1000) = 85,000

For that Z and a different arbitrary x1, find x2


85000 = 45(2000) +40(x2) . So x2 = - 8000/340= - 1250

Plot the points (1000, 1000) and (2000, - 1250). The line thru them is the Z = 85,000 line.

QM 2010 - Transcend

14

Objective Function On Feasible region


250(x1) + 160 (x2) = 10 L

x2
Z = 85,000

X2 = 4000 X1 = 3000

x1
QM 2010 - Transcend 15

Final Solution
Moving the Z line parallely up, we can see that the Z line thru point A will have a higher value than thru any other point in the Feasible Region. Calculate the coordinates of A:
Clearly, x2 of A = 4000 Put this value in the other line equation, to get x1 for A
250(x1) + 160(4000) = 10 L, so x1 = 3.60 L/250 = 1440

Find Z at A, by putting x1 = 1440, x2 = 4000 in Z equation


Z = 45(1440) + 40(4000) = 224,800

Thus Max Z = 224,800, and solution is x1 = 1440, x2 = 4000


QM 2010 - Transcend 16

Illustrating Final Solution


250(x1) + 160 (x2) = 10 L
Z = 2,24,800

A
X2 = 4000 X1 = 3000

x2
Z = 85,000

x1
QM 2010 - Transcend 17

Verification Of Final Solution


Point B has x1 = 3000 and x2 = 1563
Z at that point = 45(3000) + 40(1563) = 197,520 This less than the Z at A All other points will have even less Z So clearly Z at A is the maximum value, and coordinates of A is the solution.

QM 2010 - Transcend

18

Transportation Problem
(Special Case Of General LP Problem)

QM 2010 - Transcend

19

General Structure
We have mxn table of m sources and n destinations.
Table entries are transportation costs cij (per unit of some item) from each destination to each source Row totals Ai are availabilities at the sources Column totals Rj are requirements at the destinations
mxn decision variables (how much to ship) : x11 --- xmn An objective function to be optimized involving the decision variables: Z = c11x11 + --- +cmnxmn Constraints are shipments
Must not violate any availabilities Must meet all requirements

We have

QM 2010 - Transcend

20

Transportation LP Table
Destinations Available s1 s2 ----sm Required d1 c11 c21 d2 c12 ----dn c1n A1 A2 ----Am

Sources

cm1 R1

R2

---

---

cmn Rm

QM 2010 - Transcend

21

Transportation LP Solution Table


Destinations Available s1 s2 ----sm Required d1 x11 x21 d2 x12 ----dn x1n A1 A2 ----Am

Sources

xm1 R1

R2

---

---

xmn Rm

X in rows must add up to Availability X in columns must add up to Required Some X can be zero.
QM 2010 - Transcend 22

Try This Yourself


Cartons of milk powder are stored in 3 warehouses as follows:
Sangli: 700; Lonavla: 450; Palghar: 800

They are required at 3 customers as follows:


Vapi: 630; Nasik: 750;
Vapi Sangli Lonavla Palghar 5 7 2

Bombay: 570
Nasik 4 5 8 Bombay 2 3 6

Transport costs per carton are as follows:

Suggest 3 distribution plans, and work out total cost for each plan.
QM 2010 - Transcend 23

Assignment Problem
(Another Special Case Of General LP Problem)

QM 2010 - Transcend

24

General Structure
We have mxm table of m jobs and m machines.
Table entries are operation costs cij of assigning each job to each machine

We have
mxm decision variables ( = 1 if assigned, = 0 otherwise) : x11 --- xmn An objective function to be optimized involving the decision variables: Z = c11x11 + --- +cmnxmn Constraints are shipments
Only 1 job can be assigned to each machine

QM 2010 - Transcend

25

Assignment Problem Table


Machines m1 c11 c21 m2 c12 ----mm c1n

Jobs

j1 j2 ----jm

cm1

cmn

QM 2010 - Transcend

26

Assignment Problem Solution Table


Machines m1 x11 x21 m2 x12 ----mm x1n

Jobs

j1 j2 ----jm

xm1
There can be only one 1 in each row and in each column. All other entries must be 0
QM 2010 - Transcend

xmn

27

End Of Linear Programming

QM 2010 - Transcend

28

You might also like