D2 1.3 - Transportation as a linear program

D2 1.3 - Transportation as a linear program

You will turn transportation tables into complete linear programs, define shipment variables with units, write source and destination constraints, and handle unused stock. You will also see why one balance equation is redundant in a balanced problem.

Give every route its own decision variable

Two depots supply three shops. There are two supply equations and three demand equations, yet one of those five equations is already forced by the other four. How can a condition be essential to describe the deliveries but add no new restriction?

We will answer that by turning a transportation table into a linear program. The table is a compact picture; the model spells out what each permitted plan must do.

You already know

From the north-west corner lesson, rows identify sources, columns identify destinations, and the margins give quantities. A linear program minimises or maximises a linear objective subject to linear constraints and specified variable domains. Define variables with units, state what is minimised, and translate each condition faithfully. A feasible plan satisfies every constraint; formulating a model does not require finding its optimum.

Suppose a divisible material is transported from depots A and B to shops P, Q and R. Every tonne held at the depots must be sent, and each shop must receive exactly its stated requirement.

Cost in pounds per tonnePQRSupply, tonnes
A4477552020
B6633883030
Demand, tonnes101015152525

The entry 77 is the cost of sending one tonne along route AQ. It is a fixed coefficient, not the quantity we choose to send.

Transportation decision variables

Let xijx_{ij} be the number of tonnes transported from source ii to destination jj, where

i∈{A,B}j∈{P,Q,R}i\in\{\mathrm A,\mathrm B\} \qquad j\in\{\mathrm P,\mathrm Q,\mathrm R\}

Thus xAQx_{\mathrm{AQ}}, for example, is the quantity sent from A to Q. All six variables are non-negative. They are continuous here because the material is divisible.

There is one variable for each permitted source–destination pair. A shop's requirement is not a decision variable: it is a fixed total that the chosen deliveries must meet. For indivisible crates, a model may instead require integer shipment quantities; choose the domain from what is transported.

Every shipment appears once in a source total and once in a destination total. That records its departure and arrival; it does not charge for the shipment twice.

[DIAGRAM: asset_name: One shipment belongs to two balance equations; asset_slug: 9fm0-d2-182-row-column-balances; caption: The AQ quantity appears in source A's row and destination Q's column.; description: A two-source three-destination table of shipment variables with supplies A20 B30 and demands P10 Q15 R25, highlighting the A row and Q column and displaying their separate balance equations.]
The AQ quantity appears in source A's row and destination Q's column.

The objective charges 7xAQ7x_{\mathrm{AQ}} pounds for route AQ once. In the constraints, xAQx_{\mathrm{AQ}} has coefficient 11, because one tonne leaving A is one tonne arriving at Q.

Key idea

Costs multiply shipment variables in the objective. Supply and demand constraints add shipment quantities with coefficient 11. State both index ranges so that every variable's route is unambiguous.

Check which expression actually totals the departures from A.

Write a complete balanced transportation model

Both margins total 5050 tonnes, so the table is balanced. Use a row equation for each source and a column equation for each destination.

For a general balanced table, let sis_i be source ii's stock, djd_j destination jj's exact demand, and cijc_{ij} the unit transport cost. The following form assumes all stock is shipped and every demand is met exactly.

Balanced transportation linear program

With mm sources and nn destinations, and compatible quantity units,

minimise Z=∑i=1m∑j=1ncijxij∑j=1nxij=si(i=1,…,m)∑i=1mxij=dj(j=1,…,n)xij≥0(i=1,…,m; j=1,…,n)\begin{aligned} \text{minimise }Z&=\sum_{i=1}^{m}\sum_{j=1}^{n}c_{ij}x_{ij}\\ \sum_{j=1}^{n}x_{ij}&=s_i &&(i=1,\ldots,m)\\ \sum_{i=1}^{m}x_{ij}&=d_j &&(j=1,\ldots,n)\\ x_{ij}&\ge0 &&(i=1,\ldots,m;\ j=1,\ldots,n) \end{aligned}

The margins must satisfy ∑isi=∑jdj\sum_i s_i=\sum_j d_j. Add integer restrictions if the transported units must be whole.

Not in the formula booklet: learn it.

Writing the model out in full is often the easiest way to check that no route or margin has disappeared. A double sum is equally valid when its coefficients and index ranges are clear.

Worked example 1: read each row and column

Question. Formulate the minimum-cost transportation problem for the table in the first part. Do not solve it.

Plan. Define the six shipment quantities, minimise the sum of unit cost times quantity, then impose the two source and three destination equations.

Let xijx_{ij} be the tonnes transported from depot ii to shop jj, where i∈{A,B}i\in\{\mathrm A,\mathrm B\} and j∈{P,Q,R}j\in\{\mathrm P,\mathrm Q,\mathrm R\}.

minimise Z=4xAP+7xAQ+5xAR+6xBP+3xBQ+8xBRxAP+xAQ+xAR=20stock at AxBP+xBQ+xBR=30stock at BxAP+xBP=10demand at PxAQ+xBQ=15demand at QxAR+xBR=25demand at Rxij≥0for every listed i,j\begin{aligned} \text{minimise }Z={}&4x_{\mathrm{AP}}+7x_{\mathrm{AQ}}+5x_{\mathrm{AR}} +6x_{\mathrm{BP}}+3x_{\mathrm{BQ}}+8x_{\mathrm{BR}}\\ x_{\mathrm{AP}}+x_{\mathrm{AQ}}+x_{\mathrm{AR}}&=20 &&\text{stock at A}\\ x_{\mathrm{BP}}+x_{\mathrm{BQ}}+x_{\mathrm{BR}}&=30 &&\text{stock at B}\\ x_{\mathrm{AP}}+x_{\mathrm{BP}}&=10 &&\text{demand at P}\\ x_{\mathrm{AQ}}+x_{\mathrm{BQ}}&=15 &&\text{demand at Q}\\ x_{\mathrm{AR}}+x_{\mathrm{BR}}&=25 &&\text{demand at R}\\ x_{ij}&\ge0 &&\text{for every listed }i,j \end{aligned}

Why this step? Each column equation includes deliveries from both depots. Writing xAP=10x_{\mathrm{AP}}=10 would unnecessarily force P to receive all its material from A.

Answer. The displayed minimisation, five balance equations and non-negative continuous domain form the model. ZZ is the total transport cost in pounds.

Check. One feasible plan is

PQRA10100B0525\begin{array}{c|rrr} &\mathrm P&\mathrm Q&\mathrm R\\\hline \mathrm A&10&10&0\\ \mathrm B&0&5&25 \end{array}

Its row totals are 20,3020,30, its column totals are 10,15,2510,15,25, and its cost is

4(10)+7(10)+3(5)+8(25)=3254(10)+7(10)+3(5)+8(25)=325

This checks the meaning of the model; it does not establish that 325325 is the minimum.

Worked example 2 changes only the AQ unit cost, from 77 to 99 pounds per tonne. No quantity requirement changes.

Worked example 2: a new price changes the objective

Question. Formulate the revised model with AQ unit cost 99 pounds per tonne.

Plan. Retain the shipment definitions and every balance equation. Replace only the coefficient of xAQx_{\mathrm{AQ}}.

Let xijx_{ij} again be tonnes transported from ii to jj, with i∈{A,B}i\in\{\mathrm A,\mathrm B\} and j∈{P,Q,R}j\in\{\mathrm P,\mathrm Q,\mathrm R\}. The complete model is

minimise Z=4xAP+9xAQ+5xAR+6xBP+3xBQ+8xBRxAP+xAQ+xAR=20xBP+xBQ+xBR=30xAP+xBP=10xAQ+xBQ=15xAR+xBR=25xij≥0for every listed i,j\begin{aligned} \text{minimise }Z={}&4x_{\mathrm{AP}}+9x_{\mathrm{AQ}}+5x_{\mathrm{AR}} +6x_{\mathrm{BP}}+3x_{\mathrm{BQ}}+8x_{\mathrm{BR}}\\ x_{\mathrm{AP}}+x_{\mathrm{AQ}}+x_{\mathrm{AR}}&=20\\ x_{\mathrm{BP}}+x_{\mathrm{BQ}}+x_{\mathrm{BR}}&=30\\ x_{\mathrm{AP}}+x_{\mathrm{BP}}&=10\\ x_{\mathrm{AQ}}+x_{\mathrm{BQ}}&=15\\ x_{\mathrm{AR}}+x_{\mathrm{BR}}&=25\\ x_{ij}&\ge0\quad\text{for every listed }i,j \end{aligned}

Why this step? A price change affects how attractive a plan is. It does not change which plans satisfy the stock and demand conditions.

Answer. Minimise the revised objective over the same feasible set.

Check. The earlier feasible plan still satisfies all five balance equations. It sends 1010 tonnes along AQ, so its cost rises by 2(10)=202(10)=20, from 325325 to 345345 pounds.

Here is the promised surprise about the five equations. Add the two row equations: total deliveries are 20+30=5020+30=50. If P receives 1010 and Q receives 1515, R must receive 50−10−15=2550-10-15=25. Its equation follows from the other four. This is why balanced transportation equations contain a redundancy, rather than five independent restrictions.

That observation does not license a mismatched margin. If R instead required 2626 tonnes while the other margins stayed fixed, exact total demand would be 5151 against stock 5050, and the model would be infeasible. Present the full requested constraints clearly in a formulation answer.

Watch out

Wrong: omit “minimise”, leave the index ranges undefined, or multiply a balance equation by route costs. Right: define quantities and their routes, minimise total cost, and add unweighted quantities in every source and destination constraint.

Change the same unit cost once more; the logistics remain fixed.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account