Operations Research in Numbers: Simplex, Duality and Sensitivity, Transportation (NWC, VAM, MODI), Assignment, Branch and Bound, Markovian Queues and Simulation

Section 7 of the PI paper lists linear programming with duality and sensitivity, transportation and assignment, integer programming, Markovian queuing and discrete-event simulation; the earlier chapter states the methods and this one runs them. A two-product problem maximising 50x₁ + 40x₂ reaches ₹2800 at (x₁, x₂) = (40, 20) in three pivots, with shadow prices 20 and 10 per hour of the two scarce resources. A 3 × 4 transportation problem costs 640 by the north-west corner rule, 590 by Vogel's method and 585 at the optimum; a 4 × 4 assignment costs 32; the LP relaxation of a two-variable integer program gives 41.25 while the integer optimum is 40; and an M/M/1 queue at λ = 8, μ = 10 holds 4 customers on average.
Overview

Linear Programming: Simplex Pivots, Duality and Sensitivity

2 min read · 1 part

A shop makes two products with profits ₹50 and ₹40. Machine time: 2x₁ + x₂ ≤ 100 h; labour: x₁ + 2x₂ ≤ 80 h; market: x₁ ≤ 45. Maximise Z = 50x₁ + 40x₂. Simplex starts at the origin (all slacks basic, Z = 0) and moves along edges. Pivot 1: the most positive coefficient 50 enters x₁; the minimum-ratio test min(100/2, 80/1, 45/1) = 45 picks the market row, giving (45, 0), Z = 2250. Pivot 2: x₂ enters; ratios 10 (machine) and 17.5 (labour): the machine row leaves, giving (45, 10), Z = 2650. Pivot 3: the market slack enters; the labour row leaves, giving (40, 20), Z = 2800, with all reduced costs non-negative, so it is optimal: the optimal basis is x₁, x₂ and the market slack s₃ = 5 (45 − 40). Duality: the dual minimises 100y₁ + 80y₂ subject to 2y₁ + y₂ ≥ 50, y₁ + 2y₂ ≥ 40 (and y₃ = 0 because the market constraint has slack): y₁ = 20, y₂ = 10, and the dual objective 100 × 20 + 80 × 10 = 2800 equals the primal value — strong duality. These shadow prices say one more machine hour is worth ₹20 and one labour hour ₹10; by complementary slackness a constraint with slack has a zero price.

Sensitivity analysis asks how far the data can move before the answer changes. The shadow price of machine time (₹20/h) holds while the machine right-hand side stays between 40 and 107.5 h (the basis stays feasible), and the labour price (₹10/h) holds between 65 and 200 h; beyond these the optimal basis changes and the prices jump. The range of optimality of a cost coefficient is where the current vertex stays optimal: with the labour and machine constraints binding, c₁/c₂ may vary between 1/2 and 2 (50/40 = 1.25 lies inside), so ₹50 may move to anywhere from 20 to 80 with c₂ = 40 fixed without moving the optimum. A new product is worth making only if its profit exceeds the shadow cost of the resources it uses (its reduced cost is negative otherwise). The graphical method works for two variables: the optimum is at a corner of the feasible polygon, and a degenerate corner (more constraints binding than needed) can make simplex cycle in theory. Unbounded and infeasible problems are recognised by no leaving row and by an artificial variable stuck in the basis at a positive value respectively.

PivotEntering → vertexZ (₹)
0Origin0
1x₁ → (45, 0)2 250
2x₂ → (45, 10)2 650
3s₃ → (40, 20)2 800

A shop makes two products with profits ₹50 and ₹40. Machine time: 2x₁ + x₂ ≤ 100 h; labour: x₁ + 2x₂ ≤ 80 h; market: x₁ ≤ 45. Maximise Z = 50x₁ + 40x₂. Simplex starts at the origin (all…

Transportation and Assignment

1 min read

Three sources supply 20, 30 and 25 units and four destinations need 10, 25, 15 and 25 (balanced, 75 each). Unit costs are 8, 6, 10, 9 / 9, 12, 13, 7 / 14, 9, 16, 5. The north-west corner rule ignores cost and fills from the top-left: cost 640. Vogel's approximation (VAM) takes the row or column with the largest penalty (gap between the two smallest costs) and ships as much as possible at its cheapest cell: cost 590, usually within a unit or two of the optimum. The optimum, confirmed by MODI (all cell evaluations u_i + v_j − c_ij ≤ 0 on empty cells) and an independent LP solve, is 585: S1→D2 20; S2→D1 10, D3 15, D4 5; S3→D2 5, D4 20. A balanced m × n problem has m + n − 1 basic cells (here 6); fewer means degeneracy, repaired with a zero allocation; an unbalanced problem gets a dummy row or column of zero cost. Assignment is the transportation problem with every supply and demand equal to 1. The Hungarian method subtracts row minima, then column minima, and covers the zeros with the minimum number of lines; with the matrix 9, 11, 14, 11 / 6, 15, 13, 13 / 12, 13, 6, 8 / 11, 9, 10, 12 the optimum is job 1 → machine 4, 2 → 1, 3 → 3, 4 → 2 at cost 32, which agrees with checking all 24 permutations. A maximisation problem is converted by subtracting every entry from the largest.

MethodIdeaCost
North-west cornerIgnores costs640
Vogel (VAM)Largest penalty first590
MODI optimumAll cell evaluations ≤ 0585

Three sources supply 20, 30 and 25 units and four destinations need 10, 25, 15 and 25 (balanced, 75 each). Unit costs are 8, 6, 10, 9 / 9, 12, 13, 7 / 14, 9, 16, 5. The north-west corner…

Integer Programming and Branch and Bound

1 min read

Maximise Z = 8x₁ + 5x₂ subject to x₁ + x₂ ≤ 6 and 9x₁ + 5x₂ ≤ 45 with x₁, x₂ non-negative integers. The LP relaxation (drop integrality) gives x = (3.75, 2.25) and Z = 41.25, an upper bound for the integer problem. Branch and bound splits on a fractional variable: x₁ ≤ 3 gives (3, 3), Z = 39 (integer, so a feasible solution and a lower bound of 39); x₁ ≥ 4 gives the relaxation (4, 1.8), Z = 41; branch it on x₂: x₂ ≤ 1 gives (4.44, 1), Z = 40.56 and then x₁ ≤ 4 gives (4, 1) Z = 37, while x₁ ≥ 5 gives (5, 0), Z = 40, an integer, which beats 39; x₂ ≥ 2 is infeasible at x₁ ≥ 4. Every other branch has a bound below 40 and is fathomed. The integer optimum is x = (5, 0), Z = 40 — rounding the relaxation, (4, 2), is not even feasible (36 + 10 = 46 > 45) and (3, 2) is feasible but worth only 34. The relaxation's bound is never lower than the integer optimum for a maximisation, so Z_integer ≤ 41.25 and, because the objective has integer coefficients, ≤ 41. Gomory cuts shave off the fractional corner; 0–1 programs model yes/no choices (site selection, set cover); binary variables with big-M constraints linearise 'either-or' conditions.

CandidateFeasible?Z
LP relaxation (3.75, 2.25)Not integer41.25
Rounded (4, 2)No (46 > 45)—
(3, 3)Yes39
(5, 0)Yes — optimal40

Maximise Z = 8x₁ + 5x₂ subject to x₁ + x₂ ≤ 6 and 9x₁ + 5x₂ ≤ 45 with x₁, x₂ non-negative integers. The LP relaxation (drop integrality) gives x = (3.75, 2.25) and Z = 41.25, an upper bound…

Markovian Queues and Discrete-Event Simulation

2 min read · 1 part

In an M/M/1 queue (Poisson arrivals at λ, exponential service at μ, one server) the utilisation is ρ = λ/μ, and for λ = 8/h, μ = 10/h: ρ = 0.8; the average number in the system L = ρ/(1 − ρ) = 4.0, in the queue L_q = ρ²/(1 − ρ) = 3.2, the time in the system W = 1/(μ − λ) = 0.5 h (30 min) and in the queue W_q = ρW = 0.4 h (24 min); Little's law L = λW (8 × 0.5 = 4) ties them together, and P(n ≥ k) = ρᵏ, so P(5 or more) = 0.328. Stability needs ρ < 1: as ρ → 1 waiting explodes. An M/M/c queue with c = 2 servers each at μ = 5 and λ = 8 (a = λ/μ = 1.6, ρ = 0.8) has P₀ = 0.1111, L_q = P₀aᶜρ/(c!(1 − ρ)²) = 2.84, W_q = L_q/λ = 0.356 h (21.3 min) and L = L_q + a = 4.44; compared with one server of speed 10 (W_q = 0.4 h, W = 0.5 h) two slower servers shorten the queue wait but lengthen the time in the system to 0.556 h, because a lone customer cannot use both. Simulation replaces the formula by sampled events: a linear congruential generator x_(n+1) = (5x_n + 3) mod 16 with x₀ = 7 gives 6, 1, 8, 11, 10, 5, 12, 15, i.e. random numbers u = x/16 = 0.375, 0.062, 0.500, 0.688…; the inverse-transform method turns u into an exponential interarrival time −ln(1 − u)/λ, so u = 0.375 at λ = 8/h gives 3.5 min. The cycle length of a good generator must be long, and the stream is fully periodic — this one repeats after at most 16 draws. A discrete-event simulation advances a clock from event to event (arrival, start of service, departure) keeping an event list, which is why it handles non-Markovian systems the formulas cannot.

MeasureM/M/1 formulaλ = 8, μ = 10
Utilisationρ = λ/μ0.8
Lρ/(1 − ρ)4.0
W1/(μ − λ)0.5 h
W_qρ/(μ − λ)0.4 h
🎯 Transportation bookkeeping and MODI
A balanced transportation problem with m sources and n destinations has m + n − 1 basic cells in a non-degenerate solution: three sources and four destinations give 6. If total supply differs from total demand a dummy row or column of zero cost balances it. In the MODI test, set u₁ = 0 and solve uᵢ + vⱼ = cᵢⱼ over the basic cells, then the opportunity cost of an empty cell is cᵢⱼ − uᵢ − vⱼ; the solution is optimal when none is negative, and the most negative cell enters the basis.

In an M/M/1 queue (Poisson arrivals at λ, exponential service at μ, one server) the utilisation is ρ = λ/μ, and for λ = 8/h, μ = 10/h: ρ = 0.8; the average number in the system L = ρ/(1 −…

Key takeaways

  • Simplex pivots along edges using the entering coefficient and the minimum-ratio test; at the optimum the dual values are the shadow prices and the objectives are equal.
  • A shadow price holds only within its right-hand-side range; a constraint with slack has a zero price.
  • Transportation: NWC is crude, VAM is close, MODI proves optimality; basic cells = m + n − 1; assignment is the 1-to-1 case.
  • Integer optimum ≤ LP relaxation optimum for maximisation; rounding may be infeasible or suboptimal, so use branch and bound.
  • M/M/1: L = ρ/(1 − ρ), W = 1/(μ − λ), Little L = λW; simulation turns random numbers into events by inverse transform.

Practice questions (24)

Attempt each one before opening the answer. Every explanation names the tempting wrong option as well as the right one, because that is where marks are lost.

  1. Maximise Z = 50x₁ + 40x₂ subject to 2x₁ + x₂ ≤ 100, x₁ + 2x₂ ≤ 80 and x₁ ≤ 45. The optimal Z is:

    Numerical answer — type the value.

    Show answer

    Answer: 2800

    The binding constraints are the machine and labour rows: 2x₁ + x₂ = 100 and x₁ + 2x₂ = 80 give (40, 20), Z = 2000 + 800 = 2800. The vertex (45, 10) is feasible but worth only 2650.
  2. In the same problem the shadow price of one extra machine hour (₹) is:

    Numerical answer — type the value.

    Show answer

    Answer: 20

    The dual solves 2y₁ + y₂ = 50 and y₁ + 2y₂ = 40: y₁ = 20, y₂ = 10. Check: Z rises from 2800 to 2820 if the machine limit becomes 101 h.
  3. At the optimum of a linear programme, a constraint that has slack has a shadow price that is:

    1. Equal to the objective coefficient
    2. Negative
    3. Zero, by complementary slackness
    4. Undefined
    Show answer

    Answer: C — Zero, by complementary slackness

    An unused resource has no marginal value: adding more of it cannot improve the objective. That is complementary slackness — slack and price are never both positive.
Show the other 21 questions
  1. A balanced transportation problem with 3 sources and 4 destinations has how many basic cells in a non-degenerate solution?

    1. 6, which is m + n − 1
    2. 12
    3. 4
    4. 7
    Show answer

    Answer: A — 6, which is m + n − 1

    One of the m + n supply/demand equations is redundant because total supply equals total demand, so the rank is m + n − 1 = 6. Fewer allocated cells means degeneracy.
  2. The optimal cost of the 4 × 4 assignment with rows 9 11 14 11 / 6 15 13 13 / 12 13 6 8 / 11 9 10 12 is:

    Numerical answer — type the value.

    Show answer

    Answer: 32

    The optimal assignment is 1→4 (11), 2→1 (6), 3→3 (6), 4→2 (9): total 32, verified over all 24 permutations. Picking each row minimum greedily (9, 6, 6, 9, total 30) is not an assignment: rows 1 and 2 both choose column 1.
  3. In the integer programme max 8x₁ + 5x₂ with x₁ + x₂ ≤ 6 and 9x₁ + 5x₂ ≤ 45, the LP relaxation value is 41.25. The integer optimum is:

    1. 39 at (3, 3)
    2. 40 at (5, 0)
    3. 41 at (4, 2)
    4. 41.25
    Show answer

    Answer: B — 40 at (5, 0)

    (4, 2) violates 9x₁ + 5x₂ ≤ 45 (46). Among feasible integer points (5, 0) gives 40 and (3, 3) gives 39; rounding the relaxation gives an infeasible or inferior point.
  4. For an M/M/1 queue with arrival rate 8 per hour and service rate 10 per hour, the average time a customer spends in the system, in minutes, is:

    Numerical answer — type the value.

    Show answer

    Answer: 30

    W = 1/(μ − λ) = 1/2 h = 30 min. The waiting time in the queue alone is ρW = 24 min; 6 min is the service time 1/μ.
  5. An M/M/1 queue has λ = 8/h and μ = 10/h. The probability that five or more customers are in the system (three decimals) is:

    Numerical answer — type the value.

    Show answer

    Answer: 0.328

    P(n ≥ 5) = ρ⁵ = 0.8⁵ = 0.328. The probability of exactly 5 would be (1 − ρ)ρ⁵ = 0.066.
  6. Which statements are correct?

    1. The LP relaxation of a maximisation integer programme gives an upper bound
    2. Discrete-event simulation advances the clock from event to event
    3. Vogel's method always gives the optimal transportation solution
    4. Little's law L = λW holds for a stable queue in steady state
    Show answer

    Answer: A — The LP relaxation of a maximisation integer programme gives an upper bound; B — Discrete-event simulation advances the clock from event to event; D — Little's law L = λW holds for a stable queue in steady state

    VAM is a good starting solution, here 590 against the optimum 585, but optimality needs the MODI test. The other three statements are standard.
  7. A slack variable is added to a "less-than-or-equal-to" constraint in linear programming to

    1. make the objective nonlinear
    2. remove a variable
    3. add a cost
    4. convert the inequality into an equality
    Show answer

    Answer: D — convert the inequality into an equality

    A non-negative slack takes up the unused capacity so ≤ becomes =. It does not change the objective or remove variables, the tempting distractors.
  8. A transportation problem has a feasible solution only if

    1. total supply equals total demand (balanced), else a dummy is added
    2. supply exceeds demand always
    3. costs are equal
    4. there is only one source
    Show answer

    Answer: A — total supply equals total demand (balanced), else a dummy is added

    A balanced problem (Σsupply = Σdemand) is required; an imbalance is handled by a dummy row or column. Equal costs or a single source are not conditions for feasibility, the tempting errors.
  9. A transportation problem with 3 sources and 4 destinations has, for a non-degenerate basic feasible solution, how many occupied (basic) cells? ____

    Numerical answer — type the value.

    Show answer

    Answer: 6

    Basic cells = m + n − 1 = 3 + 4 − 1 = 6. Using m × n = 12 counts all cells, not just the basic ones. Substituting the answer back into the relation confirms it.
  10. Integer programming differs from linear programming in that integer programming

    1. requires some or all variables to take integer values
    2. has a nonlinear objective
    3. has no constraints
    4. is always easier to solve
    Show answer

    Answer: A — requires some or all variables to take integer values

    IP adds integrality restrictions to an otherwise linear model, and is generally harder (NP-hard), not easier. The objective stays linear, so "nonlinear" is the tempting confusion.
  11. In an M/M/1 queue the arrival rate is 6 per hour and the service rate 10 per hour. The utilisation ρ is ____.

    Numerical answer — type the value.

    Show answer

    Answer: 0.6

    ρ = λ/μ = 6/10 = 0.6. Inverting (10/6 = 1.67) exceeds 1 and would wrongly imply an unstable queue. Substituting the answer back into the relation confirms it.
  12. For the M/M/1 queue above (ρ = 0.6), the mean number waiting in the queue L_q = ρ²/(1 − ρ) is ____.

    Numerical answer — type the value.

    Show answer

    Answer: 0.9

    L_q = 0.36/0.4 = 0.9. Using ρ/(1 − ρ) = 1.5 gives L (number in the system), not L_q, the common mix-up. Substituting the answer back into the relation confirms it.
  13. For an M/M/1 queue with λ = 6/h and μ = 10/h, the mean time a customer spends in the system W = 1/(μ − λ), in hours, is ____.

    Numerical answer — type the value.

    Show answer

    Answer: 0.25

    W = 1/(μ − λ) = 1/4 = 0.25 h (15 min). Using 1/μ = 0.1 gives only the service time, omitting the waiting. Substituting the answer back into the relation confirms it.
  14. Which statements about a linear programming problem are correct?

    1. The feasible region is a convex set
    2. There is always a unique optimum
    3. The objective and constraints are linear
    4. An optimum, if finite, lies at a vertex
    Show answer

    Answer: A — The feasible region is a convex set; C — The objective and constraints are linear; D — An optimum, if finite, lies at a vertex

    The feasible region is convex, a finite optimum sits at a vertex, and all functions are linear. The optimum need not be unique (it can be an edge of alternative optima), so the last statement is the trap.
  15. The Vogel’s approximation method (VAM) for a transportation problem generally gives

    1. an infeasible solution
    2. the dual solution
    3. a good initial basic feasible solution, often near optimal
    4. the guaranteed optimal solution directly
    Show answer

    Answer: C — a good initial basic feasible solution, often near optimal

    VAM uses opportunity-cost penalties to build a strong starting solution, which is then improved (e.g. by MODI). It does not by itself guarantee optimality, the tempting overstatement.
  16. In a transportation plan, 10 units move on a route costing ₹2/unit and 5 units on a route costing ₹3/unit. The total cost of these moves, in ₹, is ____.

    Numerical answer — type the value.

    Show answer

    Answer: 35

    Cost = 10 × 2 + 5 × 3 = 20 + 15 = 35. Adding the unit costs (2 + 3 = 5) ignores the quantities shipped. Substituting the answer back into the relation confirms it.
  17. For the M/M/1 queue (λ = 6/h, L_q = 0.9), the mean waiting time in the queue W_q = L_q/λ, in hours (two decimals), is ____.

    Numerical answer — type the value.

    Show answer

    Answer: 0.15

    By Little’s law W_q = L_q/λ = 0.9/6 = 0.15 h (9 min). Dividing by μ instead of λ misapplies Little’s law. Substituting the answer back into the relation confirms it.
  18. A 0–1 (binary) integer variable is most naturally used to model

    1. a fractional production level
    2. a yes/no decision such as whether to open a facility
    3. an average cost
    4. a continuous flow rate
    Show answer

    Answer: B — a yes/no decision such as whether to open a facility

    A binary variable captures an all-or-nothing (open/close, select/not) choice. Continuous flows and fractional levels need continuous variables, the tempting mismatches.
  19. In the simplex method, the entering variable (for a maximisation problem) is chosen as the one with

    1. the most positive coefficient in the objective (Z) row (most negative reduced cost)
    2. the smallest right-hand side
    3. a zero coefficient
    4. the largest right-hand side
    Show answer

    Answer: A — the most positive coefficient in the objective (Z) row (most negative reduced cost)

    The entering variable is the non-basic one that improves Z fastest (most positive c_j − z_j in a max problem). The leaving variable, not the entering one, is found from the minimum ratio of RHS, the tempting confusion.
  20. For an M/M/1 queue with ρ = 0.6, the probability of exactly 2 customers in the system, P₂ = (1 − ρ)ρ², is ____ (three decimals).

    Numerical answer — type the value.

    Show answer

    Answer: 0.144

    P₂ = (1 − 0.6)(0.6²) = 0.4 × 0.36 = 0.144. Omitting the (1 − ρ) factor (using 0.36) ignores the geometric normalisation.
  21. The branch-and-bound method for integer programming works by

    1. solving LP relaxations and branching on fractional variables, pruning by bounds
    2. ignoring the constraints
    3. enumerating every integer point always
    4. rounding the LP solution once
    Show answer

    Answer: A — solving LP relaxations and branching on fractional variables, pruning by bounds

    Branch-and-bound solves the LP relaxation, branches on a fractional variable into subproblems, and prunes those that cannot beat the incumbent bound. Simply rounding the LP solution can give infeasible or suboptimal answers, the tempting shortcut.