UPI Study › Courses › Quantitative Analysis › Free lessons › Lesson 12.1 Free with a free account
Getting Goods Where They Need to Go
Quantitative Analysis · Chapter 12: Transportation ModelsSection 12.1 · lesson 51 of 5511 min · free with a free account
Free preview
Create a free account to keep watching
It takes a minute and costs nothing. Your free account unlocks all of Chapter 1 and 3 more lessons of Quantitative Analysis.
Lesson complete
Earn the 3 college credits for Quantitative Analysis
Enrolling adds a quiz after each lesson, the graded work and the official transcript. Recommended for credit by NCCRS.
Next lesson: Edge Cases and Exceptions →← Balancing Risk and ReturnNext lesson: Edge Cases and Exceptions →
In this lesson
A special-structure linear program for moving goods from many sources to many destinations at minimum total cost.
- Identify the supply, demand and cost data of a transportation problem
- Formulate the full LP: variables, objective, constraints
- Tell balanced from unbalanced, and restore balance with a dummy
- Recognise the maximisation, assignment and transhipment variants
Transcript
Everything said in the video, section by section (1,592 words). Read along, or search it.
Transportation Problems · Chapter 12.1
Getting Goods Where They Need to Go
Every distributor faces the same puzzle every week. Goods sit in several warehouses, and customers are waiting in several places. Shipping between any given pair costs a different amount per unit. So how much should travel along each route? This section builds the model that answers that question. It is called the transportation problem, and it is a linear program with a very particular shape. You will learn to spot its supply, demand, and cost data inside a word problem. Then write the objective, the constraints, and the non-negativity restrictions. You will also meet its three variants, and formulate a full warehouse-to-store example.
The Core Question
From Many Sources to Many Destinations
Start with the situation rather than the algebra. A business has multiple sources of supply: factories, warehouses, distribution centres. It also has multiple points of demand: stores, customers, project sites. The unit cost of moving goods varies by route, and that is what makes the problem interesting. The question is how much to ship from each source to each destination. Total shipping cost should be as low as possible. Every demand must be satisfied, and no source may ship more than it actually has. That is the classical transportation problem, and it is a linear program in disguise. But its structure is so regular that specialised methods beat the ordinary simplex method. The stepping-stone method, MODI, and the network simplex all exploit that structure. In practice the software hides them, whether that is Excel Solver, Python PuLP, CPLEX, or Gurobi.
Given Data
Five Ingredients, and the Formulation Writes Itself
A transportation problem has five clearly-defined ingredients. Once you can name each one in a word problem, the formulation writes itself. First, m supply origins, each with a capacity written s i. Warehouses, factories, plants: anywhere goods start their journey. Second, n demand destinations, each requiring at least d j units. Stores, customers, project sites: anywhere goods are needed. Third, a unit shipping cost c i j for every origin and destination pair. Watch the subscripts, because the order carries meaning. The first is always the origin, the second always the destination. Fourth, the decision variable x i j, the units actually shipped on that route. With m origins and n destinations there are m times n routes, and one variable for each. The objective function and the constraints complete the structure, and we build both next.
Objective Function
Minimise the Cost of Every Route at Once
The objective is the easy part, once the variables are defined. Take one route, and multiply its units by its unit cost. Now do that for every route in the network, and add the results. Minimise Z equals the double sum, over i and j, of c i j times x i j. The double sum simply means loop over origins, loop over destinations, and miss nothing. Look closely at the shape of each individual term. A constant cost, multiplied by a variable quantity. That is exactly what makes the objective linear. The model assumes the cost per unit on a route is fixed. It does not fall when you ship more, and it does not rise. If your real freight rates had volume discounts, the cost curve would bend, and this model would not fit.
The Constraints
Supply, Demand, and Non-negativity
There are three families of constraints, and their directions are not the same. Supply constraints look across a row of the cost matrix. The sum over j of x i j is at most s i. In plain words, origin i cannot ship more than its capacity. Demand constraints look down a column instead. The sum over i of x i j is at least d j. Then non-negativity: every x i j is greater than or equal to zero. You cannot ship a negative number of units. That sounds obvious, but leave it out and a solver will happily invent negative flows. The classic slip is writing both inequalities the same way round. Rows are capped from above, and columns are floored from below.
Balanced Problems
When Supply Exactly Equals Demand
Now a distinction that changes how the problem gets solved. A problem is balanced when total supply exactly equals total demand. Add up every s i, add up every d j, and compare the two totals. If they match, something useful follows immediately. Every unit produced will be shipped, and every unit demanded will be received. So no supply can be left over, and no demand can be overshot. Each at-most constraint and each at-least constraint collapses into a plain equality. Equalities give the specialised algorithms a known feasible structure to work from. That is why balanced problems are the easier case. And it is why the very first thing you do is compare the totals.
Restoring Balance
Unbalanced? Add a Dummy Row or Column
Real data is rarely balanced, and that is not a problem. The fix is a fictitious row or column carrying zero shipping cost. Suppose supply exceeds demand. Add a dummy destination whose demand equals the surplus. Goods shipped there are never actually moved; they represent unsold inventory. Now suppose demand exceeds supply instead. Add a dummy origin whose supply equals the shortfall. Units shipped from it represent demand you simply cannot meet. Try one. Total supply five hundred units, total demand four hundred and twenty. Not balanced. The surplus is eighty units. So add a dummy destination with a demand of eighty, at zero unit cost. The zero cost matters, because a fictitious route must not distort the objective.
Two Variants
Maximisation and Assignment
Three variants keep the network structure but change the objective or the topology. The first is the maximisation transportation problem. Sometimes the coefficients represent profit or revenue per unit shipped, not cost. Then you want the largest total, not the smallest. To reuse the minimisation-based algorithms, convert the matrix first. Replace every coefficient with c max minus c i j. Here c max is the largest profit value anywhere in the matrix. Solving that modified minimisation gives the same optimal shipment plan as the original. The second variant is the assignment problem. It appears when m equals n, and every supply and every demand equals one. Each origin is matched to exactly one destination, and each destination to one origin. Think workers to tasks, machines to jobs, or salespeople to territories. The Hungarian algorithm solves it in polynomial time, and Chapter thirteen covers it fully.
Transhipment
Goods That Pass Through Intermediate Nodes
The third variant is transhipment, and it is the most realistic of the three. Goods rarely travel straight from factory to store. They pass through one or more intermediate nodes on the way. Regional distribution centres, ports, or cross-docks. Each of those nodes gets a constraint of its own, called flow conservation. Total units flowing into the node must equal total units flowing out. A hub stores nothing and creates nothing; it only redirects. Decision variables are now defined on every arc of the network. That includes the arcs entering the hubs and the arcs leaving them. The network grows, but the objective is unchanged. You are still minimising total shipping cost.
Worked Example
Three Warehouses, Four Stores
Time to turn a word problem into a formulation. A regional distributor runs three warehouses, W one, W two, and W three. Weekly supply capacities are one hundred and twenty, eighty, and one hundred units. Four retail stores, S one to S four, need seventy, ninety, eighty, and sixty units a week. The cost matrix gives a unit shipping cost for every one of the twelve routes. From warehouse one it is eight, six, ten, and nine dollars a unit. From warehouse two, nine, twelve, thirteen, and seven dollars. From warehouse three, fourteen, nine, sixteen, and five dollars. Step one is always the balance check, and it comes before anything else. Total supply is one hundred and twenty plus eighty plus one hundred, which is three hundred. Total demand is seventy plus ninety plus eighty plus sixty, also three hundred. The problem is balanced, so every supply and demand constraint becomes an equality.
Variables And Objective
Steps 2 and 3 - Twelve Variables, One Objective
Step two, define the decision variables precisely. Let x i j be the units shipped from warehouse i to store j. Here i runs from one to three, and j runs from one to four. Three times four is twelve, so the model has twelve decision variables. One per route, no more and no fewer. Step three, write the objective function out in full. Minimise Z equals eight x one one, plus six x one two, plus ten x one three, plus nine x one four. Then nine x two one, twelve x two two, thirteen x two three, and seven x two four. And finally fourteen x three one, nine x three two, sixteen x three three, and five x three four. Every coefficient comes straight from the cost matrix, read row by row. There is no arithmetic here yet. Formulation is bookkeeping, and it must be exact.
Constraints And Count
Step 4 - Constraints, and What the Count Tells You
Step four is the constraints, and here the balance check pays off. Each warehouse row sums to its capacity, as an equality. The four variables leaving warehouse one add up to one hundred and twenty. Warehouse two's four sum to eighty, and warehouse three's sum to one hundred. Each store column sums to its demand, again as an equality. The three shipments arriving at store one add up to seventy. Store two receives ninety, store three eighty, and store four sixty. Add non-negativity for all twelve variables, and the model is complete. Now count what you have built. Twelve decision variables, three supply equalities, and four demand equalities. But those seven equalities are not independent of one another. Because the totals already match, one of them follows from the other six. That leaves six independent constraints, which is m plus n minus one. And that number tells you how many basic variables an optimal transportation tableau holds.
About Quantitative Analysis at UPI Study
Quantitative Analysis (Math 250) is a self-paced online course of 55 video lessons in 13 chapters, from decision analysis and simulation to inventory and queuing models, project scheduling, linear programming and transportation models. It carries a NCCRS credit recommendation for 3 semester credits.
Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Enroll now → Course details Download the syllabus All Math courses Every course with PRO →
Compare: Statistics vs Quantitative Analysis
Why take it here
Why students take Quantitative Analysis with UPI Study
Where the credit goes
Universities that work with NCCRS
Quantitative Analysis carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Thomas Edison State UniversitySigned partner
University of the PeopleSigned partner
Charter Oak State CollegeSigned partner
Strayer UniversitySigned partner
Columbia Southern UniversitySigned partner
Indiana TechSigned partner
Penn StateWorks with NCCRS
Southern New Hampshire UniversityWorks with NCCRS
SUNYWorks with NCCRS
+many more cooperating universitiesFind my college →Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.
FAQ
Questions students ask us
About Getting Goods Where They Need to Go
What is the transportation problem in linear programming?
How do you write the objective and constraints of a transportation problem?
How do you balance an unbalanced transportation problem?
What is a transshipment problem?
About the Quantitative Analysis course
How many college credits is Quantitative Analysis?
How much does Quantitative Analysis cost and what is included?
Which universities accept UPI Study credits?
How long does Quantitative Analysis take?
How are the exams done?
How do my credits reach my college?
Ready for the full course? Earn 3 credits in Quantitative Analysis.
55 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.
3 credits · NCCRSEnroll →