Dr. Ron Lembke
Linear programming is good at solving
problems with zillions of options, and
finding the optimal solution.
Could it work for transportation problems?
Costs are linear, and shipment quantities
are linear, so maybe so.
Define cij as the cost to ship one unit from
i to j.
Demand at location j is dj.
Supply at DC i is Si
Xij is the quantity shipped from DC i to
Min c ij xij
i 1 j 1
ij Si f or i 1, , M
ij d j f or j 1, , N
xij 0 f or all i, j
You have 3 DCs, and need to deliver
product to 4 customers. D2
Find cheapest way to satisfy all demand
Solving Transportation Problems
Trial and Error D E F G
– ooh, what’s that?! A 10 9 8 7
Tell me more!
B 10 11 4 5
C 8 7 4 8
Setting up LP
Create a matrix of shipment costs (in grey in
Create a matrix to hold the decision variables,
shipment quantities (in yellow).
Sum amount sent to each destination.
Sum amount sent from each DC.
Enter demands and supplies at each location.
Compute total cost of shipments (in blue).
If you don’t check “assume non-negative” we get
the following results:
Solver doesn’t converge to an optimal solution.
Use <= for shipments from DCs.
Use >= for shipments to customers.
Do we really need to?
What do we do if supply is greater than
If total demand is greater than total supply,
If demand in G is 15, we get this:
If demand at G is 15, there are no feasible
solutions, much less a best one.
We need to add a phantom source, Z, with
huge capacity. Think of it as a supplier
that ships empty boxes.
Now supply can satisfy total demand.
What cost should we use for supplier Z?
It should be the last resort, so it should be higher
than any real costs.
The cost of a shipment from Z is really the cost
of shorting the customer.
If all customers are created equal, give them all
the same shortage cost.
If some are more important, give them higher
shortage costs, and we’ll only short them as a
Shortage is dealt with by shorting
customer A, and B.
Demand exceeds supply by 3 units. Our
first choice is to short A, because they are
the cheapest. We can only short them by
2, their total demand.
Next, short B by 1 unit.