2.8 Linear Programming

Detailed Theory: Linear Programming

1. Introduction to Linear Programming

1.1 What is Linear Programming?

Linear Programming (LP) is a mathematical method to achieve the best outcome (such as maximum profit or lowest cost) in a mathematical model whose requirements are represented by linear relationships.

1.2 Key Components of LP

Every linear programming problem consists of:

  1. Objective Function: The function to be maximized or minimized

    • Example: Maximize Z=3x+4yZ = 3x + 4y

  2. Decision Variables: The variables we can control

    • Example: xx and yy

  3. Constraints: Restrictions or limitations on the variables

    • Example: 2x+y102x + y \leq 10, x+3y15x + 3y \leq 15

  4. Non-negativity Conditions: Variables must be non-negative

    • Example: x0x \geq 0, y0y \geq 0

1.3 Standard Form of LP Problem

A linear programming problem is in standard form if:

  1. It is a maximization problem

  2. All constraints are equations (not inequalities)

  3. All variables are non-negative

  4. All right-hand side constants are non-negative

Standard Form: Maximize Z=c1x1+c2x2++cnxnZ = c_1x_1 + c_2x_2 + \cdots + c_nx_n

Subject to:

a11x1+a12x2++a1nxn=b1a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n = b_1
a21x1+a22x2++a2nxn=b2a_{21}x_1 + a_{22}x_2 + \cdots + a_{2n}x_n = b_2

\vdots

am1x1+am2x2++amnxn=bma_{m1}x_1 + a_{m2}x_2 + \cdots + a_{mn}x_n = b_m
x1,x2,,xn0x_1, x_2, \ldots, x_n \geq 0
b1,b2,,bm0b_1, b_2, \ldots, b_m \geq 0

2. Formulation of Linear Programming Problems

2.1 Steps in Formulation

  1. Identify decision variables

  2. Formulate objective function

  3. Formulate constraints

  4. Add non-negativity conditions

2.2 Example: Production Problem

Problem: A company produces two products, A and B. Each unit of A gives profit of Rs. 40, each unit of B gives profit of Rs. 30. Machine time: A needs 2 hours, B needs 3 hours. Total machine time available: 60 hours. Labor: A needs 1 hour, B needs 2 hours. Total labor available: 40 hours. Find optimal production mix.

Formulation:

Step 1: Decision variables: Let x1x_1 = number of units of A produced Let x2x_2 = number of units of B produced

Step 2: Objective function (maximize profit): Maximize Z=40x1+30x2Z = 40x_1 + 30x_2

Step 3: Constraints: Machine time: 2x1+3x2602x_1 + 3x_2 \leq 60 Labor time: x1+2x240x_1 + 2x_2 \leq 40

Step 4: Non-negativity: x10x_1 \geq 0, x20x_2 \geq 0

Complete LP: Maximize Z=40x1+30x2Z = 40x_1 + 30x_2

Subject to:

2x1+3x2602x_1 + 3x_2 \leq 60
x1+2x240x_1 + 2x_2 \leq 40
x1,x20x_1, x_2 \geq 0

3. Graphical Method

3.1 When to Use Graphical Method

The graphical method can be used only when there are two decision variables.

3.2 Steps in Graphical Method

  1. Plot constraints as straight lines

  2. Identify feasible region (area satisfying all constraints)

  3. Find corner points of feasible region

  4. Evaluate objective function at each corner point

  5. Select optimal solution

3.3 Example Using Graphical Method

Solve: Maximize Z=3x+4yZ = 3x + 4y

Subject to:

x+y5x + y \leq 5
2x+y82x + y \leq 8
x0,y0x \geq 0, \quad y \geq 0

Step 1: Plot constraints

Constraint 1: x+y5x + y \leq 5

  • Line: x+y=5x + y = 5

  • Intercepts: (5,0) and (0,5)

  • Shade below line (since \leq)

Constraint 2: 2x+y82x + y \leq 8

  • Line: 2x+y=82x + y = 8

  • Intercepts: (4,0) and (0,8)

  • Shade below line

Non-negativity: x0x \geq 0, y0y \geq 0 (first quadrant only)

Step 2: Identify feasible region Feasible region is the intersection of all shaded areas.

Step 3: Find corner points

  1. Origin: (0,0)

  2. X-intercept of constraint 1: (5,0)

  3. Y-intercept of constraint 1: (0,5)

  4. Intersection of constraints: Solve x+y=5x + y = 5 and 2x+y=82x + y = 8

Subtract first from second: x=3x = 3 Then 3+y=5y=23 + y = 5 \Rightarrow y = 2 Intersection: (3,2)

Check if (0,5) satisfies constraint 2: 2(0)+5=582(0) + 5 = 5 \leq 8

Check if (4,0) satisfies constraint 1: 4+0=454 + 0 = 4 \leq 5

So corner points: (0,0), (5,0), (0,5), (3,2)

Step 4: Evaluate objective function

At (0,0): Z=3(0)+4(0)=0Z = 3(0) + 4(0) = 0

At (5,0): Z=3(5)+4(0)=15Z = 3(5) + 4(0) = 15

At (0,5): Z=3(0)+4(5)=20Z = 3(0) + 4(5) = 20

At (3,2): Z=3(3)+4(2)=9+8=17Z = 3(3) + 4(2) = 9 + 8 = 17

Step 5: Select optimal solution Maximum Z=20Z = 20 at (0,5)

So optimal solution: x=0x = 0, y=5y = 5, Z=20Z = 20

3.4 Special Cases in Graphical Method

a) Multiple Optimal Solutions

When objective function line is parallel to a constraint line forming one side of feasible region.

Example: Maximize Z=2x+2yZ = 2x + 2y with same constraints as above.

Then at (0,5): Z=10Z = 10, at (3,2): Z=10Z = 10

All points on line segment between (0,5) and (3,2) give same Z=10Z = 10

b) Unbounded Solution

When feasible region extends infinitely in direction of increasing/decreasing objective function.

Example: Maximize Z=x+yZ = x + y with constraints x0x \geq 0, y0y \geq 0 only.

c) Infeasible Problem

When no point satisfies all constraints simultaneously (feasible region is empty).

Example: x+y2x + y \leq 2 and x+y3x + y \geq 3 with x,y0x,y \geq 0


4. Simplex Method

4.1 Introduction to Simplex Method

The simplex method is an iterative algorithm for solving linear programming problems with any number of variables.

4.2 Converting to Standard Form

To use simplex method, we need to convert inequalities to equations by adding slack, surplus, and artificial variables.

a) Slack Variables (for ≤ constraints)

Add slack variable to convert inequality to equation.

Example: 2x+3y102x + 3y \leq 10 becomes 2x+3y+s=102x + 3y + s = 10 with s0s \geq 0

b) Surplus and Artificial Variables (for ≥ constraints)

  1. Subtract surplus variable to convert to equation

  2. Add artificial variable to get initial basic feasible solution

Example: x+y5x + y \geq 5 becomes x+ys+a=5x + y - s + a = 5 with s0s \geq 0, a0a \geq 0

c) Artificial Variables (for = constraints)

Add artificial variable directly.

Example: x+2y=8x + 2y = 8 becomes x+2y+a=8x + 2y + a = 8

4.3 Simplex Algorithm Steps

Step 1: Convert to standard form

Step 2: Set up initial simplex tableau

Step 3: Identify entering variable (most negative coefficient in objective row for maximization)

Step 4: Identify leaving variable using minimum ratio test

Step 5: Perform pivot operation

Step 6: Repeat until all coefficients in objective row are non-negative

4.4 Example Using Simplex Method

Maximize Z=3x+4yZ = 3x + 4y

Subject to:

x+y5x + y \leq 5
2x+y82x + y \leq 8
x,y0x, y \geq 0

Step 1: Convert to standard form Add slack variables s1s_1 and s2s_2:

Maximize Z=3x+4y+0s1+0s2Z = 3x + 4y + 0s_1 + 0s_2

Subject to:

x+y+s1=5x + y + s_1 = 5
2x+y+s2=82x + y + s_2 = 8
x,y,s1,s20x, y, s_1, s_2 \geq 0

Step 2: Initial simplex tableau

Basis
x
y
s₁
s₂
RHS

s₁

1

1

1

0

5

s₂

2

1

0

1

8

Z

-3

-4

0

0

0

Step 3: Entering variable Most negative in Z-row: -4 (column y)

Step 4: Leaving variable Minimum ratio test: For s₁ row: 5/1 = 5 For s₂ row: 8/1 = 8 Minimum is 5, so s₁ leaves

Step 5: Pivot operation Pivot on element at intersection of y-column and s₁-row (value = 1)

New tableau after making pivot element = 1 and other elements in column = 0:

Basis
x
y
s₁
s₂
RHS

y

1

1

1

0

5

s₂

1

0

-1

1

3

Z

1

0

4

0

20

Step 6: Check optimality All coefficients in Z-row are non-negative (1, 0, 4, 0 ≥ 0), so optimal.

Optimal solution: y=5y = 5, s2=3s_2 = 3, x=0x = 0, Z=20Z = 20

This matches graphical solution.


5. Duality in Linear Programming

5.1 Primal and Dual Problems

Every linear programming problem (called primal) has a corresponding dual problem.

Primal (Maximization): Maximize Z=cTxZ = c^Tx

Subject to: AxbAx \leq b, x0x \geq 0

Dual (Minimization): Minimize W=bTyW = b^Ty

Subject to: ATycA^Ty \geq c, y0y \geq 0

5.2 Rules for Forming Dual

Primal (Maximization)
Dual (Minimization)

n variables

n constraints

m constraints

m variables

Coefficients cⱼ

RHS bᵢ

RHS bᵢ

Coefficients cⱼ

Constraint i: ≤

Variable yᵢ ≥ 0

Constraint i: ≥

Variable yᵢ ≤ 0

Constraint i: =

Variable yᵢ unrestricted

Variable xⱼ ≥ 0

Constraint j: ≥

Variable xⱼ ≤ 0

Constraint j: ≤

Variable xⱼ unrestricted

Constraint j: =

5.3 Example: Primal to Dual

Primal: Maximize Z=40x1+30x2Z = 40x_1 + 30x_2

Subject to:

2x1+3x2602x_1 + 3x_2 \leq 60
x1+2x240x_1 + 2x_2 \leq 40
x1,x20x_1, x_2 \geq 0

Dual: Let y1y_1, y2y_2 be dual variables

Minimize W=60y1+40y2W = 60y_1 + 40y_2

Subject to:

2y1+y2402y_1 + y_2 \geq 40
3y1+2y2303y_1 + 2y_2 \geq 30
y1,y20y_1, y_2 \geq 0

5.4 Duality Theorems

a) Weak Duality Theorem

If xx is feasible for primal and yy is feasible for dual, then:

cTxbTyc^Tx \leq b^Ty

b) Strong Duality Theorem

If either primal or dual has an optimal solution, then so does the other, and:

Optimal Z=Optimal W\text{Optimal } Z = \text{Optimal } W

c) Complementary Slackness

At optimality:

  1. If primal constraint is not binding (slack > 0), then corresponding dual variable = 0

  2. If dual constraint is not binding (surplus > 0), then corresponding primal variable = 0


6. Sensitivity Analysis

6.1 What is Sensitivity Analysis?

Study of how changes in parameters affect optimal solution.

6.2 Types of Changes Analyzed

  1. Changes in objective function coefficients

  2. Changes in right-hand side constants

  3. Addition of new variables

  4. Addition of new constraints

6.3 Range of Optimality

For objective function coefficient cjc_j, the range of optimality is the range of values for which current optimal solution remains optimal.

Example: For Z=3x+4yZ = 3x + 4y with optimal solution (0,5):

  • Current coefficient of xx: 3

  • Range of optimality for cxc_x: cx4c_x \leq 4 (If cx>4c_x > 4, then (0,5) is no longer optimal)

6.4 Shadow Price

Shadow price of a resource is the increase in optimal value per unit increase in availability of that resource.

Mathematically: Shadow price = optimal value of corresponding dual variable.

Example: For constraint x+y5x + y \leq 5 with RHS = 5, if we increase to 6:

  • New optimal: (0,6) gives Z=24Z = 24

  • Increase: 24 - 20 = 4

  • Shadow price = 4


7. Transportation Problem

7.1 Introduction

Transportation problem deals with distributing goods from multiple sources to multiple destinations at minimum cost.

7.2 Mathematical Formulation

Let:

  • mm sources with supplies a1,a2,,ama_1, a_2, \ldots, a_m

  • nn destinations with demands b1,b2,,bnb_1, b_2, \ldots, b_n

  • cijc_{ij} = cost to transport one unit from source ii to destination jj

  • xijx_{ij} = amount transported from source ii to destination jj

Minimize total cost:

Z=i=1mj=1ncijxijZ = \sum_{i=1}^m \sum_{j=1}^n c_{ij} x_{ij}

Subject to: Supply constraints:

j=1nxij=aifor i=1,2,,m\sum_{j=1}^n x_{ij} = a_i \quad \text{for } i = 1,2,\ldots,m

Demand constraints:

i=1mxij=bjfor j=1,2,,n\sum_{i=1}^m x_{ij} = b_j \quad \text{for } j = 1,2,\ldots,n

Non-negativity:

xij0x_{ij} \geq 0

7.3 Balanced Transportation Problem

When total supply = total demand:

i=1mai=j=1nbj\sum_{i=1}^m a_i = \sum_{j=1}^n b_j

If unbalanced, add dummy source or destination.

7.4 Solution Methods

  1. North-West Corner Method

  2. Least Cost Method

  3. Vogel's Approximation Method (VAM)

  4. MODI Method (Modified Distribution) for optimality test

7.5 Example: Transportation Problem

Problem: Sources: S1 (supply 30), S2 (supply 50) Destinations: D1 (demand 20), D2 (demand 30), D3 (demand 30)

Cost matrix:

From/To
D1
D2
D3

S1

2

3

4

S2

5

1

2

Using North-West Corner Method:

Step 1: Start at NW corner (S1-D1) Allocate min(30,20) = 20 to S1-D1 S1 supply left: 10, D1 satisfied

Step 2: Move right to S1-D2 Allocate min(10,30) = 10 to S1-D2 S1 exhausted, D2 demand left: 20

Step 3: Move down to S2-D2 Allocate min(50,20) = 20 to S2-D2 D2 satisfied, S2 supply left: 30

Step 4: Move right to S2-D3 Allocate min(30,30) = 30 to S2-D3

All allocations done.

Total cost = 20×2+10×3+20×1+30×2=40+30+20+60=15020\times2 + 10\times3 + 20\times1 + 30\times2 = 40 + 30 + 20 + 60 = 150


8. Assignment Problem

8.1 Introduction

Special case of transportation problem where:

  • Number of sources = number of destinations

  • Each source supplies exactly 1 unit

  • Each destination demands exactly 1 unit

8.2 Mathematical Formulation

Minimize

Z=i=1nj=1ncijxijZ = \sum_{i=1}^n \sum_{j=1}^n c_{ij} x_{ij}

Subject to:

j=1nxij=1for i=1,2,,n\sum_{j=1}^n x_{ij} = 1 \quad \text{for } i = 1,2,\ldots,n
i=1nxij=1for j=1,2,,n\sum_{i=1}^n x_{ij} = 1 \quad \text{for } j = 1,2,\ldots,n
xij=0 or 1x_{ij} = 0 \text{ or } 1

8.3 Hungarian Method

Algorithm for solving assignment problems:

Step 1: Row reduction - subtract smallest element in each row from all elements in that row

Step 2: Column reduction - subtract smallest element in each column from all elements in that column

Step 3: Cover all zeros with minimum number of lines

Step 4: If number of lines = n, optimal solution found. Otherwise, adjust matrix and repeat.

8.4 Example: Assignment Problem

Assign 4 jobs to 4 workers with cost matrix:

Worker/Job
J1
J2
J3
J4

W1

9

2

7

8

W2

6

4

3

7

W3

5

8

1

8

W4

7

6

9

4

Solution using Hungarian method:

Row reduction:

  • Row 1: Subtract 2: [7, 0, 5, 6]

  • Row 2: Subtract 3: [3, 1, 0, 4]

  • Row 3: Subtract 1: [4, 7, 0, 7]

  • Row 4: Subtract 4: [3, 2, 5, 0]

Column reduction:

  • Col 1: Subtract 3: [4, 0, 1, 0]

  • Col 2: Subtract 0: [0, 1, 7, 2]

  • Col 3: Subtract 0: [5, 0, 0, 5]

  • Col 4: Subtract 0: [6, 4, 7, 0]

Cover zeros with minimum lines (need 4 lines for optimal).

Optimal assignment: W1 → J2, W2 → J3, W3 → J1, W4 → J4 Total cost = 2 + 3 + 5 + 4 = 14


9. Integer Programming

9.1 Introduction

Linear programming with additional requirement that some or all variables must take integer values.

9.2 Types

  1. Pure Integer Programming: All variables integer

  2. Mixed Integer Programming: Some variables integer

  3. Binary Integer Programming: Variables 0 or 1

9.3 Solution Methods

  1. Branch and Bound Method

  2. Cutting Plane Method

  3. Gomory's Cutting Plane Method

9.4 Example: Integer Programming

Maximize Z=3x+2yZ = 3x + 2y

Subject to:

2x+y62x + y \leq 6
x+2y8x + 2y \leq 8
x,y0 and integerx, y \geq 0 \text{ and integer}

LP relaxation solution (without integer constraint): x=43x = \frac{4}{3}, y=103y = \frac{10}{3}, Z=323Z = \frac{32}{3}

Branch and Bound:

  1. Branch on xx: x1x \leq 1 and x2x \geq 2

  2. Solve each subproblem

  3. Continue until integer solutions found

Optimal integer solution: x=2x = 2, y=2y = 2, Z=10Z = 10


10. Applications of Linear Programming

10.1 Business and Economics

  • Production planning: Optimal product mix

  • Inventory management: When and how much to order

  • Portfolio selection: Maximize return, minimize risk

  • Blending problems: Optimal mix of ingredients

10.2 Engineering

  • Structural design: Minimum weight structures

  • Network flows: Maximum flow, shortest path

  • Scheduling: Optimal timetables

10.3 Agriculture

  • Crop planning: Land allocation to maximize profit

  • Feed mix: Minimum cost animal feed

10.4 Healthcare

  • Resource allocation: Hospital staff scheduling

  • Diet planning: Minimum cost nutritious diet


11. Important Theorems and Concepts

11.1 Fundamental Theorem of Linear Programming

If an LP problem has an optimal solution, then it has an optimal solution at a corner point (extreme point) of the feasible region.

11.2 Extreme Point Theorem

The feasible region of an LP problem is a convex polyhedron, and the optimal solution occurs at an extreme point.

11.3 Complementary Slackness Theorem

At optimality of primal and dual:

  • If a primal variable is positive, corresponding dual constraint is tight

  • If a dual variable is positive, corresponding primal constraint is tight

11.4 Farkas' Lemma

Either Ax=bAx = b, x0x \geq 0 has a solution, or ATy0A^Ty \geq 0, bTy<0b^Ty < 0 has a solution, but not both.


12. Practice Problems

Problem 1: Graphical Method

Maximize Z=5x+3yZ = 5x + 3y

Subject to:

3x+5y153x + 5y \leq 15
5x+2y105x + 2y \leq 10
x,y0x, y \geq 0

Solution: Corner points: (0,0), (2,0), (0,3), intersection point

Solve:

3x+5y=153x + 5y = 15
5x+2y=105x + 2y = 10

Multiply first by 2: 6x+10y=306x + 10y = 30 Multiply second by 5: 25x+10y=5025x + 10y = 50 Subtract: 19x=20x=201919x = 20 \Rightarrow x = \frac{20}{19} Then 3(2019)+5y=155y=156019=22519y=45193(\frac{20}{19}) + 5y = 15 \Rightarrow 5y = 15 - \frac{60}{19} = \frac{225}{19} \Rightarrow y = \frac{45}{19}

Evaluate:

  • (0,0): Z = 0

  • (2,0): Z = 10

  • (0,3): Z = 9

  • (2019,4519)(\frac{20}{19}, \frac{45}{19}): Z = 5×2019+3×4519=10019+13519=2351912.375\times\frac{20}{19} + 3\times\frac{45}{19} = \frac{100}{19} + \frac{135}{19} = \frac{235}{19} \approx 12.37

Optimal: x=2019x = \frac{20}{19}, y=4519y = \frac{45}{19}, Z=23519Z = \frac{235}{19}

Problem 2: Simplex Method

Maximize Z=2x1+3x2Z = 2x_1 + 3x_2

Subject to:

x1+x24x_1 + x_2 \leq 4
x1x22x_1 - x_2 \leq 2
x1,x20x_1, x_2 \geq 0

Solution: Add slack variables s1,s2s_1, s_2:

Maximize Z=2x1+3x2+0s1+0s2Z = 2x_1 + 3x_2 + 0s_1 + 0s_2

Subject to:

x1+x2+s1=4x_1 + x_2 + s_1 = 4
x1x2+s2=2x_1 - x_2 + s_2 = 2

Initial tableau:

Basis
x₁
x₂
s₁
s₂
RHS

s₁

1

1

1

0

4

s₂

1

-1

0

1

2

Z

-2

-3

0

0

0

Entering: x₂ (most negative -3) Leaving: s₁ (min ratio: 4/1 = 4 vs 2/(-1) invalid)

Pivot on (1,2):

New tableau:

Basis
x₁
x₂
s₁
s₂
RHS

x₂

1

1

1

0

4

s₂

2

0

1

1

6

Z

1

0

3

0

12

Optimal (all coefficients ≥ 0)

Solution: x1=0x_1 = 0, x2=4x_2 = 4, Z=12Z = 12


13. Exam Tips and Common Mistakes

13.1 Common Mistakes

  1. Forgetting non-negativity constraints

  2. Incorrect conversion of inequalities to equations

  3. Wrong direction of inequality when forming dual

  4. Incorrect pivot element selection in simplex

  5. Not checking for multiple or unbounded solutions

13.2 Problem-Solving Strategy

  1. Understand the problem: Identify objective, variables, constraints

  2. Choose appropriate method: Graphical (2 variables), Simplex (more variables)

  3. Solve systematically: Show all steps

  4. Interpret solution: What do the numbers mean in context?

  5. Check feasibility: Does solution satisfy all constraints?

13.3 Quick Checks

  • Feasible region: Should be convex polygon

  • Optimal solution: At corner point for LP

  • Shadow prices: Non-negative for maximization

  • Dual variables: Non-negative for ≤ constraints in primal maximization

This comprehensive theory covers all aspects of linear programming with detailed explanations and examples, providing complete preparation for the entrance examination.

Last updated