Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 68

Operations Research Linear Programming

Operations Research (OR)


Branch of mathematics that deals with the allocation of scarce resources to various activities in the most effective manner Objective is to search for the best (optimal) solution(s) from among a number of alternative solutions

Introduced during World War II (WW II)

Operations Research (OR)


Scientists were asked to do research on (military) operations during WW II Success of OR led to the spread of its large-scale applications in business, industry and government Spread of OR was facilitated by the rapid growth in computational power

Systems and models


System
Collection of interrelated objects

Model
Abstraction of reality Representation of a system to study the behaviour of the system

Systems and models


Assumptions/Approximations

System

Model

Verification/Validation

Classification of models
Models

Schematic models

Physical models

Mathematical models

Diagrammatic representation of the system to display interrelationships between objects

Scaled-down look-alike model of the system

Analytic models

Simulation models

Static/Dynamic Deterministic/Stochastic

Academics or extra-curricular?
Suppose you consider academics and extra-curricular activities are the two most important aspects that have direct bearings on your prospects for placements. You estimate the ratio of the impact of devoting 1 hour to academics to the impact of devoting 1 hour to extra-curricular activities on your placement prospects to be 3:5. You decide not to spend more than 8 hours daily for these two activities. Moreover, you estimate that 1 hour of academics and 1 hour of extra-curricular activities burn, on an average, 100 and 250 calories, respectively, and you cannot afford to burn more than 1250 calories for these two activities based on your average daily calorie intake. Q. How many hours should you devote to academics and extracurricular activities daily?

Academics or extra-curricular?
Decision variables: x1: No. of hours devoted to academics daily x2: No. of hours devoted to extra-curricular activities daily Objective function: Maximize the impact on placement prospects Max z = 3x1 + 5x2 Constraints: x1 + x2 <= 8 100x1 + 250x2 <= 1250 or 2x1 + 5x2 <= 25 Non-negativity restrictions: x1, x2 >= 0

(1) (2)

Graphical solution
10

Optimal solution:
z* = 30 x1* = 5, x2* = 3

x2

(1)
C (2)

0 A 5 B x1 10 15

Assumptions in LP
Proportionality
Additivity Divisibility Certainty

Simplex algorithm
Developed by Dantzig in 1947 Convert the LP to standard form: Max z = 3x1 + 5x2 Subject to x1 + x2 + s1 =8 2x1 + 5x2 + s2 = 25 x1, x2, s1, s2 >= 0 s1 and s2 are slack variables

Basic and non-basic variables


If there are n variables and m linear equations in the standard form of an LP (n>m), we can set (n m) non-basic variables equal to zero and solve for the remaining m basic variables that satisfy the set of linear equations (provided it has a unique solution) A basic solution that satisfies the nonnegativity restrictions is called a basic feasible solution

Steps in simplex algorithm


1. Determine a starting basic feasible solution. Call it the current basic feasible solution 2. If the current basic feasible solution is optimal, stop. Otherwise, determine a new basic feasible solution that has an improved z-value 3. Calling the new basic feasible solution as the current basic feasible solution, go back to step 2

Initial simplex tableau


Basic z s1 x1 -3 1 x2 -5 1 s1 0 1 s2 0 0 Solution 0 8

s2

25

Entering variable: Leaving variable: Pivot element:

x2 s2 5

Iteration 1
Basic z s1 x1 -1 3/5 x2 0 0 s1 0 1 s2 1 -1/5 Solution 25 3

x2

2/5

1/5

Entering variable: Leaving variable: Pivot element:

x1 s1 3/5

Iteration 2
Basic z x1 x1 0 1 x2 0 0 s1 5/3 5/3 s2 2/3 -1/3 Solution 30 5

x2

-2/3

1/3

Optimal solution: x1* = 5, x2* = 3, z* = 30 Upper bound on the no. of iterations = Maximum no. of basic solutions = nCm

Optimality and feasibility


Optimality condition
The entering variable in a maximization (minimization) problem is the non-basic variable having the most negative (positive) coefficient in the z-row. Ties are broken arbitrarily. The optimum is reached at the iteration where all the z-row coefficients of the non-basic variables are non-negative (non-positive)

Feasibility condition
For both the maximization and minimization problems, the leaving variable is the basic variable associated with the smallest non-negative ratio. Ties are broken arbitrarily

Simplex method
1. Determine a starting basic feasible solution

2. Select an entering variable using the optimality condition. Stop if there is no entering variable
3. Select a leaving variable using the feasibility condition 4. Determine the new basic feasible solution by using the appropriate Gauss-Jordan computations. Go back to step 2

Graphical interpretation
10

Optimal solution:
z* = 30 x1* = 5, x2* = 3

x2

(1)
C (2)

0 A 5 B x1 10 15

Example: Company X
Company X produces two products - A and B with two raw materials, V and W the maximum availabilities of which are 7000 and 6000 units, respectively. To produce one unit of A(B), 1(2) unit(s) of V and 3(1) units of W are required. If the contributions per unit of A and B are Rs. 2 and Rs. 3, respectively, determine how many units of A and B should Company X produce in order to maximize the total contribution.
Solution: A - 1000 units and B - 3000 units

Treating variables with negative lower bounds


x2

Min z = x1 x2 Subject to -2x1 + x2 <= 4 (1) - x1 + 2x2 <= 4 (2) x1 >= -1.5, x2 >= 0
(2)

(-4/3, 4/3)

-4

-2

(1)

x1

Conversion to standard LP
x3 = x1 + 1.5 >= 0 & x1 = x3 - 1.5
Min z = - x2 + x3 - 1.5 Subject to x2 - 2x3 + s1 2x2 - x3 =1 + s2 = 2.5

x2, x3, s1, s2 >= 0

Initial simplex tableau


Basic z s1 x2 1 1 x3 -1 -2 s1 0 1 s2 0 0 Solution -1.5 1

s2

-1

2.5

Entering variable: Leaving variable: Pivot element:

x2 s1 1

Iteration 1
Basic z x2 x2 0 1 x3 1 -2 s1 -1 1 s2 0 0 Solution -2.5 1

s2

-2

0.5

Entering variable: Leaving variable: Pivot element:

x3 s2 3

Iteration 2
Basic z x2 x2 0 1 x3 0 0 s1 s2 Solution -8/3 4/3 -1/3 -1/3 -1/3 2/3

x3

-2/3 1/3

1/6

Optimal solution: x2 = 4/3, x3 = 1/6, z* = -8/3 or x1* = -4/3, x2* = 4/3, z* = -8/3

Treating free variables


x2

Min z = x1 x2 Subject to -2x1 + x2 <= 4 - x1 + 2x2 <= 4 x1, x2 free

(1) (2)
(2)

(-4/3, 4/3)

-4

-2

(1)

x1

Conversion to standard LP
Write x1 = x1+ - x1- and x2 = x2+ - x2Min z = x1+ - x1- - x2+ + x2Subject to - 2x1+ + 2x1- + x2+ - x2- + s1 - x1+ + x1- + 2x2+ - 2x2=4 + s2 = 4

x1+, x1-, x2+, x2-, s1, s2 >= 0

Initial simplex tableau


Basic z s1 x1+ -1 -2 x11 2 x2+ 1 1 x2-1 -1 s1 0 1 s2 0 0 Solution 0 4

s2

-1

-2

Entering variable: Leaving variable: Pivot element:

x1s1 2

Iteration 1
Basic z x1x1+ 0 -1 x10 1 x2+ 1/2 1/2 x2-1/2 -1/2 s1 -1/2 1/2 s2 0 0 Solution -2 2

s2

3/2

-3/2

-1/2

Entering variable: Leaving variable: Pivot element:

x2+ s2 3/2

Iteration 2
Basic z x1x1+ 0 -1 x10 1 x2+ 0 0 x20 0 s1 s2 Solution -8/3 4/3 -1/3 -1/3 2/3 -1/3

x2+

-1

-1/3

2/3

4/3

Optimal solution: x1- = 4/3, x2+ = 4/3, z* = -8/3 or x1* = -4/3, x2* = 4/3, z* = -8/3

Treating = and >= constraints


Suppose in the academics or extra-curricular? problem, you decide to devote exactly 8 hours (no less, no more) daily to these two activities. Also, you would like to burn at least 1250 calories for these two activities. Other data remaining the same, how many hours would you now devote to academics and extra-curricular activities daily? Modified formulation: Standard form: Max z = 3x1 + 5x2 Subject to x1 + x2 = 8 2x1 + 5x2 - s = 25 x1, x2, s >= 0 s is a surplus variable

Max z = 3x1 + 5x2 Subject to x1 + x2 = 8 (1) 2x1 + 5x2 >= 25 (2) x1, x2 >= 0

M-method
Max z = 3x1 + 5x2 MR1 MR2 Subject to

x1 + x 2
2x1 + 5x2 - s

+ R1

= 8
+ R2 = 25

x1, x2, s, R1, R2 >= 0


R1, R2 are called artificial variables M is a large number

Initial simplex tableau


Basic z R1 x1 -3 1 x2 -5 1 s 0 0 R1 M 1 R2 M 0 Solution 0 8

R2

-1

25

Observe that the z-row coefficients of the basic variables R1 and R2 are non-zero. To make them zero, subtract M-times the first constraint row and M-times the second constraint row from the objective row.

Modified initial simplex tableau


Basic z R1 x1 -3-3M 1 x2 -5-6M 1 s M 0 R1 0 1 R2 0 0 Solution -33M 8

R2

-1

25

Entering variable: Leaving variable: Pivot element:

x2 R2 5

Iteration 1
Basic z R1 x1 -1-3/5M 3/5 x2 0 0 s -1-1/5M 1/5 R1 0 1 R2 1+6/5M -1/5 Solution 25-3M 3

x2

2/5

-1/5

1/5

Entering variable: Leaving variable: Pivot element:

x1 R1 3/5

Iteration 2
Basic z x1 x1 0 1 x2 0 0 s -2/3 1/3 R1 5/3+M 5/3 R2 2/3+M -1/3 Solution 30 5

x2

-1/3

-2/3

1/3

Entering variable: Leaving variable: Pivot element:

s x1 1/3

Iteration 3
Basic z s x1 2 3 x2 0 0 s 0 1 R1 5+M 5 R2 M -1 Solution 40 15

x2

Optimal solution: x1* = 0, x2* = 8, z* = 40

Special cases in simplex


Degeneracy Alternative optima

Unbounded solutions
Infeasible solutions

Degeneracy
Suppose in the academics or extra-curricular? problem, you decide not to devote more than 5 hours daily to these two activities. Other data remaining the same, how many hours would you now devote to academics and extra-curricular activities daily?

Modified formulation: Max z = 3x1 + 5x2 Subject to x1 + x2 <= 5 (1) 2x1 + 5x2 <= 25 (2) x1, x2 >= 0

Standard form: Max z = 3x1 + 5x2 Subject to x1 + x2 + s1 = 5 2x1 + 5x2 + s2 = 25 x1, x2, s1, s2 >= 0

Initial simplex tableau


Basic z s1 x1 -3 1 x2 -5 1 s1 0 1 s2 0 0 Solution 0 5

s2

25

Entering variable: Leaving variable: Pivot element:

x2 s2 5

Iteration 1
Basic z s1 x1 -1 3/5 x2 0 0 s1 0 1 s2 1 -1/5 Solution 25 0

x2

2/5

1/5

Entering variable: Leaving variable: Pivot element:

x1 s1 3/5

Iteration 2
Basic z x1 x1 0 1 x2 0 0 s1 5/3 5/3 s2 2/3 -1/3 Solution 25 0

x2

-2/3

1/3

Optimal solution: x1* = 0, x2* = 5, z* = 25

Graphical interpretation
10

Optimal solution:
z* = 25 x1* = 0, x2* = 5
C

x2

5 (1)

Redundant constraint (2) B 0 5 x1 10 15

Alternative optima
Suppose in the academics or extra-curricular? problem, you estimate that the effect of 1 hour of academics and the effect of 1 hour of extra-curricular activities on your placement prospects are the same. Other data remaining the same, how many hours would you now devote to academics and extra-curricular activities daily?

Modified formulation:

Standard form:
Max z = x1 + x2 Subject to x1 + x2 + s1 = 8 2x1 + 5x2 + s2 = 25 x1, x2, s1, s2 >= 0

Max z = x1 + x2 Subject to x1 + x2 <= 8 2x1 + 5x2 <= 25 x1, x2 >= 0

(1) (2)

Initial simplex tableau


Basic z s1 x1 -1 1 x2 -1 1 s1 0 1 s2 0 0 Solution 0 8

s2

25

Entering variable: Leaving variable: Pivot element:

x1 s1 1

Iteration 1
Basic z x1 x1 0 1 x2 0 1 s1 1 1 s2 0 0 Solution 8 8

s2

-2

Entering variable: Leaving variable: Pivot element:

x2 s2 3

Iteration 2
Basic z x1 x1 0 1 x2 0 0 s1 1 5/3 s2 0 -1/3 Solution 8 5

x2

-2/3

1/3

Optimal solution: x1* = 5, x2* = 3, z* = 8

Graphical interpretation
10

Optimal solution:
z* = 8 x1* = 8, x2* = 0, or

x2

(1)
C (2)

x1* = 5, x2* = 3

0 A 5 B x1 10 15

Unbounded solutions
Suppose in the academics or extra-curricular? problem, you decide to devote at least 8 hours daily to these two activities. Also, you would like to burn at least 1250 calories for these two activities. Other data remaining the same, how many hours would you now devote to academics and extra-curricular activities daily?

Modified formulation:

Standard form:
Max z = 3x1 + 5x2 - MR1 - MR2 Subject to x1 + x2 - s1 + R1 = 8 2x1 + 5x2 - s2 + R2 = 25 x1, x2, s1, s2, R1, R2 >= 0

Max z = 3x1 + 5x2 Subject to x1 + x2 >= 8 (1) 2x1 + 5x2 >= 25 (2) x1, x2 >= 0

Initial simplex tableau


Basic z R1 x1 -3 1 x2 -5 1 s1 0 -1 s2 0 0 R1 M 1 R2 Solution M 0 0 8

R2

-1

25

Observe that the z-row coefficients of the basic variables R1 and R2 are non-zero. To make them zero, subtract M-times the first constraint row and M-times the second constraint row from the objective row.

Modified initial simplex tableau


Basic z R1 x1 -3-3M 1 x2 -5-6M 1 s1 M -1 s2 M 0 R1 0 1 R2 Solution 0 0 -33M 8

R2

-1

25

Entering variable: Leaving variable: Pivot element:

x2 R2 5

Iteration 1
Basic z R1 x1 -1-3/5M 3/5 x2 0 0 s1 M -1 s2 -1-1/5M 1/5 R1 0 1 R2 Solution 1+6/5M -1/5 25-3M 3

x2

2/5

-1/5

1/5

Entering variable: Leaving variable: Pivot element:

x1 R1 3/5

Iteration 2
Basic z x1 x1 0 1 x2 0 0 s1 -5/3 -5/3 s2 -2/3 1/3 R1 R2 Solution 30 5 5/3+M 2/3+M 5/3 -1/3

x2

2/3

-1/3

-2/3

1/3

Entering variable: Leaving variable: Pivot element:

s1 x2 2/3

Iteration 3
Basic z x1 x1 0 1 x2 5/2 5/2 s1 0 0 s2 -3/2 -1/2 R1 M 0 R2 Solution 3/2+M 1/2 75/2 25/2

s1

3/2

-1/2

-1

1/2

9/2

Entering variable: Leaving variable:

s2 ?

Graphical interpretation
10

(1)
x2 5 (2) 0 5 x1 10 15

Infeasible solutions
Suppose in the academics or extra-curricular? problem, you decide to devote at most 5 hours daily to these two activities. Also, you would like to burn at least 1500 calories for these two activities. Other data remaining the same, how many hours would you now devote to academics and extra-curricular activities daily?

Modified formulation:

Standard form:
Max z = 3x1 + 5x2 - MR Subject to x1 + x2 + s1 = 5 2x1 + 5x2 - s2 + R = 30 x1, x2, s1, s2, R >= 0

Max z = 3x1 + 5x2 Subject to x1 + x2 <= 5 (1) 2x1 + 5x2 >= 30 (2) x1, x2 >= 0

Initial simplex tableau


Basic z s1 x1 -3 1 x2 -5 1 s1 0 1 s2 0 0 R M 0 Solution 0 5

-1

30

Observe that the z-row coefficient of the basic variable R is nonzero. To make it zero, subtract M-times the second constraint row from the objective row.

Modified initial simplex tableau


Basic z s1 x1 -3-2M 1 x2 -5-5M 1 s1 0 1 s2 M 0 R 0 0 Solution -30M 5

-1

30

Entering variable: Leaving variable: Pivot element:

x2 s1 1

Iteration 1
Basic z x2 x1 2+3M 1 x2 0 1 s1 5+5M 1 s2 M 0 R 0 0 Solution 25-5M 5

-3

-5

-1

In the optimal tableau, the artificial variable R is positive!

Graphical interpretation
10

x2

5 (1) (2)

5 x1

10

15

Duality
Consider the academics or extra-curricular? problem in modified form: Primal problem Max z = 3,00,000x1 + 5,00,000x2 Subject to x1 + x2 <= 8 100x1 + 250x2 <= 1250 x1, x2 >= 0

Resources and their worth


Resources
Time: Maximum availability 8 hours Energy: Maximum availability 1250 calories

Worth of resources
y1: Unit worth of resource Time y2: Unit worth of resource Energy

Dual formulation
Dual problem Min w = 8y1 + 1250y2 Subject to y1 + 100y2 >= 3,00,000 y1 + 250y2 >= 5,00,000 y1, y2 >= 0

Primal-dual conversion rules


Maximization prob. Constraints = Variables 0 Minimization prob. Variables 0 0 Unrestricted Constraints

0
Unrestricted

Academics or extra-curricular?
Primal problem expressed in standard form: Max z = 3,00,000x1 + 5,00,000x2 Subject to x1 + x 2 + s1 =8 100x1 + 250x2 + s2 = 1250 x1, x2, s1, s2 >= 0

Optimal primal tableau


Basic z x1 x1 0 1 x2 s1 s2 Solution 0 1,66,666.67 1333.33 30,00,000 0 5/3 -1/150 5

x2

-2/3

1/150

Optimal solution: x1* = 5, x2* = 3, z* = 30,00,000

Example: Company X
Optimal primal tableau
Basic z x1 0 x2 0 s1 1.4 s2 0.20 -1/5 2/5 Solution 11,000 3000 1000

x2
x1

0
1

1
0

3/5
-1/5

Optimal solution: x1* = 1000, x2* = 3000, z* = 11,000

Sensitivity analysis: Academics or extra-curricular?


Allowable changes in the objective function coefficients to retain optimality 10

Optimal solution: z* = 30105 x1* = 5, x2* = 3

x2

(1) C (2)

0 A 5

10

15

x1 Range of contribution of academics : (200000, 500000)

Range of contribution of extra - curricular activities : (300000, 750000)

You might also like