ALGORITHM B: ACCURATE TRAFFIC EQUILIBRIUM (AND HOW TO BOBTAIL FRANK-WOLFE)
1
Robert B. Dial
[email protected] The Volpe National Transportation Systems Center Kendall Square Cambridge, MA 02142 July 26, 1999
Abstract This paper contributes the design of a novel traffic assignment algorithm, presented in such detail as to facilitate formal verification and efficient implementation. Called B, the algorithm takes a simple, intuitive, and direct approach: It shifts flow from costliest path segments to the cheapest until all used paths have costs within of the cheapest. Being implicitly path-based, B is combinatorial, correct, efficient, and boasts excellent convergence properties. In contrast with the conventional Frank-Wolfe-based approach, Algorithm B computes equilibrium flows to arbitrary accuracy, regardless of the level of congestion or the size of the network. Remarkably, B neither enumerates nor stores paths. 1 Submitted
for presentation only at the TRB Annual Conference, Washington, DC, January 2000
i
Preface: Buried Due to Dubious Review This Final Report for the U.S. Department of Transportation announces Algorithm B’s first but un finalized ideas. For example, B planned to be a post process for the then ubiquitous FW algorithm, to remove the latter’s infamous tailing. However in 2004, B’s tests would reveal that its FW pre processor was dead weight: B solved Transportation Assignment Problems very much faster without it. FW was eliminated. Otherwise, B’s original strategy stayed its course2 : Perforce are its max-min path-sement-pairs on-a-bush3 , now multi-bush2 . Because B eschewed FW, text referencing it has been removed. Little else has changed: The result is 99 percent as it was in 1999. Sections 1–4 and Section 5.3 should attract anyone interested in witnessing the birth of a truly unique TAP solution breakthrough: These initial elements enable B2 to solve classic TAPs with precision and speed neither earlier imagined nor later superseded (Figure 1). Regrettably in 1999, its seminal ideas went unshared publicly until now, 17 years later4 . That was not the plan: I submitted this report for presentation at the 2000 Annual Meeting of the TRB. Every peer of ours that I knew, Dear Reader, might welcome learning how a path-based algorithm could compute equilibrium arc flow to arbitrary precision, regardless of congestion level and network size; yet neither enumerate nor store paths: the TAP equivalent of room-temperature fusion! Its acceptance seemed certain. Wrong again: Some peers might have wished to learn of such magic; nevertheless, two of them, one of the paper’s two referees and the Chairman of the TRB Network Modeling Committee did not want me describing it in public. The reviewer, citing irrelevant papers by Boyce and Bar-Gera, gave this paper an F: He granted its ideas original and timely, but their being untested on a large network5 made them unworthy of public presentation to TRB 2000 attendees. The other referee gave the paper A+ on all counts; it mattered not. In 2000, Bar-Gera is slated to win a TranSci Best Dissertation Prize—for OBA. The Chairman too flunked my paper. However he awarded me a booby prize: the honor to speak at an unprecedented special closed meeting of his committee. He also invited BarGera—whose paper hadn’t flunked—to present OBA alongside B. This proved them very different—except that both used (Dial,1971)’s origin-based bushes, which preceded OBA by decades6 . Attending this meeting were 30-plus members, including our two most vocal senior peers cum pundits, Boyce and Florian7 . Later, both of these Emeritus Members of the hosting committee would never mention that this singular event (Figure 4) ever occured. This all had followed my retirement from the US DOT, and my attention became needed elsewhere. Algorithm B thus remained shelved and unimplemented until 2004, when Dr. Howard Slavin of Caliper Corporation offered to fund renewal of its R&D. In 2005—five years later than need be—in a tightly controlled runoff at Caliper’s offices in Newton MA, Algorithm B solves the Chicago Regional TAP six times faster than OBA2 . Robert B. Dial, 4/9/2017 2 Dial, R. 2006, A path-based user-equilibrium traffic assignment algorithm that obviates path storage and enumeration Tres B 40, 917-936. 3 Nicknamed PAS in 2010 by Boyce’s student, Bar-Gera. In 1999, OBA had already used without attribution (Dial,1971)’s origin-based bushes. In 2010, TAPAS did the same and added B’s “PAS” idea. 4 In 2009, I sent this paper to Y.Nie, who then shared it with the Northwestern library and friends, notably Bar-Gera (TAPAS) and J.Xie (iTAPAS). In return, (Nie,2010), with bar-Gera and Boyce’s endorsement, falsely claims B is route-based not path-segment based, and (Newell,1997) not (Dial,1971) invented bushes! 5 There was no real code nor data, only figures and mathematics explicating B’s new ideas. 6 Along with other bush acyclicity applications to TAPs in (Dial, 1999b, 2000). 7 While I am describing how B moved flow between path segments, Florian blurts out: “That’s simplex!” Before I could finish“No it’s not,” he ejects from his chair and flies out the door. Years later, he writes “B is Dafermos’s algorithm.” Next it’s “B does a line search.” All three are false. (Is there a pattern here?)
ii
(a) Running Times of Eight Algorithms Solving Chicago Regional’s TAP Test Case Algorithm CPU B 4 B 5 B 2 pB 4 pB 2 B 1 iTAPAS 3 TAPAS 3 BCGD 5 DBA 1 OBA 1 LUCE 1
Year 2017 2017 2017 2017 2017 2009 2014 2014 2017 2010 2012 2012
Chicago Regional Network Experiments Minutes to Relative Gaps 10−2 10−4 10−6 10−8 10−10 10−12 0.3 1.0 2.5 3.5 5.0 7.5 0.3 1.0 2.5 3.5 5.0 7.5 1.0 2.0 3.5 5.0 7.0 10.0 0.5 1.5 2.8 5.0 9.0 11.0 1.0 2.5 3.5 7.0 12.5 15.5 1.0 2.0 4.5 9.0 18.5 – 4.8 10.0 12.4 16.8 23.1 25.1 6.8 14.8 18.2 26.8 35.7 51.0 0.2 2.0 18.0 – – – 15.0 40.0 90.0 240.0 480.0 – 30.0 150.0 600.0 1800.0 – – 30.0 150.0 1020.0 2400.0 – –
10−14 9.8 9.8 11.5 – – – 28.5 76.0 – – – –
B i7-5820 Speedup 1.0x 1.0x 1.2x 1.5x 2.1x 3.7x 2.9x 7.8x 7.2x 25.9x 200.0x 266.7x
Running Time Sources: 1. 2. 3.
4 5. 6.
7.
Algorithms B and pB 2017 on i7-5820 from Figure 2. B 2009 from Figure 3(b). TAPAS and iTAPAS: (Xie, Xie, 2014). DBA: (Nie, 2010). OBA and LUCE: (Xie, Nie, Yang, 2012). TAPAS and iTAPAS are B’s illegitimate children. iTAPAS is 3x slower than B; TAPAS, 8x slower. iTAPAS is Xie and Xie’s so-caled“improved TAPAS”, more factually called, “inferior B.” Both algorithms depend on B’s ideas; both withhold honest attribution. BCGD stands for BiConjugate Gradient Decent: high-octane FW used by Caliper (and INRO?). BCGD employed 23 threads; B only 1. pB (i7-920) used 4 threads; i7-5820) used 6. DBA is (Nie, 2010) bogus “Dial’s Bush Algorithm,” A sinister charicature of B that’s 26x slower! OBA here is Nie’s very own QBA, a tweak that obstensibly kills an old OBA bug (Nie, 2010). Called by (Xie, Nie and Yang, 2012) a “widely used benchmark” to gauge performance of TAP algorithms; OBA embarrasses itslf with statistics that testify once again to its irrelevance. LUCE does not use B’s PAS, yet unlike OBA, TAPAS and iTAPAS, it duly credits (Dial, 1971) bushes.
(b) Specifications, Release Date and Sale Price of CPUs Referenced in (a) CPU 1 2 3 4 5
Intel Model Xeon-X i7-920 i5-4570 i7-5820K Xeon-E
Processor Specifications from Wikipedia GHz Bits Cores RAM(GB) Released 3.00 64 4 8 2007 2.66 32 4 3 2008 3.20 64 4 16 2013 3.30 64 6 32 2014 3.00 64 12 128 2016
$Price 958 284 192 339 2116
Notes: 1. 2. 3. 4.
All i7-920 and i7-5820 runs were with 32-bit Windows XP compilations of B and pB. In their competition, Algorithm B and BCGD both used Caliper Corporation’s computer Xeon-E. B’s speedups over DBA, OBA and LUCE are based on B (2009). All four used Nie’s Xeon-X. Even the oldest B (2009) on the slowest computer (i7-920) is significantly faster than iTAPAS, TAPAS, BCGD, DBA, OBA and Luce; all running on much faster machines (i5-4570, Xeon-X,E).
Figure 1: Run Time Statistics; Algorithms B & pB vs Six Others (Source:Dial, R.B. 2016. “pB: Algorithm B and Proportioning”, Working Paper.)
iii
(a) Algorithm B Test in 2017 B: Chicago Regional Network: 1315989.739 Trips Itn 0 1 10 20 30 40 50 60 70 80 90 100 110
Time Mins 0.17 0.47 1.63 2.49 3.50 4.63 5.68 6.58 7.41 8.23 9.02 9.78 10.50
Objective Function 27256950.118 26146612.503 25845718.523 25845689.361 25845689.323 25845689.323 25845689.323 25845689.323 25845689.323 25845689.323 25845689.323 25845689.323 25845689.323
Path-Flow Entropy 343661 520029 480827 481975 481984 481998 481998 481999 481999 481999 481999 481999 481999
User-Equilibrium Metrics relGap objGap pathGap −1 6 1.18·10 4.75·10 3.42·102 −2 6 2.87·10 1.00·10 1.94·102 −5 2 2.14·10 7.21·10 5.06·10−1 −7 1 3.25·10 1.10·10 5.78·10−2 −8 −1 1.82·10 6.11·10 4.22·10−4 −10 −2 3.99·10 1.34·10 1.63·10−5 −11 −4 2.21·10 7.45·10 6.52·10−7 −12 −4 4.36·10 1.47·10 1.46·10−7 −13 −5 9.80·10 3.30·10 3.60·10−8 −13 −6 2.32·10 7.82·10 8.48·10−9 4.69·10−14 1.58·10−6 2.08·10−9 1.17·10−14 3.95·10−7 5.35·10−10 4.43·10−16 1.49·10−8 1.39·10−10
Run on Intel i7-5820k, 64-Bit 3.30 GHz 32GB w/1 Core, Windows 10 (b) Algorithm pB Test in 2017 pB: Chicago Regional Network: 1315989.739 Trips Itn 0 1 10 20 30 40 50 60 70 80 90
Time Mins 0.18 0.66 2.43 3.94 5.43 6.92 8.13 9.05 9.84 10.66 11.40
Objective Function 27255905.696 26145401.206 25845690.396 25845689.377 25845689.375 25845689.322 25845689.322 25845689.322 25845689.322 25845689.322 25845689.322
Path-Flow Entropy 342953 776096 939837 940918 940132 939722 939206 939067 939044 938958 938925
User-Equilibrium Metrics relGap objGap pathGap 1.18·10−1 4.75·106 3.42·102 −2 5 2.72·10 9.46·10 1.87·102 −6 1 1.57·10 5.28·10 1.16·100 −8 0 4.33·10 1.46·10 1.16·100 −9 −1 6.24·10 2.10·10 1.16·100 −10 −2 7.49·10 2.52·10 5.76·10−2 −10 −3 2.07·10 6.98·10 8.93·10−6 −11 −3 8.04·10 2.70·10 3.31·10−6 −11 −3 3.52·10 1.18·10 1.76·10−6 −12 −5 2.04·10 6.86·10 1.07·10−6 −13 −5 6.81·10 8.92·10 8.45·10−7
Run on Intel i7-5820k, 64-Bit 3.30 GHz 32GB w/6 Cores, Windows 10 Notes: 0. 1. 2. 3.
B with pB code compiled on an Intel i7-920 32-bit CPU; XP VS-2008. B’s algorithm has dominated since 1999; its code since 2004. Idea theft notwithstanding In classic TAP UE, no other algorithm is as fast as B nor even pB. Example: Fig. 1(a) Iteration 50. In under 5 mins, B’s max-min ij-path-segment flow shifts result in a max-min od-route time gap of less than a millionth of a minute. (A mere statistic computed like all the others. not to solve the TAP; but only to report on progress.) 4. To a relative gap 10−12 , B is 1.5x faster than pB which however, creates 2x the entropy.
Figure 2: B & pB Iteration History: Chicago Regional Network iv
(a) Chicago: Algorithm B: Run by Dial in 2009 on Intel i7-920 at Home
It’n 0 10 20 30 40 50 60
Elapsed Minutes 0.30 3.17 5.53 9.61 15.62 21.93 27.94
Bush Updates 1771 1979 4 6 2 14 3
Traditional User-Equilibrium Criteria Relative Gap Beckmann Absolute Err < v, π > P R xa 1 − < x, t > f (x) − f (x∗ ) 0 t(xa )dx −1 1.19·10 27263436.409 4.78·106 −5 5.13·10 25846991.061 1.73·103 −6 2.00·10 25846916.786 6.74·101 −8 7.48·10 25846915.540 2.52·100 −9 1.77·10 25846915.537 5.96·10−2 −10 1.83·10 25846915.537 6.16·10−3 −11 8.99·10 25846915.537 3.03·10−3
∆Path-Time max(π − π) 3.80·102 4.77·10−1 5.20·10−2 4.45·10−3 5.56·10−5 6.23·10−6 7.41·10−7
Intel i7-920, 32-Bit, 2.67 GHz, 2GB RAM
(b) Chicago: Algorithm B: Run by Nie in 2009 on Intel Xeon at Northwestern
It’n 0 10 20 30 40 50 60
Elapsed Minutes 0.21 2.09 3.62 6.37 10.52 14.94 19.18
Bush Updates 1771 1979 4 6 2 14 3
Traditional User-Equilibrium Criteria Relative Gap Beckmann Absolute Err < v, π > P R xa 1 − < x, t > f (x) − f (x∗ ) 0 t(xa )dx 1.19·10−1 27263436.409 4.78·106 5.13·10−5 25846991.061 1.73·103 2.00·10−6 25846916.786 6.74·101 7.48·10−8 25846915.540 2.52·100 1.77·10−9 25846915.537 5.96·10−2 1.83·10−10 25846915.537 6.16·10−3 −11 8.99·10 25846915.537 3.03·10−3
∆Path-Time max(π − π) 3.80·102 4.77·10−1 5.20·10−2 4.45·10−3 5.56·10−5 6.23·10−6 7.41·10−7
DELL Precision T7400:xEON [sic] (R) CPU X5450 3.00GHz, 8G RAM
Chicago Regional Network Disimformation Alert: (Nie, 2010) Defames (B, 2006): 1.
2.
3.
4. 5. 6. 7.
Table (a) shows Dial’s i7-920 computer and (b) Nie’s Xeon solving Chicago with my 32-bit XP compiled implementation of B (Dial, 2006). The tables are not identical: Nie’s Xeon is much faster. All other statistics are, however, identical. Thus with his own computer, Nie beheld first-hand what was (in his own words) B’s “impressive performance.” He personally witnessed Algorithm B reaching a relative gap less than 10−10 in 19.18 mins. Nevertheless (Nie,2010) later blatently insinuates that reaching 10−10 takes B 480 mins! It thus deprecates B from impressive to ludicrous. Moreover, it spews two more claims Nie knew to be untrue: 1) that B is od-route based and 2) it is just “Dafermos’s algorithm.” Why would Northwestern’s assistant professor publish blatant misinformation? How could have Transportation Research Part B allowed it? Where were Nie’s professor friends Florian, Boyce and Bar-Gera to prevent Nie from sowing such deceit? In fact, Nie thanks these three for helping him produce it! They too were fully aware that B was 6x faster than OBA and was never was route-based: B is min-max-path-segment-pairs-based—nicknamed PAS by (Bar-Gera, 2010), coincidently.
Figure 3: Algorithm B on Dial and Nie’s Computers in 2009 v
........................................................................................................................................................................................................................................................................................................................................ ... .. ... .. ....................... .. .......... .............. . . . ..... OBA .... .. LUCE .. .. .... . . .. 200.0x 266.7x . . . .. . . . . . . . . . 2000 2009 . . ........ ..... ....... . ... . . . . . . . .. . . . . . . . . . . . . . . . ............... . . . . ............ . ... . . . . .. . . . . . . . . . . . . . ... ... . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . ....... .. ... . . . . . . . . .. . . . . . . . . . . . . . . . . . . ..... .. . . . . . .... . . . . .. . . . . . . . . . . . . . . . . ... ............. ....... .................. . . . . iTAPAS....2.9x .. . . . . . . ....... 2014..... ... .... ................. .. ... . . . . . . ............... ... . .. .. STOCH ....... ............... . . . . . B clone ... .... . .. ... 1971 ................... . . . . . . ........ ........ .. MRT .. . .. . . . . ..... .............. ...... .............. ...... . . ... 1999 ... .................... . . .. . . . . . . . . bushes .. . . ..... .. . .. .. . ........ . .. TAP algorithms ......................... ........ B .............................. B ............................................................. pB ... ..... ... 2000 .. PAS: ... 2006 .... ... 2016 .. ... .. acyclicity ... bushes ......... ........ min-max ......... ........ ...... . .. . . ...................... ..... minimizing . . . . .. . .... ... ... . . .ij-path-segment . . .. . . . . . . . ... . . . pairs .. ...... . road prices ... 1.5x .. .. . . ... . . . . on bushes: . . .. .. WBBR ... ..... ...................... ... .. . . . . .. .. . . fastest TAP algorithm ... ....... . . . ... . . . . . . . . . . .. ... .... .... .. ... ... . . .................... ......TAPAS ..... 7.8x (Figure 1) .... . .. . .. ... .... ............. 2010..... basic .. . . .. ... . . . . . . . . . . . . JTPR . . . . . . . . . . . DBA . . . .. insights . ... 25.9x ..... 2010 ..... .. 1994 .. .. “PAS” ... ....... ...... knickname ... .... ..... .. ... proportioning ........... .. ... path-storage issues cunning B charicature .. . ...................................................................................................................................................................................................................................................................................................................................... 1970
1995
2000
2005
2010
2015
Presentation Dates of Algorithms Based on Ideas of STOCH and/or B Notes: Dashed circles and arrow influence problem statement, not solution tactics. Doubled circles use Stoch and/or B contributions without due attribution: 1. Bush (Dial, 1970, 1971, 1999a, 1999b), graph stucture invented for TAP algorithms. 2. Min-max path segments (Dial, 1999b, 2006), knicknamed PAS (Bar-Gera, 2010). 3. (Nie, 2010, 2014) falsely claim B “od-route-based” to support Bar-Gera’s cheating. 3. Nx is B’s speedup; e. g., B is 200x faster than Nie’s “improved OBA” (Figure 1).
Insights, Algorithms and Cheats WBBR STOCH JTPR MRT B(2000) OBA B(2006) LUCE DBA TAPAS iTAPAS pB
Wardrop, Beckmann, Bertsekas, and Rockafellar: basic insights. (Dial, 1970,1971) Stochastic assignment plus other TAP related bush algorithms. (Jayakrishnan, Tsai, Prashker and Rajadhyaksha, 1994). (Dial, 1999a) Minimum Revenue Tolls, uses bushes and their min-max trees. (Dial, 1999b) presentation of B to special TRB Networks Committee Meeting (Bar-Gera, 2000) aka “Overrated Bush-based Algorithm”. (Dial, 2006) aka Algorithm B: first min-max ij-path-segments (PAS) algorithm (Gentile, Noekel, 2009). (Nie, 2010) aka “Deceitful B Abomination”, source of “statistics” slandering B (Bar-Gera, 2010) aka “Totally Aberrated, Pathetically Amoral Scam”, Sine B nihil. (Xie and Xie, 2014) aka SCAB: “Surreptitious Copied Approximatin of B” (Dial, 2015) proportional B (improved entropy): Rejected by TransResB, 4/4/17.
Figure 4: Idea Flow: Bush Based Algorithms & Grand Theft PAS vi
References Akamatsu T., 1997. Decomposition of path choice entropy in general transport networks, Transportation Science 31(4), 349–362. Bar-Gera H., 1999. Origin-based algorithm for the transportation assignment problem, Transportation Science 36(4), 398–417. Bar-Gera H., 2010. Traffic assignment by paired alternative segments,” Transportation Research Part B 44, 1022-1046. Bruynooghe, M., Gilbert, A. and Sakarovich, M., 1968. Une m´eethode d’affection du traffic. Proceedings of the 4th International Symposium on the Theory of Road Traffic Flow, 198–204. Dafermos S. and Sparrow R., 1969. The traffic assignment problem for a general network. Journal of Research of the National Bureau of Standards, 73B(22) 91–118. Dantzig G., 1963. Linear Programming and Extensions. Princeton University Press, Princeton. Florian, M., Constantin, I. and Florian, D. 2009, A new look at the projected gradient method for equilibrium assignment. TRB 2009 Annual Meeting CD-ROM (Paper revised from original submittal). Gentile, G. and Noekel, K., 2009. Linear user cost equilibrium: the new algorithm for traffic assignment in VISUM. Acquired online. Jayakrishnan R., Tsai W., Prashker J., and Rajadhyaksha S., 1994 A faster path-based algorithm for traffic assignment. Transportation Research Record 1443, 75–83. LeBlanc L., 1973. Mathematical programming algorithms for large scale network equilibrium and network design problems, Ph.D. Dissertation, Department of Industrial Engineering and Management Sciences, Northwestern University. Nguyen S., 1973. A mathematical programming approach to equilibrium methods of traffic assignment with fixed demands. Publication 138, D´epartment d’Informatique et de Recherche Op´erationelle, Universit´e de Montr´eal, Montreal. Nie Y., 2010. A class of bush-based algorithms for the traffic assignment problem. Transportation Part B, 44, 73–89. Xie J., Nie Y. and Yang X. 2012, Does LUCE Outperform OBA? Aquired online. Xie J. and Xie C. 2014. An improved TAPAS algorithm for the traffic assignment problem. Presentation at the 2014 IEEE 17 International Conference on ITS. Acquired online.
vii
1. INTRODUCTION The traffic equilibrium problem (Wardrop 1952) is well known, as are its minimization formula by Beckmann (1956), and the ubiquitous application of Frank and Wolfe’s (1956) algorithm to solve it (LaBlank 1973). Equally well know is the latter’s notorious tailing problem (Hearn 1994), precluding precise estimates of equilibrium flows in anything but small or lightly congested networks. Restricted simpicial decomposition substantially improves matters, but still leaves much to be desired (Dial 1999a). Since transportation planning network models are typically very large (often over 30,000 arcs) and always heavily congested (we know!), a better solution approach is welcome. Presented below is an approach employing a new, simple, combinatorial algorithm called B. Efficient in time and space, Algorithm B computes equilibrium arc flows to virtually any accuracy on an arbitrarily large acyclic network with a single origin—without enumerating or storing paths. The crux of this paper is the next four sections: The first introduces B and presents tiny examples. The second and third provide detailed design and mathematical justification. The fourth shows how Algorithm B, designed for acyclic networks with one origin; when properly implemented, should be able to networks with zillions of cycles and thousands or origins.
2
Overview and Examples
Traffic equilibrium occurs when for all origin-destination pairs, the used paths have costs equal to the min path’s. This immediately suggests the following ‘mathematician’s algorithm:’ Start with any feasible flow and move flow from paths that cost more to paths that cost less, until all cost the same. Initially, this approach seems naive: where would you find sufficient cycles and core to find and cache all those paths? In a general network, this can indeed pose a problem. In an acyclic network, however, it becomes the proverbial piece of cake. First, restate equilibrium slightly differently: a feasible flow is optimal when the most expensive used (max) path costs the same as least expensive (min) path. Now consider the following variation on the mathematician’s algorithm, which we will call Algorithm B: Start with any feasible flow in a single-origin acyclic network. Find any two arc-independent paths that share start and end nodes, with the costliest one being used. Shift just enough flow from the max path to the min path to equalize their cost (or until the max path is unused). Repeat until all used max-path’s costs are within of their corresponding min-path’s.
1
First, in an acyclic network, finding either min or max paths is quick, the complexity of either being only linear in the number of arcs.8 Second, while an acyclic network does have a zillion paths, and every path might carry a nonzero flow, Algorithm B can, nonetheless, ignore most of them: Consider two paths from node i to node j. These paths have arcs they share and those they do not. Let node k be the j-node of the last arc they have in common before reaching j. To improve equilibrium, the algorithm need only shift flow between their two independent path segments connecting k to j. Fourth, these relatively few independent path segments lie on the max- and min-path trees, whose paths are efficiently stored in the conventional manner of saving one predecessor arc for each node. Fifth, these local flow shifts alone will lead to a global equilibrium. Consequently, as is proved in Sections 3 and 4, Algorithm B is a network algorithm that achieves a path-based objective without storing or enumerating paths. 2.1
Overview
Assuming for a moment the above claim true, the following description of Algorithm B’s inputs, mainline, and two principal subroutines, UpdateTrees and ShiftFlow, should make sense: i. Inputs are a feasible flow and an acyclic network whose nodes are numbered from 1 to the number of nodes—in increasing topological order, making any path’s nodes sequence strictly increasing. ii. AlgorithmB, the mainline, repeatedly invokes UpdateTrees followed by ShiftFlow (each processing all nodes) until the maximum difference between any max- and min-cost path is less than a given . iii. UpdateTrees is a minor variation of folklore’s optimal-path algorithm for acyclic networks. Processing nodes in forward topological order, it computes the min- and max-path cost potentials and predecessor arcs for a subset of the network’s nodes. Given two nodes, k and j, UpdateTrees assumes that nodes up to k, that is j = 1, 2, . . . , k − 1, already have correct labels and relabels nodes k + 1 to j − 1 only. An added constraint is that a max path must have flow on it. It is possible, therefore, that a node not have a max path. On the other hand, every node has a min path. iv. ShiftFlow shifts flow from a max path to its corresponding min path. Processing nodes in backward topological order, it determines the last node k common to both the max and min path to j. It then uses Newton’s method to find the flow for the two path segments between k and j that would equalized their costs. After it changes the flow—and the costs—of the arcs on 8 This in sharp contrast with finding a longest path in general network, whose complexity is no less than np-hard.
2
these two arc-independent path segments, it invokes UpdateTrees to update the labels of every node topologically between k and j. It then continues, iteratively processing the next upstream node until reaching the origin node. This is the essence of Algorithm B. Except for its dependence on topologically ordered nodes, it sounds very similar to any other network optimization algorithms (e.g., Rockafellar 1984) . Naturally, its formal definition includes several unmentioned yet critical conditions, constraints, refinements, and other devilish details differentiating it further; and proof of its correctness awaits Section 3. Nevertheless, with only the above, we can do an example. +100
π1 π1
-100
4x
............. ............. 14 ..... 1 .......................................................................................................... 4 .... ............. ............... . . . . ... . ........ .... ... ... ....... ... .. .... ... .... ... ... . . .... ... . ... . . ... ... ... . . ... ... ... . . ... ... 24 ....... ... ... . . ... ... . .. . 34 . ... ... . 12 ..... ... ... ... . . ... ... ... . . ... ... .. . . ... ... . .. . . ... ... . .. . . ... ... . ..... ...... ... .... .... ..... . . . ... ................. . . . . . .............. .... ................................................23 .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....3.... . .....2 . . . ...... .....
2x
2x
π4 π4
x c
........... ............. ..... ..................................................14 ....................................................... 4 .... ....1..... . ...... ............... . . . . .. . ... 14 ....... ........ ... ... . .... ... ... .... ... . ... . ... . .... . .... .. . . .. . . . . . ... . . .. . . .... ... . 24....... ... . 12 .... 12 34 . ... . ... . . ... 24 . . . . . ... .. .. . . . ... .. .. . . ... . ... . ... . .... ... . ... . ... . . ... . .... .... . . ..... . . . .............. . .... . . . . ................................................23 . .............. .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....3..... ....2..... ...... .....
¬p ∧ p
x
c
x
p ∨ (p ∧ p)
x
x
c
x c23
π2 π2
(a) Flow-Cost Function
x
c34
π3 π3
(b) Legend
Figure 1: Example 1: Four-Node, Five-Arc Network w/ Linear Costs
0.00 0.00
176.00 166.00
0.00 0.00
171.50 171.25
43 ............. ............. .... 1 ........................................................................................................ 4 .... ............. ... .. .................. 172.00 . .. ..... . ... ....... ... . ... .... .... .... ... . ... ... .... ... ... . . ... ... ... . ... ... . 31. ... ... ... . 114.00 ... 57 26 ... 26.00 . .. ... ... 62.00 . ... ... .... ... ... . .... ... ... . ... ... . ... ... ... . . ... . ...... ... .... ... ........... .. . . . . . . . . . ... .. ....... . . .............................................26 . . . ..... . . . .............................................. ..... 3 .. . . .....2 . . ............ ......
42 ............. ............. .... 1 ........................................................................................................ 4 .... ............. ................ 171.50 ............ ..... ..... . .. ....... ... .... ... .... ... .... .... ... .... . ... ... . .. . . ... ... . .... . ... ... . . . . ... ... . 28........ ... ... . 114.25 ... 57 28 ... 28.50 . ... 57.25 . ... ... . .. . . ... ... . .... . ... ... . . . . ... ... . ... . ... ... . ... . ... ... . ... . ... . ...... .... ...... ... .......... . . . . . . . . . . . ... .. ....... . . ..............................................28 . . . ..... . . . .............................................. ..... 3 .. . .....2 . . ............ ......
114.00 114.00
114.25 114.25
26.00
140.00 140.00
(a) Initial: max (π j - π j ) = 10.00
28.50
142.75 142.75
(b) Final: max (π j - π j ) = 0.25
j
j
Figure 2: Example 1: Initial and Final Flows, Costs & Potentials
3
2.2
Example 1: Four Nodes, Five Arcs and Linear Costs
Figure 1(a) presents the problem: a 4-node acyclic network with five one-way arcs, whose costs are posted on the arcs. For example arc (1,2)’s cost function is four times the flow on the arc, 4x14 . There is a flow of 100 originating at node 1 and terminating at node 4. (Algorithm B allows for any or all nodes to be destinations, but to keep this first example simple, we give it only one.) Figure 1(b) explains the legend later used in Figures 2–4: To the left of each arc ij is its flow xij , to the right of each arc is its cost cij (xij ), and posted at each node are the maxand min-path potentials, π j and π j respectively. Note the use of underlines for min-path data and overlines for max-path data. Dashed arcs are present, where possible, to highlight max paths: If there is a max path to a node, and the last arc on that path is not the same as the min path’s, then the arc appears dashed; otherwise, the arc appears solid. For example, we see in Figure 2(a) that the max path from the origin node 1 to node 4 is p = {1, 2, 4} costing cp = 114.00 + 62.00 = 176.00 = π 4 , while the min path is p = {1, 2, 3, 4} costing cp = 114.00 + 26.00 + 26.00 = 166.00 = π 4 . Figure 2(a) shows Algorithm B’s input arc flows x with associated arc costs c and initial potentials π and π. Each node’s min- and max-path predecessor arcs α and α are ascertained from the graph. For example, α4 = (3, 4) while α4 = (2, 4). Figure 2(a)’s subheading reports a maximum difference between the min- and max-path costs of 10.00 (node 4). Figure 2(b) presents Algorithm B’s solution, showing flows whose new arc times reduce this maximum cost differential to 0.25. Step 0 1 2 3
Label Shift
Arcs
3 3 2 3
0 1 1 -
0 3 3 -
Max ∆c 10.00000 1.00000 0.25000 0.25000
11
2
6
0.25000
Rel Gap
0.00104
0.03308
PR
t(x)dx 8584.00 8571.50 8571.43 8571.43 8571.43
Table 1: Example 1: Iteration Summary ( = 0.25) Table 1 summarizes the algorithm’s work to go from Figure 2(a) to Figure 2(b). The threshold value for path cost differences is given as = 0.25. Steps taken by the algorithm are AlgorithmB’s iteration count. This example executed two effective AlgorithmB iterations and each examined a single path. The first row of Table 1 shows that Algorithm B started with an initial flow with a max path-cost 4
differential of ∆c = 10, a relative gap of 0.0308, and a Beckmann function value of X Z xij cij (v)dv = 8584.00. f (x) = ij∈A
0
After an initialization (Step 0) and two iterations of AlgorithmB (Steps 1 and 2), the max path-cost differential, relative gap, and objective function each reduce to 0.25, 0.00104 and 8571.43, respectively. Notice that both ∆c and f (x) decrease monotonically. This is generally true for the latter; however, in some cases an iteration may momentarily increase the former. Of course, Algorithm B never actually computes a relative gap or a Beckmann function; their values appear here only for pedagogical purposes. Through all its iterations (3), AlgorithmB computes a total of 5 node labels (column 2), and 2 path-segment flow shifts (column 2) involving a total of 6 arcs (column 3). That is, each of 3 iteration averages 11/(3 × 4) = 0.92 node labels, 0.17 flow shifts, and involves 0.50 arcs per node. Termination (Step 3) merely labels all nodes (except the origin, whose labels are 0) with their final potentials and predecessor arcs.
62.00 52.00
57.00 57.00
.............. .... .................... ..... ..... .... 1 .......................................................................................................... 4 ....... ...................... ............. . . .. . ... ... . . .......... ... .... ........ .... .. . ... .... . . ... ... . .... ... .... ... ... . .... ... ... . . ... ... . 31.. ... ... ... 26 . ... ... 26.00 . . 62.00 ... ... . ... ... .... ... ... . .... ... ... . . ... ... . .. ... ... . . ...... . ... . . .... . .......................... ............................. . . . . . 26 .. .... ................. ....... ........ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... .......3 ....... . .........2 . . . ..................... ................... ..
0 0
26.00
.............. .... .................... ..... ..... .... 1 .......................................................................................................... 4 ....... ...................... ............. . . .. . ... . ... . . ........ ... .... ........ .... .. . ... .... . . ... ... . .... ... .... ... ... . .... ... ... . . ... ... . 28.. ... ... ... 28 . ... ... 28.50 . . 57.00 ... ... . ... ... .... ... ... . .... ... ... . . ... ... . .. ... ... . . ...... . ... . . .... . .......................... ............................. . . . . . 28 .. .... .................. ....... ........ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... .......3 ....... . .........2 . . . ..................... ................... ..
26.00 26.00
28.50
0 0
28.50 28.50
c(p) = 62.00, c(p) = 52.00
c(p) = 57.00, c(p) = 57.00
c(p) − c(p) = 10.00
c(p) − c(p) = 0.00
(a) Before
(b) After
p = {2,3,4}, p = {2,4} Figure 3: Step 1.1: Flows, Costs & Potentials
5
arc i j 2 3 3 4
x 26.00 26.00 total:
attributes c(x) 26.00 26.00 52.00
arc i j 2 4 - -
c’(x) 1.000 1.000 2.000
(a) Min Path: p (before) ∆x = arc i j 2 3 3 4
x 28.50 28.50 total:
cp − cp c0 p + c0 p
attributes c(x) 28.50 28.50 57.00
x 31.00 total:
attributes c(x) c’(x) 62.00 2.000 62.00 2.000
(b) Max Path: p (before) =
10.00 62.00 − 52.00 = = 2.5 2.000 + 2.000 4.00 arc i j 2 4 - -
c’(x) 1.000 1.000 2.000
(c) Min Path: p (after)
x 28.50 total:
attributes c(x) c’(x) 57.00 2.000 57.00 2.000
(d) Max Path: p (after)
Table 2: Example 1: Step 1.1: k = 2, j = 4: Flow-Shift Calculation How Algorithm B accomplished this is seen in Figures 3 and Table 2. At the outset, UpdateTrees has already marked every node with its min- and max-path potentials and predecessor arcs (Figure 2), and ShiftFlow has begun with the processing of node 4, the topologically last node. There, as indicated by Figure 3(a)’s doubly circled nodes, ShiftFlow discovers the min- and max-path segments p = {2, 3, 4} and p = {2, 4} whose flows are respectively x = 26.00 and x = 31.00. with corresponding costs differing by 10: cp = 52.00 and cp = 62.00. While both paths originally begin at node 1 and end at 4. The last node they have in common is node 2. Only their independent path segments from node 2 to node 4 concern ShiftFlow. (To unclutter the figure, potentials appear only at nodes on these segments, and the potentials posted are ‘grounded’ at the common node 2.) Figure 3(b) reveals that ShiftFlow moved ∆x = 2.5 units of flow path from p to path p. This flow shift decreased the cost on arc (2,4) from 62.00 to 57.00, while increasing the cost on arcs (2,3) and (3,4) from 26.00 to 28.50, which equalized the cost of the two path segments at cp = cp = 57.00. 6
0 0
172.00 171.00
57.00 57.00
........... ........... ....................... ....................... 43 ......... 1 ............ ....... ....... ....... ....... ....... ....... ............... 4 ....... ..................... ..................... . . ............ . . . 172.00 .... ............. ... ..... ......... ... .... ... ... ... . . ... . ... ... ... ... .... . . ... . ... .. . . ... . ... .. . . ... . ... ... . ... ... . 28....... ... ... . 114.00 .... 57 . ... . .. 57.00 . . ... ... . ... . ... ... . ... ... . ... . ... ... . ... . .. ... . . ... . .. ... . . ... . . ........ ...... ... . . . . .. . .. ........... ................................. . . . . . . . ........ 2 ......................................................................................................... 3 ... ............. ....................... .........
.................... ............. ....... ....... ..... 1 ........................................................................................................... 4 ....... . . .. ............. ................................. ... . . .. ... .... ......... ... . .. .... ... ... ... . . ... .... ... . ... ... . ... ... ... . . ... ... . 28.. .. ... ... 28 . . ... ... 28.50 . . 57.00 ... ... .. ... ... ... . ... ... . ... ... ... . . ... ... . .. ... ... .. .... . ... . . .... . .. ............................. . ................................. . . . ..............................................28 ....... ...... ....... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..... 3 ... .........2........... . . ........................... .................
114.00 114.00
28.50
0 0
28.50 28.50
c(p) = 172.00, c(p) = 171.00
c(p) = 57.00, c(p) = 57.00
c(p) − c(p) = 1.00
c(p) − c(p) = 0.00
(a) Before
(b) After p = {1,2,4}, p = {1,4}
Figure 4: Step = 2.1: Max-, Min-Paths, Flows, Costs & Potentials arc i j 1 2 2 4
x 57.00 28.50 total:
attributes c(x) 114.00 57.00 171.00
arc i j 1 4 - -
c’(x) 2.000 2.000 4.000
(a) Min Path: p (before) ∆x = arc i j 1 2 2 4
x 57.12 28.62 total:
cp − cp c0 p + c0 p
attributes c(x) 114.25 57.25 171.50
=
x 43.00 total:
attributes c(x) c’(x) 172.00 4.000 172.00 4.000
(b) Max Path: p (before) 1.00 172.00 − 171.00 = = 0.12 4.000 + 4.000 8.00 arc i j 1 4 - -
c’(x) 2.000 2.000 4.000
(c) Min Path: p (after)
x 42.88 total:
attributes c(x) c’(x) 171.50 4.000 171.50 4.000
(d) Max Path: p (after)
Table 2: Example 1: Step 2.1: k = 1, j = 4: Flow-Shift Calculation Allowing that the formula for ∆x will be derived in the next section, the precise details of Step 1.1’s processing appear in Table 2: i. Table 2(a) lists the min path’s arcs, showing for each the flow, cost, and derivative of its cost wrt flow, before shifting a flow increment of ∆x = 2.5 from the max path to the min path; 7
ii. Table 2(b) lists the same data as (a), but for the max path; iii. Tables 2(c) and (d) list the same data as (a) and (b) for the min and max paths after the flow shift. Upon completion of the flow shift, UpdateTrees recalculates the potential only for node 3—the only node topologically between 2 and 4. For added clarity, however, Figure 3(b) also includes the effective potential at node 4. As seen in Figure 4, Step 1 reduced the max path-cost differential from its initial value of 10.00 to its current value of 1.00 (node 4). At this point, Step 2.1 (Figure 4 and Table 3) begins. After it shifts a flow of 0.12 from the max-path segment p = {1, 4} to the min-path segment p = {1, 2, 4} these two segments have equal costs of 57.00. Upon completion of Step 2, we arrive at final answer given earlier in Figure 2, where the maximum difference between all max-min path pairs is 0.25. This satisfies the specified precision ( in Table 1) and completes Example 1. +1500
π1 π1
-500
............ 400 400 .............. .............. ..... ............................................................................... ............................................................................ . . ....2...... ....3...... .....1 ...... ...... ......... 9.00 9.00 ... ... ...... . . . .... .... .... .... .... .... ... ... .. ... ... ... . ... ... 9.00 ... 400 3.27 ... 200 400 ...... 9.00 .. ... ... ... ... .... ... ... .. ... . . ....... ....... .. .. ... . . . . . . . . . . . . . . .. ... .. ..... .. ........ . . 200 . . . ..... ...............................200 . . .............................................. 5 ........................................................................... 6 .... ....4.... . ............ ............. ........ ... ... . 3.27 3.27 .... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... .. 9.00 ...... 400 3.27 ...... 200 9.00 ....... 400 ..... ..... ..... .... .... .... ......... ......... ......... .... ... .... . ........... 400 ............ ............ ..... .................................9.00 ............................................. 8 ............................................................................. 9 .... ....7..... ............. ............. .....
400
-500
π2 π2
x
x c
π3 π3
............ 12 23 .............. .............. ..... ............................................................................... ............................................................................ . . .....2..... .....3..... .....1 ...... ...... ........ ... ... ...... 23 . . . .... .... .... .... .... .... ... ... .. ... ... ... . ... ... 14 ... 14 25 ... 25 63 ....... ... ... ... ... ..... ... ... .. ... ......... ........ 5 . . ... 4........ .. . . . . . . . . .. .. .. ..... .. ........ . . 56 . . . .... .....................................45 . . ....................................... 5 ......................................................................... 6 .... ... 4 .. . . . ............ ............. ............ ... ... . 45 56 .... ... ... . . ... .. 4 .... 5 . ... ... .... ... .... .... ... ... ... ... .. .. . . 47 ... 47 58 ... 58 69 ...... ..... ..... ..... .... .... .... .......... ......... .......... .... .... .... ............ 89 ............. ............. ..... ........................................87 ...................................... 8 ............................................................................. 9 .... .....7..... ............. ............. .....
c
x
π
9.00
π
x
π7 π7
-500 o
(a) Capacity (k) and Free-Flow Cost (c )
x
π
x c
π c
c
c
c x87
x
π6
x c
x
π6
c
x c89
π8 π8 (b) Legend
c63
x69
π9 π9
c(x) = co (1 + 0.25( kx )4 ) Figure 5: Example 2: Nine-Node, Twelve-Arc Network w/ Nonlinear Costs 2.3
Example 2: Nine Nodes, Twelve Arcs and Nonlinear Costs
Figures 5 and 6 describes a slightly larger but more interesting problem and solution. In it, 1500 trips leave the origin node (1) distributing themselves equally 8
among four destination nodes (3, 7 and 9). The arc cost function is the everpopular BPR formula (Horowitz 1991) in the rectangle in Figure 5. 0.00 0.00
.... .... .... 484 717 ..... ..... ..... ..... ..... ..... .... 1 ............................................................................. 2 ........................................................................... 3 ... .............. .............. .............. . ... ... 11.89 22.96 .... ... ... ..... ..... ..... ... ... .. ... ... ... ... .. 28.79 ...... 782 4.18 ...... 233 15 ... 9.00 . ... ... .... .... .. .. .. .. ...... ........ .... 34.02 28.79........ ..... 38.57 ...... . . ..... . . . . .. ..... . . . . . . . . . 282 253 .. .. . .. .. .... ......... ....... ....... ....... ....... ............ 5 ............................................................................ 6 ..... . .....4 . . . . . . . . . ........ .......... ...... 5.23 4.55 ... ... ... ... 27.15 ... 31.70 28.79 ..... ... ... .... ... ... ... ... ... ... ... ... ... ... . 12.30 .... 500 4.72 .... 262 9.17 ...... 238 ... ... ... .... .... .... ... ... .... ....... ......... . ........ .... ... . ..... ...... . . . . . . . . . . . . . . . . . . . . . . . . . .. 262 9.00 ..... ................................................................................ .......... ....... ....... ....... ....... ............. .... . . . .....7 .....8 .....9 ........ ........ ........
22.96 22.96
47.57 34.86
0.00 0.00
.... .... .... 500 750 ..... ..... ..... ..... ..... ..... .... 1 ............................................................................. 2 ........................................................................... 3 ... .............. .............. .............. ... ... 12.30 25.69 .... ... ... ....... .... .... .... .... .... ... ... ... ... ... ... ... . . ... 9.00 25.69 .... 749 4.47 .... 250 ... .... .... ... ... ... ... ... ... ... .... ...... ... 34.63 .... 30.16 25.69........ ..... ...... . . . . . . ... .. ..... . . . . . . . . . ................ ...............................250 .............. .... .............................249 .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....5..... ....6..... . .....4 . . . ........ ........ ...... 4.47 4.47 ... ... ... ... 30.16 ... 34.63 25.69 ..... ... ... .... ... ... ... ... ... ... ... ... ... ... . 12.30 .... 500 4.47 .... 249 9.21 ...... 250 ... ... ... .... .... .... ... ... .... ....... ......... . ........ .... ... ..... ...... . . . . . . . . . . . . . . . . . . . . . . . . . .. 249 9.00 ..... ................................................................................ ................................................................................ .... . . . .....7 .....8 .....9 ........ ........ ........
25.69 25.69
41.08 40.86
38.74 31.86
37.98 37.98
34.63 34.63
9.25
47.98 40.87
(a) Initial: max (π j - π j ) = 12.71
37.98 37.98
9.21
43.83 43.83
(b) Final: max (π j - π j ) = 0.00
j
j
Figure 6: Example 2: Initial and Final Flow, Costs & Potentials Initial and final states, in Figures 6(a) and 6(b), show that the max cost differential falls from 12.71 to 0.00. Table 4 reveals that Algorithm B finished in 3 iterations, requiring a total of 8 flows shifted and 36 nodes labeled; i.e., each iteration labeled each of the networks 9 nodes and shifted flow an average of 2.222 and 0.296 times, respectively. n 0 1 2 3
Label Shift
Arcs
8 25 18 9
0 4 3 1
0 20 12 4
Max ∆c 12.70858 5.87220 0.02591 0.00000
60
8
36
0.00000
PR
Rel Gap 0.03651 -
t(x)dx 36402.558 36206.794 36197.861 36197.854
0.00000
36197.854
Average/node/iteration: label = 2.222 shift = 0.296 (paths = 0.592) Table 4: Example 2: Iteration Summary ( = 0.001)
9
3
Algorithm Design
This section presents an annotated detailed technical design of Algorithm B. It begins with a broad-brush decomposition into nine procedures and ends with pseudo code and comments for each. ..................................................................................................... ... ... ... ... ... .... . .. 14 ...... .... ..............................................................................................
AlgorithmB
.............................................................................................. .... ... ... ... ... ... ... ... . ... 11 ...... ... ..............................................................................................
UpdateTrees
.............................................................................................. .... ... ... ... ... ... ... ... . ... 13 ...... ... ..............................................................................................
.............................................................................................. .... ... ... ... ... ... ... ... . ... 12 ...... ... ..............................................................................................
.............................................................................................. .... ... ... ... ... ... ... ... . ... 10 ...... ... ..............................................................................................
GetBranchNode
ShiftFlow
EqualizePathCost
.............................................................................................. .... ... ... ... ... ... ... ... ... 9 ...... ... ..............................................................................................
GetDeltaXandC
.............................................................................................. .... ... ... ... ... ... ... ... . ... 11 ...... ... ..............................................................................................
UpdateTrees
.............................................................................................. .... ... ... ... ... ... ... ... ... 8 ...... ... ..............................................................................................
UpdatePathFlow
.............................................................................................. .... ... ... ... ... ... ... ... ... ... .. ... ...............................................................................................
ArcCost
.............................................................................................. .... ... ... ... ... ... ... ... ... ... .. ... ...............................................................................................
ArcDerivative
Figure 7: Algorithm B Architecture (Call Tree) 3.1
Overview
Figure 7 shows all nine procedures and their interrelationship: A procedure connects to another below it if the former calls the latter. The integer is the number of the figure containing its design. From the top down: i. AglorithmB [14]9 is the main procedure. It iteratively invokes two procedures, UpdateTrees to price paths and ShiftFlow to swap flow between paths, until the maximum difference ∆c between any max- and min-path cost drops to a given level . ii. UpdateTrees [11] puts max- and min-path potentials (π and π), and predecessor labels ( α and α) on a given subset of nodes. Both AlgorithmB and EqualizeCost invoke it, the former to initialize these labels and the latter to update them in accordance with revised arc flows (xij ). 9 To reference a procedure’s defining figure’s number, we enclose it in square brackets. To reference one or more line numbers in its algorithm’s code, we add a dot followed by the line-number(s); e.g., [14.3–5] refers to lines 3 through 5 in Figure 14, the figure defining AlgorithmB.
10
iii. ShiftFlow [13] manages the discovery of arc-independent max and min paths (p and p) to each node j and the transfer of flow between those paths to equalize their costs c and c. It uses three other procedures , GetBranchNode, EqualizeCost and UpdateTrees, who to do all the work. iv. GetBranchNode [12] delivers the start node k, the only node p and p have in common except their shared end node j. v. EqualizeCost [10] subtracts the right amount of flow from p to add to p to make c equal c. To accomplish this, it uses Newton’s method with the help of GetDeltaXandC and UpdatePathFlow. vi. GetDeltXandC [9] delivers an increment of flow ∆x and the current max- and min-path cost difference ∆c = c − c. vii. UpdatePathFlow [8] add (or subtracts) a flow increment ∆x to all arcs ij on a given path and updates those arcs’ costs and derivatives in accordance with their new flow (xij ± ∆x). It invokes ArcCost and ArcDerivative to fetch the updated arc costs and derivatives. viii. ArcCost and ArcDerivative provide the cost cij (xij ) and derivative c0ij (xij ) of a given arc ij at a given flow xij . The sequel defines and describes all the above in turn and in detail, from the bottom up. 3.2
ArcCost and ArcDerivative
Specific to a particular model instance, the procedures ArcCost and ArcDerivative are user-provided real-valued call-back functions. The first must return positive values; the second, nonnegative. UpdatePathFlow [8.7–8] invokes them using the following protocal: cij ← ArcCost( ij, xij ) c0ij ← ArcDerivative(ij, xij ) where ij is an arc and xij its flow. In the case of Example 1 above, they return cij (xij ) = aij xi j and c0ij (xij ) = aij where aij is a positive scalar, specific to each arc ij, and given in Figure 1(a). In the case of Example 2, they return cij (xij ) = coij (1 + 0.25(
x3 xij 4 ) ) and c0ij (xij ) = coij ij 4 kij kij
where the free-flow cost coij and the practical capacity kij are specific to each link ij, as given in Figure 5(a). 11
procedure UpdatePathFlow ( ∆x, k, j, α ) → ( xp , cp , c0p ) input ∆x amount of flow to add to path p—a scalar k start node node of path to j j end node of path α node predecessor-arc array output xp path p’s revised total flow cp path p’s revised cost 0 cp path p’s revised cost derivative local ij arc being processed = (i, j) algorithm 1. (xp , cp , c0p ) ← (∞, 0, 0) 2. i ← j 3. while i 6= k do 4. ij ← αi 5. xij ← xij + ∆x 6. xp ← min(xp , xij ) 7. (cij , c0ij ) ← (ArcCost( ij, xij ), ArcDerivative(ij, xij )) 8. (cp , c0p ) ← (cp + cij , c0p + c0ij ) 9. return ( xp , cp , c0p ). Figure 8: Path-Flow Updater 3.3
UpdatePathFlow [8]
Input for UpdatePathFlow includes a path’s flow increment ∆x, start node k, end node j, and min- or max-path predecessor-arc array α. Tracing back through predecessor arcs, UpdateFlow adds ∆x to each arc on the path from j back to k. Depending on ∆x’s sign, it reduces or increases a path’s flow. Which path is affected depends on which predecessor array, α or α, that EqualizeCost [10.3–4] specifies. Besides updating the flow on each arc in the path, it computes and returns the maximum arc flow xp on the path [8.6] and the sums cp and c0p of the path’s arc costs and derivatives [8.7–9].
12
procedure GetDeltaXandC ( x, x, c, c, c0 , c0 ) → (∆x, ∆c) input x, x total flow on min, max path from k to j c, c max-, min-path costs c0 , c0 max-, min-path cost derivatives algorithm 1. ∆x ← if c < c then x else x 2. if ∆x ≤ 0 then return(0, 0) 3. if c0 + c0 ≤ 0 then 4. ∆x ← c ≤ c then x else −x 5. else c−c ) ∆x ← min( ∆x, 0 6. c + c0 7. return (∆x, |c − c|). Figure 9: Flow and Cost Differentials Calculator 3.4
GetDeltaXandC [9]
Invoked by EqualizeCost [10.1,5], GetDeltaXandC receives flows (x, x), costs (c, c), and derivatives (c0 , c0 ) of the min and max path. It returns the cost difference ∆c and flow increment ∆x. ∆c is used by EqualizeCost to test for termination in Newton’s method, and ∆x is the amount it increments a path’s flow in one iteration. Since while iterating, EqualizeCost may occasionally overshoot the min path’s optimal flow before converging there, the min path may itermediately experience flow reduction. This happens when ∆c is negative, and GetDeltaXandC [9.1] chooses which path is to lose flow accordingly. GetDeltaXandF [9.2] returns ∆x and ∆c with zeros when ∆x is nonpositive: there is no flow left to remove. Otherwise, if the derivatives sum has vanished, then it sets ∆x to the entire flow on the max path: if adding flow has no effect on the path cost, then all flow goes on the cheapest path. Finally, the typical case [9.6]: If there is flow to shift and the derivatives sum is not zero, the flow increment becomes either all the flow on the costly path or the ratio of the cost difference to the derivative sum, whichever is smallest (as justified in Section 4.2 below). Note that the former takes all the flow from the max path to put on the min path, while the latter would immediately equalize the two path costs were all arc cost functions linear.
13
procedure EqualizeCost( k, j, x, x, c, c, c0 , c0 , λ) input k, j first and last nodes of max and min path segments x, x total flow on min, max path from k to j c, c max-, min-path costs c0 , c0 max-, min-path cost derivatives λ expansion factor for ∆c import upper bound on max-min path cost differential—a scalar α, α nodes-length min-, max-path predecessor arc arrays local ∆x flow to add to min path and subtract from max path ∆c difference between max- and min-path cost algorithm 1. (∆x, ∆c) ← GetDeltaXandC (x, x, c, c, c0 , c0 ) 2. while < λ ∆c do 3. (x, c, c0 ) ← UpdatePathFlow (+∆x, k, j, α) 4. (x, c, c0 ) ← UpdatePathFlow (−∆x, k, j, α) 5. (∆x, ∆c) ← GetDeltaXandC (x, x, c, c, c0 , c0 ) 6. return Figure 10: Path Cost Equalizer
3.5
EqualizeCost [10]
EqualizeCost is the mainline in applying Newton’s method to equalize the cost of the two arc-independent coterminal min- and max-path segments p and p. It ensures that the correct amount of flow switches from p to p. Called by ShiftFlow [10.5], it receives the paths’ start and end nodes k and j, together with their flows (x, x), costs (c, c), and derivatives (c0 , c0 ) as arguments. Additionally, it imports the two node-length arrays α and α, containing a predecessor arc for each node in the min and max path respectively. These latter arrays are instantiated and exported by AlgorithmB, and UpdateTrees maintains them. EqualizeCost just ‘manages,’ while GetDeltaXandC [9] and UpdatePathFlow [8] do all the thinking. It merely continues having UpdatePathFlow add ∆x to the 14
min path and subtract it from the max path until λ times the path-cost difference ∆c, drops below . The expansion factor λ turns the cost difference of a path segment into an estimate for an entire origin-destination path. An entire o-d path can contain more than one of these arc-independent segments; therefore, if the former is to be smaller than , the error in each of the latter must be considerably less than . λ0 s is computed in GetBranchNode [12.13]. Its formulation appears in Section ??.
procedure UpdateTrees (k, n) → ∆c input k exclusive lower bound on nodes to label n exclusive upper bound on nodes to label output ∆c maximum difference of max- and min-path cost import A set of arcs in acyclic network π, π nodes-length min-, max-path potential arrays α, α nodes-length min-, max-path predecessor arc arrays local i, j i- and j-node of current arc ij algorithm 1. (∆c, π o , αo ) ← (0, 0, −1) 2. for j ∈ {k + 1, k + 2, . . . , n − 1} do 3. (π j , π j , αj , αj ) ← (∞, −∞, 0, 0) 4. for ij ∈ A do 5. if π i + cij < π j then 6. ( π j , αj ) ← (π i + cij , ij ) 7. if αi 6= 0 and xij 6= 0 and π i + cij > π j then 8. ( π j , αj ) ← ( π i + cij , ij ) 9. if αj 6= 0 then ∆c ←max( π − π, ∆c) 10. return(∆c). Figure 11: UpdateTrees: Node Processing: Potentials Calculation
15
3.6
UpdateTrees [11]
UpdateTrees maintains potentials (π, π) and predecessor-arc arrays (α, α) for both min- and max-path trees. It imports these four arrays, along with the network’s arc set A. all of which are exported by the mainline procedure AlgorithmB. Called by AlgorithmB [14.4] and ShiftFlow [13.6], it assumes that the network is a connected and acyclic, and that the node numbers are compact, in topological sequence, and begin with 1 (the origin node). It assumes also that nodes 1 to k already have correct min- and max-path potentials and predecessor arcs. These assumptions and the validity of the loop invariant, that all nodes prior to j have correct labels, verify the procedure’s correctness. Walking the network’s j-nodes in forward topological order, UpdateTrees examines each node’s in-star for its optimizing arc. The min-path part [11.6–7] is standard fare. The max-path part [11.8–9] ensures that the max path has flow. While all nodes have a min path—the network is connected, a node may not have a max path. UpdateTrees marks a node missing a max path by setting its predecessor arc to null. UpdateTrees visits only a subset of nodes—those topologically between input parameters k and n, exclusive. Only when the input parameters k and n are 1 and the highest node number plus 1, respectively, do all nodes receive labels. Note that when n is not greater than the number of nodes, labels for nodes greater or equal to n remain unchanged and probably incorrect; however, this does not impact AlgorithB’s validity. See ShiftFlow [13]. UpdateTrees returns the maximum difference between a max-path and min-path cost, accurate only when all nodes receive labels. 3.7
GetBranchNode [12]
GetBranchNode’s main task is finding k, the last node that the cheapest and costliest paths p, and p have in common before reaching node j. It returns k along with three data for each path: x = min xij ij∈p
c=
X
cij
and
x = min xij
(flow on the path)
and
c=
X
cij
(cost of the path)
c0ij .
(cost derivative of the path).
ij∈p
ij∈p
c0 =
X ij∈p
ij∈p
c0ij
and
c0 =
X ij∈p
GetBranchNode counts arcs on each path segement in order to compute λ, an expansion factor that transforms this cost difference into an estimate of that for a complete o-d path. (See Section ?? for details regarding λ.) Upon conclusion [12.12–13], if the factored cost differential is small enough to ignore, ∆c < , it returns k as zero. 16
procedure GetBranchNode (j) → (k, x, x, c, c c0 , c0 ; λ) input j terminal common node of max and min path j output k penultimate common node of max and min path to j x, x total flow on min, max path from k to j c, c max-, min-path costs c0 , c0 max-, min-path cost derivatives λ expansion factor for ∆c import c m upper bound on number of arcs on a path—a scalar α, α nodes-length min-, max-path predecessor arc arrays local m, m number of arcs on max, min-path ij, ij an arc in min, max path from k to node j algorithm 1. (ij, ij) ← (αj , αj ) 2. (x, x, c, c, c0 , c0 , m, m ) ← (xij , xij , cij , cij , c0ij , c0ij , 1, 1) 3. while i 6= i do 4. while i < i do 5. ij ← αi 6. x ← min (x, xij ) 7. (c, c0 , m) ← ( c + cij , c0 + c0ij , m + 1) 8. while i < i do 9. ij ← αi 10. x ← min (x, xij ) 11. (c, c0 , m) ← ( c + cij , c0 + c0ij , m + 1) c− max (m, m)/2). 12. λ ← 1+ floor ((m 13. k ← if λ (c − c) < then 0 else i 14. return ( k, x, x, c, c, c,0 c0 , λ). Figure 12: Branch-Node Detection
17
GetBranchNode locates the common node k by tracing each path back from j via its predecessor arc αj or αj . To preclude visiting extraneous nodes, it traces nodes in descending sort wrt their min-path potential10 All the above outputs are computed during its short walk to the branch node k. procedure ShiftFlow() → kb output kb furthest upstream branch-node k import π, π nodes-length min-, max-path potential arrays α, α nodes-length min-, max-path predecessor arc arrays local j terminal common node of min and max paths k penultimate common node of max and min path to j x, x total flow on min and max path from k to j c, c max- and min-path costs c0 , c0 max- and min-path cost derivatives λ expansion factor for ∆c algorithm 1. for j ∈ (n, n − 1, . . . , 2) do 2. if αj and π j < π j then 3. ( k. x, x, c, c, c0 , c0 , λ) ← GetBranchNode (j) 4. if 0 < k then 5. EqualizeCost ( k, j, x, x, c, c, c0 , c0 , λ) 6. RelabelNodes ( k, j) 7. kb ← k b 8. return (k). Figure 13: Path Flow Shifter11 3.8
ShiftFlow [13]
ShiftFlow is another ‘manager,’ doing nothing but looping through all the nodes (except the origin) in reverse topological order, while calling other procedures to 10 My
friend Mike Ball taught me this trick. The expansion factor λ was removed from B’s design early on.
11 Errata:
18
do the work. It makes one sweep at equalizing paths from the origin to all other nodes, processing only nodes whose max-path potential π j is greater than its minpath potential π j . For these nodes, it lets GetBranchNode and EquilizeCost do the thinking. The former returns the two paths’ last shared node k prior to j, plus other, respective path parameters EqualizeCost needs to make both path segments from k to j have the same cost. When GetBranchNode[12.12-13] returns k as zero, it is telling ShiftFlow that the difference between the two costs is already sufficiently small. The max-path’s segment is never smaller than the min path’s, c > c; otherwise π j could be reduced or π j increased! Also, the cost of the two path segments can be equal even though the costs their parent o-d max and min paths are unequal; while the converse is not true. That is, < π j − π j 6⇒ < c − c while > π j − π j ⇒ > c − c. After equalizing path segments to node j, ShiftFlow calls UpdateTrees to correct the labels of nodes between k and j, exclusive: • the reason for not correcting labels at nodes 1, 2, . . . , k, is that they will not have changed: all the arcs with altered flows lie downstream from k; • the reason for not correcting labels for nodes j, j + 1, . . . , n is that none of them will be referenced before ShiftFlow returns to AlgorithmB[14]. Upon ShiftFlow’s return, AlgorithmB will call UdateTrees to update all nodes below kb the highest upstream node that ShiftFlow involved in a flow change. Thus, every entry into ShiftFlow arrives with all node labels being correct. 3.9
AlgorithmB [14]
Like most good mainline procedures, AlgorithmB merely decomposes its chore into tasks for subordinate procedures and monitors their progress. Inputs are the acyclic network’s arc set A, its highest node number nhat, and its arc cost and derivative arrays c and c0 . In addition it receives an initial flow vector x and an upper bound on the maximum tolerable max-min cost differential. The arc-flow vector x serves as both input and output, being updated in situ with flows approaching equilibrium. The node potential vectors π and π hold the costs of the cheapest and costliest path to each node, and the arrays α and α hold the corresponding node-predecessor arcs. All four arrays are maintained by UpdateTrees. The value of ∆c, set by UpdateTrees, gives the current maximum difference between π j and π j over all nodes j. The value of kb is the lowest node number that ShiftFlow involved in a flow change; i.e., min- and max-cost b trees requires no updates at nodes 1, 2, . . . , ...k.
19
c, ) → ( x, ∆c) procedure AlgorithmB (A, n; x, c, c0 , m input A set of arcs in acyclic network n highest node number (topologically ordered nodes) 0 c, c arcs-length cost and derivatives arrays x initial arc-flow vector c m upper bound on number of arcs on a path—a scalar upper bound on max-min path cost differential—a scalar output x equilibrium arc-flow vector ∆c maximum of min- and max-path cost differences local π, π nodes-length min-, max-path potential arrays α, α nodes-length min-, max-path predecessor arc arrays kb furthest upstream branch-node algorithm c, ) 1. export(A, n; x, c, c0 , π, π, α, α, m 2. ∆c ← UpdateTrees (1, n + 1) 3. while < ∆c do 4. kb ← ShiftFlow() b n + 1) 5. ∆c ←UpdateTrees (k, 6. return (x, ∆c ).
Figure 14: Algorithm B Main Line
AlgorithmB loops through calls to UpdateTrees and ShiftFlow until all maxand min-path costs are within of each other. Clearly, if the input is kosher and these two procedures do their job, then AlgorithB is correct. That is, when its preconditions are satisfied, so will be its postconditions:
20
i. Preconditions. The network is acyclic, i.e., contains no path that loops back on itself, and has a single origin node. Furthermore, nodes are identified by c, and the origin a unique integer ranging from 1 to the number of nodes m node is 1. All the arc cost function cij () are positive, nondecreasing, and twice differentiable, while its derivative c0ij is nonnegative. The upper bound is greater than zero. ii. Postconditions. The final flow x is feasible, and for every node j in the network, the difference between the cost of any used path from 1 to any node j is within of the cost of the cheapest path from 1 to j. iii. Loop Invariant. Flows remain feasible, potentials are correct, and kb and ∆c are as described above. iv. Termination. The set of feasible flows is compact. Beckmann function reduces with each iteration, and it is bounded below at a flow for which ∆c = 0; therefore, AlgorithmB terminates. For formal proofs of the less obvious of the above claims, see Section 4. 3.10
Example 2 Procedure Trace
Knowing now the exact of Algorithm B’, we may observe its behavior in greater detail. Recall Example 2 in Section 2, the 9-node example shown in Figure 5, whose processing is summarized in Table 4. The max cost differential ∆c reduced from 12.70858 to 0.00000 in 3 iterations, requiring a grand total of 60 node labels and 8 flow shifts. Table 5 below decomposes these data into procedure calls, showing the impact of each and the path-terminating nodes involved. For example, iteration 2 in Steps 2.1 to 2.3 shifted flow on three paths, whose (k, j) terminal node pairs were (5,9), (4,9) and (1,5), reducing ∆c to 5.721, 0.026 and 0.000 respectively. The column headed ‘m’ contains the number of Newton iterations, which was always 2 except in case of iterations 2.3 and 3.1, when it was only 1.
21
Step Algorithm 1.0 1.1
1.2
1.3
1.4 2.0 2.1
2.2
2.3 3.0 3.1 4.0
UpdateTrees GetBranchNode ShiftFlow UpdateTrees GetBranchNode ShiftFlow UpdateTrees GetBranchNode ShiftFlow UpdateTrees GetBranchNode ShiftFlow UpdateTrees UpdateTrees GetBranchNode ShiftFlow UpdateTrees GetBranchNode ShiftFlow UpdateTrees GetBranchNode ShiftFlow UpdateTrees UpdateTrees GetBranchNode ShiftFlow UpdateTrees UpdateTrees
k
j Label Shift Arcs Its
1 5 5 1 1 3 1 1 5 1 1 1 5 5 4 4 1 1 1 5 5 5
9 9 9 7 7 7 3 3 5 5 0 9 9 9 7 9 7 5 5 5 0 9 9 9 0
8 4 6 5 2 8 4 4 2 8 4 5
1 1 1 1 1 1 1 1 -
Total:
50
8
4 6 6 4 4 4 4 4 -
2 2 2 2 2 2 1 1 -
∆x
∆c
10.178 5.399 31.972 30.872 14.976 1.349 0.242 1.153 -
12.709 0.248 12.814 0.326 12.572 12.572 3.348 3.348 0.000 5.872 0.339 5.721 5.721 0.026 0.026 0.000 0.026 0.026 0.000 0.000
PR
c(x)dx
36402.558 36401.927 36401.706 36232.618 36206.794 36205.525 36197.863 36197.861 36197.854 36197.854
36 14
Table 5: Example 2: Algorithm Trace
4
Formalities
That Algorithm B constitutes a valid approach to solving the traffic equilibrium problem appears self-evident: It equalizes the cost of the cheapest and costliest used paths; thus, the cost of all used paths is cheapest: It achieves a user-equilibrium. At the risk of appearing precious, this section gives proofs of the correctness of B’s most important calculations. Nothing in this section depends on the network being acyclic. 22
4.1
Convergence
Referring to the Beckmann’s formulation we prove convergence and derive GetDeltaXandC’s procedure for computing for ∆x. Theorem. If all arc cost functions cij () are nondecreasing and twice differentiable, and a path’s cost is the sum of its arcs’ cost, then Algorithm B converges to a user-equilibrium flow. That is, the flow vector it computes approaches ∗
x ∈ arg min f (x) = x∈X
xij X Z
cij (v) dv.
(1)
ij∈A 0
where X is the set of all feasible traffic assignments. Proof. As for showing feasibility (x ∈ X), the algorithm begins with a feasible flow and leaves it that way after every flow change. That is, the node flows are invariant and the arc flows stay nonnegative: i. Node Flows. Upon equalizing path costs, the algorithm leaves node flows unchanged. At nodes strictly between the common start and end nodes k and j, UpdatePathFlow adds the same ±∆x to both its incoming and outgoing arcs. At the paths’ end nodes themselves, this invariance holds as well. On the longer path, ±∆x is subtracted from its arcs out of k and into j, while the same amount is added to its arcs out of k and into j. ii. Nonnegativity. All arc flows remain nonnegative. The path that gains flow certainly keeps all its arcs’ flow nonnegative, and in GetDeltaXandC [9.6], the assignment c−c ) ∆x ← min( ∆x, 0 c + c0 assures that the path losing flow loses no more than that on its arc with the lowest flow. As for showing optimality, the algorithm converges on x∗ because the feasible set X is closed and bounded, the objective function (1) is convex, and it decreases each time the algorithm equalizes a pair of min- and max-path costs. The first two assertions are is well known; the last is easy to prove. Let x be the flow vector before path-cost equalization and let p and p be the (arc-independent) path pair being equalized. Because p and p share no arcs, the objective readily decomposes into three terms, revealing its separable dependence on the flows on link composing these paths: f (x) = min x∈X
xij X Z
cij (v) dv +
(ij)∈p 0
xij X Z
cij (v) dv +
(ij)∈p 0
23
X
Zxij
ij∈A\(p ∪ p) 0
cij (v) dv.
(2)
Since flow change only on arcs in p and p, value of f (x) depends only on the flow on these two, which in turn depends solely on ∆x. As mentioned earlier, to assure that flows resulting from path-cost equalization remain nonnegative: xij −∆x ≥ 0 for (ij) ∈ p, we let x = min xij ij∈p
and constrain ∆x such that 0 ≤ ∆x ≤ x. The minimization subproblem (2) localizes to finding ∆ x∗
∈ arg min g(∆x) = 0≤∆x≤x
xijZ+∆x
X
cij (v) dv +
(ij)∈p
xijZ−∆x
X
cij (v) dv.
(ij)∈p
0
(3)
0
Because f () is convex, minimizing g() wrt ∆x assures descent from f (x) whenever ∆x∗ > 0. The derivative of g(∆x) is g 0 (∆x) =
X
cij (xij + ∆x) −
X
cij (xij − ∆x)
ij∈p
(ij)∈p def
= c(x + ∆x) − c(x − ∆x)
where c(x) and c(x) are the costs of paths p and p at arc flow x. Therefore, g()’s minimum occurs at ∆x∗ ∈ [0, x] whenever: ∆x ∗
= 0 ⇒ c(x + ∆x∗ ) ≥ c(x − ∆x∗ ) ∆x∗ = x ⇒ c(x + ∆x∗ ) ≤ c(x − ∆x∗ ) 0 < ∆x∗ < x ⇒ c(x + ∆x∗ ) = c(x − ∆x∗ ).
(4) (5) (6)
Assertions (4–6) state formally a patently intuitive result: path costs are made equal if possible, and if not, then the resultant cheapest path’s flow is increased by the maximum amount. Algorithm B does exactly that. 4.2
Flow Increment: ∆X
Algorithm B, or more specifically ShiftFlow (Figure 13), uses Newton’s method to solve (4–6). The path-cost difference and it first-order approximation are: c(xij + ∆x) − c(xij − ∆x) =
X
c(xij + ∆x) −
ij∈p
≈
X
c(xij ) +
X
c(xij − ∆x)
ij∈p
c0ij (xij )∆x
ij∈p
−
X
c(xij ) −
ij∈p
24
c0ij (xij )∆x
.
(7)
For brevity let cp =
X
cij (xij )
and
c0p =
ij∈p
X
c0ij (xij )
ij∈p
then setting approximation (7) to zero and solving for ∆x yields ∆x
=
cp − cp . c0p + c0p
(8)
Accordingly, OptimizeCost (Figure 10) iterates xij ← xij + ∆x for xij ∈ p xij ← xij − ∆x for xij ∈ p until the two path flows converge at a point where the path-cost difference they induce is no larger than the given tolerance .
5
Summary and Concluding Remarks
While research on alternative approaches continues (Heydecker al 1999) and (Sobranski 1999), virtually all traffic equilibrium algorithms in practice apply generalpurpose algorithm to our specific problem. Most notable is the ubiquitous FrankWolfe approach and failed attempts to speed up its glacial rate of convergence. This paper presents a novel traffic assignment algorithm, designed in detail sufficient for formal verification and efficient implementation. Called B, the algorithm’s simple approach is intuitive, demonstrably correct, time and space efficient, and boasts excellent convergence properties. It can equilibrium flows to mear arbitrary accuracy, regardless of the level of congestion or the size of the network. Remarkably, although path-based, Algorithm B neither enumerates nor stores paths. 5.1
Summary
Algorithm B’s approach to finding equilibrium flows is combinatorial and direct: It moves flow from costliest paths to cheapest paths until all used paths’ costs are within of their cheapest path. It makes this simple approach practical by restricting attention to a relatively small number of path segments restricted to an origin-node invariant acylic network. Because processing acylic networks is much, much faster than general networks, B easily achieves sharp user-equilibrium flows in any network, no matter how large or congested—given a proper initial solution. 5.2
Further Research
Some areas ripe for further research include large-scale testing, algorithm refinement, and application of B to models other than traffic assignment. 25
Large-Scale Testing. The next logical step is to write some code and subject Algorithm B to strenuous testing on several large networks, and report statistics comparing its performance with Frank-Wolfe’s. Regrettably, this was beyond the budget constraints of this present effort. Algorithm Improvements. Besides testing B, there is making it more efficient. Several opportunities present themselves. For example, A network pruning preprocess could be very advantageous. Road network’s average out-degree is less than 3; therefore, Ao will have nodes whose in- and out-degree is one. These nodes can be removed by fusing the arcs and reformulating their cost and derivative functions. More important, many very large networks have extraneous arcs in Ao , which do not lie on any path from the origin o to any sink node. A one-time, simple backward-pass algorithm can detect and remove them to speed up the entire process. Refinements are possible to reduce the number of nodes UpdateTrees [11] labels and the number of times ShiftFlow [13] runs. UpdateTrees labels an entire annulus of nodes, when it should only label a wedge. ShiftFlow wastes time with path pairs whose cost difference may be tiny difference compared to others upstream. Here, scaling might help: Path pairs could be processed in descending order of the magnitude of their cost differential. Other Applications. Algorithm B is more robust than this paper suggests. For example, in the very important practical case of turn costs, i.e., costs associated with adjacent arc pairs; a rote-copy model of the street network would violate the additivity assumption. However, as is rather well known, the simple reinterpretation of the street’s arcs as the model’s nodes, and the street’s turns as the model’s arcs, the problem falls into B’s domain. In addition, B expeditiously serves the need of planners to assess the impacts of moderate changes to arc costs and/or o-d demand. In the former case, the cost functions are updated and B re-equilibrates from the warm start of its prior flows (xo ). In the latter, an all-or-nothing assignment effects a flow change to the existing solution, and then B re-equilibrates. Whenever the cost and demand updates leave the subnetworks (Ao ) with same topology, the new equilibrium arc flows compute very quickly. Also, as will be shown in a future article (Dial 1999d), it is readily modified to compute equilibrium for a logit traffic assignment; and it seems suited for dynamic traffic assignments (Friesz al). In ShiftFlow and UpdateTrees there is an implicit backward and forward movement through time. Picture B shifting vectors of flows among max- and min-cost paths within a time slice in which trees are invariant. Finally, B can solve any non-linear network optimization—provided path costs are arc-additive, arc flows are unbounded, and arc costs are nondecreasing and differentiable. Lagrangian relaxation techniques (Bertsekas 1995), which bring complicating constraints up into the objective function, may in instances bring 26
new problems inside B’s application domain. 5.3
Relationship to Other Work
Inspiration for Algorithm B came from three sources. First was a conversation with Terry Friesz, who told me that I could never depend on FW to converge, and that when the going got flat, it was time to change horses. The first new horse was simplicial decomposition using a nonlinear complementarity model of the master problem (Dial 1999a); it tailed later than FW, but tailed nevertheless. Algorithm B is a newer horse—without a tail. Second were presentations by R. Jayrakrishnan (Jayrakrishnan et al) and Fabien Laurent (tbd) at the Transportation Research Board’s annual meeting in 1994 and ’95. Jayrakrishnan gave me the idea of using Newton’s method on path flows; he credited Bertsekas (1976) his own source for it. While his implementation does use Newton’s method to shift flows, it does not find and maintain path data with the speed and efficiency of Algorithm B, being unaware of applicability of acyclic networks. What helped awake me to acyclic networks was Laurent’s research in logit assignment. Laurent reported that equilibrium arrived lickety split when he kept the “bush”—an acyclic network—fixed. He did not, however, suggest a means for finding the proper bush. Third are two of my own researches. My ancient discovery of “Stoch” (Dial 1971) first taught me to exploit the significance and convenience of acylic networks. More recent work on road pricing (Dial 1999b and 1999c) indebted me to the obvious yet invaluable fact that, whenever our stated assumptions hold, equilibrium flows are always the sum of flows on origin-based acyclic networks. 5.4
Acknowledgements
I am very grateful for the superb working environment the Volpe National Transportation Systems Center provides. In addition, I am indebted to Mary Lawler for her generous assistance to Mike Jacobs for his unfaltering support. Roman Dial will be forever appreciated for introducing his Dad to TEX, LATEX, and PICTEX, which over the last few years, have improved the content as well as the form of my work. Finally, thanks go to Laura Van Gorden, who helped with the most arduous task, editing.
27
References Beckmann M., McGuire C. and Winston C. (1956). Studies in the Economics of Transportation, Yale University Press. Bertsekas D. (1995). Nonlinear Programming. Athena Scientific, Belmont, MA. Bertsekas, D. (1976) On the Goldstein-Levitin-Polyak gradient projection method. IEEE Transactions on Automatic Control 21 No. 2, pp 174-183. Dantzig B. (1963). Linear Programming and Extensions. Princeton University Press, Princeton N. J. Dial R.B. (1969). Algorithm 360: shortest-path forest with topological ordering, Communications of the Association of Computing Machinery, 12 pp 632–633. Dial R.B. (1971). A probabilistic multipath assignment model that obviates path enumeration. Transportation Research, 5 pp 83–111. Dial R.B. (1999a). Network-optimized congestion pricing part II: algorithms and examples. Operations Research 47 No. 2 pp 327–336. Dial R.B. (1999b). Minimal-revenue congestion pricing part I: A fast algorithm for the singleorigin case. Transportation Research 33B pp 189–202. Dial R.B. (2000). Minimal-revenue congestion pricing part II: An efficient algorithm for the general case. Transportation Research 34B pp 645–665. Friesz T., Bernstein D, Smith T., Tobin, R. and Wie, B. (1993). A variational inequality formulation of the dynamic network user equilibrium problem. Operations Research, 41 No. 1 pp 179–191. Hearn D. and Lawphongpanich S. (1984). Simplicial decomposition of the asymmetric traffic assignment problem. Transportation Research 18B(2) pp 123–133. Heydecker B., Logie M. and Smith M. (1999). Generalized Equilibrium Modeling: Final Report MVA Ltd. Surrey, UK. Horowitz A. (1991). Delay-Volume Relations for Travel Forecasting, Based on the 1985 Highway Capacity Manual. U.S. Department of Transportation, Federal Highway Administration. Jayakrishnan R., Tsai W., Prashker J., and Rajadhyaksha S. (1994) A faster path-based algorithm for traffic assignment. Transportation Research Record No.1443 pp 75–83. Laurent F. (1997). (tbd) LeBlanc L. (1973). Mathematical programming algorithms for larg scale network equilibrium and network design problems. Ph.D. Thesis, Dept. of Industrial Engineering and Management Sciences, Northwestern University, Evanston, IL. Patriksson M. (1994). The Traffic Assignment Problem: Models and Methods. VSP, Utrecht, The Netherlands. Rockafellar R.T. (1984). Network Flows and Monotropic Optimization, John Wiley & Sons, New York. Nguyen S. (1973). A mathematical programming approach to equilibrium methods of traffic assignment with fixed demands. Publication 138, D´epartment d’Informatique et de Recherche Op´erationelle. Universit´e de Montr´eal, Montreal. Sobranski G. (1999). A method for solving the asymmetric Wradrop equilibrium assignment problem. Working Paper. MVA Ltd., Surrey, UK. Wardrop J. (1952). Some theoretical aspects of road traffic research. Proc.Inst. of Civil Engineers, Part 2, pp 325–378.
28