Module 16 · 10 min read · Free chapter
Operations research: linear programming, transportation, assignment and queuing
Linear programming finds the best value of a linear objective under linear limits, and the answer always sits at a corner of the feasible region. Transportation problems need m plus n minus 1 occupied cells and are checked by the MODI method, while assignment uses the Hungarian method. In an M/M/1 queue, time in system is one over service rate minus arrival rate.
Start from zero: making the best decision with numbers
A furniture unit makes tables and chairs. Each needs carpentry hours and polishing hours, and each earns a different profit. How many of each should it make this week?
A cement company must ship from three plants to four sites at least cost. A workshop must give four jobs to four machinists so the total time is least. A tool crib sees mechanics queueing for tools; is one attendant enough?
These are all operations research problems: choosing the best decision under limits. The tools here are linear programming, the transportation and assignment models, queuing theory and sequencing. Project scheduling with PERT and CPM is covered in Engineering economics and project management: PERT and CPM, and inventory models in Inventory control: EOQ, reorder point, safety stock and ABC analysis.
This chapter covers linear programming by graph and simplex with duality, the transportation and assignment problems, queuing models, and sequencing with a word on replacement and games.
Why it matters. GATE asks LP corner points, transportation degeneracy, the Hungarian method and M/M/1 numericals. ESE and BPSC AE add simplex, duality and Johnson's rule.
Linear programming: graphical, simplex and duality
Formulation. Choose decision variables, write a linear objective, and list linear constraints with non-negativity. For the furniture unit, with x tables and y chairs:
- Maximise .
- Carpentry: hours; polishing: hours; .
Graphical method (two variables). Plot each constraint, shade the feasible region, and evaluate Z at each corner point; the optimum lies at a corner.
Here the corners are (0, 0), (30, 0), (0, 30) and the intersection of the two lines. Solving and gives x = 22.5 and y = 15. Then Z = 1350 + 600 = 1950, which beats Z = 1800 at (30, 0) and 1200 at (0, 30). So the best plan is 22.5 tables and 15 chairs a week, for a profit of ₹1950.
Special cases. An unbounded solution when the region opens in the improving direction; infeasible when no point meets all constraints; multiple optima when the objective line is parallel to a binding constraint; and a redundant constraint that does not touch the region.
Simplex method. Convert inequalities to equations:
- constraints get a slack variable.
- constraints get a surplus variable minus, plus an artificial variable, handled by the Big M or two-phase method.
- Start at a basic feasible solution. The entering variable has the most negative entry in the Z row (for maximisation). The leaving variable has the smallest positive ratio of right-hand side to the pivot column (minimum ratio test). Pivot and repeat until no negative entry remains.
Duality. Every primal LP has a dual: a maximisation with m constraints and n variables becomes a minimisation with n constraints and m variables. The objective coefficients and right-hand sides swap, and the constraint matrix is transposed. At optimum the two objective values are equal. The dual variables are shadow prices, the gain in Z per extra unit of each resource.
Transportation and assignment problems
The transportation problem. Ship goods from m sources with supplies to n destinations with demands at unit costs , minimising total cost. It is balanced when total supply equals total demand; otherwise add a dummy row or column with zero cost.
Initial basic feasible solution.
- North-west corner rule: start at the top-left cell and allocate as much as possible, moving right or down. Quick but ignores cost.
- Least cost method: allocate first to the cheapest cell.
- Vogel's approximation method (VAM): for each row and column find the penalty, the difference between the two lowest costs, and allocate to the cheapest cell in the line with the highest penalty. It usually gives a solution close to optimal.
Degeneracy. A basic solution must have exactly m + n - 1 occupied cells. If fewer, the solution is degenerate; place a tiny quantity in an independent empty cell to proceed.
Optimality test: MODI (u-v) method.
- For each occupied cell, set , starting with one u equal to zero.
- For each empty cell, compute the opportunity cost .
- If all , the solution is optimal. Otherwise bring in the cell with the most negative , using a closed loop of plus and minus shifts.
The assignment problem. Assign n jobs to n workers, one each, to minimise total cost or time. It is a special transportation problem with all supplies and demands equal to 1. The Hungarian method solves it:
- Subtract each row's minimum from that row, then each column's minimum from that column.
- Cover all zeros with the fewest straight lines.
- If the number of lines equals n, make assignments on zeros, one per row and column.
- Otherwise subtract the smallest uncovered number from all uncovered cells, add it at intersections of lines, and repeat.
For maximisation, subtract every entry from the largest first. An unbalanced problem gets a dummy row or column of zeros. A forbidden assignment gets a very large cost M.
Queuing theory
Elements of a queue. Arrivals (often Poisson with mean rate ), service times (often exponential with mean rate ), the number of servers, queue discipline (first come first served, priority), and the calling population. Kendall's notation A/B/c writes arrival distribution, service distribution and number of servers; M stands for Markovian (Poisson arrivals or exponential service).
The M/M/1 model. One server, Poisson arrivals, exponential service, infinite queue, first come first served. It needs , or the queue grows without limit.
- Utilisation: ; probability the system is empty: ; probability of n in system: .
- Average number in system: .
- Average number in queue: .
- Average time in system: .
- Average waiting time in queue: .
- Little's law: and , true for very general queues.
A worked example. Mechanics arrive at a tool crib at 8 per hour and the attendant serves 10 per hour. Then , mechanics, , hour = 30 min, and hour = 24 min. If a mechanic's time costs much more than an attendant's, a second attendant may well pay for itself.
The lesson of utilisation. As approaches 1, L grows like : at 0.5 it is 1, at 0.9 it is 9, at 0.95 it is 19. Systems run close to full load always have long queues.
Multi-server queues (M/M/c) spread arrivals over c servers with utilisation ; formulas are more involved and tables are used.
Sequencing, replacement and games
Single-machine sequencing rules.
- Shortest processing time (SPT): minimises mean flow time and mean number of jobs waiting.
- Earliest due date (EDD): minimises maximum lateness.
- First come first served: fair but rarely optimal.
- Flow time of a job is its completion time measured from time zero; mean flow time is their average.
Johnson's rule: n jobs on two machines. All jobs go through machine 1, then machine 2, in the same order. To minimise total elapsed time (makespan):
- Find the smallest processing time among all jobs on both machines.
- If it is on machine 1, put that job as early as possible; if on machine 2, as late as possible.
- Remove the job and repeat until all are placed.
A worked example. Jobs A to D take (M1, M2) times of A (5, 2), B (1, 6), C (9, 7), D (3, 8). The smallest time is 1 on M1 for B, so B goes first. Next is 2 on M2 for A, so A goes last. Next is 3 on M1 for D, so D goes second, leaving C third.
The order is B, D, C, A. M1 finishes jobs at 1, 4, 13 and 18. M2 finishes them at 7, 15, 22 and 24, so the makespan is 24.
Replacement analysis. For items that wear out gradually, such as machines and vehicles, replace when the average annual cost (capital cost less resale plus cumulative running cost, divided by years) is at its minimum. For items that fail suddenly, like bulbs, compare group replacement of all items at intervals with individual replacement on failure.
Game theory basics. In a two-person zero-sum game, a saddle point exists when the maximin equals the minimax; the value of the game is that entry and both players use pure strategies. Without a saddle point, players mix strategies; for a 2 by 2 game the odds method or algebra gives the probabilities.
Descriptive lens: how this topic is asked in written papers
Written papers test this chapter in four ways:
- Formulate and solve: an LP by the graphical or simplex method, and write its dual.
- Solve: a transportation problem by VAM and MODI, or an assignment by the Hungarian method.
- Calculate: M/M/1 measures and decide on adding a server.
- Sequence: jobs by Johnson's rule and find the makespan.
Practice questions (our own, not previous-year questions).
- Solve graphically: maximise subject to , , , . (10 marks)
- Customers arrive at a single counter at 12 per hour and are served at 15 per hour. Find utilisation, average queue length and average waiting time in queue. (5 marks)
- Explain degeneracy in the transportation problem and how it is resolved. (5 marks)
Answer plan for question 1.
- Corners: (0, 0), (4, 0), (4, 3), (2, 6), (0, 6).
- Z values: 0, 12, 27, 36, 30.
- Optimum at (2, 6) with Z = 36.
Answer plan for question 2.
- ; ; hour, 16 min.
Quick revision
- LP optimum at a corner; slack for , surplus and artificial for ; minimum ratio test for leaving variable.
- Dual: swap objective and right-hand side, transpose matrix; equal optimum values; dual variables are shadow prices.
- Transportation: m + n - 1 occupied cells; NWC, least cost, VAM; MODI .
- Assignment: Hungarian method; lines equal n means optimal.
- M/M/1: , , , .
- SPT minimises mean flow time; Johnson's rule for two machines.
- PERT and CPM are in project management.