Assignment vs Transportation Problem
Assignment is a one-to-one matching model (each row/column used exactly once). Transportation ships quantities from sources to destinations to satisfy supply and demand (many-to-many). Assignment is a special case of transportation (supplies/demands all equal 1), but it is typically solved with the Hungarian algorithm.
For solved assignment practice, see assignment examples.
On this page
Quick takeaway: Use assignment for one-to-one pairings. Use transportation for quantity shipping with general supplies/demands. Assignment can be written as transportation by setting all supplies/demands to 1, but transportation cannot generally be reduced to assignment without losing meaning.
Models side-by-side
Assignment (balanced nΓn)
minimize Ξ£_i Ξ£_j c(i,j) x(i,j)
subject to Ξ£_j x(i,j) = 1
Ξ£_i x(i,j) = 1
x(i,j) β {0,1}
Transportation
minimize Ξ£_i Ξ£_j c(i,j) x(i,j)
subject to Ξ£_j x(i,j) = supply(i)
Ξ£_i x(i,j) = demand(j)
x(i,j) β₯ 0
If an assignment matrix is rectangular, use dummy rows/columns: unbalanced assignment.
When to use which
Use assignment when
- each worker must get exactly one job and each job must be filled once,
- the decision is a pairing (binary), not a shipped quantity,
- cost depends only on the pair (i,j).
Use transportation when
- you ship divisible quantities,
- supplies/demands are general numbers,
- a source can serve multiple destinations and vice versa.
Worked examples (solved)
Worked example
Example 1: Assignment as transportation (supplies/demands = 1)
Assignment costs:
J1 J2 J3 W1 4 1 3 W2 2 0 5 W3 3 2 2
Transportation conversion
Set supplies and demands to 1:
- Supply(W1)=Supply(W2)=Supply(W3)=1
- Demand(J1)=Demand(J2)=Demand(J3)=1
Solved assignment
One optimal assignment is W1βJ2 (1), W2βJ1 (2), W3βJ3 (2), total 5. (Manual steps: assignment examples.)
Worked example
Example 2: Transportation problem solved + optimality check (MODI)
Two sources ship to three destinations. Total supply = total demand = 50.
Costs per unit:
D1 D2 D3 Supply
S1 2 4 5 20
S2 3 1 7 30
Demand 10 25 15
Step 1 β Start with a feasible plan (least-cost style)
A good feasible shipment plan is:
- x(S2,D2)=25 (use the cheapest lane cost=1)
- x(S1,D1)=5 and x(S2,D1)=5 (to meet D1=10 while respecting supplies)
- x(S1,D3)=15 (use remaining S1 supply to meet D3)
Shipment table (nonlisted cells are 0):
D1 D2 D3 Supply S1 5 0 15 20 S2 5 25 0 30 Demand 10 25 15
Total cost
- S1βD1: 5Γ2 = 10
- S1βD3: 15Γ5 = 75
- S2βD1: 5Γ3 = 15
- S2βD2: 25Γ1 = 25
Total = 10 + 75 + 15 + 25 = 125.
Step 2 β MODI optimality check (uβv potentials)
For a basic feasible solution, compute potentials u_i (rows) and v_j (columns) so that for each basic cell:
u_i + v_j = c(i,j).
We have basic cells: (S1,D1), (S1,D3), (S2,D1), (S2,D2).
Set u(S1)=0. Then:
- From (S1,D1): v(D1)=2
- From (S1,D3): v(D3)=5
- From (S2,D1): u(S2)+2=3 β u(S2)=1
- From (S2,D2): 1+v(D2)=1 β v(D2)=0
Now compute reduced costs for nonbasic cells:
Ξ(i,j) = c(i,j) - (u_i + v_j).
If all Ξ β₯ 0, the solution is optimal (for minimization).
- Nonbasic (S1,D2): Ξ = 4 – (0+0) = 4 β₯ 0
- Nonbasic (S2,D3): Ξ = 7 – (1+5) = 1 β₯ 0
All reduced costs are nonnegative β the solution is optimal.
Questions people ask
Questions people ask
Is assignment always a special case of transportation?
Yes, mathematically: if you set every supply and every demand equal to 1 and restrict flows to 0/1, the transportation constraints force exactly one unit shipped from each row and into each columnβmatching the assignment structure.
Assignment is still treated separately because (1) it has a strong matching structure, and (2) Hungarian/KuhnβMunkres exploits that structure efficiently.
Questions people ask
Why doesnβt Hungarian solve transportation problems?
Transportation decisions are quantities, not one-to-one pairings. A single source can ship to multiple destinations. The constraint geometry and the algorithmic structure are different: transportation is typically solved by transportation simplex / min-cost flow methods, with optimality checks based on potentials and reduced costs (like the MODI method).
Hungarian is a matching algorithm built around creating/selecting independent zeros (tight reduced costs) in a square matrix. That is not the natural structure of quantity-shipping flow problems.
Questions people ask
What if my assignment is not square?
Thatβs the unbalanced assignment case. Add dummy rows/columns and interpret dummies as βidleβ or βunfilled.β See unbalanced assignment.
Disclaimer
Educational content only. Real logistics and staffing problems often include constraints not captured by basic assignment or transportation models (time windows, multi-period planning, capacity rules, fairness, routing). Validate assumptions and solution meaning before operational use. Read the full disclaimer.