solving shortest path problems with a weight constraint ... · sents duty hours, and replenishment...

21
Solving Shortest Path Problems With a Weight Constraint and Replenishment Arcs Olivia J. Smith a,* , Natashia Boland b , Hamish Waterer b a University of Melbourne, Department of Mathematics and Statistics, Australia b University of Newcastle, Department of Mathematical and Physical Sciences, Australia Abstract This paper tackles a generalization of the weight constrained shortest path problem in a directed network (WCSPP) in which replenishment arcs, that reset the accumulated weight along the path to zero, appear in the network. Such situations arise, for example, in airline crew pairing applications, where the weight repre- sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight represents time elapsed, or flight time, and replenishment arcs represent maintenance events. In this paper, we introduce the weight constrained shortest path problem with replenishment (WCSPP-R), de- velop preprocessing methods, extend existing WCSPP algorithms, and present new algorithms that exploit the inter-replenishment path structure. We provide the results of computational experiments investigating the benefits of preprocessing and comparing several variants of each algorithm, on both randomly generated data, and data derived from airline crew scheduling applications. Keywords: constrained shortest paths, shortest paths, preprocessing, replenishment, labeling algorithms 1. Introduction Given a directed graph, together with a start node, an end node, and a cost and a non-negative weight value for each arc, the weight constrained shortest path problem (WCSPP) is the problem of finding a least cost path in the graph from the start node to the end node, subject to a limit on the total weight. This paper extends the WCSPP to include replenishment arcs which reset weight accumulation to zero, giving the weight constrained shortest path problem with replenishment (WCSPP-R). In this problem, the total accumulation of weight at any point in a feasible path cannot exceed the weight limit. The WCSPP has been widely studied because of its relevance to important practical applications, such as crew scheduling, rostering, aircraft routing and telecommunications. Interestingly, most of these appli- cations exhibit replenishment opportunities. In crew scheduling and rostering, rest periods, for example, either overnight in the case of scheduling, or for periods of two or more days in the case of rostering, re- plenish crews’ ability to work. In aircraft routing, maintenance events replenish aircrafts’ ability to fly. In telecommunications, equipment can be placed in the network to replenish a signal. Thus the WCSPP-R is, in many important applications, a more directly applicable model than the WCSPP. It is therefore somewhat surprising that the WCSPP-R has received relatively little attention to date. Replenishment in various forms has been considered in other contexts, for example, in telecommunications network design involving the use of relays to regenerate signal [2, 3]; as a traveling salesman problem variant, in which the salesman cannot visit too many nodes in a row, or travel too far, without visiting a “replenishment” node [10]; and in aircraft routing, in which an aircraft cannot fly too many hours without having a maintenance opportunity [12]. It therefore deserves more attention than it has received so far. * Corresponding authour Email address: [email protected] (Olivia J. Smith) Preprint submitted to Elsevier October 19, 2010

Upload: others

Post on 23-Sep-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

Solving Shortest Path Problems With a Weight Constraint andReplenishment Arcs

Olivia J. Smitha,∗, Natashia Bolandb, Hamish Watererb

aUniversity of Melbourne, Department of Mathematics and Statistics, AustraliabUniversity of Newcastle, Department of Mathematical and Physical Sciences, Australia

Abstract

This paper tackles a generalization of the weight constrained shortest path problem in a directed network(WCSPP) in which replenishment arcs, that reset the accumulated weight along the path to zero, appear inthe network. Such situations arise, for example, in airline crew pairing applications, where the weight repre-sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, wherethe weight represents time elapsed, or flight time, and replenishment arcs represent maintenance events. Inthis paper, we introduce the weight constrained shortest path problem with replenishment (WCSPP-R), de-velop preprocessing methods, extend existing WCSPP algorithms, and present new algorithms that exploitthe inter-replenishment path structure. We provide the results of computational experiments investigatingthe benefits of preprocessing and comparing several variants of each algorithm, on both randomly generateddata, and data derived from airline crew scheduling applications.

Keywords: constrained shortest paths, shortest paths, preprocessing, replenishment, labeling algorithms

1. Introduction

Given a directed graph, together with a start node, an end node, and a cost and a non-negative weightvalue for each arc, the weight constrained shortest path problem (WCSPP) is the problem of finding a leastcost path in the graph from the start node to the end node, subject to a limit on the total weight. Thispaper extends the WCSPP to include replenishment arcs which reset weight accumulation to zero, givingthe weight constrained shortest path problem with replenishment (WCSPP-R). In this problem, the totalaccumulation of weight at any point in a feasible path cannot exceed the weight limit.

The WCSPP has been widely studied because of its relevance to important practical applications, suchas crew scheduling, rostering, aircraft routing and telecommunications. Interestingly, most of these appli-cations exhibit replenishment opportunities. In crew scheduling and rostering, rest periods, for example,either overnight in the case of scheduling, or for periods of two or more days in the case of rostering, re-plenish crews’ ability to work. In aircraft routing, maintenance events replenish aircrafts’ ability to fly. Intelecommunications, equipment can be placed in the network to replenish a signal. Thus the WCSPP-R is,in many important applications, a more directly applicable model than the WCSPP. It is therefore somewhatsurprising that the WCSPP-R has received relatively little attention to date.

Replenishment in various forms has been considered in other contexts, for example, in telecommunicationsnetwork design involving the use of relays to regenerate signal [2, 3]; as a traveling salesman problemvariant, in which the salesman cannot visit too many nodes in a row, or travel too far, without visiting a“replenishment” node [10]; and in aircraft routing, in which an aircraft cannot fly too many hours withouthaving a maintenance opportunity [12]. It therefore deserves more attention than it has received so far.

∗Corresponding authourEmail address: [email protected] (Olivia J. Smith)

Preprint submitted to Elsevier October 19, 2010

Page 2: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

However, to the best of the authors’ knowledge, the only work which considers replenishment in the contextof the WCSPP is the PhD thesis of Cabral [8]; Cabral et al. [2, 3] use the same variant of WCSPP-R as asubproblem, but don’t describe methods for its solution.

Like the WCSPP, the WCSPP-R is NP-Hard. The former is shown in Garey and Johnson [9]. The latteris easily obtained by noting that the WCSPP is a special case of WCSPP-R. Also like the WCSPP, theWCSPP-R can be solved in pseudo-polynomial time. This follows from results of Cabral [8] on a relatedproblem.

Solving the WCSPP has received a significant amount of attention in the literature. Starting with theseminal work of Desrochers and Soumis [5], most approaches are based on some form of labeling algorithm.However significant work has highlighted the utility of preprocessing procedures, and the use of Lagrangianrelaxation, enumeration, kth-shortest paths, and combinations of these ideas to achieve substantial computa-tional improvements. The most recent sequence of work combines preprocessing and Lagrangian relaxationwith label-setting [7], interleaves Lagrangian relaxation and preprocessing, combined with enumeration [13],and culminates with Carlyle et al. [4], which integrates Lagrangian relaxation, enumeration and preprocess-ing for problems with one or more weight constraints, to find ε-optimal solutions with controllable ε. Thelatter also includes a broader overview of methods for WCSPP.

As already mentioned, the only work we are aware of which considers replenishment in the context ofthe WCSPP is the PhD thesis of Cabral [8]. This thesis considers the shortest path problem with relays(SPPR), which deals with an undirected graph in which replenishment can occur at any node, at the priceof some node-dependent cost. As in the WCSPP-R, in the SPPR a path can accumulate no more thana given weight limit before replenishment must occur. WCSPP-R could be viewed as a generalization ofSPPR. Any instance of SPPR can readily be transformed to an instance of WCSPP-R by first convertingthe undirected graph to a directed one in the usual way, and then replacing each node i with three nodesi1, i2, i3, together with additional (non-replenishment) arcs (i1, i3) and (i2, i3) having cost and weight zero,and replenishment arc (i1, i2) having cost given by the replenishment cost at i, and weight zero. Each arcentering node i in the original network should now enter node i1, and each leaving i should leave i3. Theconverse is almost true: any WCSPP-R instance could be converted to a directed form of SPPR instance byinserting a new node in the middle of each replenishment arc, having replenishment cost zero, and settingreplenishment cost at all other nodes sufficiently high to discourage their use for replenishment in an optimalpath. However either of these transformations obscures the problem structure, and we believe both SPPRand WCSPP-R warrant separate attention.

Cabral [8] presents three algorithms for the SPPR. Two are label correcting algorithms that use differentmethods of storing the labels. The third uses the structure of a feasible path, which consists of a sequence ofsubpaths between replenishments, to develop a method in which a shortest path is found in a “higher level”network. In this network, replenishment occurs at all nodes, and arcs represent the minimum cost weightfeasible replenishment-free path between the two nodes in the original network. This latter algorithm isfound to be far less efficient than either of the label correcting methods.

In this paper we develop and extend the ideas in [8] to arrive at highly computationally efficient proce-dures for solving the WCSPP-R. We present two different types of algorithm. One type, like the third algo-rithm of [8], uses a higher-level network, which we call the meta-network, to exploit the inter-replenishmentsubpath structure of feasible paths. WCSPP-R can be expected to have much sparser replenishment op-tions than SPPR, so the meta-network will be much less dense for WCSPP-R than for the SPPR case.Thus we expect the meta-network approach to be more competitive for WCSPP-R than for SPPR. We de-velop new meta-network methods, showing that the use of bounds can reduce the proportion of arcs in themeta-network that need to be explored to a tiny fraction. We also consider label correcting methods incor-porating replenishment, and experiment with several different label data structure and treatment strategies.We show that the label treatment order has a critical effect: the right order can reduce the computationtime by several orders of magnitude. In addition to these two approaches, we develop preprocessing methodsfor WCSPP-R which in some cases lead to significant speed-ups. The key contributions of this paper aresummarised as follows:

1. Introducing WCSPP-R,

2

Page 3: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

2. Preprocessing techniques for WCSPP-R,3. Meta-network algorithms, incorporating techniques such as bounding and incremental meta-network

generation, that substantially improve computational performance,4. Exploration of label-correcting methods for WCSPP-R with alternative label treatment orders, leading

to orders of magnitude improvement in computation time, and5. Computational experiments showing that WCSPP-R can be solved very efficiently, with instances

arising from real airline planning applications solved in a fraction of a second.

The rest of this paper is organised as follows. Section 2 gives a formal definition of the WCSPP-R andestablishes our notation. Section 3 describes preprocessing. The label-correcting algorithms are given inSection 4. Meta-network methods are developed in Section 5. Numerical results and comparisons betweenall methods are given in Section 6. Further work is discussed in Section 7.

2. Problem Definition

We formally define the weight constrained shortest path problem with replenishment (WCSPP-R) as fol-lows. We first define our path notation, then define the weight constrained shortest path problem (WCSPP),and finally define the WCSPP-R.

Given a directed graph G = (N,A) with nodes N and arcs A ⊆ N×N , we define a path p in G from i1 toin, with i1, in ∈ N , to be an ordered set of nodes i1, i2, . . . , in ∈ N with (ik, ik+1) ∈ A for all k = 1, . . . , n−1.Depending on context, we will also let the path p represent the set of arcs forming the path, i.e. we will say(ik, ik+1) ∈ p for all k = 1, . . . , n− 1.

Each arc (i, j) ∈ A has a given cost ci,j and non-negative weight wi,j . The cost of a path p is denoted byc(p), and defined to be c(p) =

∑(i,j)∈p ci,j . Its weight is w(p) =

∑(i,j)∈p wi,j . The WCSPP with a weight

limit W is the problem of finding a path p in G from given start node s to end node t that minimises c(p)subject to w(p) ≤ W .

We define R ⊂ A to be the set of replenishment arcs. Replenishment arcs represent opportunities for theweight to be reset to zero. Problems with replenishment arcs can easily be reformulated as problems withreplenishment nodes and vice versa. Throughout this paper, we allow a replenishment arc to have a non-zeroweight. We define replenishment to occur at the start of the arc. This means that each replenishment arc(i, j) effectively splits a path into two subpaths, one which ends at node i and one which starts with the arc(i, j). We assume, without loss of generality that the start node s has no incoming arcs. If this is not thecase, these arcs can be removed as a preprocessing step. In this situation, we can consider every arc (s, j)originating from the start node to be a replenishment arc.

To complete our formal definition of the WCSPP-R, we extend our notation to include path concatena-tion. Specifically, we define an operator “|” such that if p1 = i1, i2, . . . , ik and p2 = j1, j2, . . . , jn with ik = j1then p1|p2 = i1, i2, . . . , ik, j2, . . . , jn. We also define an inter-replenishment path (IR path) as any path pwhich starts with a replenishment arc, contains no other replenishment arc and ends at a node j which hasat least one outgoing replenishment arc, or ends at t.

For any path p from s to t, let kp be the number of replenishment arcs in p including the one originatingfrom s. We can now rewrite the path p as p1|p2| . . . |pkp

where pi is an IR path for all i = 1, . . . , kp. As thisdecomposition is unique, we can define a subpath function s(p, i) = pi for any path p and for i = 1, . . . , kp.If we let P be the set of all paths from s to t, then the WCSPP-R can be defined as follows:

minp∈P

c(p)

s.t. w(s(p, i)) ≤ W ∀i ∈ 1, . . . , kp.

In what follows, we refer to the combination (N,A, R,w, c, W, s, t) of network (N,A) with replenishmentarcs R ⊂ A, arc weights w, arc costs c, weight limit W , start node s and end node t as a WCSPP-R instance.

3

Page 4: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

3. Preprocessing

Preprocessing has been well established for the WCSPP. Dumitrescu and Boland [7], for example, giveextensive preprocessing procedures, and show that these are able to solve many instances without furthereffort. Here, the first steps of WCSPP preprocessing are adapted for the WCSPP-R. These steps make useof bounds and partial path information computed in the course of standard minimum cost and minimumweight shortest path calculations. Algorithms for these calculations must first be modified to apply in thecontext of replenishment.

To carry out preprocessing, we first run standard shortest path algorithms to compute minimum costpaths from s to each node, and from each node to t. We refer to these methods as SP−COST−F and SP−COST−Bfor the forwards and backwards paths respectively. Since there is a chance that a partial path from s to icould be concatenated with a partial path from i to t to give a feasible s-t path, we also ask the shortest pathalgorithm to store information about weight along each partial path. In the context of replenishment, themost useful information about weight along a partial path to i is (i) the weight accumulated since the lastreplenishment arc before i, and (ii) an indicator as to whether any weight-infeasible IR subpaths appears inthe partial path. We refer to the former as the weight of the partial path, and the latter as the violation.Thus with two shortest path solves, we compute the following values for each node i ∈ N :ζcs,i = the cost of the least cost path from s to i,

ζci,t = the cost of the least cost path from i to t,

ζws,i = the weight of the least cost path from s to i,

ζwi,t = the weight of the least cost path from i to t,

ζvs,i = T if an IR subpath on the least cost path from s to i violates the weight limit, F

otherwise, andζvi,t = T if an IR subpath on the least cost path from i to t violates the weight limit, F

otherwise.Note that ζw

s,t computed by the backward algorithm gives the weight of the first IR subpath, whilst the sameparameter computed by the forward algorithm gives the weight of the last IR subpath. Since the only useof this parameter is to check if we have found a feasible path, in each case we check that, and afterwardignore it. In either case, provided s and t are connected, ζc

s,t provides a lower bound on the value of theWCSPP-R.

We also seek minimum-weight feasible paths from s to each node and from each node to t, taking intoaccount replenishment. To do so in the forward direction, we solve the following dynamic programmingequations:

ωws,j = min{ min

(i,j)∈R{wi,j : ωw

s,i < +∞}, min(i,j)∈A\R

{ωws,i + wi,j : ωw

s,i + wi,j ≤ W},+∞ } (1)

where ωws,j denotes the weight of the minimum-weight path from s to j, and we initialize ωw

s,s = 0 and ωws,j =

+∞ for all j ∈ N \{s}. Note that we have to be quite careful: a node at the start of a replenishment arc thatis not reachable with a weight-feasible path could be “disguised” by the reset that occurs with replenishment.We thus include a feasibility check in the second clause of the dynamic programming equation, ensuring thatωw

s,j < +∞ if and only if there exists a weight feasible path to j. The check in the first clause ensures thatwe can only start an IR subpath with a replenishment arc which is reachable with a weight-feasible path.Once the equations are solved, we simply check ωw

s,t ≤ W to determine that the instance is feasible. Theequations in the backward direction are similar. The resulting forward and backward algorithms are calledSP−WEIGHT−F and SP−WEIGHT−B respectively. The algorithms also record the cost of the minimum-weightfeasible path to/from each node. Thus with two more shortest path-type solves, we compute the followingvalues for each node i ∈ N :ωc

s,i = the cost of the least weight path from s to i,ωc

i,t = the cost of the least weight path from i to t,ωw

s,i = the weight of the least weight path from s to i, andωw

i,t = the weight of the least weight path from i to t,where these values are taken to be +∞ if no weight feasible path exists. If the instance is feasible, then ωc

s,t

provides a finite upper bound on the value of the WCSPP-R.

4

Page 5: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

Once we have the costs and weights of the shortest paths, we can remove nodes and arcs from thenetwork using the algorithm summarized in Algorithm 1. Here we use ζ+ to represent the best upper boundon the cost of a feasible path found so far. It is assumed that each time ζ+ is updated in the algorithm, thecorresponding path (the incumbent best solution), is updated also. The algorithm works by removing arcsand nodes which cannot be part of a feasible path, or a path with a better value than that of the incumbent(lines 1.13 to 1.19). Note that whenever arcs or nodes are removed from the network, we assume that theset of replenishment arcs and the arc cost and weight vectors are modified accordingly.

Lines 1.21 to 1.25 attempt to “glue together” partial paths to create better feasible solutions. Sincethe weight of the partial path to i recorded in both minimum cost and minimum weight algorithms in theforward direction is the weight accumulated since the last replenishment before i, and in the backwarddirection for a partial path from i is the weight accumulated from i to the next replenishment, it is easy totest feasibility of “glued together” partial paths. For example, if we consider concatenating the path foundby the minimum cost algorithm to i with arc (i, j) followed by the path found with the minimum weightalgorithm from j, we see that if ζw

s,i + wi,j + ωwj,t ≤ W then the IR subpath containing (i, j) is feasible. If

furthermore ζvs,i = F then the whole path must be feasible (since ωw

j,t < +∞ only if the entire partial pathfrom j is weight feasible). For convenience of exposition, we define

fi,j(u1, u2) =

+∞, if (i, j) ∈ R and u1 > W,u2, if (i, j) ∈ R and u1 ≤ W,u1 + u2, otherwise ((i, j) ∈ A \R),

for each (i, j) ∈ A; this allows us to avoid a lot of subclauses in checking feasibility of “glued together”partial paths. It is also helpful to define fi,i(u1, u2) = u1 +u2. Note that the algorithm aggressively removesarcs and nodes that can’t be part of a solution strictly better than the incumbent, and so in the course ofthe preprocessing, the instance may become infeasible or the optimal path eliminated otherwise.

4. Label Correcting Algorithm

In this section we define the label correcting algorithms we will use. Such algorithms maintain a set ofnon-dominated labels, where a label L = (i, cL, wL), said to be on node i, represents a partial path from sto node i with cost cL and weight wL, and a label L1 is said to dominate label L2 if they are on the samenode, and if cL1 < cL2 and wL1 ≤ wL2 or cL1 ≤ cL2 and wL1 < wL2 . Label correcting algorithms treat labelsin turn, extending them along outgoing arcs; they differ primarily in the label treatment order used. For afurther discussion of such algorithms, see the chapter by Desrosiers et al. [6].

Here we show, as did Cabral [8], that with minor modification, the usual label treatment procedureapplies to the WCSPP-R. In particular, it is important to use in the label the definition of weight givenin Section 3, i.e., the weight accumulated along the path since the last replenishment. We believe thatCabral [8] only considered one label treatment order; we consider 10 different orders, and compare theirperformance numerically.

Our label correcting algorithms maintain a set of labels L, and a subset L′ ⊆ L of untreated labels, bothinitialized with the label (s, 0, 0). The label treatment procedure for the WCSPP-R is given in Algorithm2. The label to be treated is extended from its node along each outgoing arc, generating new labels. Weassume that at least a basic form of preprocessing has been completed first, so that we may make use oflower bounds on weight and cost from each node to t, and make use of a global upper bound ζ+. These areused to ensure we delete non-dominated labels which either cannot be extended to form a feasible path tot or cannot be extended to form a path to t with cost less than that of the current incumbent. Of course,if more complete preprocessing is used, then the networks will be smaller, and the bounds tighter, which islikely to lead to fewer labels. Note that these algorithms might be further enhanced by attempting to “gluetogether” paths to a node, represented by a label, with paths from the node, represented by a bound, whenthe result is feasible, allowing the algorithm to improve the incumbent as it goes, and so improve the upperbound ζ+. We leave this modification to future work.

5

Page 6: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

Algorithm 1: PREPROCESSInput: A WCSPP-R instance (N,A, R,w, c, W, s, t)Output: A modified WCSPP-R instance, a feasible solution if available and ζ and ω valuesζ+ := +∞;1.1

while first iteration, or changes were made in the last iteration do1.2

Run SP−COST−F to obtain ζcs,i, ζw

s,i and ζvs,i for all i ∈ N ;1.3

if ζvs,t = F and ζw

s,t ≤ W then STOP:optimum found, go to 1.29;1.4

Run SP−COST−B to obtain ζci,t, ζw

i,t and ζvi,t for all i ∈ N ;1.5

if ζvs,t = F and ζw

s,t ≤ W then STOP:optimum found, go to 1.29;1.6

Run SP−WEIGHT−F to obtain ωcs,i and ωw

s,i for all i ∈ N ;1.7

if ωws,t > W then STOP: now infeasible, go to 1.29;1.8

else ζ+ := min{ζ+, ωcs,t};1.9

Run SP−WEIGHT−B to obtain ωci,t and ωw

i,t for all i ∈ N ;1.10

ζ+ := min{ζ+, ωcs,t};1.11

if ζ+ ≤ ζcs,t then STOP: optimum found, go to 1.29;1.12

forall i ∈ N such that fi,i(ωws,i, ω

wi,t) > W or ζc

s,i + ζci,t ≥ ζ+ do1.13

A := A \ {{(i, j) ∈ A} ∪ {(j, i) ∈ A}};1.14

N := N \ {i};1.15

end1.16

forall (i, j) ∈ A do1.17

if fi,j(ωws,i, wi,j + ωw

j,t) > W or ζcs,i + ci,j + ζc

j,t ≥ ζ+ then1.18

A := A \ {(i, j)};1.19

else if fi,j(ζws,i, wi,j + ζw

j,t) ≤ W and ζvs,i = ζv

j,t = F then1.20

ζ+ := min{ζ+, ζcs,i + ci,j + ζc

j,t};1.21

else if fi,j(ζws,i, wi,j + ωw

j,t) ≤ W and ζvs,i = F then1.22

ζ+ := min{ζ+, ζcs,i + ci,j + ωc

j,t};1.23

else if fi,j(ωws,i, wi,j + ζw

j,t) ≤ W and ζvj,t = F then1.24

ζ+ := min{ζ+, ωcs,i + ci,j + ζc

j,t};1.25

end1.26

end1.27

end1.28

return (N,A, R,w, c, W, s, t), ω, ζ, incumbent solution;1.29

6

Page 7: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

Algorithm 2: LABEL−TREATMENTInput: A WCSPP-R instance (N,A, R,w, c, W, s, t), label set L, untreated subset L′ ⊆ L, ζc

j,t andωw

j,t values for each j ∈ N , an upper bound ζ+, a list of nodes N and a label L = (i, cL, wL)Output: Updated label sets L and L′ after treatment of L, as well as the set N of nodes which have

had a label updated.forall nodes j such that (i, j) ∈ A do2.1

if (i, j) ∈ R then w := wi,j else w := wL + wi,j ;2.2

if w + ωwj,t ≤ Wand cL + ci,j + ζc

j,t < ζ+ then2.3

L := (j, cL + ci,j , w);2.4

if L is not dominated by any label in L then2.5

N := N ∪ {j}, L := L ∪ {L} and L′ := L′ ∪ {L};2.6

Remove labels in L and L′ dominated by L;2.7

end2.8

end2.9

end2.10

L′ = L′ \ {L};2.11

N := N \ {i};2.12

return N and updated L and L′;2.13

We consider two classes of label treatment order. The first stores labels by the node they are on, selectsa node according to some order, and then treats all untreated labels on that node, (we call this treating thenode), repeating until there are no untreated labels. In this case, the label sets are organized by node, andwe use L(j) and L′(j) to denote the set of labels and untreated labels respectively on each node j ∈ N .We consider 6 different node orders: node index, reverse node index, node with the minimum weight labelon it, maximum weight, minimum cost and maximum cost. These all make use of the set N returned byAlgorithm 2, for example, the maximum cost variant chooses i ∈ arg max

j∈Nmax

(j,wL,cL)∈L′(j)cL to treat next. In

the latter four node orders, ties are broken by choosing the node with smallest index. We note that nodeindex order could be viewed as equivalent to random node order, except that in the networks we deal with,node indices embed structure in the network. We discuss this point further in Section 6.2.

The second label treatment order stores all untreated labels L′ in a binary heap, selects a label accordingto some order, treats the label, and repeats until there are no untreated labels. We consider 4 alternativelabel orders: minimum weight, maximum weight, minimum cost and maximum cost. In all cases ties arebroken by choosing the label with smallest node index. The resulting algorithms are named and summarisedin Table 1.

Note that in Cabral’s thesis [8], label treatment order is not specifically dealt with, although it appearsto be similar to our NODE. Note also that we expect orders based on weight to behave quite differently inWCSPP-R than they do in WCSPP. In the latter, weights are monotonically increasing along paths, soweight measures say something about how “complete” a path is. In the WCSPP-R, by contrast, weight canbe reset to zero along a path, so weight measures can be expected to tell us relatively little.

In reporting out computational results (Section 6), we prefix the name of the label treatment order with“LC”, so for example, the label-correcting algorithm treating nodes in order of minimum weight is denotedby LC-N-MIN-W.

5. Meta-Network Methods

In this section we develop methods that make use of a network which “sits over” the original network andguides the higher level decision about the IR path structure of the solution. We call this the meta-network.Since each IR path in an optimal solution is itself the solution of a WCSPP, we hope with these methods tocapitalize on recent advances in solvers for the WCSPP, which we employ as a subproblem. In what follows,

7

Page 8: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

Class Name Label Treatment OrderNODE Node index i = 1, 2, . . . , nREV−NODE Reverse node index i = n, n− 1, . . . , 1

Node N−MIN−W Node with min weight label minj∈N

min(j,wL,cL)∈L′(j)

wL

Treat- N−MAX−W Node with max weight label maxj∈N

max(j,wL,cL)∈L′(j)

wL

ment N−MIN−C Node with min cost label minj∈N

min(j,wL,cL)∈L′(j)

cL

N−MAX−C Node with max cost label maxj∈N

max(j,wL,cL)∈L′(j)

cL

MIN−W Min weight label min(j,wL,cL)∈L′

wL

Label MAX−W Max weight label max(j,wL,cL)∈L′

wL

Treat- MIN−C Min cost label min(j,wL,cL)∈L′

cL

ment MIN−C Max cost label max(j,wL,cL)∈L′

cL

Table 1: Label Correcting Algorithms

we show how we construct the meta-network, give a basic algorithm for solving the WCSPP-R using it, andthen describe a series of improvements, aimed at reducing the solution times.

5.1. The Meta-NetworkWe define the meta-network to have a set of meta-nodes NM ⊆ N and meta-arcs AM ⊆ NM × NM ,

together with a collection of additional information which we will define shortly. The meta-nodes are theset of nodes that could start or end an IR path:

NM = {i ∈ N : (i, j) ∈ R for some j ∈ N} ∪ {t}.

Note that by earlier assumptions it must be that s ∈ NM . We take AM to be the set of pairs (i, j) ∈NM ×NM , i 6= j, for which there can exist an IR path from i to j, i.e. with the property that there existsa weight-feasible path from i to j using one of the replenishment arcs outgoing from i, but not using anyother replenishment arc. Clearly AM can be established for the price of |NM | − 1 shortest path (minimumweight) calculations. However we do have to take some care, as the solution to a WCSPP-R may include anIR path which is not elementary. For example, consider the network in Figure 1 where replenishment arcsare shown in bold, all arcs including replenishment have unit weight and the weight limit is 3. Clearly theonly feasible s-t path is s, 1, 2, 3, 4, 3, t and the only meta-arc between 3 and T consists of the path 3, 4, 3, twhich includes the cycle 3, 4, 3. It is thus important that our shortest path algorithm for establishing arcsin AM allows IR-paths including cycles through their start node (it is not hard to argue that these are theonly cycles that can occur in an optimal solution to the WCSPP-R). To address this, for any i ∈ NM withan outgoing non-replenishment arc, we create a copy i′, and replace all arcs (j, i) ∈ A with (j, i′), and allarcs (i, j) ∈ A \ R with (i′, j). In the resulting modified network, all nodes in NM have the property thatall outgoing arcs are replenishment arcs, so no cycles need be considered. From this point on, we assumethat all node with outgoing replenishment arcs have no outgoing non-replenishment arcs.

If for each (i, j) ∈ AM we knew the minimum cost weight-feasible IR path from i to j, then the WCSPP-Rcould be solved for the price of a single shortest path solve in the meta-network. Indeed our first meta-network algorithm does exactly that. However finding the minimum cost weight-feasible IR path from i toj requires the solution of a WCSPP. Doing this for every (i, j) ∈ AM is computationally expensive, and, aswe shall see, unnecessary; steps toward solving the WCSPP-R in the meta-network may be interleaved withsolving the WCSPP subproblems. We thus first initialize a subnetwork for each (i, j) ∈ AM , in which westep toward solving the WCSPP from node i to node j, using information based solely on standard shortestpath calculations.

8

Page 9: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

1 2 3

t

4s

Figure 1: The example network with replenishment arcs shown in bold

For each (i, j) ∈ AM , we denote the associated subnetwork, or underlying network, by Gi,j = (N i,j , Ai,j).The raison d’etre of this network is to discover whether or not a minimum cost weight-feasible IR path fromi to j is to form an IR subpath in an optimal solution to the WCSPP-R. A number of ways of initializingthis network for each (i, j) ∈ AM suggest themselves. For example, with two shortest path (least weightforward and backward) calculations, and a simple preprocessing procedure, we could ensure that N i,j andAi,j included only nodes and arcs respectively that appear in some weight-feasible IR path from i to j.Again we view this initialization as too computationally expensive. Instead, as shown in Algorithm 3 wecalculate for each meta-node i ∈ NM the minimum weight IR path from i to any node, set N i to be theset of nodes in N reachable from i for which the least weight IR path from i does not exceed the weightlimit. We set Ai to be the arcs induced by N i, giving network Gi = (N i, Ai). Gi,j is initialized by settingN i,j = N i and Ai,j = Ai for each (i, j) ∈ AM .

In initializing the meta-network and the underlying networks, we also seek to initialize lower and upperbounds on the value of the WCSPP associated with each meta-arc. These bounds will be useful in thesubsequent WCSPP-R solution procedure. Before giving Algorithm 3 – our algorithm for initializing themeta-network and underlying networks – we first discuss some of the subproblem solvers we will need torefer to. For solving a shortest path problem from node i to node j in a network (N ,A) with arc lengthsζ, we use the notation SP(N ,A, ζ, i, j). When we require the shortest path procedure to return the shortestpaths and lengths (with respect to ζ) from node i to all nodes, (i.e. the forward shortest path tree), we usethe notation SP−T−F(N ,A, ζ, i). If there is no path to a node, then these procedures are assumed to returna length value of +∞ for that node.

We call the value of the WCSPP associated with each meta-arc the cost of the meta-arc, and denote itby c. Note that unless explicitly stated, we don’t assume that this value is known. Instead, we calculateand record upper and lower bounds on it. Notation introduced in this section is summarised below:NM = the set of all meta-nodes,AM = the set of meta-arcs,N i,j = the set of all nodes in the underlying graph of meta-arc (i, j),Ai,j = the set of arcs in the underlying network of meta-arc (i, j),ci,j = the cost of meta-arc (i, j) ∈ AM ,c−i,j = a lower bound on the cost of meta-arc (i, j) ∈ AM ,c+i,j = an upper bound on the cost of meta-arc (i, j) ∈ AM , and

qi,j = the weight-feasible path in (N i,j , Ai,j) corresponding to c+i,j .

When finding the minimum weight paths to meta-nodes, we are also able to find least weight paths toeach original node. We can remove all arcs which cannot form part of a weight feasible path from i; this isdone in line 3.5 of Algorithm 3, and the resulting arc set used to initialize the underlying network for eachmeta-arc starting from node i. Clearly if the minimum weight path from one meta-node to another exceedsthe weight limit, the pair do not form a meta-arc. Otherwise they do, and the minimum weight path is afeasible path, whose cost gives an upper bound on the cost of the meta-arc (set in line 3.15).

By also finding minimum cost paths from each meta-node, we can determine lower bounds on the costof each meta-arc (set in line 3.10). If the minimum cost path found from one meta-node to another is alsoweight-feasible, then it provides an identical upper bound, set at line 3.12. At this point the upper and

9

Page 10: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

lower bounds on the cost of the meta-arc will be identical; we have solved the WCSPP for this meta-arc.The full algorithm we use to create the meta-network, its associated bound information, and its under-

lying networks, is shown in Algorithm 3. In subsequent sections, we show how to solve the WCSPP-R byvarious means, from this starting point. We describe the basic algorithm in Section 5.2, which simply solvesthe WCSPP for every meta-arc. Sections 5.3 improves on this with some meta-network preprocessing toeliminate meta-arcs, and bounds deduction that can be used to accelerate the WCSPP solver. In Section 5.4we introduce a method that interleaves solution of the WCSPP problems in the underlying networks withthe solution of the problem in the meta-network, to avoid solving the WCSPP for all meta-arcs. Section 5.5attempts to cut WCSPP solution short, if it becomes apparent that the corresponding meta-arc is unlikely tobe part of an optimal path. Observing that Algorithm 3 makes a substantial contribution to the computingtime, in Section 5.6 we revisit the overall method, and find that by adapting an A* algorithm for solvingthe problem in the meta-network to generate lower bounds for meta-arcs on an as-needed basis, efficiencyis greatly increased. In Section 5.7, all meta-network algorithms are summarized.

Algorithm 3: Create the meta-networkInput: A WCSPP-R instance (N,A, R,w, c, W, s, t)Output: A meta-network (NM , AM ) with upper and lower bounds c+

i,j and c−i,j respectively on theminimum cost weight-feasible path for each meta-arc (i, j) ∈ AM , together with a weightfeasible path qi,j with c(qi,j) = c+

i,j

NM := {i ∈ N : i = t or ∃j ∈ N with (i, j) ∈ R} and AM := ∅;3.1

forall i ∈ NM do3.2

Ai := (A \R) ∪ {(i, j) ∈ R};3.3

Solve SP−T−F(N,Ai, w, i) to obtain ωwi,k, the minimum weight of any path from i to each node3.4

k ∈ N , and use the tree found to calculate ωci,h, the cost of the minimum weight path to h for

each h ∈ NM ;Ai := {(j, k) ∈ Ai : ωw

i,j + wj,k ≤ W};3.5

Solve SP−T−F(N,Ai, c, i) to obtain ζci,k, the minimum cost of any path from i to each node3.6

k ∈ NM , and use the tree found to calculate ζwi,k, the weight of the minimum cost path to k;

forall j ∈ NM do3.7

if ωwi,j ≤ W then3.8

AM := AM ∪ {(i, j)};3.9

c−i,j := ζci,j ;3.10

if ζwi,j ≤ W then3.11

c+i,j := c−i,j ;3.12

qi,j := the path to j found in line 3.6 ;3.13

else3.14

c+i,j := ωc

i,j ;3.15

qi,j := the path to j found in line 3.4;3.16

end3.17

end3.18

Set Ai,j := Ai and N i,j := {k ∈ N : ωwi,k ≤ W};3.19

end3.20

end3.21

return NM , AM , {(c−i,j , c+i,j , q

i,j , Ai,j , N i,j)}(i,j)∈AM3.22

5.2. Basic AlgorithmThe basic algorithm seeks to take advantage of recent WCSPP solvers, and exploit them as a “black

box”. The basic algorithm finds the exact value of ci,j and the corresponding path, qi,j , for each meta-arc

10

Page 11: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

(i, j) ∈ AM , by solving the corresponding WCSPP. It then finds the shortest path from s to t in the meta-network with respect to costs c, denoted by p = u∗1, u

∗2, . . . , u

∗k. We then replace each meta-arc (u∗i , u

∗i+1)

with the subpath qu∗i ,u∗i+1 , giving p∗ = qu∗1 ,u∗2 |qu∗2 ,u∗3 | . . . |qu∗k−1,u∗k through the original network. We refer tothis as the META-BASIC algorithm.

In our implementation of the META-BASIC algorithm, we use the method described in [13] to solve theWCSPPs. One of our enhancements, discussed in later sections, utilises the fact that this method providesincreasing lower bounds on the costs throughout the processing, which is not necessarily a feature of allWCSPP methods. In later sections, we also make use of the ability of the method of [13] to use upperbounds to remove arcs and so speed up computation.

This basic algorithm requires a large amount of computational effort to solve the individual WCSPPsto determine the ci,j values. For example, a network with less than 5,000 arcs can have more than 60,000meta-arcs. The following sections introduce methods based on bounds which can be used to reduce thenumber of times we have to solve a WCSPP.

5.3. Induced Upper BoundsWe can easily use the information returned by Algorithm 3 to find a feasible solution and hence upper

bound for the WCSPP-R: we simply solve SP(NM , AM , c+, s, t), and concatenate the paths qi,j for eachmeta-arc (i, j) ∈ AM used in the shortest path. The resulting path in (N,A) must be feasible for theWCSPP-R, and its value, which we denote by ζ+, provides an upper bound. This upper bound can be usedto induce an upper bound on the cost of each arc in the meta-network, such that if the cost of the meta-arcis determined at some stage to meet or exceed this bound, then the meta-arc cannot appear in any solutionto the WCSPP-R better than the one found so far.

To find these induced upper bounds, we proceed as follows. Since c− gives a lower bound on the costof each meta-arc, for the price of two shortest path calculations in the meta-network, with arc lengths setto c−, we can calculate ζ−s,i, a lower bound on the cost of any replenishment weight feasible path from s

to meta-node i, and ζ−i,t, a lower bound on the cost of any replenishment weight feasible path from i tot, for all meta-nodes i ∈ NM . Then clearly if, for any meta-arc (i, j) ∈ AM , we are able to deduce thatζ−s,i + ci,j + ζ−j,t ≥ ζ+, we can eliminate (i, j); it cannot participate in a solution better than one alreadyfound. We call Ui,j = ζ+ − ζ−s,i − ζ−j,t the induced upper bound on meta-arc (i, j) ∈ AM .

There are two ways in which we make use of the induced upper bounds.

1. As soon as the induced upper bound is calculated on a meta-arc (i, j) ∈ AM , if its current lowerbound, c−i,j , is at least this upper bound, i.e. if c−i,j ≥ Ui,j , then we delete the meta-arc from themeta-network. Meta-arcs which are removed in this way are referred to as deleted in preprocessing.(This can be viewed as a preprocessing operation in the meta-network).

2. The minimum of the current upper bound, c+i,j , and the induced upper bound Ui,j , for meta-arc (i, j)

can be used as an input to the WCSPP algorithm for meta-arc (i, j). The WSCPP algorithm usedin our computational work ([13]) makes use of upper bounds to remove underlying arcs, so the use ofinduced upper bounds in this way can speed up the WCSPP solution. If at any stage in its solution,the WCSPP method, (which repeatedly calculates increasing lower bounds), deduces that the value ofthe WCSPP meets or exceeds the induced upper bound, then it can be halted, and the correspondingmeta-arc removed from the meta-network. Such arcs are referred to as deleted by WCSPP.

5.4. Using Lower Bounds in the Meta-NetworkThe basic algorithm can solve a very large number of WCSPPs, even when induced upper bounds are

used to remove some arcs. However most of the WCSPPs solved are for meta-arcs not required in theoptimal solution. In this section, we make use of the lower bounds on the costs of meta-arcs to guide thesolution procedure, only solving the WCSPP for meta-arcs which appear likely to be in the optimal solution,based on their lower bound.

The method, which we refer to as the META-LOWBND algorithm, first solves a shortest path from s to tin the meta-network, with arc lengths set to c−, the meta-arc cost lower bounds calculated in Algorithm 3.

11

Page 12: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

It then seeks the first meta-arc (i, j) ∈ AM on the resulting path for which the lower and upper bounddiffer, i.e., for which c−i,j 6= c+

i,j . The WCSPP for (i, j) is then solved, and both c−i,j and c+i,j set to its

optimal value. This process is repeated until all meta-arcs in the shortest s-t path in the meta-network withrespect to lengths c− have identical upper and lower bounds on their cost. The result must be the optimalWCSPP-R solution, in the worst case found by solving as many complete WCSPPs as the basic algorithm,but in general needing far fewer WCSPP solutions.

5.5. Threshold ValuesWhen using the META-LOWBND algorithm, we don’t necessarily want to entirely solve the WCSPP for

each meta-arc considered. The WCSPP method we use ([13]) gives increasing lower bounds during itscomputation. When the lower bound becomes high enough to suggest that the meta-arc may not, after all,be likely to be on the optimal WCSPP-R path, we can “pause” solution of the WCSPP for that meta-arc. Wedo this once the lower bound for the WCSPP reaches a threshold value, denoted by ti,j for each (i, j) ∈ AM .

To determine the lowest possible threshold value, i.e., the value at which (i, j) ∈ AM is no longer on ashortest path in the meta-network, (with respect to the lower bounds on meta-arc cost), we run a shortestpath algorithm on the meta-network with arc (i, j) removed. This gives the value of the shortest paththrough the current meta-network that doesn’t use the arc (i, j). We call this value ζi,j . We also have thecost of the current shortest path, ζ−. If the lower bound on the cost of meta-arc (i, j) maintained duringthe WCSPP solve increases from c−i,j to c−i,j + ζi,j − ζ−, then there is a shortest path in the meta-networkwhich does not make use of meta-arc (i, j). In this case, we may no longer be interested in this meta-arc.

To avoid excessive “cycling”, (pauses followed by later resumptions in the WCSPP solution procedurefor a meta-arc), we set our threshold value for each meta-arc (i, j) to be somewhat higher than ζi,j : we set

ti,j := βc+i,j + (1− β)(c−i,j + ζi,j − ζ−) (2)

for all (i, j) ∈ AM , where β ∈ [0, 1] is a parameter indicating how aggressive we should be deciding to pauseWCSPP solution. When β is set to 0, the threshold values are likely to cause frequent cycling. When β takesthe value 1, the threshold values are calculated but never used (all WCSPPs solve to optimality). Neitherof these situations is desirable. We set β by testing values strictly between 0 and 1 on the first 10 of eachtype of data set, averaged over a variety of weight limits, and choosing that with the best time performanceto use for that data set.

Note that whenever solution of a WCSPP is paused, the lower bound on the cost of the correspondingmeta-arc is updated. Not also that the calculation of the threshold values is “dynamic”, since the value ofζi,j could change whenever lower bounds on meta-arc costs change. Here we recalculate it for a meta-arcprior to either starting or resuming a WCSPP solve.

5.6. A* Lower BoundsUsing Algorithm 3 to set up the meta-network requires a shortest path to be run from each meta-node

to find lower bounds on the cost of each meta-arc. In our test cases, a significant amount of time is spentsolving these shortest path problems. In this section, we use a method based on A* algorithm of Hart etal [11] for solving the shortest path problems in the meta-network, employing very simple lower bounds,to reduce the number of these shortest path problems we have to solve. The method avoids calculatingmeta-arc cost lower bounds that the simple bounds can rule out.

For the specification of this algorithm, we use the notation WCSPP(N ,A, ω, ζ,W, i, j) to mean that theWCSPP with network (N ,A), weights ω and costs ζ, weight limit W and start and end nodes i and j issolved. The outputs of this method may be a path or the cost of the path or both, this will be specified foreach context.

The overall algorithm, Algorithm 4 is given below. Lines 4.1 up to 4.12 are a reduced form of Algorithm 3,in which only minimum weight paths are found, and so only the meta-arcs themselves, and upper boundson their cost, are calculated; no lower bounds are available. Instead, at line 4.12, a single shortest pathcalculation is carried out to yield cost lower bounds that we can expect to be somewhat weaker (the pricewe pay for fewer shortest path calculations). Here SP−T−B(N,A, c, t) denotes a backwards shortest path

12

Page 13: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

algorithm finding the shortest path from i to t in (N,A) with respect to arc lengths c, for each i ∈ N ; thelength of the shortest path found is denoted by ci. This yields a lower bound on the “cost-to-go” at everynode: for each i ∈ N , the value ci, a lower bound on the cost of any path in (N,A) from i to t. This isused within the A* algorithm at line 4.14 to avoid having to calculate minimum-cost paths from i for alli ∈ NM . Instead, the true/false (T/F ) indicator vector done records for which i ∈ NM the forwards costshave already been found. In the A∗ algorithm, if i ∈ NM needs to be considered, but donei = F , thenSP−T−F(N i, Ai, c, i) is solved, to calculate c−i,j for all (i, j) ∈ AM , and donei is set to T . This adaptation ofthe A* algorithm is given in Appendix A. It returns the minimum c− path in (NM , AM ) from s to t, thepath itself, q, and updated values for done and c−, in the case that more c− values were calculated in thecourse of the algorithm. The remainder of the algorithm is very similar to Algorithm META-LOWBND, withthe adapted A* algorithm used as the meta-network shortest path solver.

Algorithm 4: META-A*-LOWBNDInput: A WCSPP-R instance (N,A, R,w, c, W, s, t)Output: A solution to the WCSPP-RInitialize NM := {i ∈ N : i = t or (i, j) ∈ R,∃j ∈ N} and AM := ∅;4.1

forall i ∈ NM do4.2

Ai := (A \R) ∪ {(i, j) ∈ R};4.3

Solve SP−T−F(N,Ai, w, i) to obtain ωwi,k, the minimum weight of any path from i to each node4.4

k ∈ NM , and use the tree found to calculate wci,k, the cost of the minimum weight path to k;

Ai := {(j, k) ∈ Ai : ωwi,j + wj,k ≤ W} and N i := {j ∈ N : ωw

i,j ≤ W};4.5

forall j ∈ NM such that ωwi,j ≤ W do4.6

AM := AM ∪ {(i, j)};4.7

Set c+i,j := ωc

i,j and qi,j := the path to j found in line 4.4;4.8

Set Ai,j := Ai and N i,j := {k ∈ N : ωwi,k ≤ W};4.9

end4.10

end4.11

Solve SP−T−B(N,A, c, t) to obtain ci for each i ∈ N ;4.12

Set donei := F for all i ∈ NM and c−i,j = −∞ for all (i, j) ∈ AM ;4.13

Solve SP−A∗(NM , AM , done, {(N i, Ai)}i∈NM , c, c−, c, s, t) to yield q, a minimum c− path in (NM , AM )4.14

from s to t, and updated values for done and c−;if no path q was found then STOP: the WCSPP-R is infeasible;4.15

while c−i,j6= c+

i,jfor some (i, j) ∈ q do4.16

Let (i, j) be the first arc in q with c−i,j 6= c+i,j ;4.17

Solve WCSPP(N i,j , Ai,j , w, c, W, i, j) to get path qi,j ;4.18

Set c−i,j = c+i,j = ci,j := c(qi,j);4.19

Solve SP−A∗(NM , AM , done, {(N i, Ai)}i∈NM , c, c−, c, s, t) to yield optimal path q, and updated4.20

done and c− valuesend4.21

Replace each (i, j) ∈ q with qi,j ;4.22

return q4.23

When using A* it would also be possible to create the meta-network on the fly at the same time asdetermining costs. In the context of column generation, however, weights remain the same for multipleiterations and so we only need to create the meta-network once.

5.7. Algorithm SummaryThe meta-network algorithms and enhancements are tested in a variety of combinations. These are

summarized in Table 2. Note that any of these algorithms can be performed either with or without the use

13

Page 14: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

of Algorithm 1 for initial preprocessing.

Algorithm Name DescriptionMN-BASIC Algorithm 3 followed by META-BASICMN-BASIC-IUB-PREP MN-BASIC with induced upper bounds used for

meta-network preprocessingMN-BASIC-IUB-ALL MN-BASIC-IUB-PREP with induced upper bounds

used also for input to the WCSPP solverMN-LOWBND Algorithm 3 followed by META-LOWBNDMN-LOWBND-IUB-PREP MN-LOWBND with induced upper bounds used for

meta-network preprocessingMN-LOWBND-IUB-ALL MN-LOWBND-IUB-PREP with induced upper bounds

used also for input to the WCSPP solverMN-LB-THRESH Algorithm 3 followed by META-LOWBND

with thresholding to pause WCSPP solvesMN-LB-THRESH-IUB-PREP MN-LB-THRESH with induced upper bounds used for

meta-network preprocessingMN-LB-THRESH-IUB-ALL MN-LB-THRESH-IUB-PREP with induced upper bounds

used also for input to the WCSPP solverMN-A*-LB META-A*-LOWBND

Table 2: Meta-network algorithms

6. Numerical Results

6.1. The Data SetsWe used two different types of networks for numerical evaluation of the algorithms. The first are randomly

generated grid networks that contain cycles, but in which all costs are positive, similar to those used in [7].The grid is defined by its height and width. The start and end nodes are separate from the grid. There arearcs moving forwards through the network between horizontally adjacent nodes as well as from s to eachnode in the far left column and from each node in the right most column to t. There are also arcs betweenvertically adjacent nodes both up and down, resulting in cycles.

For our test cases, integer costs are randomly generated using a uniform distribution on [0, 100]. Theweight of each arc is generated to be roughly inversely proportional to the cost using the following formulafrom [1]:

wi,j = 1 +⌊

γC

ci,j + 1

⌋+ nrand(

⌊C

ci,j + 11− γ2

γ

⌋) (3)

where C is the largest cost of any arc, nrand(x) is a function which finds an integer random number between0 and x and γ is a parameter. As was done in [1], we use γ = 0.163; experimentation in [1] found this valueto yield reasonably difficult problems. Each arc has a probability 0.05 of being a replenishment arc, unlessit starts at s, in which case it is always a replenishment arc by definition.

Our second set of data is based on acyclic networks that come from an airline crew pairing problem.Solution of this problem by branch-and-price generates subproblems that have WCSPP-R structure, if oneassumes a simplified set of crew rules. For these subproblems, the nodes represent flights, and arcs representpossible crew connections between them. Any connection that allows enough time to sleep is defined to bea replenishment arc, and the weight limit is the number of hours a crew can work before sleeping. This isa simplification of the crew rules to determine a feasible schedule. Although in practice the crew sleepingrule determines the weight limit, we test a range of weight limits in order to explore the effect of these onperformance (see later for details).

14

Page 15: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

All crew pairing WCSPP-R instances we test are drawn from the branch-and-price process for a singlereal airline instance, with a dated scheduling running over 40 days. The solution algorithm used by ourindustry partner for this instance used only 12 column generation iterations at the root node, (their algorithmgenerated and added a large number of columns at each iteration), and then “dived”, generating a single lineof descendent nodes. At each node, only a small number of column generation iterations were performed,and the process stopped after a total of 131 calls to the column generation subproblem solver. We sampledsubproblems from below the root node by selecting 6 consecutive subproblems sampled from the 25%,50%, 75% and 100% marks through the 119 calls to the subproblem solver. This gave us a total of 36WCSPP-R instances. The network for this problem had 3,639 nodes and 64,525 arcs, of which about 80%are replenishment arcs. The connection structure led to most nodes being meta-nodes, as some longerconnections from each flight are required, if possible.

For both random grid and airline instances, we test a range of different weight limits. To ensure we testinteresting values, for each instance, we use a lower weight limit W− and an upper weight limit W+, andthen test the instances with weight W = αW− + (1− α)W+ for α values of 0, 0.1, 0.5, 0.9 and 1. For theresults reported in Section 6.3, we use “exact” W− and W+ values: W+ is the weight of a minimum costpath and W− is smallest weight limit for which there is a feasible path. When comparing label correctingmethods in Section 6.2, we test very large randomly generated networks, for which finding W+ and W−

exactly is very computationally intensive. Instead, we use a constant value for W− and approximate valuesfor W+. We noticed that the exact W− for all instances reported in Section 6.3 ranged between 24 and 31,and so chose W− to be 35 for all random instances in Section 6.2; this was large enough so that all largerrandom instances tested to date are feasible.

All results are from a PC with two 2 GHz processors and 3 gigabytes of RAM running Linux. As aWCSPP solver, we use the methods described in [13].

6.2. Label Correcting MethodsWe investigate the computational performance of the various label treatment orders discussed in Section

4, both with and without preprocessing. In order to expose significant differences in the methods, and checkthe persistence of any trends as problem size increases, we considered 100 × 100, 200 × 200 and 400 × 400random grid networks as described above.

The running times for the label correcting methods on all instances in the airline data set are all less thana second, so details of these are not included here. However, as is usual for column generation subproblems,our airline networks contain negative costs, which are likely to have a significant impact on the performanceof some label treatment orders, such as LC−MIN−C. To investigate this issue, we consider 200× 200 randomgrid graphs with some negative costs. To avoid negative cost cycles, we only allow forward arcs to havenegative costs. These costs are randomly generated on [−200, 200].

Running times for each of the label treatment orders are shown in Table 3, both with and withoutpreprocessing. Each entry in the body of the table is the running time in seconds, averaged over 50 randomlygenerated instances, all using the same value of α, indicated in the column heading, to determine the weightlimit. The best value (least average run time) in each column is indicated in bold font. In addition tocomparing the methods as described in Section 4, we also include LC−NODE−NOPRE which uses the same labeltreatment order as NODE but does not include even the basic preprocessing required to obtain ζ and ω values.

To investigate the effect of preprocessing, for each group of instances of the same size, we give summarystatistics of the improvement factors with respect to processing time. The processing time improvementfactor (in the column labelled “t”) is the average, over all problems in the group, of the run time withoutpreprocessing divided by the run time with preprocessing. When preprocessing provides a speed-up, thisnumber is greater than 1. The standard deviation improvement factor (in the column labelled “s.d.”) isfound by taking, for each α, the standard deviation of run times over all instances for that value of α,with and without preprocessing, and calculating the average over all α values of the standard deviationwithout preprocessing divided by standard deviation with preprocessing. If preprocessing provides greaterconsistency in processing times for randomly generated instances of the same size and with the same α value,then this factor will be greater than one.

15

Page 16: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

Non-N

egativ

eA

rcC

osts

200×

200

Inclu

des

Negativ

eC

osts

100×

100

200×

200

400×

400

200×

200

Impro

ve

Impro

ve

Impro

ve

Impro

ve

α0

0.1

0.5

0.9

1t

s.d.

00.1

0.5

0.9

1t

s.d.

00.1

0.5

0.9

1t

s.d.

00.1

0.5

0.9

1t

s.d.

LC−

NODE−

NOPRE

with

out

0.0

60.2

50.3

70.4

10.4

10.8

91.9

12.7

73.0

43.0

56.0

312.4

819.6

821.9

322.2

01.7

04.8

56.8

17.3

27.4

8LC−

NODE

with

0.1

70.3

20.2

20.1

50.1

40.7

10.6

11.7

72.7

42.2

91.9

11.8

90.7

40.7

512.7

619.6

520.1

216.9

615.9

40.8

00.7

63.7

96.8

77.2

76.6

06.3

90.7

60.8

1w

ithout

0.1

10.2

30.1

40.1

00.1

01.2

31.9

81.6

91.3

71.3

48.8

314.8

716.4

214.1

713.7

32.5

55.3

05.6

85.1

44.9

6

LC−

REV−

NODE

with

0.1

80.4

50.2

90.1

60.1

50.8

00.8

62.0

64.1

73.8

52.8

92.7

70.8

20.8

815.7

229.5

436.6

832.9

431.3

10.8

80.9

24.0

48.1

79.7

99.1

18.9

90.8

10.8

6w

ithout

0.1

20.3

60.2

40.1

30.1

21.4

93.3

53.3

42.4

92.2

711.7

124.8

032.9

430.7

729.7

22.8

06.6

08.2

47.6

57.5

3LC−

MIN−

Cw

ith0.1

50.2

10.1

90.1

30.1

20.6

40.4

52.2

17.9

67.8

55.2

54.6

70.6

30.3

99.7

010.4

19.5

68.6

28.0

50.6

50.3

82.9

951.9

941.5

628.3

027.8

70.8

70.9

3w

ithout

0.0

90.1

20.1

00.0

90.0

82.1

78.1

18.2

75.8

45.1

15.4

85.5

35.8

15.7

45.6

91.6

949.8

142.2

128.5

625.8

6LC−

MAX−

Cw

ith0.2

20.5

90.2

40.1

70.1

60.7

50.8

42.7

69.0

94.8

43.4

93.4

50.8

40.9

846.3

3164.6

95.8

258.1

954.1

30.9

70.9

76.0

050.9

078.3

267.5

464.7

81.1

00.9

6w

ithout

0.1

70.4

90.1

60.1

20.1

12.4

98.1

74.0

33.0

12.7

847.4

8154.8

791.0

457.2

748.9

75.0

749.0

377.3

967.2

464.8

2LC−

MIN−

Ww

ith0.2

20.8

40.2

80.1

90.1

80.8

00.8

52.8

912.7

26.4

24.7

94.7

20.8

80.9

936.0

3195.3

6129.4

379.0

474.7

31.0

11.0

65.9

344.3

531.8

121.2

521.7

70.9

00.9

8w

ithout

0.1

90.7

90.1

90.1

40.1

32.5

812.5

25.9

84.4

84.3

336.3

7205.5

5132.4

680.1

272.2

04.8

142.8

430.9

219.8

020.9

6LC−

MAX−

Ww

ith0.2

00.6

40.2

90.1

80.1

80.7

90.8

62.5

57.2

44.8

83.6

93.5

60.8

60.9

843.3

577.0

484.7

164.6

661.1

10.9

71.0

55.0

517.2

321.4

216.7

516.1

00.8

91.0

2w

ithout

0.1

60.5

60.2

20.1

40.1

42.1

56.6

84.2

63.2

63.1

842.9

370.7

285.3

763.7

658.2

14.0

515.8

220.0

715.3

414.8

8LC−

N−MIN−

Cw

ith0.4

40.9

10.5

40.2

50.2

41.0

90.8

66.1

711.3

49.7

96.7

56.3

21.0

30.9

291.5

5169.9

192.6

6167.1

7160.0

61.1

30.9

3w

ithout

0.3

90.8

20.5

80.2

60.2

45.6

010.5

99.5

76.8

16.1

687.5

3165.1

6189.0

2169.9

7162.7

2LC−

N−MAX−

Cw

ith29.8

194.5

515.1

58.6

88.7

13.5

81.6

2w

ithout

52.6

6146.6

724.5

714.4

613.8

2LC−

N−MIN−

Ww

ith1.3

210.6

53.2

31.2

21.2

11.9

31.0

1w

ithout

1.4

710.6

24.1

71.4

31.4

0LC−

N−MAX−

Ww

ith3.1

883.0

316.5

96.5

76.4

28.2

51.3

5w

ithout

3.8

6111.7

631.1

812.1

410.2

8

Table

3:

Avera

ge

Tim

es(C

PU

s)fo

rLabel

Correctin

gA

lgorith

ms

with

Vario

us

Label

Trea

tmen

tO

rders

16

Page 17: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

Recall that there are three distinct types of label correcting algorithms. The first type treats nodesbased either on forward or reverse node order. We expect these to benefit from their very low computationaloverhead in node selection. The second type of algorithm (LC−N) treats nodes based on cost or weight order.The final category (LC−MIN/MAX) treats individual labels based on cost or weight order. We expect thesemethods to benefit from the consistency in label selection order.

The first section of Table 3 shows that even for 100 × 100 networks, solutions can be found in lessthan 0.5s for most methods. Only three methods consistently take over a second. The worst performingmethods are those which treat the node based on an ordering by weight or cost, rather than by node index.Of these, the best is based on choosing the node containing the minimum cost label. Given all arcs havea non-negative cost and that costs are therefore increasing along a path, we expect this to perform well.Since the other three LC−N methods perform so badly, they were not tested on larger instances. Note thatLC−N−MIN−C method was the worst method on larger instances, suggesting that the LC−N are, across theboard, the weakest type.

We can see that for problems with a tight weight limit, (low α values), it is often best to use LC−NODE−NOPRE.In these cases, least cost paths are very unlikely to provide good bounds meaning that finding ζ and ω boundsis not useful. In general, however, the effort involved in finding ζ and ω values appears warranted with thebetter label correcting methods.

The best performing label correcting algorithms for the random grid networks with non-negative costs areLC−NODE and LC−MIN−C. The good performance of LC−MIN−C is expected, as all costs are non-negative. Thesurprising result is the good performance of LC−NODE and even LC−REV−NODE. In particular, LC−REV−NODEoutperforms LC−N−MIN−C. Both of these methods pick a node and investigate all of its unexplored labels. Inour networks, most arcs (i, j) have i < j so LC−REV−NODE should perform poorly, whereas choosing a nodewith a minimum cost label should be more effective. This suggests that when there is no very strong basisfor choosing a label, it may be best to choose quickly, particularly for small networks.

As expected LC−MIN−C is not as strong a method when negative costs are included. In the case of α = 0.1it is on average the worst algorithm of its type. For problems with negative costs, it seems that LC−MAX−Wis the best LC−MIN/MAX type method, but is still beaten overall by the methods using node ordering.

One of the surprising results is the poor performance of preprocessing. In most cases the preprocessingdoes not improve the overall speed of the algorithm. It appears that preprocessing is more useful when theproblems are more difficult.

The three algorithms which perform well on average, (LC−MIN−C, LC−NODE and LC−REV−NODE), are morerobust with respect to weight limit. All of the other methods show a more significant spike for the dif-ficult non-negative cost, α = 0.1 instances. Note that for these methods preprocessing is not generallyadvantageous.

6.3. Comparison Of Meta-Network MethodsNumerical results for the various meta-network algorithms are summarized in Table 4. Algorithms are

named as defined in Section 5.7. Two of the best performing label correcting algorithms are also includedin the table, for comparison. As for the label-correcting algorithms, we consider the meta-network methodsboth with and without preprocessing.

Table 4 gives results for both random grid and airline network data sets. For each of these, we again testa range of weight limits between upper and lower bounds, W+ and W−, given by W = αW− + (1− α)W+

for α = 0, 0.1, 0.5, 0.9 and 1.0, but in this case use exact values for W+ and W−.The meta-network methods rely on a shortest path procedure. For the random grid networks, we use

Dijkstra’s algorithm, as all costs are non-negative. For the airline networks, the column generation frameworkmeans that some arc costs will be negative, so Dijkstra’s Algorithm, is no longer applicable. Since the airlinenetworks are acyclic, the shortest path algorithm instead uses the topological order to treat labels.

For the threshold based meta-network algorithms, a key parameter, β, used in equation (2) to decidehow aggressive to be in stopping the WCSPP solver for each meta-arc, must be set. We tested the first 10instances for each data set with a variety of β values, and found that β = 0.2 was best for the random gridnetworks and β = 0.9 for the airline networks. These values were used for the rest of the instances in thatdata set.

17

Page 18: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

Recall that all of the meta-network methods start with creation of the meta-network. This involvesfinding which meta-node pairs have a meta-arc between them and upper bounds on the cost of each. Whenused in column generation, the meta-arcs and the paths which give the upper bounds can be found a prioriand so this time is reported separately in the row titled Make. The time taken to find the lower bounds isincluded in the reported results for each method.

Table 4 shows the run time averages and standard deviations for each of the ten meta-network algorithms,as well as the two label correcting algorithms, over 50 randomly generated grid instances for each of size50× 50 and 100× 100 networks, (for algorithms which perform well), and over the 36 airline instances.

The most obvious feature of these results is the significant improvement from using preprocessing. Forall instances with α = 1, preprocessing will find the optimal solution, as the least cost solution is feasible;this is clearly quicker than using a meta-network method. The effect of preprocessing is significant even forinstances with α < 1. In general, the improvement from preprocessing is better for methods with worseperformance. It is also interesting to note that the standard deviation is reduced by preprocesing, meaningthat preprocessing provides more consistent run times for meta-network methods.

Whilst the basic meta-network method shows very poor performance, a number of the improvements wehave introduced are seen to be very effective. We consider separately the effects of induced upper bounds,lower bounds, threshold values and A* lower bounds.

Overall, using induced upper bounds is not very helpful. Its use can lead to a substantial proportionof arcs eliminated. For example, when used in the basic meta-network method on 50 × 50 grid networkswith α = 0, the induced upper bounds delete on average almost 84% of meta-arcs. However for instanceswith higher weight limits (α values 0.1 or higher), induced upper bounds only delete between 2.5% and4% of meta-arcs. Unfortunately, the instances for which induced upper bounds delete a high proportion ofmeta-arcs tend to be instances that are “easy”; they don’t make an impact on harder instances.

By contrast, lower bounds provide a very noticeable improvement for the random grid instances, observedby comparing MN−BASIC run times to those of MN−LOWBND. They are able to reduce dramatically the numberof meta-arcs that need to be explored. For example, in the 50× 50 grid instances, only 1.56% of meta-arcsare explored in the worst case (α = 0.1). For all other α values, the average percentage explored is wellbelow 1%. The time improvement is not as dramatic for airline networks, but there is still a marked decreasein average time from MN−BASIC to MN−LOWBND. Using the case of α = 0.1 as an example, the average timewithout preprocessing decreases from 8.62s to 1.82s.

Using threshold values generally degrades performance, seen by comparing MN−LOWBND with MN−LB−THRESHmethods. This suggests that the effort taken to find the threshold values (a shortest path pass for eachbound) is not worthwhile. It is possible to find induced upper bounds using heuristic methods, but initialexperiments with this did not show promising results.

The best performing of the meta-arc methods is MN−A ∗−LB. Using A* reduces the number of meta-arcsfor which we have to find the lower bound. The number of meta-arcs which need to be explored overallincreases by no more than 0.002%. Combining this method with preprocessing gives the best results of anymeta-arc method.

At present, although the best meta-network methods are able to improve on the basic algorithm byorders of magnitude, the meta-network methods are not able to beat the performance of label correcting.Meta-network based methods are, however, likely to be able to benefit from advances in parallel processingmore easily than label correcting methods. For example, the “while” loop in Algorithm 5 is obviouslyparallelizable.

It is important to note that the airline instances can all be solved in significantly less than a second bythe label correcting algorithm, and all except the α = 0.5 instances in less than a second by MN−A ∗−LB.

7. Conclusion

In this paper we have considered two different classes of algorithm for solving the WCSPP-R: labelcorrecting and meta-network methods. The former adapt standard methods for solving the WCSPP, whilstthe latter exploit any available solution method for the WCSPP to solve subproblems. We have also adapted

18

Page 19: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

50×

50

100×

100

Air

line

Impro

ve

Impro

ve

Impro

ve

α0

0.1

0.5

0.9

1t

s.d.

00.1

0.5

0.9

1t

s.d.

00.1

0.5

0.9

1t

s.d.

Num

Solv

ed

00

11

37

50

00

544

50

24

24

24

25

26

Make

0.6

70.7

91.0

21.0

21.0

214.4

716.7

023.4

323.0

523.1

410.6

810.5

410.7

210.6

910.7

4LC−

MIN−

Cw

ith

0.0

10.0

20.0

20.0

10.0

11.2

80.8

10.0

70.1

60.1

30.0

80.0

61.0

80.3

90.0

40.0

80.5

70.0

90.0

11.3

81.8

2w

ithout

0.0

10.0

10.0

10.0

10.0

00.0

60.1

00.0

70.0

60.0

60.0

10.1

21.3

50.1

90.0

1LC−

NODE

wit

h0.0

10.0

20.0

20.0

10.0

11.2

50.9

10.0

80.2

30.1

30.0

90.0

51.3

60.6

70.0

40.0

30.0

30.0

30.0

10.8

10.4

2w

ithout

0.0

10.0

20.0

10.0

00.0

00.0

60.1

70.0

80.0

60.0

60.0

10.0

10.0

20.0

10.0

1

MN−

A∗−

LB

wit

h0.0

64.3

30.7

50.0

20.0

0345.9

7177.3

10.5

3150.4

13.9

20.0

70.0

68.4

46.2

00.5

90.5

727.0

90.3

30.0

113.4

18.4

7w

ithout

0.1

34.2

91.1

60.1

80.0

81.4

9152.0

56.2

11.0

40.6

50.7

30.7

627.8

30.4

60.2

6MN−

LB−

THRESH

wit

h0.0

65.2

81.3

70.0

30.0

04365.2

54160.0

70.5

2214.0

415.2

60.1

30.0

6284.1

357.4

90.5

10.5

475.6

80.6

90.0

1136.4

323.6

4w

ithout

0.2

25.2

33.2

42.1

21.9

72.7

8213.5

947.0

036.4

735.9

01.7

41.8

683.1

92.0

12.0

4MN−

LB−

THRESH−

IUB−

PREP

wit

h0.0

75.2

71.3

90.0

30.0

04587.5

44299.8

00.5

3213.2

215.3

40.1

30.0

6289.2

059.4

20.5

20.6

176.4

70.7

50.0

1141.7

423.6

3w

ithout

0.2

25.2

63.2

82.1

72.0

32.7

7214.6

247.2

536.9

836.8

61.9

01.9

582.8

82.1

02.1

0MN−

LB−

THRESH−

IUB−

ALL

wit

h0.0

75.2

31.3

90.0

30.0

04599.2

24396.3

60.5

3214.6

615.4

0.1

30.0

6289.2

854.6

10.5

40.5

877.4

40.7

50.0

1138.9

723.4

5w

ithout

0.2

25.1

13.2

92.1

62.0

62.7

6215.2

247.6

237.1

836.5

81.8

21.8

782.5

72.1

22.0

6MN−

LOWBND

wit

h0.0

74.8

31.3

00.0

30.0

04034.9

14015.9

00.5

2142.0

112.6

10.1

30.0

6311.2

684.7

40.5

00.5

343.1

20.6

90.0

1133.5

613.4

9w

ithout

0.2

24.5

52.9

02.0

01.9

33.2

7166.0

546.6

640.1

839.2

51.7

41.8

247.9

71.9

91.9

9MN−

LOWBND−

IUB−

PREP

wit

h0.0

74.8

91.3

10.0

30.0

04088.4

44156.8

40.5

3142.2

812.8

10.1

30.0

6318.4

074.8

10.5

40.5

543.5

60.7

10.0

1142.0

213.5

3w

ithout

0.2

14.5

22.9

72.0

61.9

73.3

4166.6

647.9

841.0

940.4

01.8

81.9

047.9

32.1

02.0

9MN−

LOWBND−

IUB−

ALL

wit

h0.0

74.8

51.2

80.0

30.0

04124.3

54123.4

70.5

2142.0

512.8

40.1

30.0

6322.0

966.2

80.5

50.5

443.6

60.7

00.0

1141.3

813.3

5w

ithout

0.2

14.5

32.9

42.0

41.9

63.3

3167.5

447.5

141.7

040.6

71.8

11.9

947.5

42.1

12.0

9MN−

BASIC

wit

h0.2

0223.9

2286.7

42.4

10.0

01314406.5

51337607.0

70.5

20.5

269.4

24.3

80.0

1148.6

425.6

5w

ithout

0.3

1205.4

1826.5

1612.7

6541.7

41.7

88.6

278.8

56.3

32.4

9MN−

BASIC−

IUB−

PREP

wit

h0.1

4220.1

5270.7

82.2

30.0

01273199.8

11298876.3

20.5

20.5

866.4

94.0

50.0

1151.6

122.4

5w

ithout

0.9

0212.6

6870.1

8636.3

3557.8

51.8

52.8

973.8

16.0

52.5

3MN−

BASIC−

IUB−

ALL

wit

h0.1

3185.0

4223.0

21.8

60.0

01156130.0

81243483.4

00.5

10.5

566.2

24.0

10.0

1153.2

823.1

2w

ithout

0.3

0174.7

2725.5

2567.2

3522.6

61.7

82.9

676.0

46.1

82.5

8

Table

4:

Aver

age

Tim

es(C

PU

s)fo

rVari

ous

Met

a-N

etw

ork

Met

hods

19

Page 20: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

the standard preprocessing for the WCSPP to make it applicable to the WCSPP-R. For each class, weconsider a number of algorithm variants and improvements, and test these computationally on instancesdrawn from two data sets: randomly generated grid networks and realistic airline crew pairing columngeneration subproblems.

The label correcting algorithms are able to solve airline instances in well under a second. Choosingthe least weight label at all times does not perform well in the context of replenishment, since weight candecrease along a path. If all costs in the network are known to be non-negative, it is sensible to choose theleast cost label. Otherwise, simply selecting nodes in index order and treating all untreated labels on thecurrent node appears to perform well.

The meta-network methods are not able to match label correcting in performance on the problems testedhere. They are, however, significantly improved by the bounding methods introduced in this paper and couldalso be improved further by parallel processing. The meta-network may also be applicable to other weightconstrained problems with replenishment.

In future work, we intend to look at other applications of the meta-network as well as extending thesingle weight WCSPP-R to include multiple replenishing resources.

Acknowledgements

The authors would like to acknowledge Dr. Ranga Muhandiramge and Dr. Irina Dumitrescu for lettingus use their code as well as Dr. Jakob Puchinger for discussions regarding meta-network methods. We wouldalso like to acknowledge the support of grants ARC LP0669824 and ARC LP0883855. Finally, we would liketo thank our industry partners Constraint Technologies Inc. for data and for partially funding this work.

References

[1] N. Boland, J. Dethridge, and I. Dumitrescu. Accelerated label setting algorithms for the elementary resource constrainedshortest path problem. Operations Research Letters, 34(1):58–68, 2006.

[2] E. A. Cabral, E. Erkut, G. Laporte, and R. A. Patterson. Wide area telecommunication network design: application tothe Alberta SuperNet. Journal of the Operational Research Society, 59(11):1460–1470, 2008.

[3] E. A. Cabral, E. Erkut, G. Laporte, and R.A. Patterson. The network design problem with relays. European Journal ofOperational Research, 180(2):834–844, 2007.

[4] W. M. Carlyle, J. O. Royset, and R. K. Wood. Lagrangian Relaxation and Enumeration for Solving Constrained Shortest-Path Problems. Networks, 52(4):256–270, 2008.

[5] M. Desrochers and F. Soumis. A Generalized Permanent Labeling Algorithm for the Shortest-Path Problem with TimeWindows. INFOR, 26(3):191–212, 1988.

[6] J. Desrosiers, Y. Dumas, M. Solomon, and F. Soumis. Time Constrained Routing and Scheduling, Handbook in OperationsResearch and Management Science, chapter 8: Network Routing, pages 35–139. Springer, 1995.

[7] I. Dumitrescu and N. Boland. Improved preprocessing, labeling and scaling algorithms for the weight-constrained shortestpath problem. Networks, 42(3):135–153, 2003.

[8] Cabral E.A. Wide area telecommunication network design: Problems and solution algorithms with application to theAlberta SuperNet. PhD thesis, University of Alberta (Canada), 2005.

[9] M.R. Garey and D.S. Johnson. Computers and intractability. A guide to the theory of NP-completeness. Freeman, Oxford,UK, 1979.

[10] G. Ghiani, G. Laporte, and F. Semet. The black and white traveling salesman problem. Operations Research, 54(2):366–378, 2006.

[11] P.E. Hart, N.J. Nilsson, and B. Raphael. A Formal Basis for Heuristic Determination of Minimum Cost Paths. IEEETransactions on Systems Science and Cybernetics, SSC4(2):100–107, 1968.

[12] V. Mak and N. Boland. Polyhedral results and exact algorithms for the asymmetric travelling salesman problem withreplenishment arcs. Discrete Applied Mathematics, 155(16):2093–2110, 2007.

[13] R. Muhandiramge and N. Boland. Simultaneous solution of Lagrangean dual problems interleaved with preprocessing forthe weight constrained shortest path problem. Networks, 53(4):358–381, 2009.

Appendix A

The A* algorithm described by Hart et al [11] provides a framework for using “distance-to-go” estimatesto reduce the search space of a shortest path algorithm. It “processes” nodes i in increasing order of gi +hi,

20

Page 21: Solving Shortest Path Problems With a Weight Constraint ... · sents duty hours, and replenishment arcs represent crew overnight rests, and also in aircraft routing, where the weight

where gi is the distance found from s to i, and hi is a lower bound on the minimum cost from i to t. Ifthe estimates hi satisfy a consistency criteria, hi ≤ hj + li,j for each arc (i, j), where l denotes the arclength, then this processing order ensures no node is revisited. Using lower bounds h we can potentiallyavoid looking at large unnecessary sections of the network.

Usually, an A* algorithm is applied in cases where the distance-to-go can be calculated as required (innetwork embedded in Euclidean space, this is often the straight line distance between the current node andthe goal node) and the arc lengths are known a priori. We reverse this situation; the distance-to-go is knowna priori and we calculate the arc lengths as needed.

We apply it here to find minimum cost lower bound paths in the meta-network. The lower boundestimate we use for the cost-to-go for meta-node i is the cost of the least-cost path from i to t in the originalnetwork. These costs, denoted by ci, can be found simultaneously for all i using a single backwards pass ofa suitable shortest path algorithm. Note that these estimates satisfy the consistency criteria.

Our A* algorithm, as it is applied in Algorithm 4 is shown below in Algorithm 5.

Algorithm 5: SP−A∗Input: A meta-network (NM , AM ), meta-arc cost lower bounds c−, cost-to-go lower bounds ci for

each meta-node i ∈ NM , start node s and end node t, together with underlying networks(N i, Ai) for each i ∈ NM , original costs c, and a true/false vector done indicating from whichmeta-nodes outgoing meta-arc values for c− are known

Output: A minimum c− path in (NM , AM ) from s to t, and updated values for done and c−

Initialize gi := +∞ for all i ∈ NM \ {s} and gs := 0;5.1

i := s;5.2

while i 6= t do5.3

if donei = F then5.4

Solve SP−T−F(N i, Ai, c, i) to get c−i,j for all j with (i, j) ∈ AM ;5.5

donei := T ;5.6

end5.7

forall (i, j) ∈ AM do gj := min{gj , gi + c−i,j} ;5.8

Select i ∈ arg mink∈NM

{gk + ck};5.9

end5.10

return the path from s to t corresponding to gt, together with updated done and c values5.11

21