Optimal design: Transportation and resource flow

Definition

When resour­ces need to be dis­tri­bu­ted across various loca­ti­ons, and dis­tri­bu­ti­on is only pos­si­ble along cer­tain rou­tes, the resul­ting pro­blem is cal­led a rou­ting pro­blem. This encom­pas­ses the design of opti­mal flows of goods, ener­gy, or infor­ma­ti­on through com­plex networks.

The­se are pro­blems that par­ti­cu­lar­ly ari­se in the trans­por­ta­ti­on sec­tor, whe­re they mani­fest as ques­ti­ons about the shor­test rou­tes for goods trans­por­ta­ti­on. Accor­ding to stu­dies such as [1], up to 13% of a pro­duc­t’s total manu­fac­tu­ring cos­ts can be attri­bu­ted to trans­por­ta­ti­on cos­ts, pre­sen­ting signi­fi­cant oppor­tu­ni­ties for savings.

Origin: Route design

The so-cal­led Tra­vel­ling Sales­per­son Pro­blem (TSP) is an arche­typ­al rou­ting pro­blem that was mathe­ma­ti­cal­ly for­mu­la­ted in the 19th cen­tu­ry. In the TSP, a sales­per­son needs to visit a set of loca­ti­ons and choo­se the sequence of sites such that the total dura­ti­on of the tour is minimized.

The pro­blem seems tri­vi­al but is pro­ven to be one of the most dif­fi­cult mathe­ma­ti­cal chal­lenges. Fur­ther­mo­re, its rele­van­ce extends far bey­ond trans­por­ta­ti­on. Data clus­te­ring, wiring of micro­chips, arran­ging semi­con­duc­tor com­pon­ents into an inte­gra­ted cir­cuit, air­port design, and con­trol­ling lar­ge telesco­pes to tar­get mul­ti­ple celes­ti­al bodies can all be for­mu­la­ted in the lan­guage of rou­ting plan­ning. See, for exam­p­le, [2].

TSP: Example

The TSP is a pro­to­ty­pe for many trans­por­ta­ti­on and resour­ce flow pro­blems. Even an ins­tance with just a few loca­ti­ons to visit high­lights the dif­fi­cul­ties. Sup­po­se the­re are 4 loca­ti­ons to be visi­ted in such a way that the tra­vel time is mini­mi­zed. For sim­pli­ci­ty, we omit the cons­traint that the start­ing point and end­point should be identical.

Figu­re 1: Illus­tra­ti­on of tra­vel dura­ti­ons in a tour plan­ning pro­blem. 4 loca­ti­ons with known distances from each other are to be visi­ted. (a), (b). The dura­ti­ons for some of the rou­tes are recor­ded in ( c).

The shor­test tour in the abo­ve exam­p­le is \(1\rightarrow 2\rightarrow 3\rightarrow 4\) with a tra­vel time of 10 hours. Howe­ver, this result is only appa­rent after all \(4! = 4*3*2*1 = 24\) pos­si­ble tours have been cal­cu­la­ted and their lengths com­pared. This method, based on revie­w­ing all pos­si­ble opti­ons, rapidly loses prac­ti­ca­bi­li­ty with an incre­asing num­ber of desti­na­ti­ons. For 12 loca­ti­ons, alre­a­dy 500,000,000 opti­ons must be cal­cu­la­ted. The intro­duc­tion of cons­traints and more com­plex objec­ti­ve func­tions requi­res a com­ple­te­ly dif­fe­rent approach to sol­ving the problem.

Optimization formulation

Rou­ting pro­blems like the TSP can be for­mu­la­ted using mixed-inte­ger line­ar optimi­zation. To do this, bina­ry varia­bles \(x_{ij} \in \{0,1\}\) are intro­du­ced, which indi­ca­te whe­ther the direct rou­te from point \(i\) to point \(j\) is taken or not. With \(c_{ij}\) repre­sen­ting the tra­vel times bet­ween points \(i\) and \(j\), the optimi­zation pro­blem is as fol­lows [3]:

$$\begin{align}
\min{x_{ij}} ~~~ & \sum_{i=1}^n \sum_{j=1, j\neq i}^n c_{ij}x_{ij} &&\\
\text{s.t.} ~~~& \sum_{i=1, i \neq j}^n x_{ij}=1 &&j=1, …, n \\
&\sum_{j=1, j\neq i}^n x_{ij}=1 && j=1, …, n \\
& \sum_{i \in Q} \sum_{j\in Q, j\neq i} x_{ij}\le |Q|-1 && \forall Q\underset{\neq}{\subset} \{1, … , n\}, |Q|\ge 2
\end{align}$$

The role of the cons­traints is to enforce a flow on the trans­port net­work whe­re each loca­ti­on is visi­ted and left exact­ly once and which con­ta­ins no loops.

Generalization

To address the com­ple­xi­ty of real-world pro­blems, prac­ti­ce shows that addi­tio­nal cons­traints and model details are neces­sa­ry. For exam­p­le, the fol­lo­wing situa­tions need to be modeled:

  • The pre­sence of mul­ti­ple trans­port vehic­les and the pos­si­bi­li­ty to rent addi­tio­nal ones
  • Capa­ci­ty limi­ta­ti­ons of deli­very vehicles
  • Maxi­mum per­mis­si­ble dri­ving dura­ti­ons and fixed time frames for deliveries
  • Simul­ta­neous deli­veries and pro­duct returns
  • Pen­al­ties for unde­li­ver­ed shipments
  • Ran­dom effects and robust tour plans

All of this makes tour plan­ning pro­blems often have very com­pli­ca­ted mathe­ma­ti­cal for­mu­la­ti­ons with a daun­ting amount of equations.

Example

Three vehic­les are available to tra­vel through a set of \(n=45\) loca­ti­ons \(v_i, i=1, \ldots, n\), in such a way that the length of the lon­gest tour is mini­mi­zed. This can be for­mu­la­ted as the optimi­zation pro­blem [4, p. 154]:

$$\begin{align} \min_{x_{ij}} ~~~& \max\left(\sum_{i<j} c_{ij}x_{ij}^1, \sum_{i<j}c_{ij}x_{ij}^2, \sum_{i<j} c_{ij}x_{ij}^3\right) \\ \text{s.t.} ~~~& x(\delta(\{v_0\}))=6 && \\ &x(\delta(\{v_i\}))=2 && i=1, \ldots, n \\ & x(\delta(S)) = 6 && S\subseteq V\setminus\{v_0\} \\ & 0 \le x_{0j}^k \le 2 && j=1, \ldots, n,~~~ k=1, 2, 3 \\ & 0 \le x_{ij}^k \le 1 && i < j,~~~ i,j =1, \ldots, n,~~~ k=1, 2, 3 \\ & x_{ij}^k \in \mathbb{Z} && i\le j, ~~~ i,j=1, \ldots, n, ~~~ k=1, 2, 3 \end{align}$$

Here, \(x_{ij}^k\) is an indi­ca­tor varia­ble that deno­tes whe­ther vehic­le \(k\) tra­vels from \(i\) to \(j\), \(V=\{v_0, \ldots, v_n\}\) repres­ents the set of all loca­ti­ons inclu­ding the start and end­point \(v_0\), and \(\delta(S)\) is the set of con­nec­tions lea­ding out of the set \(S\). The term \(x(\delta(S))\) repres­ents the sum of the actu­al con­nec­tions lea­ding out of the set \(S\).

Figu­re 2: Two ran­dom pro­blem ins­tances whe­re the loca­ti­ons of the \(n=15\) points were ran­dom­ly sel­ec­ted (a), (b). The opti­mal tour plan­ning with 3 vehic­les is shown in ©, (d), mini­mi­zing the maxi­mum tour length.

Solution

Note that the requi­re­ment \(x(\delta(S))=6 \forall S \subseteq V \setminus \{v_0\}\) includes an equa­ti­on for each subset of \(V=\{v_1, …, v_n\}\). Sin­ce the­re are expo­nen­ti­al­ly many equa­tions, the­se equa­tions are typi­cal­ly neither manu­al­ly for­mu­lable nor sol­va­ble and are also not acces­si­ble to a nor­mal com­pu­ter. E.g. if the num­ber of loca­ti­ons in the abo­ve exam­p­le are increased to 30, the amount of equa­tions from that cons­traint alo­ne num­ber at least \(2^{30}\approx 1\) billion.

Howe­ver, powerful soft­ware exists that can appro­xi­m­ate­ly sol­ve the­se pro­blems using heu­ristics. For the abo­ve exam­p­le, we used the OR-Tools libra­ry from Google—a tool­box with a Python inter­face that spe­ci­fi­cal­ly deals with pro­vi­ding algo­rith­ms for ope­ra­ti­ons rese­arch. More infor­ma­ti­on about the packa­ge, which was signi­fi­cant­ly deve­lo­ped by Lau­rent Per­ron and Vin­cent Fur­non and is publicly available, can be found here .

Practical aspects

Due to the dif­fi­cul­ty of exact­ly sol­ving tour plan­ning pro­blems, algo­rith­ms have been deve­lo­ped that quick­ly lead to good, though pro­ba­b­ly not opti­mal, tours. Given the eco­no­mic signi­fi­can­ce of trans­port pro­blems, a lot of work has gone into deve­lo­ping various heu­ristics, and some prac­ti­cal rules have emer­ged that can be used ad hoc by users wit­hout signi­fi­cant com­pu­ta­tio­nal effort.

An exam­p­le of this is the lar­gest-gap stra­tegy, by which for­k­lift ope­ra­tors choo­se their rou­tes in a warehouse [5]. Tour plan­ning pro­blems, the­r­e­fo­re, are still not exact­ly sol­va­ble but at least appro­xi­m­ate­ly so. And the rou­tes found through optimi­zation are often 10–15% bet­ter than tho­se plan­ned manu­al­ly [4, p. 153].

Code & Sources

Exam­p­le code: OD_routing.py in our tuto­ri­al­fol­der

[1] Owoc, M., & Sar­gious, M. A. (1992). The Role of Trans­por­ta­ti­on in Free Trade Com­pe­ti­ti­on. In N. Waters (ed.), Cana­di­an Trans­por­ta­ti­on: Com­pe­ting  in a Glo­bal Con­text. Banff, Alber­ta, Canada.

[2] Len­s­tra, J. K. & Rin­nooy, K. (1975). Some Simp­le Appli­ca­ti­ons of the Tra­vel­ling Sales­man Pro­blem. Ope­ra­tio­nal Rese­arch Quar­ter­ly, 26(4), 717–733.

[3] Dant­zig, G., Ful­ker­son, R., & John­son, S. (1954). Solu­ti­on of a lar­ge-sca­le Tra­vel­ling Sales­man Pro­blem. Jour­nal of the Ope­ra­ti­ons Rese­arch Socie­ty of Ame­ri­ca, 2(4), 393–410.

[4] Appa, G. M., Pitsou­lis, L., & Wil­liams, H. P. (2006). Hand­book on Model­ling for Dis­crete Optimi­zation. Ber­lin, Hei­del­berg: Springer.

[5] Peter­sen, C. G. (1997). An Eva­lua­ti­on of Order Picking Rou­ting Poli­ci­es. Inter­na­tio­nal Jour­nal of Ope­ra­ti­ons & Pro­duc­tion Manage­ment, 17, 1096–1111.