Operational ResearchUnit 38 min read

Unit 3 – Simplex Method & Duality

Unit 3 of Operational Research: a comprehensive guide to the Simplex algorithm, duality theory, worked examples, and real‑world applications for TU, PU and NEB students.

Key points

  • The Simplex method transforms an LPP into standard form and iteratively improves the objective using pivot operations.
  • Duality links every primal LP to a dual LP; optimal solutions satisfy complementary slackness.
  • Primal and dual solutions provide economic interpretations (shadow prices, resource values).
  • Simplex is efficient for most practical problems but can suffer from degeneracy and exponential worst‑case.
  • Linear programming underpins many industry decisions: inventory, scheduling, network design, and finance.

Introduction

Operational Research (OR) is the science of decision‑making under constraints.
A Linear Programming Problem (LPP) is a special OR model where the objective and constraints are linear.
The Simplex method is the most widely used algorithm to solve LPPs exactly.
Duality is a fundamental property of LPs that associates a dual problem to every primal problem, revealing hidden economic meanings.


1. Simplex Method

1.1 Standard Form

A primal maximization problem is written as

To apply Simplex, we convert inequalities to equalities by adding slack variables :

The initial basic feasible solution (BFS) is obtained by setting decision variables to zero and taking .

1.2 Simplex Tableau

The tableau records the coefficients of the constraints, the objective function, and the current basic variables.
A typical tableau for the example below is shown in Figure 1.

1.3 Pivot Operations

  1. Entering variable – choose the most negative coefficient in the objective row (for maximization).
  2. Leaving variable – compute the minimum ratio among positive entries.
  3. Pivot – divide the pivot row by the pivot element and eliminate the pivot column from other rows by row operations.

1.4 Simplex Algorithm (Mermaid Flowchart)

flowchart TD
  A["Start"] --> B["Check optimality: any negative in z-row?"]
  B -->|"No"| C["Optimal solution found"]
  B -->|"Yes"| D["Select entering variable (most negative)"]
  D --> E["Select leaving variable (minimum ratio)"]
  E --> F["Pivot to update tableau"]
  F --> B

1.5 Worked Example – Bakery Production

A bakery produces two types of cakes:

  • Type A requires 2 kg of flour and 1 kg of sugar.
  • Type B requires 1 kg of flour and 1 kg of sugar.

The bakery has 5 kg of flour and 4 kg of sugar.
Profit per cake: ₹5 for A, ₹3 for B.

Formulate and solve:

Step 1 – Standard form

Add slack variables :

Step 2 – Initial tableau (Figure 1)

Step 3 – First pivot

  • Entering variable: (most negative coefficient ).
  • Leaving variable: (ratio vs ).

Pivot on element in row 1, column .

Updated tableau (Figure 2)

Step 4 – Second pivot

  • Entering variable: (coefficient in z‑row).
  • Leaving variable: (ratio vs ).

Pivot on element in row 2, column .

Final tableau (Figure 3)

Optimal solution:
cake of type A, cakes of type B, profit .
All constraints satisfied and no negative coefficients remain in the objective row, so the solution is optimal.


2. Duality

2.1 Primal–Dual Relationship

For a primal maximization problem in standard form:

the dual minimization problem is

  • Primal variables ↔ Dual constraints.
  • Primal constraints ↔ Dual variables .
  • Objective coefficients ↔ Dual RHS .

2.2 Weak and Strong Duality

  • Weak duality: For any feasible and , .
  • Strong duality: If both problems have optimal solutions, then .

2.3 Dual of the Bakery Example

Primal (above) has , , .
Dual:

Solving dual by Simplex (Figure 4)

Pivoting yields optimal dual solution , , , matching the primal optimum .
The dual variables are the shadow prices: the marginal increase in profit per additional unit of flour or sugar.

2.4 Complementary Slackness

For optimal primal and dual :

In the bakery example, (flour constraint tight), so can be positive; , so .
This confirms the economic interpretation: flour is a binding resource, sugar is not.


3. Comparison of Primal and Dual

Feature Primal (Max) Dual (Min)
Variables Decision variables Shadow prices
Constraints
RHS Resource limits Objective coefficients
Objective Maximize Minimize
Feasibility
Economic meaning Production levels Resource values

4. Advantages & Disadvantages of Simplex

Advantage Explanation
Exact optimality Guarantees global optimum for linear problems.
Widely implemented Available in Excel Solver, MATLAB, Python libraries.
Intuitive tableau Easy to trace solution path.
Dual solution Provides shadow prices automatically.
Disadvantage Explanation
Worst‑case exponential Rare in practice but theoretically possible.
Degeneracy Can cause cycling; requires anti‑cycling rules.
Requires linearity Non‑linear problems need different methods.

5. Real‑World Applications

5.1 eSewa – Transaction Routing

eSewa processes millions of micro‑transactions daily.
It models the routing of funds through multiple payment gateways as an LPP:

  • Decision variables: number of transactions routed via each gateway.
  • Constraints: gateway capacity, regulatory limits.
  • Objective: minimize transaction fee or maximize throughput.
    The simplex solution tells eSewa the optimal split of traffic to keep costs low while respecting limits.

5.2 Ncell – Tower Placement

Ncell must decide where to install new base stations to cover the Kathmandu Valley.
An LPP models:

  • Variables: binary decision to build a tower at a candidate site.
  • Constraints: coverage requirements, budget, interference limits.
  • Objective: maximize coverage or minimize cost.
    The dual variables represent the marginal value of adding coverage to a specific area, guiding future investment.

5.3 Daraz – Warehouse Allocation

Daraz assigns orders to regional warehouses to minimize delivery time.
The problem is a transportation LP:

  • Variables: number of orders shipped from warehouse to customer zone .
  • Constraints: warehouse capacity, demand fulfillment.
  • Objective: minimize total shipping cost.
    Simplex yields the optimal shipment plan; dual prices indicate how much the cost would rise if a warehouse’s capacity were reduced.

6. In the Real World

Product Idea Used How It Works
eSewa Linear programming for transaction routing Optimizes gateway selection to minimize fees while meeting capacity constraints.
Ncell LP for tower placement Determines optimal tower locations to maximize coverage under budget limits.
Daraz Transportation LP for order allocation Allocates orders to warehouses to minimize shipping cost and delivery time.

Worked real‑situation example:
A local bakery (like the one in the worked example) uses the Simplex solution to decide how many cakes of each type to bake each day. The optimal mix (1 type A, 3 type B) maximizes profit given limited flour and sugar, exactly mirroring the theoretical example.


7. Exam Tip

  • Formulation: Always write the problem in standard form before applying Simplex.
  • Tableau: Keep the tableau clean; label rows and columns clearly.
  • Pivot rules: Use the most negative coefficient for entering variable; minimum ratio for leaving variable.
  • Dual questions: Identify primal and dual variables; write complementary slackness conditions.
  • Interpretation: Explain the economic meaning of dual variables (shadow prices).
  • Practice: Solve at least two full Simplex traces and one duality pair before the exam.

calculatorA standard scientific calculator used for manual simplex calculations (Image: LoMit, CC BY-SA 4.0, via Wikimedia Commons) graph paperGraph paper for sketching constraint lines and feasible region (Image: Mikus, CC BY-SA 4.0, via Wikimedia Commons) penA pen for writing tableau entries during exams (Image: Petar Milošević, CC BY-SA 4.0, via Wikimedia Commons)

Based on the TU BCA syllabus for Operational Research (CAOR451), unit 3.

Discussion

Loading…