44
Journal of Algorithms 48 (2003) 91–134 www.elsevier.com/locate/jalgor Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds Ulrich Meyer Max-Planck-Institut für Informatik (MPII), Stuhlsatzenhausweg 85, 66123 Saarbrücken, Germany Received 14 April 2001 Abstract We study the average-case running-time of single-source shortest-path (SSSP) algorithms assuming arbitrary directed graphs with n nodes, m edges, and independent random edge weights uniformly distributed in [0, 1]. We give the first label-setting and label-correcting algorithms that run in linear time O(n + m) on the average. In fact, the result for the label-setting version is even obtained for dependent edge weights. In case of independence, however, the linear-time bound holds with high probability, too. Furthermore, we propose a general method to construct graphs with random edge weights that cause large expected running times when input to many traditional SSSP algorithms. We use our method to prove lower bounds on the average-case complexity of the following algorithms: the “Bellman–Ford algorithm” [R. Bellman, Quart. Appl. Math. 16 (1958) 87–90, L.R. Ford, D.R. Fulkerson, 1963], “Pallottino’s Incremental Graph algorithm” [S. Pallottino, Networks 14 (1984) 257–267], the “Threshold approach” [F. Glover, R. Glover, D. Klingman, Networks 14 (1984) 23–37, F. Glover, D. Klingman, N. Phillips, Oper. Res. 33 (1985) 65–73, F. Glover, D. Klingman, N. Phillips, R.F. Schneider, Management Sci. 31 (1985) 1106–1128], the “Topological Ordering SSSP algorithm” [A.V. Goldberg, T. Radzik, Appl. Math. Lett. 6 (1993) 3–6], the “Approximate Bucket implementation” of Dijkstra’s algorithm [B.V.Cherkassky, A.V. Goldberg, T. Radzik, Math. Programming 73 (1996) 129–174], and the “-Stepping algorithm” [U. Meyer, P. Sanders, 1998]. 2003 Elsevier Inc. All rights reserved. Partially supported by the DFG Grant SA 933/1-1, the Future and Emerging Technologies programme of the EU under Contract IST-1999-14186 (ALCOM-FT), and the Center of Excellence programme of the EU under Contract ICAI-CT-2000-70025. Parts of this work were done while the author was visiting the Computer and Automation Research Institute of the Hungarian Academy of Sciences, Center of Excellence, MTA SZTAKI, Budapest. E-mail address: [email protected]. 0196-6774/03/$ – see front matter 2003 Elsevier Inc. All rights reserved. doi:10.1016/S0196-6774(03)00046-4

Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

Embed Size (px)

Citation preview

Page 1: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

r

ds

ghtsthatevennd holds

hts thateithms:ord,

14984)

man,ering

ath..

e of theunder

er andTAKI,

Journal of Algorithms 48 (2003) 91–134

www.elsevier.com/locate/jalgo

Average-case complexity of single-sourceshortest-paths algorithms: lower and upper boun

Ulrich Meyer

Max-Planck-Institut für Informatik (MPII), Stuhlsatzenhausweg 85, 66123 Saarbrücken, Germany

Received 14 April 2001

Abstract

We study the average-case running-time of single-source shortest-path (SSSP) algorithmsassuming arbitrary directed graphs withn nodes,m edges, and independent random edge weiuniformly distributed in[0,1]. We give the first label-setting and label-correcting algorithmsrun in linear timeO(n + m) on the average. In fact, the result for the label-setting version isobtained for dependent edge weights. In case of independence, however, the linear-time bouwith high probability, too.

Furthermore, we propose a general method to construct graphs with random edge weigcause large expected running times when input to many traditionalSSSP algorithms. We usour method to prove lower bounds on the average-case complexity of the following algorthe “Bellman–Ford algorithm” [R. Bellman, Quart. Appl. Math. 16 (1958) 87–90, L.R. FD.R. Fulkerson, 1963], “Pallottino’s Incremental Graph algorithm” [S. Pallottino, Networks(1984) 257–267], the “Threshold approach” [F. Glover, R. Glover, D. Klingman, Networks 14 (123–37, F. Glover, D. Klingman, N. Phillips, Oper. Res. 33 (1985) 65–73, F. Glover, D. KlingN. Phillips, R.F. Schneider, Management Sci. 31 (1985) 1106–1128], the “Topological OrdSSSP algorithm” [A.V. Goldberg, T. Radzik, Appl. Math. Lett. 6 (1993) 3–6], the “ApproximateBucket implementation” of Dijkstra’s algorithm [B.V. Cherkassky, A.V. Goldberg, T. Radzik, MProgramming 73 (1996) 129–174], and the “∆-Stepping algorithm” [U. Meyer, P. Sanders, 1998] 2003 Elsevier Inc. All rights reserved.

Partially supported by the DFG Grant SA 933/1-1, the Future and Emerging Technologies programmEU under Contract IST-1999-14186 (ALCOM-FT), and the Center of Excellence programme of the EUContract ICAI-CT-2000-70025. Parts of this work were done while the author was visiting the ComputAutomation Research Institute of the Hungarian Academy of Sciences, Center of Excellence, MTA SZBudapest.

E-mail address:[email protected].

0196-6774/03/$ – see front matter 2003 Elsevier Inc. All rights reserved.doi:10.1016/S0196-6774(03)00046-4

Page 2: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

92 U. Meyer / Journal of Algorithms 48 (2003) 91–134

monlylex set-

s [36],sporta-aphicalc flowrtest-prob-

for com-king

. A di-modate

th

ealx

two

omial-r case,t of anybe theshowedlabel-ntages

ertainodel

nces.et ofusefull-worldand

Ps. The

1. Introduction

Shortest-paths problems are among the most fundamental and also the most comencountered graph problems, both in themselves and as subproblems in more comptings [1]. Besides obvious applications like preparing travel time and distance chartshortest-paths computations are frequently needed in telecommunications and trantion industries [60], where messages or vehicles must be sent between two geogrlocations as quickly or as cheaply as possible. Other examples are complex traffisimulations and planning tools [36], which rely on a large number of individual shopaths problems. Further applications include many practical integer programminglems. Shortest-paths computations are used as subroutines in solution proceduresputational biology (DNA sequence alignment [68]), VLSI design [8], knapsack pacproblems [25], and traveling salesman problems [43] and for many other problemsverse set of shortest-paths models and algorithms have been developed to accomthese various applications [11].

One of the most commonly encountered subtypes is thesingle-source shortest-pa(SSSP) version: letG = (V ,E) be a directed graph,|V | = n, |E| = m, let s be adistinguished vertex of the graph, and letc be a function assigning a nonnegative rweight to each edge ofG. The objective of the SSSP is to compute, for each vertev

reachable froms, the weight dist(v) of a minimum-weight (“shortest”) path froms to v;the weight of a path is the sum of the weights of its edges.

1.1. Worst-case versus average-case analysis

Shortest-paths algorithms commonly apply iterative labeling methods, of whichmajor types arelabel-settingand label-correcting (we will formally introduce thesemethods in Section 1.3). Some sequential label-correcting algorithms have polyntime upper-bounds, others even require exponential time in the worst case. In eithethe best sequential label-setting algorithms have better worst-case bounds than thalabel-correcting algorithm. Hence, at first glance, label-setting algorithms seem tobetter choice. However, several independent case studies [6,10,13,28,29,44,50,70]that SSSP implementations of label-correcting approaches frequently outperformsetting algorithms. Thus, worst-case analysis sometimes fails to bring out the advaof algorithms that perform well in practice.

Many input generators produce input instances at random according to a cprobability distribution on the set of possible inputs of a certain size. For this input mone can study theaverage-case performance, that is, theexpectedrunning time of thealgorithm averaged according to the applied probability distribution for the input instaIt nearly goes without saying that the choice of the probability distribution on the spossible instances may crucially influence the resulting average-case bounds. Achoice establishes a reasonable compromise between being a good model for readata (i.e., producing “practically relevant” instances with sufficiently high probability)still being mathematically analyzable.

Frequently used input models for theexperimentalperformance evaluation of SSSalgorithms are random or grid-like graphs with independent random edge weight

Page 3: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 93

l-lifesdirect

on thegraphlysis of

ortest-ectionsrelateducket-ction 5).s are

SP-Cgraphsh many

ependstegergn

resulting inputs exhibit certain structural properties with high probability (whp),1 forexample concerning the maximum shortest-path weightL = maxdist(v) | dist(v) < ∞or connectivity. However, it is doubtful whether some of these properties reflect reafeatures or should rather be considered as artifacts of the model, which possibly mithe quest for practically relevant algorithms.

Mathematical average-case analysis for shortest-paths algorithms has focusedAll-Pairs Shortest-Paths problem for a simple graph model, namely the completewith random edge weights. One of the merits of this paper is an average-case anasequential SSSP algorithms onarbitrary directed graphs with random edge weights.

1.2. Organization of the paper

Sections 1.3 and 1.4 provide a short summary of basic solution approaches for shpaths problems. Readers familiar with the SSSP problem may choose to skip these sand refer to them when necessary. Section 2 presents an overview of previous andwork whereas Section 3 lists our new results. In Section 4 we review some simple bbased SSSP algorithms. Then we present our new algorithms SP-S and SP-C (SeBoth algorithms run in linear time on average. Even though the two approachevery similar, the analysis of SP-S (Section 6) is significantly simpler than that of(Section 7). Finally, in Section 8, we demonstrate a general method to constructwith random edge weights that cause superlinear average-case running-times wittraditional label-correcting algorithms.

1.3. Basic labeling methods

Shortest-paths algorithms are usually based on iterativelabeling methods. For eachnodev in the graph they maintain a tentative distance label tent(v); tent(v) is an upperbound on dist(v). The value of tent(v) refers to the weight of the lightest path froms to v

found so far (if any). Initially, the methods set tent(s) := 0, and tent(v) := ∞ for all othernodesv = s.

The generic SSSP labeling approach repeatedly selects an arbitrary edge(u, v) wheretent(u) + c(u, v) < tent(v), and resets tent(v) := tent(u) + c(u, v). Identifying such anedge(u, v) can be done withO(m) operations. The method stops if all edges satisfy

tent(v) tent(u)+ c(u, v) ∀(u, v) ∈ E. (1)

By then, dist(v) = tent(v) for all nodesv. If dist(v) = tent(v) then the label tent(v) is saidto bepermanent(or final); the nodev is said to besettledin that case.

The total number of operations needed until the labeling approach terminates don the order of edge selections; in the worst case it is pseudo-polynomial for inweights, O(n2 · m · C), and O(m · 2n) otherwise [1]. Therefore, improved labelinalgorithms perform the selection in a more structured way:they select nodes rather thaedges. In order to do so they keep acandidate node setQ of “promising” nodes. We

1 For a problem of sizen, we say that an event occurswith high probability(whp) if it occurs with probabilityat least 1−O(n−α) for an arbitrary but fixed constantα 1.

Page 4: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

94 U. Meyer / Journal of Algorithms 48 (2003) 91–134

de2

d is

ubset of

procedure SCAN(u)for all (u, v) ∈ E do

if tent(u)+ c(u, v) < tent(v) thentent(v) := tent(u)+ c(u, v)

if v /∈ Q thenQ := Q∪ v

Q := Q \ u

Fig. 1. Pseudo code of the SCAN operation for nonnegative edge weights.

algorithm GENERIC SSSPfor all v ∈ V do

tent(v) := ∞tent(s) := 0Q := swhile Q = ∅ do

select a nodeu ∈ Q

SCAN(u)

Fig. 2. Pseudo code for the generic SSSP algorithm with a candidate node set.

requireQ to contain the starting nodeu of any edge(u, v) that violates the optimalitycondition (1).

Requirement 1. Q ⊇ u ∈ V : ∃(u, v) ∈ E with tent(u)+ c(u, v) < tent(v).

The labeling methods based on a candidate setQ of nodes repeatedly select a nou ∈ Q and apply the SCAN operation (Fig. 1) to it untilQ finally becomes empty. Figuredepicts the resulting generic SSSP algorithm.

Subsequently, the set of all outgoing edges ofu will also be called theforward starof u,abbreviatedFS(u). SCAN(u) applied to a nodeu ∈ Q removesu fromQ andrelaxesall2

outgoing edges ofu, that is, the procedure updates

tent(vi) := mintent(vi), tent(u)+ c(u, vi)

∀(u, vi) ∈ FS(u).

If the relaxation of an edge(u, vi) reduces tent(vi) wherevi /∈ Q, thenvi is also insertedinto Q. For nonnegative edge weights, SCAN(u) will not reduces tent(u).

During the execution of the labeling approaches with a node candidate setQ the nodesmay be in differentstates: a nodev never inserted intoQ so far (i.e., tent(v) = ∞) is said tobeunreached, whereas it is said to be acandidate(or labeledor queued) while it belongsto Q. A nodev selected and removed fromQ whose outgoing edges have been relaxesaid to bescannedas long asv remains outside ofQ.

2 There are a few algorithms that deviate from this scheme in that they sometimes only consider a sthe outgoing edges.

Page 5: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 95

onlydge

tain

ance

ed

to be

lecty

et node

The implementation of the SCAN procedure immediately implies:

Observation 2. For any nodev, tent(v) never increases during the labeling process.

Furthermore, the SCAN procedure maintainsQ as desired:

Lemma 3. TheSCAN operation ensures Requirement1.

Proof. Q is required to contain the starting nodeu of any edgee = (u, v) that violatesthe optimality condition (1). Due to Observation 2, the optimality condition (1) canbecome violated when tent(u) is decreased, which, in turn, can only happen if some e(w,u) into u is relaxed during a SCAN(w) operation. However, if SCAN(w) reducestent(u) then the procedure also makes sure to insertu intoQ in caseu is not yet containedin it. Furthermore, at the moment whenu is removed fromQ the condition (1) will notbecome violated because of the relaxation ofFS(u).

In the following we state the so-called monotonicity property. It proves helpful to obbetter data structures for the maintaining of the candidate setQ.

Lemma 4 (Monotonicity).For nonnegative edge weights, the smallest tentative distamong all nodes inQ never decreases during the labeling process.

Proof. Let M(Q) := mintent(v): v ∈ Q. The tentative distance of a nodev can onlydecrease due to a SCAN(u) operation whereu ∈ Q, (u, v) ∈ E, and tent(u) + c(u, v) <

tent(v); if v is not queued at this time, then a reduction of tent(v) will result in v

enteringQ. However, as all edge weights are nonnegative, SCAN(u) updates tent(v) :=tent(u) + c(u, v) M(Q). Finally, M(Q) will not decrease when a node is removfromQ.

So far, we have not specified how the labeling methods select the next nodescanned. The labeling methods can be subdivided into two major classes:label-settingapproaches andlabel-correctingapproaches. Label-setting methods exclusively senodesv with final distance value, i.e., tent(v) = dist(v). Label-correcting methods maselect nodes with nonfinal tentative distances, as well.

In the following we show that wheneverQ is nonempty then it always contains a nodvwith final distance value. In other words, there is always a proper choice for the nexto be scanned according to the label-setting paradigm.

Lemma 5 (Existence of an optimal choice).Let c(e) 0 for all e ∈ E.

(a) After a nodev is scanned withtent(v) = dist(v), it is never added toQ again.(b) For any nodev reachable from the source nodes with tent(v) > dist(v) there is a node

u ∈ Q with tent(u) = dist(u), whereu lies on a shortest path froms to v.

Page 6: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

96 U. Meyer / Journal of Algorithms 48 (2003) 91–134

e

ethodto be

s the

ationsy eachxample,

and

il theirsettingtionsimple;

e. For

Fig. 3. SCAN step in Dijkstra’s algorithm.

Proof. (a) The labeling method ensures tent(v) dist(v) at any time. Also, whenv isadded toQ, its tentative distance value tent(v) has just been decreased. Thus, if a nodvis scanned with tent(v) = dist(v), it will never be added toQ again later.

(b) Let 〈s = v0, v1, . . . , vk = v〉 be a shortest path froms to v. Then tent(s) =dist(s) = 0 and tent(vk) > dist(vk). Let i be minimal such that tent(vi) > dist(vi). Theni > 0, tent(vi−1) = dist(vi−1) and

tent(vi) > dist(vi) = dist(vi−1)+ c(vi−1, vi) = tent(vi−1)+ c(vi−1, vi).

Thus, by Requirement 1, the nodevi−1 is contained inQ. The basic label-setting approach for nonnegative edge weights is Dijkstra’s m

[15]; it selects a candidate node with minimum tentative distance as the next nodescanned. Figure 3 demonstrates an iteration of Dijkstra’s method.

The following lemma shows that Dijkstra’s selection method indeed implementlabel-setting paradigm.

Lemma 6 (Dijkstra’s selection rule).If c(e) 0 for all e ∈ E then tent(v) = dist(v) forany nodev ∈ Q with minimaltent(v).

Proof. Assume otherwise, i.e., tent(v) > dist(v) for some nodev ∈ Q with minimaltentative distance. By Lemma 5, there is a nodez ∈ Q lying on a shortest path fromsto v with tent(z) = dist(z). Due to nonnegative edge weights we have dist(z) dist(v).However, that implies tent(z) < tent(v), a contradiction to the choice ofv.

Hence, by Lemma 5, label-setting algorithms have a bounded number of iter(proportional to the number of reachable nodes), but the amount of time required biteration depends on the data structures used to implement the selection rule. For ein the case of Dijkstra’s method the data structure must support efficient minimumdecrease_key operations.

Label-correcting algorithms may have to rescan some nodes several times untdistance labels eventually become permanent; Fig. 4 depicts the difference to label-approaches. Label-correcting algorithms may vary largely in the number of iteraneeded to complete the computation. However, their selection rules are often very sthey frequently allow implementations where each selection runs in constant tim

Page 7: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 97

approach

lings

apply

ches:tually,

he data

. Forh finaliterionted.

rbitrarythearallellikelymaytion of

havenodets the

Fig. 4. States for a reachable non-source node using a label-setting approach (left) and label-correcting(right).

Fig. 5. Input graph for which the candidate setQ contains only one entry with final distance value: after settnodes 0, 1,. . . , i − 1 the queue holds nodei with (actual) distancei/n, and all othern − i − 1 queued nodehave tentative distance 1.

example, the Bellman–Ford method [3,21] processes the candidate setQ in simple FIFO(First-In First-Out) order.

Our new SSSP algorithms either follow the strict label-setting paradigm or theylabel-correcting with clearly defined intermediate phases of label-setting steps.

1.4. Advanced label-setting methods

In this section we deal with a crucial problem for label-setting SSSP approaidentifying candidate nodes that have already reached their final distance values. Acseveral mutually dependent problems have to be solved: first of all, adetection criterionis needed in order to deduce that a tentative distance of a node is final. Secondly, tstructure that maintains the setQ of candidate nodes must support efficientevaluationofthe criterion andmanipulationof the candidate set, e.g., inserting and removing nodeseach iteration of the labeling process, the criterion must identify at least one node witdistance value; according to Lemma 5 such a node always exists. However, the crmay even detect a whole subsetR ⊆ Q of candidate nodes each of which could be selecWe callR theyieldof a criterion.

Large yields may be advantageous in several ways: being allowed to select an anode out of a big subsetR could simplify the data structures needed to maintaincandidate set. Even more obviously, large yields facilitate concurrent node scans in pSSSP algorithms, thus reducing the parallel execution time. On the other hand, it isthat striving for larger yields will make the detection criteria more complicated. Thisresult in higher evaluation times. Furthermore, there are graphs where at each iterathe labeling process the tentative distance of only one single node inQ is final—even ifQcontains many nodes; see Fig. 5.

In the following we will present the label-setting criteria used in this paper. Wealready seen in Lemma 6 that Dijkstra’s criterion [15], i.e., selecting a labeledwith minimum tentative distance as the next node to be scanned, in fact implemen

Page 8: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

98 U. Meyer / Journal of Algorithms 48 (2003) 91–134

finalroaches

riteriaerved

s

oming

he

oof

hasently,OurSSSP

o ourtensivewhole

label-setting paradigm. However, it also implicitly sorts the nodes according to theirdistances. This is more than the SSSP problem asks for. Therefore, subsequent apphave been designed to avoid the sorting complexity; they identified label-setting cthat allow to scan nodes in nonsorted order. Dinitz [16] and Denardo and Fox [10] obsthe following:

Criterion 7 (GLOB-criterion). Let M mintent(v): v ∈ Q. Furthermore, letλ :=minc(e): e ∈ E. Thentent(v) = dist(v) for any nodev ∈ Q havingtent(v) M + λ.

The GLOB-criterion of Dinitz and Denardo–Fox isglobal in the sense that it applieuniformly to any labeled node whose tentative distance is at mostM + λ. However, ifλ = c(u′, v′) happens to be small,3 then the criterion is restrictive for all nodesv ∈ V , eventhough its restriction may just be needed as long as the nodesu′ andv′ are part of thecandidate set. Therefore, it is more promising to applylocal criteria: for each nodev ∈ Q

they only take into account a subset of the edge weights, e.g., the weights of the incedges ofv. The following criterion is frequently used in our algorithms.

Lemma 8 (IN-criterion).LetM mintent(v): v ∈ Q. For nonnegative edge weights, tlabeled nodes of the following sets have reached their final distance values:

U1 := v ∈ Q | ∀u ∈ Q: tent(v) tent(u)

,

U2 := v ∈ Q | ∀(u, v) ∈ E: c(u, v) tent(v) − M

.

Proof. The claim for the setU1 was established in Lemma 6 of Section 1.3. The prfor the setU2 follows the same ideas; assume tent(v) > dist(v) for some nodev ∈ U2.By Lemma 5 there is a nodez ∈ Q, z = v, lying on a shortest path froms to v withtent(z) = dist(z) M. However, since all edges intov have weight at least tent(v) − M,this implies dist(v) dist(z)+ tent(v) − M tent(v), a contradiction.

Lemma 8 was already implicit in [10,16]. However, for a long time, the IN-criterionnot been exploited in its full strength to derive better SSSP algorithms. Only recThorup [65] used it to yield the first linear-time algorithm for undirected graphs.algorithms for directed graphs also rely on it. Furthermore, it is used in the latestalgorithm of Goldberg [32], as well.

2. Previous and related work

In the following we will list some previous shortest-paths results that are related tresearch. Naturally, due to the importance of shortest-paths problems and the inresearch on them, our list cannot (and is not intended to) provide a survey of the

3 This is very likely in the case of independent random edge weights uniformly distributed in[0,1] as assumedfor our average-case analysis.

Page 9: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 99

results

avean byunsoretativeresult,used onts in[4,

der ofon–

RAMthm;ionalfirst

oldsd the

ached:

rithm

apsdrlinears isr

ontainedlexity

ithestedound

field. Appropriate overview papers for classical and recent sequential shortest-pathsare, e.g., [6,11,52,58,65,71].

2.1. Sequential label-setting algorithms

A large fraction of previous work is based on Dijkstra’s method [15], which we hsketched in Section 1.3. The original implementation identifies the next node to sclinear search. For graphs withn nodes,m edges, and nonnegative edge weights, it rin O(n2) time, which is optimal for fully dense networks. On sparse graphs, it is mefficient to use a priority queue that supports extracting a node with smallest tendistance and reducing tentative distances for arbitrary queued nodes. After Dijkstra’smost subsequent theoretical developments in SSSP for general graphs have focimproving the performance of the priority queue: Applying William’s heap [69] resula running time ofO(m · logn). Taking Fibonacci heaps [22] or similar data structures17,64], Dijkstra’s algorithm can be implemented to run inO(n · logn + m) time. In fact,if one sticks to Dijkstra’s method, thus considering the nodes in nondecreasing ordistances, thenO(n · logn + m) is even the best possible time bound for the comparisaddition model: anyo(n · logn)-time algorithm would contradict theΩ(n · logn)-timelower-bound for comparison-based sorting.

A number of faster algorithms have been developed for the more powerfulmodel. Nearly all of these algorithms are still closely related to Dijkstra’s algorithey mainly strive for an improved priority queue data structure using the additfeatures of the RAM model (see [58,65] for an overview). Fredman and WillardachievedO(m · √

logn) expected time with randomized fusion trees [23]; the result hfor arbitrary graphs with arbitrary nonnegative edge weights. Later they obtainedeterministicO(m + n · logn/ log logn)-time bound by using atomic heaps [24].

The ultimate goal of a worst-case linear time SSSP algorithm has been partially reThorup [65,66] gave the firstO(n + m)-time RAM algorithm for undirectedgraphswith nonnegative floating-point or integer weights fitting into words of lengthw. Hisapproach applies label-setting, too, but deviates significantly from Dijkstra’s algoin that it does not visit the nodes in order of increasing distance froms but traverses aso-calledcomponent tree. Unfortunately, Thorup’s algorithm requires the atomic he[24] mentioned above, which are only defined forn 21220

. Hagerup [38] generalizeThorup’s approach to directed graphs. The time complexity, however, becomes supeO(n + m · logw). The currently fastest RAM algorithm for sparse directed graphdue to Thorup [67]; it needsO(n + m · log logn) time. Alternative approaches fosomewhat denser graphs have been proposed by Raman [57,58]: they requireO(m + n ·√

logn · log logn) andO(m + n · (w · logn)1/3) time, respectively. Using an adaptatiof Thorup’s component tree approach, Pettie and Ramanchandran [56] recently obimproved SSSP algorithms for the pointer machine model. Still, the worst-case compfor SSSP on sparse directed graphs remains superlinear.

In Section 4 we will review some basic implementations of Dijkstra’s algorithm wbucketbased priority queues [1,10,12,16]. Alternative bucket approaches include n(multiple levels) buckets and/or buckets of different widths [2,10]. So far, the best b

Page 10: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

100 U. Meyer / Journal of Algorithms 48 (2003) 91–134

21]. Itmeeand

te

aseeededn–howedriginal

a sets.effects.ite of

s.graphach forors thatderlinearl andRAMnputhm as

withtimes

of anthen

or thee.s with

for SSSP on arbitrarydirectedgraphs with nonnegative integer edge-weights in1, . . . ,Cis O(m + n · (logC)1/4+ε) expected time for any fixedε > 0 [58].

2.2. Sequential label-correcting algorithms

The classic label-correcting SSSP approach is the Bellman–Ford algorithm [3,implements the set of candidate nodesQ as a FIFO-Queue and achieves running tiO(n · m). There are many more ways to maintainQ and select nodes from it (se[6,27] for an overview). For example, the algorithms of Pallottino [54], GoldbergRadzik [34], and Glover et al. [29–31] subdivideQ into two setsQ1 andQ2 each ofwhich is implemented as a list. Intuitively,Q1 represents the “more promising” candidanodes. The algorithms always scan nodes fromQ1. According to varying rules,Q1is frequently refilled with nodes fromQ2. These approaches terminate in worst-cpolynomial time. However, none of the alternative label-correcting algorithms succto asymptotically improve on theO(n ·m)-time worst-case bound of the simple BellmaFord approach. Still, a number of experimental studies [6,10,13,28,29,44,50,70] sthat some recent label-correcting approaches run considerably faster than the oBellman–Ford algorithm and even outperform label-setting algorithms on certain datSo far, no profound average-case analysis has been given to explain the observedA striking example in this respect is the shortest-paths algorithm of Pape [55]; despexponential worst-case time it performs very well on real-world data like road graph

We would like to note that faster sequential SSSP algorithms exist for specialclasses with arbitrary nonnegative edge weights, e.g., there is a linear-time approplanar graphs [41]. The algorithm uses graph decompositions based on separatmay have size up toO(n1−ε). Hence, it may in principle be applied to a much broaclass of graphs than planar graphs if just a suitable decomposition can be found intime. The algorithm does not require the bit manipulating features of the RAM modeworks for directed graphs, thus it remains appealing even after Thorup’s linear-timealgorithm for arbitrary undirected graphs. Another example for a “well-behaved” iclass are graphs with constant tree width; they allow for a linear-time SSSP algoritwell [5].

2.3. Random edge weights

Average-case analysis of shortest-paths algorithms mainly focused on theAll-PairsShortest-Paths(APSP) problem on either the complete graph or random graphsΩ(n · logn) edges and random edge weights [9,26,40,49,63]. Average-case runningof O(n2 · logn) as compared to worst-case cubic bounds are obtained by virtueinitial pruning step: ifL denotes a bound on the maximum shortest-path weight,the algorithms discardinsignificant edgesof weight larger thanL; they will not be partof the final solution. Subsequently, the APSP is solved on the reduced graph. Finputs considered above, the reduced graph containsO(n · logn) edges on the averagThis pruning idea does not work on sparse random graphs, let alone arbitrary graphrandom edge weights.

Page 11: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 101

rage-sdetween

enny real

orithm

ts.y

orst-

raphse

d

of anSSSP

(SP-S)ieves

cordingult

ibutionr theendent.s with

orst-ined

orFurther

Another pruning method was explored by Sedgewick and Vitter [62] for the avecase analysis of theOne-Pair Shortest-Paths(OPSP) problem onrandom geometric graphGd

n(r). Graphs of the classGdn(r) are constructed as follows:n nodes are randomly place

in ad-dimensional unit cube, and each edge weight equals the Euclidean distance bthe two involved nodes. An edge(u, v) is included if the Euclidean distance betweenu

and v does not exceed the parameterr ∈ [0,1]. Random geometric graphs have beintensively studied since they are considered to be a relevant abstraction for maworld situations [14,62]. Assuming that the source nodes and target nodet are positionedin opposite corners of the cube, Sedgewick and Vitter showed that the OPSP algcan restrict itself to nodes and edges being “close” to the diagonal betweens andt , thusobtaining average-case running-timeO(n).

Mehlhorn and Priebe [45] proved that for thecompletegraph with random edge weighevery SSSP algorithm has to check at leastΩ(n · logn) edges with high probabilityNoshita [53] and Goldberg and Tarjan [35] analyzed the expected number ofdecrease_Keoperations in Dijkstra’s algorithm; the time bound, however, does not improve on the wcase complexity of the algorithm.

Meyer and Sanders [48] gave a label-correcting algorithm for arbitrary directed gwith independent random edge weights in[0,1]. The algorithm runs in average-case timO(n + m + d · E[L]), whered denotes the maximum node degree in the graph anLdenotes the maximum shortest-path weight. However, there are graphs wherem = O(n)

butd · E[L] = Ω(n2); in that case the algorithm requiresΩ(n2) time on average.

3. Our contribution

We develop a new sequential SSSP approach, which adaptively splits bucketsapproximate priority-queue data-structure, thus building a bucket hierarchy. The newapproach comes in two versions, SP-S and SP-C, following either the label-settingor the label-correcting (SP-C) paradigm. Our method is the first that provably achlinearO(n +m) average-case execution time onarbitrary directedgraphs.

In order to facilitate easy exposition, we assume random edge weights chosen acto the uniform distribution on[0,1], independently of each other. In fact, the rescan be shown for much more general random edge weights in case the distrof edge weights “is linear” in a neighborhood of zero. Furthermore, the proof foaverage-case time-bound of SP-S does not require the edge weights to be indepIf, however, independence is given, then the linear-time bound for SP-S even holdhigh probability.

The worst-case times of the basic algorithms SP-S and SP-C areO(n · m) andO(n ·m · logn), respectively. Furthermore, running any other SSSP algorithm with wcase timeT (n,m) “in parallel” with either SP-S or SP-C, we can always obtain a combapproach featuring linear average-case time andO(T (n,m)) worst-case time.

Our result immediately yields anO(n2 + n · m) average-case time algorithm fAPSP, thus improving upon the best previous bounds on sparse directed graphs.extensions, especially towards parallel SSSP, are provided in [47].

Page 12: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

102 U. Meyer / Journal of Algorithms 48 (2003) 91–134

on input

m edgeerage-no’s], the[34],],

areonly

oaches

46,48].rbitraryn radixs

ideas-S, thusfs as-C.

eepingys in

ket

allest

SSSP algorithm Average-case timeBellman–Ford algorithm [3,21] Ω(n4/3−ε)

Pallottino’s Incremental Graph algorithm [54] Ω(n4/3−ε)

Basic Topological Ordering algorithm [34] Ω(n4/3−ε)

Threshold algorithm [29–31] Ω(n · logn/ log logn)ABI-Dijkstra [6] Ω(n · logn/ log logn)∆-Stepping [48] Ω(n · √

logn/ log logn)

Fig. 6. Proved lower bounds on the average-case running times of some label-correcting algorithmsclasses withm = O(n) edges and random edge weights.

Finally, we present a general method to construct sparse input graphs with randoweights for which several label-correcting SSSP algorithms require superlinear avcase running-time: we consider the “Bellman–Ford algorithm” [3,21], “PallottiIncremental Graph algorithm” [54], the “Threshold approach” by Glover et al. [29–31basic version of the “Topological Ordering SSSP algorithm” by Goldberg and Radzikthe “Approximate Bucket implementation” of Dijkstra’s algorithm (ABI-Dijkstra) [6and its refinement, the “∆-Stepping algorithm” [48]. The obtained lower boundssummarized in Fig. 6. It is worth mentioning that the constructed graphs containO(n) edges, thus maximizing the performance gap as compared to our new apprwith linear average-case time.

Preliminary accounts of our results on sequential SSSP have appeared in [Subsequently, Goldberg [32,33] obtained the linear-time average-case bound for adirected graphs as well. He proposes a quite simple alternative algorithm based oheaps. For integer edge weights in1, . . . ,M, whereM is reasonably small, it achieveimproved worst-case running-timeO(n · logC + m), whereC M denotes the ratiobetween the largest and the smallest edge weight inG. However, for real weights in[0,1]as used in our analysis, the value ofC may be arbitrarily large.

Even though Goldberg’s algorithm is different from our methods, some underlyingare the same. Inspired by his paper we managed to streamline some proofs for SPsimplifying its analysis and making it more appealing. However, more involved proothose in [46,48] are still necessary for the analysis of the label-correcting version SP

4. Simple bucket structures

4.1. Dial’s implementation

Many SSSP labeling algorithms—including our new approaches—are based on kthe set of candidate nodesQ in a data structure withbuckets. This technique was alreadused in Dial’s implementation [12] of Dijkstra’s algorithm for integer edge weight0, . . . ,C: a labeled nodev is stored in the bucketB[i] with index i = tent(v). In eachiteration Dial’s algorithm scans a nodev from the first nonempty bucket, that is the bucB[k], wherek is maximal withB[i] = ∅ for all i < k. In the following we will also usethe termcurrent bucket, Bcur, for the first nonempty bucket. OnceBcur = B[k] becomesempty, the algorithm has to change the current bucket. As shown in Lemma 4, the sm

Page 13: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 103

strarsingle, the

tiveecking

node,one in

Fig. 7. Impact of the bucket width∆. The drawing shows the contents of the bucket structure for ABI-Dijkrunning on a little sample graph. If∆ is chosen too small then the algorithm spends many iterations with traveempty buckets. On the other hand, taking∆ too large causes overhead due to node rescans: in our exampnodeq is rescanned several times. Choosing∆ = 0.8 gives rise to 27 edge relaxations, whereas taking∆ = 0.1results in just 12 edge relaxations but more iterations.

tentative distance among all labeled nodes inQ never decreases in the case of nonnegaedge weights. Therefore, the new current bucket can be identified by sequentially chB[k + 1],B[k + 2], . . . , until the next nonempty bucket is found.

Buckets are implemented as doubly linked lists so that inserting or deleting afinding a bucket for a given tentative distance and skipping an empty bucket can be d

Page 14: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

104 U. Meyer / Journal of Algorithms 48 (2003) 91–134

ucket.ucket:

d Fox

ce of

tanceededncetra’sIFOce ofthe

y

h

oaches

ersionl edge

this

in

(andy

constant time. Still, in the worst case, Dial’s implementation has to traverseC · (n− 1)+ 1buckets. However, by reusing empty buckets cyclically, space for onlyC + 1 buckets isneeded.

4.2. Buckets of fixed width

Dial’s implementation associates one concrete tentative distance with each bAlternatively, a whole interval of tentative distances may be mapped onto a single bnodev ∈ Q is kept in the bucket with indextent(v)/∆. The parameter∆ is called thebucket width.

Let λ denote the smallest edge weight in the graph. Dinitz [16] and Denardo an[10] demonstrated that a label-setting algorithm is easily obtained ifλ > 0: taking∆ λ,all nodes inBcur have reached their final distance; this is an immediate consequeneither Criterion 7 or Lemma 8 using the lower boundM := j ·∆ if Bcur = B[j ]. Therefore,these nodes can be scanned in arbitrary order.

Choosing∆> λ either requires to repeatedly find a node with smallest tentative disin Bcur or results in a label-correcting algorithm: in the latter case it may be neto rescannodes fromBcur if they have been previously scanned with nonfinal distavalue. This variant is also known as the “Approximate Bucket implementation of Dijksalgorithm” [6] (ABI-Dijkstra) where the nodes of the current bucket are scanned in Forder. The choice of the bucket width has a crucial impact on the overall performanABI-Dijkstra. On the one hand, the bucket width should be small in order to limitnumber of node rescans. On the other hand, setting∆ very small may result in too manbuckets. Figure 7 depicts the tradeoff between these two parameters.

Sometimes, there is no good compromise for∆: in Section 8.4.1 we will provide a grapclass withO(n) edges and random edge weights, where each fixed choice of∆ forces ABI-Dijkstra into superlinear average-case running time. Therefore, our new SSSP apprchange the bucket width adaptively.

5. The new algorithms

5.1. Preliminaries

In this section we present our new algorithms, called SP-S for the label-setting vand SP-C for the label-correcting version. For ease of exposition we assume reaweights from the interval[0,1]; any input with nonnegative edge weights meetsrequirement after proper scaling. The algorithms keep the candidate node setQ in abucket hierarchyB: they begin with an arrayL0 at level 0.L0 containsn buckets,B0,0, . . . ,B0,n−1, each of which has width∆0 = 2−0 = 1. The starting nodes is put intothe bucketB0,0 with tent(s) = 0. BucketB0,j , 0 j < n, represents tentative distancesthe range[j, j + 1).

Our algorithms may extend the initial bucket structure by creating new levelslater removing them again). Thus, beside the initialn buckets of the first level, they macreate new buckets. All buckets of leveli have equal width∆i , where∆i = 2−l for some

Page 15: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 105

ngeket

t one.

t

nbe

astfies theision

gead. The

settance

res ofover;t

wever,

integerl i. The arrayLi+1 at leveli + 1 refines a single bucketBi,k of the arrayLi atlevel i. This means that the range of tentative distances[x, x + ∆i) associated withBi,k

is divided over the buckets ofLi+1 as follows: if Li+1 containsκi+1 = ∆i/∆i+1 2buckets thenBi+1,j , 0 j < κi+1 keeps nodes with tentative distances in the ra[x + j ·∆i+1, x + (j + 1) ·∆i+1). Since leveli + 1 covers the range of some single bucof level i we also say that leveli + 1 hastotal level width∆i .

The level with the largest indexi is also referred to as thetopmostor highestlevel. Theheightof the bucket hierarchy denotes the number of levels, i.e., initially it has heighThe first or leftmostnonempty bucket of an arrayLi denotes the bucketBi,k wherek ismaximal withBi,j = ∅ for all 0 j < k. Within the bucket hierarchyB, thecurrent bucketBcur always refers to the leftmost nonempty bucket in the highest level.

Our algorithms generate a new topmost leveli + 1 by splitting the current buckeBcur = Bi,k of width ∆i at level i. When a nodev contained inBi,k is moved to itsrespective bucket in the new level then we say thatv is lifted. After all nodes have beeremoved fromBi,k , the leftmost nonempty bucket in the new topmost level has toidentified as the new current bucket.

5.2. The common framework

After initializing the buckets of level zero, settingBcur := B0,0, and insertings intoBcur,our algorithms SP-S and SP-C work inphases. It turns out that each phase will settle at leone node, i.e., it scans at least one node with final distance value. A phase first identinew current bucketBcur. Then it inspects the nodes in it, and takes a preliminary decwhetherBcur should be split or not.

If not, then the algorithms scanall nodes contained inBcur simultaneously;4 we willdenote this operation by SCAN_ALL(Bcur). We call this step of the algorithmregularnode scanning. As a result,Bcur is first emptied but it may be refilled due to the edrelaxations of SCAN_ALL(Bcur). This marks theregular end of the phase. If afterregular phase all buckets of the topmost level are empty, then this level is removealgorithms stop after level zero is removed.

Otherwise, i.e., ifBcur should be split, then the algorithms first identify a nodeU1 ∪ U2 ⊆ Bcur (see Fig. 8) whose labels are known to have reached their final disvalues. Then all these nodes are scanned, denoted by SCAN_ALL(U1 ∪ U2). This stepof the algorithm is calledearly node scanning. It removesU1 ∪ U2 from Bcur but mayalso insert additional nodes into it due to edge relaxations. IfBcur remains nonempty afteSCAN_ALL(U1 ∪ U2) then the new level is actually created and the remaining nodBcur are lifted to their respective buckets of the newly created level. The phase isin that case we say that the phase found anearly end. If, however, the new level was nocreated after all (becauseBcur became empty after SCAN_ALL(U1 ∪U2)) then the phasestill ended regularly.

4 Actually, the nodes of the current bucket could also be extracted one-by-one in FIFO order. Hoconsidering them in phases somewhat simplifies the analysis for the label-correcting approach.

Page 16: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

106 U. Meyer / Journal of Algorithms 48 (2003) 91–134

es the

in the

tweendue togree)

8

rchy:

SP-S (* SP-C *)CreateL0, initialize tent(·), and inserts into B0,0i := 0,∆i := 1while i 0 do

while nonempty bucket exists inLi dorepeat

regular := true /* Begin of a new phase */j := mink 0 | Bi,k = ∅Bcur := Bi,j , ∆cur := ∆i

b∗ := # nodes inBcur (* d∗ := maxdegree(v) | v ∈ Bcur *)if b∗ > 1 then (* if d∗ > 1/∆cur then *)

U1 := v ∈ Bcur | ∀u ∈ Bcur: tent(v) tent(u)U2 := v ∈ Bcur | ∀(u, v) ∈ E: c(u, v) ∆curSCAN_ALL(U1 ∪U2) /* Early scanning */if Bcur = ∅

CreateLi+1 with ∆i+1 := ∆cur/2 (* with ∆i+1 := 2−log2 d∗ *)

Lift all remaining nodes fromBcur to Li+1regular := false,i := i + 1 /* Early end of a phase */

until regular = trueSCAN_ALL(Bcur) /* Regular scanning / end of a phase */

RemoveLi , i := i − 1

Fig. 8. Pseudo code for SP-S. Modifications for SP-C are given in (* comments *). SCAN_ALL denotextension of the SCAN operation (Fig. 1) to sets of nodes.

5.3. Different splitting criteria

The label-setting version SP-S and the label-correcting version SP-C only differbucket splitting criterion. Consider a current bucketBcur. SP-S splitsBcur until it containsa single nodev; by then tent(v) = dist(v). If there is more than one node inBcur then thecurrent bucket is split into two new buckets; compare Fig. 8.

In contrast, adaptive splitting in SP-C is applied to achieve a compromise beeither scanning too many narrow buckets or incurring too many node rescansbroad buckets: letd∗ denote the maximum node degree (sum of in-degree plus out-deamong all nodes inBcur at the topmost leveli. If d∗ > 1/∆i , then SP-C splitsBcur intoκi = ∆i/∆i+1 2 new buckets having width∆i+1 = 2−log2 d

∗ each; compare Figs.and 9.

Both splitting criteria imply a simple upper bound on the bucket widths in the hierainitially, buckets of level 0 have width∆0 2−0 = 1. Each subsequent splitting ofBcur =Bi,j at leveli creates a new leveli + 1 with at least two buckets of width∆i+1 ∆i/2.Therefore, we find by induction:

Invariant 9. Buckets of leveli have width∆i 2−i .

For the label-correcting version SP-C, the invariant can be refined as follows:

Page 17: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 107

ns

ket.

uckett

cket.

ftmost

ances

iffound

rom theare

ing

Fig. 9. (Left) Basic case in the label-correcting approach: detecting a node with degree 4 inB0,j of L0 forces

a split into buckets of widths 2−log2 4 = 1/4. Nodesu andv are not lifted but selected for early node sca(u has smallest tentative distance inBcur, all incoming edges ofv have weight larger than∆cur). (Right) Generalsituation: after a bucket split, the first nonempty bucket of the highest level becomes the new current buc

Invariant 10. Let d denote the maximum degree among all nodes in the current bBcur = Bi,j at level i when the regular node scanning ofSP-Cstarts. Then the buckewidth∆i of Bcur is at mostmin2−log2 d , 2−i.

In the following we will collect some more observations concerning the current bu

5.4. The current bucket

The algorithms stay with the same current bucketBcur = Bi,j until it is split or finallybecomes empty after a phase. Then a new current bucket must be found: the lenonempty bucket of the topmost level. Thus, the following invariant is maintained.

Invariant 11. When a phase ofSP-Sor SP-Cstarts then the current bucketBcur containsa candidate node with smallest tentative distance. Furthermore, if some nodev ∈ Q iscontained inBcur, then any nodeu ∈ Q havingtent(u) tent(v) is contained inBcur aswell.

This is easily seen by induction: initially, the nodes with the smallest tentative distreside in the leftmost nonempty bucket of level zero; i.e., inBcur. By the monotonicityproperty (Lemma 4) the smallest tentative distance inQ never decreases. Therefore,Bcur = B0,j becomes empty after a phase, then the next nonempty bucket can beby linear search to the right, i.e., testingB0,j+1,B0,j+2, . . . . When leveli + 1 comes intoexistence then it inherits the tentative distance range and the nonscanned nodes fsingle bucketBcur at leveli. After lifting, the nodes with smallest tentative distancesfound in the leftmost nonempty bucket of leveli + 1, thus maintaining the invariant.

IdentifyingBcur at the new leveli + 1 is done by linear search again, this time startfrom the leftmost bucket of arrayLi+1, Bi+1,0. Subsequent searches forBcur on the

Page 18: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

108 U. Meyer / Journal of Algorithms 48 (2003) 91–134

d thee can

f the

tions.

veallif the

the. Thisrds,up

e.all

g. As

topmost leveli + 1 continue from the previous current bucket of leveli + 1. In case thereis no further nonempty bucket on the topmost level then this level is removed ansearch continues at the first nonsplit bucket of the previous level, if any. Altogether wsummarize the crucial points about identifying the current bucket as follows:

Observation 12. Let t be the total number of newly created buckets. Keeping track ocurrent bucket can be done inO(n + t) time.

5.5. Progress of the algorithms

We continue with some observations concerning the efficiency of the scan opera

Lemma 13. The tentative distances of all nodes in the setU1 ∪ U2 are final.

Proof. Let Bcur be in charge of the distance range[M,M + ∆cur). Hence, tent(v) <M +∆cur for any nodev ∈ U1 ∪U2. By Invariant 11,M mintent(v): v ∈ Q. Therefore,we can apply the IN-criterion of Lemma 8 whereU1 = U1 andU2 ⊆ U2.

Observe that whenever SCAN_ALL(Bcur) is executed in SP-S thenBcur contains atmost one node. Together with Invariant 11 and Lemmas 6, 8, and 13 this implies

Corollary 14. SP-Simplements the label-setting paradigm.

A further remark is in order concerning the IN-criterion.

Remark 15. Our algorithms may lift a nodev several times. In that situation, a naimethod to check whetherv belongs to the setU2 might repeatedly read the weights ofedges intov and recompute the minimum. This can result in a considerable overheadin-degree ofv is large andv is lifted many times. Therefore, it is better to determinesmallest incoming edge weight of each node once and for all during the initializationpreprocessing takesO(n + m) time; the result can be stored in an extra array. Afterwaeach check whether a nodev belongs toU2 or not can be done in constant time by a lookin the extra array.

In the following we turn to the number of phases.

Lemma 16. Each phase ofSP-Sor SP-Csettles at least one node.

Proof. By Invariant 11,Bcur contains a candidate nodev with smallest tentative distancFurthermore, according to Lemma 6, tent(v) = dist(v). A phase with regular end scansnodes contained inBcur, hencev will be settled. In case of an early phase end,v belongsto the setU1. Therefore, it is scanned in that case, too.

At most minn,m nodes are reachable from the source nodes. Consequently, thealgorithms require at most minn,m phases. Each phase causes at most one splittin

Page 19: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 109

obtain

f the

at

he

t most

nd theits

m

evelsannedts

er

for SP-S, each splitting creates at most two new buckets. Hence, we immediatelythe following simple upper bounds.

Corollary 17. At any time the bucket hierarchy forSP-Scontains at mostminn,m levels.SP-Screates at most2 · minn,m new buckets.

The splitting criterion of SP-C implies better bounds on the maximum height ohierarchy.

Lemma 18. At any time the bucket hierarchy forSP-Ccontains at mostlog2n + 2 levels.SP-Ccreates at most4 ·m new buckets.

Proof. A current bucket on leveli having width∆i is only split if it contains a node withdegreed > 1/∆i . By Invariant 9,∆i 2−i . Furthermore,d 2 ·n (recall thatd is the sumof in-degree and out-degree). Therefore, 2· n > 1/∆i 2i implies that splittings may onlyhappen on leveli, i 0, if i < log2n + 1 log2n + 1. In other words, there can bemostlog2n + 2 levels.

During the execution of SP-C, if a nodev ∈ Bcur is found that has degreed > 1/∆curand all other nodes inBcur have degrees at mostd , thenv causes a splitting ofBcur intoat most 2· (d − 1) new buckets. After nodev caused a splitting it is either settled by tsubsequent early scan operations or it is lifted into buckets of width at most 1/d . Observethatv never falls back to buckets of larger width. Therefore, each node can cause aone splitting. Consequently, SP-C creates at most

∑v∈V 2 · (degree(v) − 1) 4 · m new

buckets. The observations on the maximum hierarchy heights given above naturally bou

number of lift operations for each nodev ∈ V . However, we can provide sharper limbased on the weights of the edges intov.

Lemma 19. Consider a reachable nodev ∈ V with in-degreed ′. Lete1 = (u1, v), . . . , ed ′ =(ud ′, v) denote its incoming edges. Furthermore, leth be an upper bound on the maximuheight of the bucket hierarchy. Nodev is lifted at most

L(v) := min

h− 1, max

1jd ′

⌈log2

1

c(ej )

times.

Proof. Within the bucket hierarchy, nodes can only be moved upwards, i.e., to lwith higher indices. This is obvious for SP-S; in the case of SP-C, note that a rescnode can only reappear in the sameBcur it was previously removed from, or in one of irefining buckets on higher levels. Thus, each node can be lifted at mosth − 1 times. Letc∗v := min1jd ′ c(ej ) be the weight of the lightest edge into nodev. If v is lifted fewer

than log2(1/c∗v) times or if log2(1/c

∗v) > h, then the claim holds. Otherwise, aft

log2(1/c∗v) lift operations,v resides in a currentBcur of width at most 2−log2(1/c

∗v) c∗

v

(by Invariant 9). IfBcur is split thenv ∈ U1 ∪ U2. Hence,v will be settled by early node

Page 20: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

110 U. Meyer / Journal of Algorithms 48 (2003) 91–134

he

chy.kett.

urrentatn bea 21).

. The

ch

Fig. 10. A worst-case setting for relaxations of the edge(v,w) with bottom-up search for the target bucket. Tsmaller the edge weight the more levels have to be checked.

scanning ofU1 ∪U2 (Lemma 13); on the other hand, ifBcur is not split, thenv is eventuallysettled by regularly scanning the nodes inBcur. In both cases,v will not be lifted anymore.

Using max1jd ′ log2(1/c(ej )) ∑

1jd ′ log2(1/c(ej )), Lemma 19 yields thefollowing simple inequality.

Corollary 20. SP-SandSP-Cperform at most∑

e∈Elog2(1/c(e)) lift operations.

5.6. Target-bucket searches

We still have to specify how the SCAN_ALL procedure works in the bucket hierarFor the relaxation of an edgee = (u, v) it is necessary to find the appropriate target bucthat is in charge of the decreased tent(v): eitherBcur or a so far unvisited nonsplit buckeThe target bucket search can be done by a simple bottom-up search: fort = tent(v),the search starts in the arrayL0 and checks whether the bucketB0 = [b0, b0 + ∆0) =[t, t + 1) has already been split or not. In the latter case,v is moved intoB0,otherwise the search continues in the arrayL1 and checksB1 = [b1, b1 + ∆1) whereb1 = b0 + (t − b0)/∆1 · ∆1. Generally, if the target bucketBi = [bi, bi + ∆i) at levelihas been split then the search proceeds with bucketBi+1 = [bi+1, bi+1 + ∆i+1) wherebi+1 = bi + (t − bi)/∆i+1 ·∆i+1.

Each level can be checked in constant time. In the worst case all levels of the cbucket hierarchy must be examined, i.e., at mostn levels for SP-S (Corollary 17), andmost log2n + 2 levels for SP-C (Lemma 18); see also Fig. 10. Better bounds caobtained if we include the weight of the relaxed edge into our considerations (Lemm

Lemma 21. Leth be an upper bound on the maximum height of the bucket hierarchybottom-up target-bucket search for the relaxation of an edgee = (v,w) with weightc(e)checks at mostR(v,w) := minh, log2(1/c(e)) + 1 levels.

Proof. When the edgee = (v,w) from the forward starFS(v) is relaxed, thenv is scannedfrom a current bucketBcur := Bk,l at the topmost levelk. Hence, the target-bucket sear

Page 21: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 111

ora level

ket

of

dgesby

willP-C.

lso

to theclearlyre atc. The

h nodeell. By

1

n the

for w examines at mostk + 1 h levels. The claim trivially holds if the target bucket fw belongs to level 0. Therefore, let us assume that the proper target bucket lies ini∗ 1. Let Ri = [ri, ri + ∆i−1) denote the range of tentative distances leveli 1 is incharge of; recall that the whole range of leveli represents the range of a single split bucat leveli − 1. Due to the way buckets are split,Rk ⊆ Ri for 1 i k. Therefore, wheneis relaxed, we have tent(v) rk ri . The leveli∗ of the target bucket must be in chargethe new tentative distance tent(v)+c(e) ri∗ +c(e). Hence,c(e) < ∆i∗−1. By Invariant 9,∆i∗−1 2−i∗+1. After simple transformations we obtaini∗ < log2(1/c(e)) + 1. Remark 22. For nonnegative edge weights the algorithms never relax self-loop e(v, v). Hence, the total costs to scan a nodev including edge relaxations is boundedO(1 +∑

w∈FS(v), w =v R(v,w)).

This concludes our collection of basic observations. In the next sections wecombine these partial results in order to obtain performance bounds for SP-S and S

6. Performance of the label-setting version SP-S

In this section we will first prove that SP-S has worst-case timeO(n ·m). Then we showthat it runs in linearO(n + m) time on the average. Finally, we prove that this bound aholds with high probability.

Initializing global arrays for tentative distances, level zero buckets, and pointersqueued nodes and storing the lightest incoming edge for each node (Remark 15) canbe done inO(n + m) time for both algorithms SP-S and SP-C. By Lemma 16, there amostn phases, each of which requires constant time for setting control variables, etremaining costs of SP-S account for the following operations.

(a) Scanning nodes.(b) Generating, traversing and removing new buckets.(c) Lifting nodes in the bucket hierarchy.

As for (a), we have seen before that SP-S performs label-setting (Corollary 14); eacis scanned at most once. Consequently, each edge is relaxed at most once, as wCorollary 17, the bucket hierarchy for SP-S contains at mostn levels. Therefore, Lemma 2implies that the total number of levels checked during all relaxations is bounded by

min

n ·m,

∑e∈E

(⌈log2

1

c(e)

⌉+ 1

). (2)

Concerning (b), we know from Corollary 17 that the algorithm creates at most

2 · minn,m (3)

new buckets. Traversing and finally removing them can be done in time linear inumber of buckets; also compare Observation 12. Identifying the setsU1 andU2 during

Page 22: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

112 U. Meyer / Journal of Algorithms 48 (2003) 91–134

des ischeckion.

ility9,20,

rmlyom

to behigh

dent,

ri-

a split takes time linear in the number of nodes in the split bucket. Each of these noeither early scanned or lifted right after the split. Hence, the constant time share towhether such a node belongs toU1∪U2 can be added to its respective scan or lift operat

Finally, the upper bound for (c) follows from Lemma 19 and Corollary 20 whereh n,and at most minn,m nodes are reachable froms: SP-S performs at most

min

minn,m · n,

∑e∈E

⌈log2

1

c(e)

⌉(4)

lift operations.Combining the bounds above immediately yields the following result.

Theorem 23. SP-SneedsO(minn ·m,n+ m +∑e∈Elog2(1/c(e))) time.

In the following we will consider the average-case behavior of SP-S.

6.1. Average-case complexity ofSP-S

In this and the following sections we will frequently use basic facts from probabtheory. An introduction to the probabilistic analysis of algorithms can be found in [137,51,61].

Theorem 24. On arbitrary directed networks with random edge weights that are unifodrawn from[0,1], SP-Sruns inO(n+m) average-case time; independence of the randedge weights isnotneeded.

Proof. DefineXe := log2(1/c(e)). By Theorem 23, SP-S runs inO(n+m+∑e∈E Xe)

time. Hence, it is sufficient to bound the expected value of∑

e∈E Xe. Due to the linearityof expectation we haveE[∑e∈E Xe] =∑

e∈E E[Xe]. By the uniform distribution,

E[Xe] =∞∑i=1

i · P[Xe = i] =∞∑i=1

i · 2−i = 2 (5)

for any edgee ∈ E. Therefore,E[∑e∈E Xe] = O(m). Note once more that Theorem 24 does not require the random edge weights

independent. However, if they are independent then the result even holds withprobability. This can be shown with a concentration result for the sum of indepengeometrically distributed random variables.

Lemma 25 [59, Theorem 3.38].Let X1, . . . ,Xk be independent, geometrically distbuted random variables with parametersp1, . . . , pk ∈ (0,1). Let µ = E[∑k

i=1Xi], andlet p = min1ik pi . Then for allδ > 0 it holds that

P

[k∑

i=1

Xi (1+ δ) ·µ]

(

1 + δ ·µ · pk

)k

· e−δ·µ·p. (6)

Page 23: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 113

,39]

m

bound

ndm6)

ider aprovePaths

ghts

ctions

Proof. In [59] it is shown how (6) can be derived from the Chernoff bounds [7below. Lemma 26 (Chernoff bounds [7,39]).Let X1, . . . ,Xk be independent binary randovariables. Letµ = E[∑k

j=1Xj ]. Then it holds for allδ > 0 that

P

[k∑

j=1

Xj (1 + δ) ·µ]

e− minδ2,δ·µ/3. (7)

Furthermore, it holds for all0< δ < 1 that

P

[k∑

j=1

Xj (1 − δ) ·µ]

e−δ2·µ/2. (8)

After having presented these basic tools, we come back to the high-probabilityfor SP-S.

Theorem 27. SP-SrequiresO(n + m) time with high probability on arbitrary directednetworks with random independent edge weights uniformly drawn from[0,1].

Proof. DefineXe := log2(1/c(e)). As in the case of Theorem 24, we have to bou∑e∈E Xe. Note thatP[Xe = i] = (1/2)i , i.e., Xe is a geometrically distributed rando

variable with parameterpe = 1/2. Furthermore,E[Xe] = 2. Hence, we can use formula (with δ = 1,p = 1/2, andµ = 2 ·m to see

P[∑e∈E

Xe 4 ·m]<

(3

4

)m

.

6.2. Immediate extensions

This section deals with a few simple extensions for SP-S: in particular, we conslarger class of distribution functions for the random edge weights, sketch how to imthe worst-case performance, and identify implications for the All-Pairs Shortest-problem.

6.2.1. Other edge weight distributionsTheorem 24 does not only hold for random edge weights uniformly distributed in[0,1]:

from its proof it is obvious that any distribution function for the random edge weisatisfying

E[⌈

log21

c(e)

⌉]= O(1)

is sufficient. The edge weights may be dependent, and even different distribution funfor different edge weights are allowed.

Page 24: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

114 U. Meyer / Journal of Algorithms 48 (2003) 91–134

re

eseegere

P-S

overber of

rceafterith

nteger

ortest-es that

for

give aente.

The uniform distribution in[0,1] is just a special case of the following much mogeneral class: let us assume 0 c(e) 1 has a distribution functionFe with the propertiesthat Fe(0) = 0 and thatF ′

e(0) is bounded from above by a positive constant. Thproperties imply thatFe can be bounded from above as follows: there is an intconstantα 1 so that for all 0 x 2−α , Fe(x) 2α · x. Let Ye be a random variablthat is uniformly distributed in[0,2−α]. For all 0 x 1, P[c(e) x] P[Ye x] =min2α · x,1. Consequently, for all integersi 1,

P[⌈

log21

c(e)

⌉ i

] P

[⌈log2

1

Ye

⌉ i

]= min

2α−i ,1

.

Thus,

E[⌈

log21

c(e)

⌉]

∞∑i=1

i · min2α−i,1

α +

∞∑i=1

(i + α) · 2−i 4 · α.

6.2.2. Other splitting criteriaIf the current bucketBcur containsb∗ > 1 nodes at the beginning of a phase then S

splitsBcur into two new buckets. Actually, SP-S still runs in linear average-case time ifBcuris split intoO(b∗) buckets: in that case the total number of newly generated bucketsthe whole execution of SP-S is linear in the total number of nodes plus the total numlift operations, i.e.,O(n+ m) on the average.

6.2.3. Improved worst-case boundsThe worst-case timeΘ(n ·m) can be trivially avoided by monitoring the actual resou

usage of SP-S and starting the computation from scratch with Dijkstra’s algorithmSP-S has consumedΘ(n · logn + m) operations. Similarly, SP-S can be combined wother algorithms in order to obtain improved worst-case bounds for nonnegative iedge weights [58].

6.2.4. All-pairs shortest-pathsSolving SSSP for each source node separately is the most obvious All-Pairs Sh

Paths algorithm. For sparse graphs, this strategy is very efficient. In fact, SP-S implithe APSP problem on arbitrary directed graphs can be solved inO(n2 + n · m) time onthe average. This is optimal ifm = O(n). All previously known average-case boundsAPSP were inω(n2).

7. Performance of the label-correcting version SP-C

In analogy to Section 6, we first consider the worst-case complexity of SP-C. Wesimple proof for theO(n·m · logn)-bound and then continue with a more detailed treatmof the number of node scans. Subsequently, we turn to the average-case running tim

Theorem 28. SP-CrequiresO(n ·m · logn) time in the worst case.

Page 25: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 115

done,

,canned,

most

tms in

n

ich itr

te

t

Proof. Similar to SP-S, the initialization of the data structures for SP-C can bein O(n + m) time. By Lemma 18, SP-C creates at most 4· m new buckets. Hencecreating, traversing and removing all buckets can be done inO(n + m) time (see alsoObservation 12). The bucket hierarchy for SP-C contains at mosth = O(logn) levels(Lemma 18). Consequently, SP-C performs at most

min

n · h,

∑e∈E

⌈log2

1

c(e)

⌉= O(n · logn)

lift operations (Lemma 19 and Corollary 20). By Lemma 16, there are at mostn phaseseach of which settles at least one node. Therefore, even though nodes may be resno node is scanned more thann times. That implies that altogether at mostn ·m edges arerelaxed. Due toh = O(logn), the target-bucket search for each relaxation requires atO(logn) time. Hence, SP-C runs inO(n ·m · logn) time in the worst-case.

In the following we will have a closer look at the number of scan operations.

7.1. The number of node scans

Each nodev that is reachable from the source nodes will be inserted into the buckestructureB and scanned at least once. Recall from the description of the algorithSection 5.2 that there areregularnode scans andearly node scans; for an early scan ofv,the IN-criterion (Lemma 8) ensures tent(v) = dist(v). A re-insertionof v into B occursif v was previously scanned with nonfinal distance value tent(v), and now the relaxatioof an edge intov reduces tent(v). A re-insertion ofv later triggers arescanof v fromsome current bucket involving re-relaxations ofv’s outgoing edges. We distinguishlocalrescansof v, i.e., v is removed and rescanned for the same current bucket from whwas removed and scanned before, andnonlocal rescansof v, wherev is rescanned afteremoving it from a different current bucket.

Lemma 29 (Number of scan operations).Letv ∈ V be an arbitrary node with degreed 1and in-degreed ′, 1 d ′ d . Definec∗

v := min1jd ′ c(ej ) to be the weight of the lightesedge into nodev. LetGi be the subgraph ofG that is induced by all vertices with degreat most2i . For eachv ∈ Gi , letCv

i be the set of nodesu ∈ Gi that are connected tov by asimple directed path〈u, . . . , v〉 in Gi of total weight at most2−i . Finally, letD(Gi) denotethe maximum size(i.e., number of edges) of any simple path inGi with total weight at mos2−i . SP-Cperforms at most

SN (v) := min

log2n + 1,min

k0

k: c∗

v 1

2k · d

(9)

nonlocal rescans of nodev and at most

SL(v) :=log2n+1∑i=log2d

∣∣Cvi

∣∣ (10)

local rescans of nodev. Furthermore, for each current bucket of width2−i there are atmostD(Gi)+ 1 regular scan phases.

Page 26: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

116 U. Meyer / Journal of Algorithms 48 (2003) 91–134

n

ates ofd

tng

a

ce

,

s

can

,

s—

Proof. By Invariant 10, the very first regular scan of nodev (if any) takes place whev resides in a current bucketBi0 having bucket width∆i0 2−log2 d. We first discussnonlocal rescans.

Node v can only be rescanned for another current bucket afterv moved upwardsin the bucket hierarchy. As there are at mostlog2n + 2 levels, this can happenmost log2n + 1 times. The new current buckets cover smaller and smaller rangtentative distances: thekth nonlocal rescan ofv implies thatv was previously (re-) scanneconcerning some current bucketBik−1 having bucket width∆ik−1 2−log2d−k+1 whereasit is now rescanned for a new current bucketBik = [bik , bik + ∆ik ) ⊂ Bik−1 of width∆ik 2−log2 d−k at some higher levelik > ik−1. As soon asv enters the current buckeBik , we have tent(v) < bik + 2−log2d−k . By then, the smallest tentative distance amoall queued candidate nodes is at leastbik (Invariant 11). Therefore, if

c∗v 1

2k · d 2−log2 d−k for somek 0 (11)

then tent(v) = dist(v) according to the IN-criterion (Lemma 8); in that case, thekthnonlocal rescan ofv will be the last time thatv is scanned. The bound (9) of the lemmfollows by choosing the smallest nonnegativek satisfying inequality (11).

Now we turn to the local rescans ofv. Consider a current bucketBcur = [b, b + ∆cur)

from which v is rescanned. By Invariant 10,Bcur has bucket width∆cur = 2−i forsomei log2d. We shall use the notation tentj (v) to denote the tentative distanof v at the beginning of phasej . Let t denote the first regular scan phase forBcur.Let t ′ be the last phase wherev is rescanned concerning thisBcur. Hence,z := tentt

′(v)

constitutes the smallest tentative distance found forv beforeBcur is split or finally becomesempty. It follows that there are at mostt ′ − t local rescans ofv from Bcur. Furthermoreb dist(v) z < b +∆cur, and tentj (v) > tentt

′(v) for all j < t ′.

Let VS ⊆ V denote the set of nodes that were scanned and settled before phaset ; notethatVS contains all nodes with dist( · ) < b. Finally, letVB ⊆ V \ VS be the set of nodecontained inBcur when the phaset starts. All nodes inVB have degree at most 2i , i.e., theybelong toGi . Furthermore, as long as the algorithm scans nodes andBcur is neither splitnor emptied, the algorithm keeps exploring paths inGi , starting from the nodes inVB .

Let us fix a pathP = 〈vt , vt+1, . . . , vt ′ = v〉 whose exploration causes the last resof v from Bcur in phaset ′ with tentative distancez: nodevj , t j t ′, is scannedin phasej ; therefore, tentj+1(vj+1) tentj (vj ) + c(vj , vj+1). On the other handtentj+1(vj+1) < tentj (vj )+ c(vj , vj+1) would imply that there is another path fromVB tov in Gi that results in tentt

′(v) < z; this contradicts the choice ofP . Thus, tentj+1(vj+1) =

tentj (vj ) + c(vj , vj+1). We concludec(P ) = tentt′(v) − tentt (vt ) < b + ∆cur − b = 2−i .

In fact, P must be a simple path inGi ; otherwise—due to nonnegative edge weightv would already have been scanned in some phasej < t ′ with tentj (v) = z, thuscontradicting our observation that tentj (v) > tentt

′(v). Therefore,v can be reached from

the nodesvt , . . . , vt ′−1 in Gi along paths of weight less than 2−i , i.e.,vt , . . . , vt ′−1 ∈ Cvi .

Consequently,|Cvi | t ′ − t . Since there are at mostt ′ − t local rescans ofv fromBcur their

number is bounded by|Cv|.

i
Page 27: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 117

f

(forwe can

f SP-Cn from

f

htndom.

The discussion above easily implies thatk subsequent regular scan phases forBcurrequire at least one simple path inGi havingk − 1 edges and total weight at most 2−i .Hence, there are at mostD(Gi)+ 1 regular scan phases for this current bucket.

After having dealt with local rescans of nodev from one particular current bucket owidth 2−i , we can easily bound the total number of local rescans of nodev: the first localrescan ofv (if any) takes place in a current bucket of width 2−i0, wherei0 log2 d.Further local rescans may happen for other current buckets of width 2−i1, 2−i2, . . . , where

i0 < i1 < i2 < · · ·; hence, there are at most∑log2n+1

i=log2 d |Cvi | local rescans ofv in total.

Using Lemma 19 (for the number of lift operations), Lemma 21 and Remark 22the costs of scan operations), and Lemma 29 (for the number of scan operations),restate the worst-case running time of SP-C as follows:

Corollary 30. LetL(v), R(v,w), SN(v), andSL(v) be defined as in Lemmas19, 21, 29,and29, respectively.SP-Cruns in time

O(n+ m +

∑v∈V

(L(v) + (

1 + SN(v) + SL(v)) ·(

1+∑

w∈FS(v), w =v

R(v,w)

))).

(12)

7.2. Average-case complexity ofSP-C

This section serves to establish an average-case bound on the running time ounder the assumption of independent random edge weights that are uniformly draw[0,1]. According to Corollary 30 it is sufficient to find an upper bound for

E[n+ m +

∑v∈V

(L(v) + (

1 + SN(v) + SL(v)) ·(

1+∑

w∈FS(v), w =v

R(v,w)

))].

Due to the linearity of expectation we can concentrate on the termsE[L(v)] and

E[(

1 + SN(v) + SL(v)) ·(

1+∑

w∈FS(v), w =v

R(v,w)

)]. (13)

Recall from Lemma 29 that the values ofSN (v) andSL(v) depend on the weights oedges and simple paths into nodev; they donotdepend on the weights of any edge(v,w),w = v, in the forward star ofv. On the other hand,R(v,w) solely depends on the weigof the edge(v,w); see Lemma 21. Hence, as all edge weights are independent, the ravariables(1 + SN(v) + SL(v)) and (1 + ∑

w∈FS(v), w =v R(v,w)) are independent, tooConsequently, the average-case running time for SP-C is bounded from above by

O(n+ m +

∑v∈V

(E[L(v)

]+ (1 + E

[SN(v)

]+ E[SL(v)

])

×(

1 +∑

E[R(v,w)

]))). (14)

w∈FS(v), w =v

Page 28: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

118 U. Meyer / Journal of Algorithms 48 (2003) 91–134

are.

Now we will show the following inequalities: For any nodev ∈ V and any edge(v,w) ∈ E we have

E[L(v)

] 2 · degree(v) (Lemma 32),

E[R(v,w)

] 3 (Lemma 32),

E[SN(v)

] 2 (Lemma 33),

E[SL(v)

] 2 · e (Lemma 35).

After inserting these inequalities in (14), we immediately obtain

Theorem 31. On arbitrary directed networks with random edge weights thatindependent and uniformly drawn from[0,1], SP-Cruns inO(n + m) average-case time

In the remainder we prove the inequalities mentioned above.

Lemma 32. Let L(v) and R(v,w) be defined as in Lemmas19 and 21, respectively.For any nodev ∈ V and any edge(v,w) ∈ E, we haveE[L(v)] 2 · degree(v) andE[R(v,w)] 3.

Proof. ForL(v), consider a reachable nodev ∈ V with in-degreed ′, 1 d ′ degree(v).Let e1 = (u1, v), . . . , ed ′ = (ud ′, v) denote itsd ′ incoming edges.L(v) is bounded fromabove by

∑1jd ′ log2(1/c(ej )). By inequality (5), we have

E[⌈

log21

c(e)

⌉]=

∞∑i=1

i · P[⌈

log21

c(e)

⌉= i

]=

∞∑i=1

i · 2−i = 2

for any edgee ∈ E. Hence,E[L(v)] 2 · d ′ 2 · degree(v). Similarly, R(v,w) log2(1/c(v,w)) + 1 for any edge(v,w) ∈ E. Thus,E[R(v,w)] 2 + 1 = 3. Lemma 33. For any nodev ∈ V , letSN(v) be defined as in Lemma29; thenE[SN(v)] 2.

Proof. Let v have degreed 1 and in-degreed ′, 1 d ′ d . Let c∗v := min1jd ′ c(ej )

be the weight of the lightest edge into nodev. From the definition ofSN(v), we easilyderive

SN (v) mink0

k: c∗

v 1

2k · d.

Due to the uniform edge weight distribution we have

P[c∗v 1

2k · d]

1−d ′∑j=1

P[c(ej ) <

1

2k · d]

= 1 − d ′ · 1

2k · d 1− 2−k.

Thus,P[SN(v) k] 1− 2−k andP[SN(v) k + 1] 2−k. Therefore,

E[SN (v)

] =∞∑

P[SN(v) = i

] · i =∞∑

P[SN(v) i

]

∞∑2−i+1 = 2.

i=1 i=1 i=1

Page 29: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 119

n willges

mly

he

dgetltoforrt

ee

are

Before we show the last missing inequality,E[SL(v)] 2 · e , we first prove that longpaths with small total weight are unlikely for random edge weights. This observatiobe used to boundE[SL(v)] in Lemma 35. In the following, a path without repeated edand total weight at most∆ will be called a∆-path.

Lemma 34. Let P be a path ofl nonrepeated edges with independent and unifordistributed edge weights in[0,1]. The probability thatP is a ∆-path equals∆l/l! for∆ 1.

Proof. Let Xi denote the weight of theith edge on the path. The total weight of tpath is then

∑li=1Xi . We prove by induction overl that P[∑l

i=1Xi ∆] = ∆l/l! for∆ 1: if l = 1 then due to the uniform distribution the probability that a single eweight is at most∆ 1 is given by∆ itself: P[X1 ∆] = ∆. Now we assume thaP[∑l

i=1Xi ∆] = ∆l/l! for ∆ 1 is true for somel 1. In order to prove the resufor a path ofl + 1 edges, we split the path into a first part ofl edges and a second partone edge. For a total path weight of at most∆, we have to consider all combinations f0 z ∆ 1 so that the first part ofl edges has weight at most∆− z and the second pa(one edge) has weightz. Thus,

P

[l+1∑i=1

Xi ∆

]=

∆∫0

P

[l∑

i=1

Xi ∆ − z

]dz =

∆∫0

(∆ − z)l

l! dz = ∆l+1

(l + 1)!

Lemma 35. LetSL(v) be defined as in Lemma29. For any nodev ∈ V , E[SL(v)] 2 · e.

Proof. Recall thatGi denotes the subgraph ofG that is induced by all vertices with degrat most 2i . Furthermore, for anyv ∈ Gi , Cv

i denotes the set of nodesu ∈ Gi that areconnected tov by a simple directed path〈u, . . . , v〉 in Gi of total weight at most 2−i . For

any nodev with degreed , SL(v) :=∑log2n+1i=log2 d |Cv

i |.Let us definePv

i to be the set of all simple(2−i )-paths intov in Gi . Obviously,|Cv

i | |Pvi |. Hence,

E[SL(v)

]

log2n+1∑i=log2 d

E[∣∣Pv

i

∣∣].Since all nodes inGi have degree at most 2i , no more thand · (2i )(l−1) simple paths ofl edges each enter nodev in Gi . Taking into account the probability that these paths(2−i )-paths (Lemma 34), we find

E[SL(v)

]

log2n+1∑i=log2 d

∞∑l=1

d · 2i·(l−1) · 2−i·l/ l! =log2n+1∑i=log2 d

d

2i·( ∞∑

l=1

1

l!

)

∞∑

2−i · e = 2 · e. (15)

i=0
Page 30: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

120 U. Meyer / Journal of Algorithms 48 (2003) 91–134

uns in

sourceomd by

uentialn the

nsideredgoodfor

or

ultinge time.ndoms into

wingr totalvementtually–Ford

ssical

il

BF;

y lists

Hence, by now we have provided the missing pieces in order to show that SP-C rlinear time on the average (Theorem 31).

As already mentioned in Section 6.2 for SP-S, SP-C can keep track of the actual reusage: afterΘ(n · logn + m) operations it may abort and start the computation frscratch with Dijkstra’s algorithm. Thus, the worst-case total execution time is limiteO(n · logn+ m) while the linear average-case bound is still preserved.

So far we have given upper bounds on the average-case complexity of some seqSSSP algorithms. In the following section we will provide superlinear lower bounds oaverage-case running time of certain SSSP algorithms.

8. Lower bounds

Looking at the average-case performance of the sequential SSSP approaches coso far, one might conclude that random edge weights automatically result inalgorithmic performance. Limitations for simple algorithms like ABI-Dijkstra as seengraph classes with high maximum degreed might be artifacts of a poor analysis. Fexample, up to now we have not excluded that taking a bucket widthΩ(1/d) for ABI-Dijkstra would still reasonably bound the overhead for node rescans while the resreduction of the number of buckets to be traversed might facilitate linear average-casIn this section we tackle questions of that kind. We provide graph classes with raedge weights that force a number of well-known label-correcting SSSP algorithmsuperlinear average-case time.

Worst-case inputs for label-correcting algorithms are usually based on the folloprinciple: Paths with a few edges are found earlier but longer paths have smalleweights and hence lead to improvements on the tentative distances. Each such improtriggers a node rescan (and potentially many edge re-relaxations), which evenmake the computation expensive. We shall elucidate this strategy for the Bellmanalgorithm.

The shortest-paths algorithm of Bellman and Ford [3,21], BF for short, is the clalabel-correcting approach. It maintains the set of labeled nodes in a FIFO queueQ. Thenext nodev to be scanned is removed from the head of the queue; a nodew /∈ Q whosetentative distance is reduced after the relaxation of the edge(v,w) is appended to the taof the queue; ifw already belongs toQ then it will not be appended. We define aroundofBF by induction: the initialization, during which the source node is added toQ, is roundzero. Fori > 0, roundi scans the nodes that were added to the queue during roundi − 1.

8.1. Fixed edge weights

Now we explicitly construct a difficult input graph class with fixed edge weights forsee Fig. 11 for a concrete instance. Let us call the classGBF(n, r). The shortest path fromthe single sources = v0 to the nodeq = vr is given byP = 〈v0, v1, . . . , vr−1, vr 〉. Eachedge onP has weight one. Furthermore, there are edges(vi, q), 0 i < r, having weightc(vi, q) = 2 · (r − i)− 1. Let us assume that these edges appear first in the adjacenc

Page 31: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 121

scan

re

s

pathr, thefixednumbere.

ts is

hs

drawn

al

Fig. 11. Difficult input graphGBF(10,4) with fixed edge weights. It causes the Bellman–Ford algorithm tonodeq four times.

of their respective source nodes. Finally,q hasn − r − 1 outgoing edges to nodes that anot part ofP . Hence, for any choice ofr, GBF(n, r) consists of at most 2· n edges.

For this graph class, BF shows the following behavior: at the beginning of roundi, 1i r −1, the nodesvi andq are inQ with tent(q)= 2· r − i and tent(vi) = i, respectively.Due to the order of the adjacency lists and the FIFO processing,q will be scanned beforeviin roundi. Scanningvi first reduces tent(q) to i + 2 · (r− i)− 1= 2 · r − i− 1, thus addingq to Q again; then the node scan ofvi also relaxes the edge(vi , vi+1), hence reducingtent(vi+1) to i + 1. However, since the edge(vi , vi+1) is relaxed after the edge(vi , q), thenodevi+1 is appended toQ after q is already inQ again. This maintains the maliciousetting for the next round. Altogether,q is scannedr times. Each scan ofq relaxes all itsn − r − 1 outgoing edges. If we chooser = n/2, then BF performsΩ(n2) operations forthis graph withO(n) edges with fixed weights.

For random edge weights it is unlikely that a given long path has a small totalweight (e.g., compare Lemma 34 for paths of total weight at most 1). Moreoveexpected path weight is linear in the number of edges. In fact, if we replace theedge weights in the graph class above by random edge weights then the expectedof rescans ofq is constant and therefore the expected time for BF is linear in that cas

8.2. Emulating fixed edge weights

Our main idea for the construction of difficult graphs with random edge weighto emulatesingle edgesei having fixed weight bywhole subgraphsSi with random edgeweights. EachSi contains exactly one sourcesi and one sinkti . Furthermore, the subgrapare pairwise edge-disjoint and can only share sources and sinks. Each subgraphSi is builtby a chain of so-called(u, v, k)-gadgets.

Definition 36. An (u, v, k)-gadget consists ofk + 2 nodesu, v, w1, . . . ,wk and the 2· kedges(u,wi) and(wi, v). The parameterk is called theblow-up factorof a gadget.

As before, we will assume that random edge weights are independent and uniformlyfrom [0,1].

Lemma 37. The expected shortest path weight betweenu andv in a (u, v,1)-gadget is1,in a (u, v,2)-gadget it is23/30.

Proof. For k = 1, there is only oneu–v path in the(u, v,1)-gadget and its expected totweight is clearly 2· 1/2 = 1.

Page 32: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

122 U. Meyer / Journal of Algorithms 48 (2003) 91–134

athsht

sets ore takephs ofcasethen the

For k = 2, let Y1 andY2 be the random variables that denote the weight of the p〈u,w1, v〉 and〈u,w2, v〉, respectively. Letfe(x) denote the density function for the weigof the single edgee

fe(x) =

1 for 0 x 1,

0 otherwise.

Using the definition above, the density function forYi is given by

fYi (x) =+∞∫

−∞f(u,wi )(y) · f(wi ,v)(x − y)dy =

min1,x∫max0,x−1

1 · 1 dy

=x for 0 x 1,

2 − x for 1< x 2.

The distribution function for the shortest path weight in a(u, v,2)-gadget is given by

W(z) = 1 −(

1 −z∫

0

fY1(x)dx

)·(

1 −z∫

0

fY2(x)dx

)

=−z4/4 + z2 for 0 z 1,

−z4/4 + 2 · z3 − 6 · z2 + 8 · z − 3 for 1< z 2.

Finally,

E[minY1, Y2]=

2∫0

x ·w(x)dx,

where

w(z) =−z3 + 2 · z for 0 z 1,

−z3 + 6 · z2 − 12· z + 8 for 1< z 2

denotes the derivative ofW(z). A simple calculation yields

E[minY1, Y2] =

1∫0

−x4 + 2 · x2 dx +2∫

1

−x4 + 6 · x3 − 12· x2 + 8 · x dx

= 7

15+ 3

10= 23

30.

Large fixed edge weights are emulated by chains ofl 1 gadgets, each of which hablow-up factor one. Smaller fixed weights are emulated using either fewer gadghigher blow-up factors for a fraction of the gadgets in their respective subgraphs. If wthe parameterl large enough then the actual shortest path weights in the chain subgragadgets will just slightly deviate from their expected values with high probability. Inthe gradations between these expected values are much higher than the deviationsemulated behavior will be as desired.

Page 33: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 123

rge

label-them

ithes

r

nt foro

t

nt

Fig. 12. An instance of the graph classGL(n, ε) with random edge weights; it is designed to cause laaverage-case running-times for label-correcting SSSP algorithms of the list class.

8.3. Inputs for algorithms of the list class

Now we provide a concrete conversion example, which works for several SSSPcorrecting algorithms that apply simple list data-structures (like FIFO queues), amongthe Bellman–Ford algorithm. As a basis we use the input classGBF(n, r) with fixed edgeweights of Fig. 11. Let 0< ε < 1/3 be some arbitrary constant. The new input class wrandom edge weights—calledGL(n, ε)—is derived as follows: the fixed-weight edgentering the nodeq in GBF(n, r) are replaced byr = n1/3−ε subgraphsSi , 0 i < r,each of which consists of a chain withl = n2/3 gadgets. More specifically,Si contains(i · n1/3+ε) (· , · ,2)-gadgets whereas the remainingl − i · n1/3+ε gadgets inSi have blow-up factor one. Altogether this accounts forn1−ε gadgets, that is at most 4· n1−ε nodesand edges. EachSi is reachable froms along a chain ofi + 1 auxiliary edges; one furtheedge connects eachSi to q . Thus, the shortest pathPi from s to q throughSi comprises2 · n2/3 + i + 2 edges. Figure 12 shows the principle. All these auxiliary edges accouat most another 3· n1/3−ε nodes and edges in the graph. Finally,q has outgoing edges tthe remainingΘ(n) nodes of the graph. Hence,GL(n, ε) consists ofΘ(n) edges. SimilarlytoGBF(n, r), the adjacency lists of the nodess = v0, v1, . . . , vr−1 are ordered in a way thathe edge(vi , Si) is relaxed first whenvi is scanned.

Let Wi be the random variable denoting the weight of the shortest pathPi from s to q

throughSi in GL(n, ε). Due to the auxiliary edges that connectSi with s, we find

E[Wi ] = l − i · 7

30· n1/3+ε + i + 2

2.

Hence,E[Wi ] − E[Wi+1] = 7/30· n1/3+ε − 1/2. We will make use of yet another variaof the Chernoff bounds in order to show thatWi >Wi+1 with high probability.

Lemma 38 [18,42]. Let the random variablesX1, . . . ,Xn be independent, withak Xk bk for eachk, for some arbitrary realsak , bk. LetX =∑

k Xk . Then for anyt 0,

P[∣∣X − E[X]∣∣ t

] 2 · exp

( −2 · t2∑k(bk − ak)2

). (16)

Page 34: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

124 U. Meyer / Journal of Algorithms 48 (2003) 91–134

t

t

f thenalthe

how

ns are

e

hts

Lemma 39. LetW be the event that the random variablesWi for the weight of the shortespathPi from s to q throughSi in GL(n, ε) satisfy

W0 >W1 > · · · >Wn1/3−ε−1.

For every constant0< ε < 1/3 and sufficiently largen, W holds with probability at leas1 − e−nε .

Proof. Lemma 38 is applied as follows: forn 8,Wi is the sum ofn2/3 + i + 2 2 · n2/3

independent random variables:n2/3 random variables for the shortest-path distances orespectiven2/3 gadgets inSi , andi + 2 random variables for the weights of the exteredges that connectSi with s andq . Each of these random variables takes values ininterval[0,2]. Thus,

P[∣∣Wi − E[Wi ]

∣∣ 4 · n1/3+ε/2] 2 · exp

(−2 · 16· n2/3+ε

2 · n2/3 · 4

)= 2 · e−4·nε .

By Boole’s inequality,|Wi − E[Wi ]| < 4 · n1/3+ε/2 for all i, 0 i < n1/3−ε, withprobability at least 1− 2 · n1/3−ε · e−4·nε 1 − e−nε for n → ∞. We still have to checkthat |Wi − E[Wi ]| 4 · n1/3+ε/2 and |Wi+1 − E[Wi+1]| 4 · n1/3+ε/2 together implyWi >Wi+1:

Wi − Wi+1 E[Wi ] − 4 · n1/3+ε/2 − (E[Wi+1] + 4 · n1/3+ε/2)

= 7

30n1/3+ε − 1

2− 8 · n1/3+ε/2 > 0 for n → ∞.

If the eventW holds, then we have achieved our main emulation goal: paths froms to q

of larger size (i.e., more edges) have smaller total weight. In the following we studysome label-correcting algorithms perform on graphs fromGL(n, ε) if W holds.

8.3.1. The Bellman–Ford algorithmThe graph classGL(n, ε) was derived from the input classGBF(n, r), which had been

tuned to the Bellman–Ford algorithm. Therefore, most of the subsequent observatiosimple consequences of the discussion in Section 8.1. If the eventW of Lemma 39 holdsthen the following actions take place: The nodeq is first reached via the shortest pathP0through the subgraphS0; q will be queued. However,q will have been removed from thqueue before the outgoing edge of the last node inS1 will be relaxed. The relaxation viaP1improves tent(q); therefore,q is queued again. After the removal ofq , tent(q) is improvedvia P2, etc. Consequently, the nodeq is scannedr times. Each timeq is scanned, itsΘ(n) outgoing edges are relaxed. Thus, ifW holds, then BF requires nonlinearΘ(n4/3−ε)

operations on graphs fromGL(n, ε).

Lemma 40. There are input graphs withO(n) nodes and edges and random edge weigsuch that the Bellman–Ford algorithm with a FIFO queue requiresΘ(n4/3−ε) operationswhp for any constant0< ε < 1/3.

Proof. Follows immediately from the discussion above.

Page 35: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 125

m ones ofoving

ctingiefly

the

sst

hts

r inthe

ts ofe.

d by the

sly

gativering the

Implementations of the BF algorithm often apply the so-calledparent-checkingheuristic: the outgoing edges of a nodev in the queue are only relaxed ifv’s parent,u,concerning the current shortest path tree is not in the queue as well; otherwise tent(u) wasrecently improved and tent(v) is surely not final. Consequently,v is discarded from thequeue.

The heuristic does not improve the performance of the Bellman–Ford algorithgraphs fromGL(n, ε): the only nodes affected by this heuristic are the successor nodq when tent(q) is improved. However, none of these nodes has outgoing edges; remthem from the queue is asymptotically as costly as scanning them.

The input classGL(n, ε) also yields poor performance on other SSSP label-correapproaches belonging to the category of list algorithms. In the following we brconsider two examples: the incremental graph algorithm of Pallottino [54] andtopological ordering algorithm of Goldberg and Radzik [34].

8.3.2. The algorithms of Pallottino and Goldberg–RadzikPallottino’s algorithm [54]—PAL for short—maintains two FIFO queuesQ1 andQ2.

Labeled nodes that have been scanned at least once are stored inQ1 whereas labeled nodethat have never been scanned are maintained inQ2. At any time, each node is in at moone queue. The next node to be scanned is removed from the head ofQ1 if this queue is notempty and from the head ofQ2 otherwise. Initially,Q1 is empty andQ2 holds the sourcenodes. If tent(v) is reduced due a relaxation of the edge(u, v) while scanningu thenv isonly added to eitherQ1 orQ2 if it is currently not stored in any of them: ifv was scannedbefore then it will be added to the tail ofQ1, or to the tail ofQ2 otherwise. This approachas worst-case execution timeO(n2 · m) but performs very well on many practical inpu[6,70].

Due to the structure of our graph classGL(n, ε) the only nodes that can ever appeaqueueQ1 are the nodeq and its immediate successors. Similarly to the BF algorithmFIFO queues in PAL enforce thatq is reached via pathsPi in order of increasingi. SinceW0 >W1 > · · · > Wr−1 whp, PAL frequently putsq into Q1 and thus relaxes theΘ(n)

outgoing edges ofq before the computation carries on. Altogether PAL needsΘ(n4/3−ε)

operations whp.The algorithm of Goldberg and Radzik [34], abbreviated GOR, maintains two se

nodes,Q1 andQ2, as well. Initially, Q1 is empty andQ2 contains the starting nodAt the beginning of each round, the basic version of GOR buildsQ1 based onQ2 andmakesQ2 the empty set.Q1 is linearly ordered. During a round, the nodes fromQ1 arescanned according to this order; target nodes whose tentative distances are reducescanning will be put intoQ2. After Q1 is empty it is refilled as follows: letQ′ be theset of nodes reachable fromQ2 via edges(u, v) in the subgraphG′ having reduced costtent(u) + c(u, v) − tent(v) 0. Using depth first search,Q1 is assigned the topologicalsorted5 setQ′ such that for every pair of nodesu andv in Q′ with (u, v) ∈ G′, u precedesv in Q1. Thus,(u, v) will be relaxed beforev is scanned fromQ1.

5 Topological sorting ofG′ is possible for nonnegative edge weights, since there are no cycles with netotal weight inG′; cycles of weight zero are either contracted or the respective back edges discovered duDFS computation are deleted fromG′.

Page 36: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

126 U. Meyer / Journal of Algorithms 48 (2003) 91–134

h

om

d

hes.

R

omerithms

e-

s

es alle since

et, i.e.,omesistance

m thesee next

e-by-one

An edge (u, v) ∈ E with tent(u) = ∞ and tent(v) = ∞ only belongs toG′ ifc(u, v) = 0. Let W ′ be the event that the input graphGL(n, ε) contains no edges witweight zero. For independent random edge weights uniformly drawn from[0,1],W ′ holdswith probability 1. GivenW ′, it is easily shown by induction that

(1) in thekth round, GOR scans nodes that are reachable froms via paths of at most 2· kedges;

(2) the DFS search inG′ at the end of roundk only finds nodes that can be reached frs in GL(n, ε) via paths of at most 2· k + 2 edges.

If the eventW of Lemma 39 andW ′ hold then the nodeq of GL(n, ε) is scanned for thefirst time in roundn2/3 + 1, based on a path froms to q via S0 having 2· n2/3 + 2 edges.The next better paths viaS1 andS2 comprise 2· n2/3 + 3 edges and 2· n2/3 + 4 edges,respectively; thus, they are not discovered by the DFS search at the end of rounn2/3.Therefore, the respective last nodes ofS1 andS2 are not scanned beforeq in roundn2/3+1.Similarly, a rescan ofq during roundn2/3 + 1 + i is due to a path froms to q thoughS2·i ;none of the better paths viaS2·i+1, . . . , Sr−1 has been found by the previous DFS searcThus, onceq has been reached for the first time in roundn2/3 + 1, itsΘ(n) outgoing edgeswill be re-relaxed during each of the next(r −1)/2 phases again. We conclude that GOrequiresΩ(n4/3−ε) operations ifW andW ′ hold, which happens with high probability.

8.4. Examples for algorithms with approximate priority queues

After having discussed difficult input graphs with random edge weights for salgorithms with simple list data structures in Section 8.3, we now turn to SSSP algowhich apply some simple “approximate” priority queues.

8.4.1. Simple bucket approachesLet us consider the sequential∆-Stepping algorithm of [48]. It maintains a on

dimensional arrayB of buckets whereB[i] stores the setv ∈ V : v is queued andtent(v) ∈ [i ·∆,(i + 1) ·∆). Similar to our new algorithms, the parameter∆ is a positivereal number, which is also called the “bucket width.”

The∆-Stepping approach distinguisheslight edges andheavyedges: a light edge haweight at most∆, the weight of a heavy edge is larger than∆. In eachphase, the algorithmscansall 6 nodes from the first nonempty bucket (i.e., the current bucket) and relaxlight edges out of these nodes. The relaxation of heavy edges is not needed at this timthey can only result in tentative distances outside of the scope of the current buckthey will not insert nodes into the current bucket. Once the current bucket finally becempty after a phase, all nodes in its distance range have been assigned their final dvalues during the previous phase(s). Subsequently, all heavy edges emanating fronodes are relaxed once and for all. Then the algorithm sequentially searches for thnonempty bucket.

6 Similar to the bucket-splitting approaches, the nodes of the current bucket could also be scanned onin FIFO order.

Page 37: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 127

l

the

des

litting

rm

de

itht thelue.

htet

ce

hts,

For maximum node degreed and maximum shortest-path weightL, the analysis in[48] showed that it is sufficient to take buckets of width∆ = Θ(1/d) in order to limit theaverage-case overhead for node rescans and edge re-relaxations byO(n + m). However,L/∆ = Θ(L · d) buckets have to be traversed for that choice of∆. The resulting totaaverage-case timeO(E[L · d] + n + m) may be largely dominated by the termE[L · d].To which extent can∆ be increased in order to find an optimal compromise betweennumber of traversed buckets and the overhead due to node rescans?

In the following we will show that there are graphs withO(n) edges where any fixebucket width∆ results inΩ(n · √

logn/ log logn) operations on the average. This providanother motivation for the need of improved algorithms like the adaptive bucket spapproaches SP-C and SP-S.

In principle, we would like to re-use the graph classGL(n, ε) of Section 8.3 in ordeto construct difficult inputs for the∆-Stepping. But there, in order to deal with randodeviations, single fixed edge weights had been emulated by long chains ofn2/3 gadgetswith random edge weights; each chain accounted for a total path-weight ofΘ(n2/3) onthe average. Our analysis for SP-C (and the∆-Stepping), however, pointed out that norescans can be attributed to paths of small total weight (at most∆ 1). Therefore, wewill design another input class for the∆-Stepping, featuring short chains and gadgets wrapidly increasing blow-up factors. The following lemma bounds the probability thashortest path weight of a single(u, v, k)-gadget deviates too much from its expected va

Lemma 41. The shortest path weight between the nodesu and v in a (u, v, k)-gadget,k ln2n, lies in the interval[1/(√k · lnn), lnn/

√k] with probability at least1 − 2/ ln2n

for n 20.

Proof. As in the proof of Lemma 37, letYi be the random variable denoting the weigof the path〈u,wi, v〉 via the intermediate nodewi within the gadget. Furthermore, lZ = mini Yi be the weight of the shortest path betweenu and v. The density functionfor Yi is given byfYi (x) = x if 0 x 1 (compare the proof of Lemma 37), henP[Yi x] = 1/2 · x2 for 0 x 1. Therefore,

P[Z 1√

k · lnn

]=(

1− 1

2· 1

k · ln2n

)k

1 − k

2 · k · ln2n> 1 − 1

ln2n.

In order to show

P[Z lnn√

k

]= 1 − O

(1

ln2n

),

let Xi be a binary random variable such thatXi = 1 if both c(u,wi) lnn/(2 · √k ) and

c(wi, v) lnn/(2 · √k ), andXi = 0 otherwise. Due to independent random edge weig

P[Xi = 0] = 1− ln2n/(4 · k). Clearly,Z lnn/√k if

∑i Xi 1. Hence,

P[Z lnn√

k

] P

[∑Xi 1

]= 1 −

(1− ln2n

4 · k)k

1 − e− ln2n/4 1− 1

ln2n

i
Page 38: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

128 U. Meyer / Journal of Algorithms 48 (2003) 91–134

hts

ch

Fig. 13. Difficult input class for the∆-Stepping algorithm. ChainCi consists ofi gadgetsGi with blow-up factorki = ln6·i n each. An extra chainC causes a high maximum shortest-path weight on the average.

for n 20. Therefore, by Boole’s inequality,

P[

1√k · lnn

Z lnn√k

] 1 − 2

ln2n.

Lemma 41 is used in the construction of a difficult graph class for the∆-Steppingalgorithm.

Lemma 42. There are input graphs withO(n) nodes and edges and random edge weigsuch that the∆-Stepping algorithm requiresΩ(n · √

logn/ log logn ) operations on theaverage, no matter how∆ is chosen.

Proof. Consider the following graph class: from the starting nodes to some nodeq withn/3 outgoing edges there arer chainsC1, . . . ,Cr of gadgets. Nodes is the entering nodeof the first gadget of each chain. Similarly,q is the leaving node of the last gadget of eachain. ChainCi , 1 i r, consists ofi gadgetsGi with blow-up factorki = ln6·i n each.Finally, a separate chainC of n/3 edges branches from nodes as well; compare Fig. 13.

Due toC, the average-case maximum shortest-path weight in the graph satisfiesE[L] n/6. Thus, if the bucket width is chosen as∆ 6 · √

ln lnn/ lnn ( 1 for n → ∞) thenthe∆-Stepping algorithm has to traverse at leastE[L]/∆ = Ω(n · √

lnn/ ln lnn) bucketson the average. Henceforth we will assume 1 ∆> 6 · √

ln lnn/ lnn.Let Xq denote the number of light edges (c(e) ∆) emanating from nodeq . Unless

tent(q) = dist(q), the∆-Stepping algorithm only relaxes light edges out ofq . We findE[Xq ] = n/3 ·∆ 2 · n · √

ln lnn/ lnn. By Chernoff bounds (Lemma 26),

P[Xq E[Xq ]

2

] e−E[Xq ]/8 e−(n/4)·√ln lnn/ lnn 1

20for n 20.

Having r chainsC1, . . . , Cr accounts for a total of∑

1ir i < r2 gadgets. We aim tochooser large under the condition that all these gadgets contribute at mostn/3 nodes and2 ·n/3 edges in total. It is sufficient to consider the inequalityr2 · (1+ ln6·r n) n/3; after

Page 39: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 129

r

stated

t)

e 5,r

f at

at

a)dting the

such

tage of: foresresibleboth

some simple transformations it turns out thatr = lnn/(20 · ln lnn) is a feasible choice fon 20.

By Lemma 41, the weight of the shortest path within each single gadget ofCi exceedsthe interval[1/(√ki · lnn), lnn/

√ki ] with probability at most 2/ ln2n if n 20.

Let E be the event that the shortest-path weights of all gadgets are bounded asabove, and that nodeq has at leastE[Xq ]/2 outgoing light edges. Hence,

P[E] 1 − 1

20− r2 · 2

ln2n= 1 − 1

20− ln2n

400· (ln lnn)2· 2

ln2n 1 − 1

20− 1

200

9

10.

Let Wi be the shortest-path weight of chainCi . If E holds, then

Wi i√ki · lnn

>(i + 1) · lnn√

ki · ln3n= (i + 1) · lnn√

ki+1 Wi+1, (17)

and thereforeW1 >W2 > · · ·>Wr with probability at least 9/10. In other words, givenE ,we managed to produce an input graph where paths froms to q of larger size (i.e., moreedges) have smaller total weight. How oftenq is scanned and how many outgoing (lighedges ofq are relaxed during these scans depends on the chosen bucket width∆: however,if E holds and∆ > 6 · √

ln lnn/ lnn, already the shortest-path froms to q throughC1,

〈s, v1,1, q〉, has total weight at most lnn/√

ln6n = 1/ ln2n < ∆. Therefore,s, v1,1, andq are scanned for the current bucketB[0] in phases 1, 2, and 3, respectively. In phasthe nodeq is removed fromB[0] and scanned again since the∆-Stepping finds a bettepath 〈s, v2,1, v2,2, v2,3, q〉 throughC2. Altogether, if E holds and∆ > 6 · √

ln lnn/ lnnthenq is scannedr lnn/(20 · ln lnn) times. Each such scan involves the relaxation oleastE[Xq ]/2 n · √

ln lnn/ lnn light edges leavingq . Hence—givenE—the∆-Steppingperforms at leastn/20·√lnn/ ln lnn edge relaxations. The claim follows from the fact thE holds with probability at least 9/10.

The “Approximate Bucket implementation” [6] of Dijkstra’s algorithm (ABI-Dijkstressentially boils down to the sequential∆-Steppingwithoutdistinction between light anheavy edges, i.e., all outgoing edges of a removed node are relaxed. Hence, repeatwo parts of the proof above for either∆ ln lnn/ lnn or ∆< ln lnn/ lnn when all edgesout of nodeq are relaxed after each removal ofq yields

Corollary 43. There are graphs withO(n) nodes and edges and random edge weightsthat ABI-Dijkstra requiresΩ(n · logn/ log logn) operations on the average.

A comparison between Lemma 42 and Corollary 43 seems to reveal an advanthe ∆-Stepping over ABI-Dijkstra due to the distinction of light and heavy edgesthe underlying graph class and a proper choice of∆, the∆-Stepping approach computSSSP inΘ(n · √

logn/ log logn) time on the average, whereas ABI-Dijkstra requiΩ(n · logn/ log logn) operations on the average. However, it might still be possto construct graphs withO(n) nodes and edges and random edge weights whereapproaches provably needΩ(n · logn/ log logn) operations on the average.

Page 40: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

130 U. Meyer / Journal of Algorithms 48 (2003) 91–134

ideases isFIFOempty.sentative

Thehold

l thanalueions aretly wee

e

OWe proofchain

t

Fig. 14. Modified input class for the threshold approach.

8.4.2. Threshold algorithmGlover et al. suggested several variants [29–31] of a method which combines

lying behind the algorithms of Bellman–Ford and Dijkstra: the set of queued nodpartitioned into two subsets, NOW and NEXT. These sets are implemented byqueues. The algorithms operate in phases; at the beginning of each phase, NOW isFurthermore, the methods maintain a threshold parametert whose value is computed aan average (weighted by constant factors) between the smallest and the average tdistance among all nodes in NEXT. During a phase, the algorithms append nodesv fromNEXT having tent(v) t to the FIFO queue of NOW and scan nodes from NOW.algorithmic variants differ in the concrete formulae for the computation of the thresvaluet ; there are other options as well, e.g., whether nodesv in NEXT having tent(v) t

are immediately appended to NOW or just after NOW remains empty.The general strategy of the threshold method is potentially much more powerfu

the∆-Stepping with fixed bucket width: an appropriate re-selection of the threshold vtafter each phase might avoid superfluous edge relaxations. Furthermore, no operatwasted for the traversal of a large number of empty buckets. However, subsequenwill demonstrate that very similar graph classes as those for the∆-Stepping also caussuperlinear average-case time for the threshold algorithms with FIFO queues.

Lemma 44. There are input graphs withn nodes,m = O(n) edges and random edgweights such that the standard threshold method with two FIFO queues requiresΩ(n ·logn/ log logn) operations on the average.

Proof. In the following we assume that nodes from NEXT are only transferred to Nafter NOW becomes empty. We re-use the notation and graph class developed in thof Lemma 42 with slight modifications, compare Figs. 13 and 14: the separate longC is omitted, and theΘ(n) edges out of the nodeq are extended ton′ = Θ(n) independenpathsBi = 〈q, bi, b′

i〉 of two edges each. Similarly,n′ independent pathsAi = 〈s, ai , a′i〉 of

length two each branch from the nodes.With at least constant probability it is true that

Page 41: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 131

t 1

frome

asn

n:

re that.next

pdates

ime on

stra’s-case

ibeynto the

roving

(1) the eventE from the proof of Lemma 42 holds,(2) Θ(n) edges from bothAi andBi have weight at least 1/2.

We will assume that these conditions hold. The basic rationale behind the chainsAi andBi is to keep the set NEXT well filled with nodes having tentative distances at leas/2,thus maintaining a large threshold value.

After the edges ofs are relaxed, NEXT contains the inner nodes of the first gadgeteach chainCi and alsoΘ(n) nodesai from the chainsAi . As a consequence, given thconditions on the edge weights as stated above, the threshold value will bet = Θ(1).Hence, a constant fraction of the nodes in NEXT will be moved to NOW, and—Eholds—the nodes on the shortest paths of the chainsCi are among them. The relaxatioof all edges out of nodes in NOW will put anotherΘ(n) nodesa′

i from Ai into NEXT,thus keeping the threshold value large (t = Θ(1)) whereas tent(q) 1/ ln2n due toE anda path〈s, v′, q〉 wherev′ ∈ C1.

Subsequently, one observesr − 1 = Θ(logn/ log logn) cycles of the same patterscanningq from NOW will cause NEXT to storeΘ(n) nodesbi or b′

i from Bi for thenext two phases. Therefore, the threshold value remains sufficiently high to ensuthose nodes ofCi that are required for the next improvement ofq are transferred to NOWAs a consequence,q is re-inserted into NOW with improved distance value, and thecycle starts. Note that subsequent updates for tent(q) are separated by a phase whereq isnot part of NOW; however, as the queues operate in FIFO mode, the order of these uwill be maintained. Hence, with at least constant probability there areΘ(logn/ log logn)cycles, each of which requiresΘ(n) operations.

9. Conclusions

We have presented the first SSSP algorithms that run in linear average-case tarbitrary directed graphs with random edge weights. Worst-case timeΘ(n logn + m) canstill be guaranteed by monitoring the actual time usage and switching back to Dijkalgorithm if required. In addition, we have shown lower-bounds on the averagerunning times of some previous label-correcting algorithms.

Acknowledgments

The author thanks Torben Hagerup, Annamária Kovács, Volker Priebe, and Jop Sfor valuable discussions and suggestions. Furthermore, the author is gratefulanonymous referees for their detailed comments, which played a crucial role in impboth the analysis and the presentation of the paper.

Page 42: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

132 U. Meyer / Journal of Algorithms 48 (2003) 91–134

Hall,

blem,

CM–

rithms,

uation,

vations,

scencerated

in the

(1979)

.969)

and

t. Sci.,

eling

i heaps

s, Draft

rithms,

mput.

t paths,

–157.Appl.

(1986)

ithm,

References

[1] R.K. Ahuja, T.L. Magnanti, J.B. Orlin, Network Flows: Theory, Algorithms, and Applications, Prentice1993.

[2] R.K. Ahuja, K. Mehlhorn, J.B. Orlin, R.E. Tarjan, Faster algorithms for the shortest path proJ. ACM 37 (2) (1990) 213–223.

[3] R. Bellman, On a routing problem, Quart. Appl. Math. 16 (1958) 87–90.[4] G.S. Brodal, Worst-case efficient priority queues, in: Proc. 7th Ann. Symp. on Discrete Algorithms, A

SIAM, 1996, pp. 52–58.[5] S. Chaudhuri, C.D. Zaroliagis, Shortest paths in digraphs of small treewidth, Part I: Sequential algo

Algorithmica 27 (3–4) (2000) 212–226.[6] B.V. Cherkassky, A.V. Goldberg, T. Radzik, Shortest path algorithms: Theory and experimental eval

Math. Programming 73 (1996) 129–174.[7] H. Chernoff, A measure of asymptotic efficiency for tests of a hypothesis based on the sum of obser

Ann. Math. Statist. 23 (1952) 493–507.[8] J. Cong, A.B. Kahng, K.S. Leung, Efficient algorithms for the minimum shortest path Steiner arbore

problem with applications to VLSI physical design, IEEE Trans. Computer-Aided Design of IntegCircuits and Systems 17 (1) (1998) 24–39.

[9] C. Cooper, A. Frieze, K. Mehlhorn, V. Priebe, Average-case complexity of shortest-paths problemsvertex-potential model, Random Structures Algorithms 16 (2000) 33–46.

[10] E.V. Denardo, B.L. Fox, Shortest route methods: 1. Reaching pruning and buckets, Oper. Res. 27161–186.

[11] N. Deo, C. Pang, Shortest-path algorithms: Taxonomy and annotation, Networks 14 (1984) 275–323[12] R.B. Dial, Algorithm 360: Shortest-path forest with topological ordering, Commun. ACM 12 (11) (1

632–633.[13] R.B. Dial, F. Glover, D. Karney, D. Klingman, A computational analysis of alternative algorithms

labeling techniques for finding shortest path trees, Networks 9 (1979) 215–248.[14] J. Díaz, J. Petit, M. Serna, Random geometric problems on[0,1]2, in: RANDOM: International Workshop

on Randomization and Approximation Techniques in Computer Science, in: Lecture Notes in CompuVol. 1518, Springer, 1998, pp. 294–306.

[15] E.W. Dijkstra, A note on two problems in connexion with graphs, Nummer. Math. 1 (1959) 269–271.[16] E.A. Dinic, Economical algorithms for finding shortest paths in a network, in: Transportation Mod

Systems, 1978, pp. 36–44.[17] J.R. Driscoll, H.N. Gabow, R. Shrairman, R.E. Tarjan, Relaxed heaps: An alternative to Fibonacc

with applications to parallel computation, Commun. ACM 31 (11) (1988) 1343–1354.[18] D.P. Dubhashi, A. Panconesi, Concentration of measure for the analysis of randomized algorithm

Manuscript, http://www.brics.dk/~ale/papers.html, October 1998.[19] W. Feller, An Introduction to Probability Theory and Its Applications, Vol. I, Wiley, 1968.[20] W. Feller, An Introduction to Probability Theory and Its Applications, Vol. II, Wiley, 1971.[21] L.R. Ford, D.R. Fulkerson, Flows in Networks, Princeton Univ. Press, Princeton, NJ, 1963.[22] M.L. Fredman, R.E. Tarjan, Fibonacci heaps and their uses in improved network optimization algo

J. ACM 34 (1987) 596–615.[23] M.L. Fredman, D.E. Willard, Surpassing the information theoretic bound with fusion trees, J. Co

System Sci. 47 (1993) 424–436.[24] M.L. Fredman, D.E. Willard, Trans-dichotomous algorithms for minimum spanning trees and shortes

J. Comput. System Sci. 48 (1994) 533–551.[25] A. Frieze, Shortest path algorithms for knapsack type problems, Math. Programming 11 (1976) 150[26] A.M. Frieze, G.R. Grimmett, The shortest-path problem for graphs with random arc-lengths, Discrete

Math. 10 (1985) 57–77.[27] G. Gallo, S. Pallottino, Shortest path methods: A unifying approach, Math. Programming Study 26

38–64.[28] G. Gallo, S. Pallottino, Shortest path algorithms, Ann. Oper. Res. 13 (1988) 3–79.[29] F. Glover, R. Glover, D. Klingman, Computational study of an improved shortest path algor

Networks 14 (1984) 23–37.

Page 43: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

U. Meyer / Journal of Algorithms 48 (2003) 91–134 133

s. 33

their

pean230–

um on2001,

tt. 6

Report

dies in

2001.es and

(1985)

graphs,

oc. 58

shortest

Oper.

ctures

in: Proc.http:001.D thesis,

Ann.1998,

the C

ls andputer

ms 6

(1984)

Math.

[30] F. Glover, D. Klingman, N. Phillips, A new polynomially bounded shortest path algorithm, Oper. Re(1985) 65–73.

[31] F. Glover, D. Klingman, N. Phillips, R.F. Schneider, New polynomial shortest path algorithms andcomputational attributes, Management Sci. 31 (1985) 1106–1128.

[32] A.V. Goldberg, A simple shortest path algorithm with linear average time, in: Proc. 9th Ann. EuroSymposium on Algorithms (ESA), in: Lecture Notes in Comput. Sci., Vol. 2161, Springer, 2001, pp.241.

[33] A.V. Goldberg, Shortest path algorithms: Engineering aspects, in: Proc. 12th Intern. SymposiAlgorithms and Computation (ISAAC 2001), in: Lecture Notes in Comput. Sci., Vol. 2223, Springer,pp. 502–513.

[34] A.V. Goldberg, T. Radzik, A heuristic improvement of the Bellman–Ford algorithm, Appl. Math. Le(1993) 3–6.

[35] A.V. Goldberg, R.E. Tarjan, Expected performance of Dijkstra’s shortest path algorithm, TechnicalTR-96-062, NEC Research, 1996.

[36] B. Golden, T. Magnanti, Transportation planning: Network models and their implementation, in: StuOperations Management, 1978, pp. 365–518.

[37] G.R. Grimmett, D.R. Stirzaker, Probability and Random Processes, 3rd Edition, Oxford Univ. Press,[38] T. Hagerup, Improved shortest paths on the word RAM, in: 27th Colloquium on Automata, Languag

Programming (ICALP), in: Lecture Notes in Comput. Sci., Vol. 1853, Springer, 2000, pp. 61–72.[39] T. Hagerup, C. Rüb, A guided tour of Chernoff bounds, Inform. Proc. Lett. 33 (1990) 305–308.[40] R. Hassin, E. Zemel, On shortest paths in graphs with random weights, Math. Oper. Res. 10 (4)

557–564.[41] M.R. Henzinger, P. Klein, S. Rao, S. Subramanian, Faster shortest-path algorithms for planar

J. Comput. System Sci. 55 (1) (1997) 3–23.[42] W. Hoeffding, Probability inequalities for sums of bounded random variables, J. Amer. Statist. Ass

(1964) 13–30.[43] D. Houck, J. Picard, M. Queyranne, R. Vemuganti, The traveling salesman problem as a constrained

path problem: Theory and computation experience, Opsearch (India) 17 (1980) 94–109.[44] M.S. Hung, J.J. Divoky, A computational study of efficient shortest path algorithms, Comput.

Res. 15 (6) (1988) 567–576.[45] K. Mehlhorn, V. Priebe, On the all-pairs shortest-path algorithm of Moffat and Takaoka, Random Stru

Algorithms 10 (1997) 205–220.[46] U. Meyer, Single-source shortest-paths on arbitrary directed graphs in linear average-case time,

12th Ann. Symp. on Discrete Algorithms, ACM–SIAM, 2001, pp. 797–806; Extended version://www.mpi-sb.mpg.de/~umeyer/pubs.html as Technical Report MPI-I-2001-1-002, MPI Informatik, 2

[47] U. Meyer, Design and analysis of sequential and parallel single-source shortest-paths algorithms, PhUniversität des Saarlandes, 2002.

[48] U. Meyer, P. Sanders,∆-stepping: A parallel single source shortest path algorithm, in: Proc. 6thEuropean Symposium on Algorithms (ESA), in: Lecture Notes in Comput. Sci., Vol. 1461, Springer,pp. 393–404.

[49] A. Moffat, T. Takaoka, An all pairs shortest path algorithm with expected timeO(n2 logn), SIAM J.Comput. 16 (1987) 1023–1031.

[50] J.-F. Mondou, T.G. Crainic, S. Nugyen, Shortest path algorithms: A computational study withprogramming language, Comput. Oper. Res. 18 (1991).

[51] R. Motwani, P. Raghavan, Randomized Algorithms, Cambridge Univ. Press, 1995.[52] M. Nonato, S. Pallottino, B. Xuewen, SPT_L shortest path algorithms: Review, new proposa

some experimental results. Technical Report TR-99-16, University of Pisa, Department of ComScience, 1999.

[53] K. Noshita, A theorem on the expected complexity of Dijkstra’s shortest path algorithm, J. Algorith(1985) 400–408.

[54] S. Pallottino, Shortest-path methods: Complexity, interrelations and new propositions, Networks 14257–267.

[55] U. Pape, Implementation and efficiency of Moore-algorithms for the shortest route problem,Programming 7 (1974) 212–222.

Page 44: Average-case complexity of single-source shortest-paths algorithms: lower and upper bounds

134 U. Meyer / Journal of Algorithms 48 (2003) 91–134

3th Ann.

posium

(1997)

l. 78,

IEEE

time

t. Sci.,

M 46

rtation

posium

[56] S. Pettie, V. Ramachandran, Computing shortest paths with comparisons and additions, in: Proc. 1Symp. on Discrete Algorithms, ACM–SIAM, 2002, pp. 267–276.

[57] R. Raman, Priority queues: Small, monotone and trans-dichotomous, in: 4th Annual European Symon Algorithms (ESA), in: Lecture Notes in Comput. Sci., Vol. 1136, Springer, 1996, pp. 121–137.

[58] R. Raman, Recent results on the single-source shortest paths problem, ACM SIGACT News 28 (2)81–87.

[59] C. Scheideler, Probabilistic Methods for Coordination Problems, in: HNI-Verlagsschriftenreihe, VoUniversity of Paderborn, 2000.

[60] M. Schwartz, T.E. Stern, Routing techniques used in computer communication networks, in:Transactions on Communications, 1980, pp. 539–552.

[61] R. Sedgewick, P. Flajolet, An introduction to the analysis of algorithms, Addison–Wesley, 1996.[62] R. Sedgewick, J.S. Vitter, Shortest paths in Euclidean graphs, Algorithmica 1 (1986) 31–48.[63] P.M. Spira, A new algorithm for finding all shortest paths in a graph of positive arcs in average

O(n2 log2n), SIAM J. Comput. 2 (1973) 28–32.[64] T. Takaoka, Theory of 2–3 heaps, in: Computing and Combinatorics, in: Lecture Notes in Compu

Vol. 1627, Springer, 1999, pp. 41–50.[65] M. Thorup, Undirected single-source shortest paths with positive integer weights in linear time, J. AC

(1999) 362–394.[66] M. Thorup, Floats, integers, and single source shortest paths, J. Algorithms 35 (2000) 189–201.[67] M. Thorup, On RAM priority queues, SIAM J. Comput. 30 (2000) 86–109.[68] M.S. Waterman, Mathematical Methods for DNA Sequences, CRC Press, Boca Raton, FL, 1988.[69] J.W.J. Williams, Heapsort, Commun. ACM 7 (6) (1964) 347–348.[70] F.B. Zhan, C.E. Noon, Shortest path algorithms: An evaluation using real road networks, Transpo

Sci. 32 (1998) 65–73.[71] U. Zwick, Exact and approximate distances in graphs—a survey, in: Proc. 9th Ann. European Sym

on Algorithms (ESA), in: Lecture Notes in Comput. Sci., Vol. 2161, Springer, 2001, pp. 33–48.