CalcTypes
Guide / Article

Assignment vs Transportation Problem: Differences + Solved Example

Last updated: β€’ Sources β€’ Methodology

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.

This β€œoptimality check” is a lecture-friendly reason transportation is not solved by Hungarian: the structure uses flow/potentials logic, not one-to-one matching zeros.

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.

Sources
  1. Munkres (1957) β€” Algorithms for the Assignment and Transportation Problems (SIAM)
  2. Kuhn (1955) β€” The Hungarian method for the assignment problem
  3. Google OR-Tools β€” Optimization documentation (assignment/flow context)
  4. Wikipedia β€” Transportation problem (overview)

Methodology: How This Guide Works

This guide explains the difference between the assignment and transportation problems using the standard textbook treatment found in operations-research courses (for example Hillier & Lieberman, Introduction to Operations Research, and Taha, Operations Research: An Introduction). Each step is written so you can repeat it by hand, and the worked examples use the same steps as the CalcTypes assignment and transportation solvers, so you can reproduce them there.

Assumptions and Limitations

Assumptions

  • Assignment problems are one-to-one with supply and demand of 1 at every node.
  • Transportation problems allow any supply and demand quantities.
  • Costs are linear and known.

Limitations

  • Real logistics often needs capacities, time windows or multiple products that neither basic model covers.
  • Examples are small teaching problems; real problems usually need more constraints and data checks.
  • Terminology differs slightly between textbooks.