Auction Algorithms for Shortest Hyperpath Problems - CiteSeerX

15 downloads 0 Views 272KB Size Report
Aug 10, 1998 - of the auction method for the shortest path problem. In this paper we extend the ... algorithms for hard combinatorial problems 10]. ..... 102. 125. 250. HAR. 171. 117. 131. 144. 273. HAR2. 144. 98. 126. 135. 257. HARn. 176.
Universita degli Studi di Camerino Dipartimento di Matematica e Fisica Operations Research Group

Auction Algorithms for Shortest Hyperpath Problems R. De Leone

D. Pretolani

August 10, 1998

Technical Report no. OR-CAM-1998-01

Auction Algorithms for Shortest Hyperpath Problems R. De Leone 1

D. Pretolani 2

Dipartimento di Matematica e Fisica, Universita di Camerino, Via Madonna delle Carceri, 62032 Camerino (MC) ITALY. Email [email protected] 1

Dipartimento di Matematica e Fisica, Universita di Camerino, Via Madonna delle Carceri, 62032 Camerino (MC) ITALY. Email [email protected] 2

August 10, 1998 Abstract.

The auction{reduction algorithm is a strongly polynomial version of the auction method for the shortest path problem. In this paper we extend the auction{reduction algorithm to di erent types of shortest hyperpath problems in directed hypergraphs. The results of preliminary computational experiences show that the auction{reduction method is comparable to other known methods for speci c classes of hypergraphs.

Keywords:

rithms.

directed hypergraphs; hyperpaths; shortest paths; auction algo-

AMS subject classi cation:

90C35, 90B10, 05C65

1 Introduction The shortest hyperpath problem is the extension to directed hypergraphs [11] of the classical shortest path problem (SPT) in directed graphs. Though not as pervasive as SPT, shortest hyperpaths have several relevant applications. In particular, they are at the core of trac assignment algorithms for transit networks [13, 14, 18]. Shortest hyperpath models have been constructed for the SPT problem in stochastic and time-dependent networks [17] and for production planning in assembly lines [12]. Moreover, shortest hyperpath algorithms are used as building blocks of enumerative algorithms for hard combinatorial problems [10]. As a consequence, there is a growing interest for ecient shortest hyperpath algorithms. This provides motivations for further investigating known methods [11, 15], both from a theoretical and a practical point of view, and for developing new ones. Auction algorithms were rst proposed by Bertsekas [1, 2] for the assignment problem and later extended to general transportation problems [5, 6]. A survey of the auction algorithms for network optimization problems is contained in [4, Chapter 4]. Auction algorithms for shortest path problems on graphs were proposed in [3]. For the single{origin single{destination case the method can be viewed as an application of the auction method (with  = 0) to a speci cally constructed assignment problem, and nite termination of the procedure can be established. Furthermore, the algorithm is a dual coordinate ascent method. Strongly polynomial version of the auction method were proposed by Pallottino and Scutella [16], who de ne a pruning procedure that reduces the graph to the shortest path tree. Further improvements to this method are given in [7], where the pruning method is strengthened, and the structure of the reduced graph is exploited to obtain a better time complexity. A variant of the auction algorithm with pruning is proposed in [8]. In this paper, we devise an auction method for shortest hyperpaths with nonnegative hyperarc weights, by slightly modifying the SPT algorithm given in [7]. Our method can be tailored to solve several types of shortest hyperpath problems; for the various cases, we provide a worst case complexity bound. Finally, we report the results of a preliminary computational experience. In Section 2 we give the basic de nitions on hypergraphs and shortest hyperpaths. The proposed auction method for shortest hyperpaths is presented in Section 3. Computational results and conclusions are presented in Sections 4 and 5, respectively.

2 Shortest Hyperpaths in Directed Hypergraphs A directed hypergraph H is a pair (V ; E ), where V is a set of nodes and E is a set of directed hyperarcs; a hyperarc is a pair e = (T (e); h(e)), where T (e)  V is the tail of e, and h(e) 2 V n T (e) is its head. A detailed introduction to directed 1

hypergraphs can be found in [11], where a more general de nition of hypergraphs is introduced; the particular class of hypergraphs considered in this paper are called B-graphs in [11]. The size jej of hyperarc e is the number of nodes it contains in its tail and head: jej = jT (e)j + 1: The hyperarc e is an arc if jej = 2, and a proper hyperarc if jej > 2. Denote by ma and mh the number of arcs and proper hyperarcs, respectively; let m = ma + mh = jEj and n = jNj. The size of H is the sum of the cardinalities of its hyperarcs: X size(H) = jej: e2E

Given a node u, the Forward Star of u, FS (u), is the set of hyperarcs e such that u 2 T (e) and the Backward Star of u, BS (u), is the set of hyperarcs e such that u = h(e). A path Pst , of length q, in the hypergraph H = (V ; E ) is a sequence: Pst = (v1 = s; e1 ; v2 ; e2 ; : : : ; vq+1 = t) where, for 1  i  q, ei 2 E , vi 2 T (ei ) and vi+1 = h(ei ). The nodes s and t are the origin and the destination of the path Pst , respectively. We say that node t is connected to node s in H if a path Pst exists in H. If t 2 T (e1 ), then the path Pst is a cycle. A path is cycle-free if it does not contain any subpath which is a cycle, i.e., vi 2 T (ej ) ) j  i, for 1  i  q + 1. Given a hypergraph H = (V ; E ) and two nodes s; t 2 V , a hyperpath st is a minimal hypergraph (with respect to deletion of nodes and hyperarcs) H = (V ; E ) such that: 1. E  E ; S 2. s; t 2 V = e2E (T (e) [ fh(e)g); 3. u 2 V ; u 6= s ) u is connected to s in H by a cycle-free path. Observe that for each u 2 V n fsg there exists a unique hyperarc e 2 E such that h(e) = u; e is the predecessor hyperarc of u in , and is denoted by e (u). We say that node t is hyperconnected to s in H if there exists a hyperpath from s to t in H. Given a hyperarc a, we say that a hyperarc ar is contained in a, or is a reduction of a, if h(ar ) = h(a), and ; 6= T (ar )  T (a). Note that a is contained in itself, and ar is strictly contained in a if T (ar )  T (ar ). Given a and u 2 T (a), we denote by a n u the reduction of a obtained deleting u from T (a). We say that a hypergraph is full when it contains all the possible reductions of each of its proper hyperarcs. A full hypergraph can be represented by its support hypergraph Hs , obtained by deleting all the strictly contained hyperarcs. Conversely, given any hypergraph H, we can obtain the corresponding full hypergraph Hf by adding all the strictly contained hyperarcs. 2

2.1 Shortest Hyperpaths

A weighted hypergraph is such that each hyperarc e is assigned a nonnegative real weight w(e). The weight of a hyperpath in a weighted hypergraph can be de ned in several ways. It is known that some de nitions lead to intractable shortest hyperpath problems [9]. Here we restrict to de nitions that are known to be tractable [11]. A weighting function is a node function that, given a hyperpath st = (V ; E ), assigns a value W (u) to its nodes, depending on the weights of its hyperarcs. The value W (t) is the weight of  under the chosen weighting function. An additive weighting function satis es the properties that W (s) = 0, and for u 6= s W (u) is a function of the predecessor e (u) only. Formally, an additive weighting function can be de ned by means of the following recursive equations:

W (u) =

(

0 if u = s w(e (u)) + F (e (u)) if u 2 V =fsg

(1)

where F (e) is a non-decreasing function of the weights of the nodes in T (e). Clearly, many di erent additive weighting functions can be de ned (see [11]); consider rst the value function, which is obtained by de ning F (e) in (1) as follows:

F (e) =

X

u2T (e)

W (u):

The minimum value (shortest hyperpath) problem consists of nding a set of minimum value hyperpaths from the origin node s to each node u 6= s hyperconnected to s. We denote by V (u) the minimum value of a hyperpath su in H; we assume V (s) = 0, and V (u) = +1 if u is not hyperconnected to s. The distance function is obtained from (1) de ning F (e) as follows:

F (e) = maxfW (u) : u 2 T (e)g: The minimum distance problem asks for the minimum distance hyperpaths from origin s. Denote by D the vector of minimum distances, where again D(s) = 0, and D(u) = +1 if u is not hyperconnected to s. Since arc weights are nonnegative, the minimum value and minimum distance problems can be solved eciently by procedure SBT [11]. A computational analysis of several variants of SBT can be found in [15].

2.1.1 Minimum Time Problems in Transit Hypergraphs The problem of nding the passenger's expected travel time is at the core of several urban transit networks models. This problem has been formulated in terms of hyperpaths in transit networks [13] and in F-graphs [11, 14]. Here, introducing the time 3

weighting function in transit hypergraphs, we de ne a particular shortest hyperpath problem that, though using a di erent (and slightly more general) terminology, is equivalent to the formulations found in [13, 14]. A transit hypergraph is a weighted support hypergraph H = (V ; E ) where a positive parameter u is associated with each node u 2 V . Let Hf = (V ; Ef ) be the full hypergraph represented by H. Consider an e 2 Ef contained in a proper hyperarc a 2 H: the time weighting function is obtained from (1) by de ning the weight w(e) and the function F (e) as follows: X u ; (e) = u2T (e)

w(e) = 1=(e); X u F (e) = (e) W (u): u2T (e)

In practice, F (e) is the weighted average (with weights :) of the values W () in T (e), while w(e) is the inverse of the sum of the weights : in T (e). For an arc e = (fug; v) 2 Ef corresponding to an arc a 2 E the function F (e) is de ned in the same way, which gives F (e) = W (u); however, in this case w(e) = w(a) can be any nonnegative value. The minimum time problem consists of nding the minimum time hyperpaths, from a given origin s, in the full hypergraph Hf . Note that Hf may be considerably larger than its support H: in practice, solving the minimum time problem eciently requires to work directly on H. This is the aim of the following observations. Denote by E the vector of minimum times, where E (s) = 0 and E (u) = 1 if u is not hyperconnected to s in Hf . For each e 2 Ef de ne:

u E (u): u2T (e) (e) Consider a proper hyperarc a 2 E , and let R(a) be the set of the reductions of a; denote by e(a) the reduction of a yielding the minimum time t(e): e(a) = arg e2min t(e): R(a) t(e) = w(e) +

X

The following relations hold ([13], Proposition 6): t(e(a)) > E (w); 8w 2 T (e(a)); (2) t(e(a))  E (w); 8w 2 T (a) n T (e(a)): Consider the nodes in T (a) in increasing order of E , i.e. let T (a) = fu1 ; : : : ; uk g, with E (ui )  E (ui+1 ), 1  i < k. For 1  i  k let ai be the reduction of a such that T (ai ) = fu1 : : : ui g. It follows from (2) that e(a) = ah , where h = 1max fi : E (ui ) < t(a)g: ik 4

In practice, working on the support hypergraph requires nding the hyperarc

e(a) without considering the whole set of reductions of a. Indeed, according to the previous observations, this can be done by processing the nodes in T (a) in the order u1 ; u2 : : : ; uk . For each ui 2 T (a), compute the value t(ai): if E (ui ) < t(ai ), then ui 2 T (e(a)), otherwise, e(a) = ai?1 . This technique has been used to compute expected

travel times eciently [13, 14], and will be adopted in our auction algorithm for the minimum time problem.

2.1.2 Reductions and Shortest Hyperpaths

A hyperarc reduction operation on a proper hyperarc a consists of replacing a by a hyperarc ar contained in a, returning a reduced hypergraph. Clearly, if the hypergraph is weighted, a nonnegative weight w(ar ) must be assigned to ar . The following propositions show that by suitably choosing the weight on ar a reduction operation does not modify the optimal solution of the shortest hyperpath problem. Proofs are rather straightforward and are omitted. Suppose we are given a weighted hypergraph H, and the corresponding vectors of optimal solutions V , D for the value and distance weighting functions. Given a proper hyperarc a and u 2 T (a), consider replacing a by ar = a n u. Proposition 2.1 If w(ar ) = w(a) + V (u), V is the vector of optimal values in the reduced hypergraph.

Proposition 2.2 If D(u)  maxfD(v) : v 2 T (ar )g and w(ar ) = w(a), D is the vector of optimal distances in the reduced hypergraph.

Now suppose we are given a transit hypergraph H, the corresponding full hypergraph Hf , and the optimum times E . Let e be a proper hyperarc in Hf , with t(e) > E (u) for each u 2 T (e), and consider replacing e by an arc er = (fug; h(a)), with u 2 T (e): Proposition 2.3 If w(er ) = t(e) ? E (u), E is the vector of optimal times in the reduced full hypergraph.

3 Auction Algorithms for Shortest Hyperpaths In this section we propose an auction method for the minimum value problem and discuss the adaptation to other weighting functions. Before introducing our approach, we brie y recall some relevant features of the auction algorithms for SPT; the reader is referred to the cited literature for further details. The auction algorithm for shortest path problems on graphs maintains a path P (the candidate path) starting at the origin s and a set of dual node prices p satisfying 5

the following complementary slackness (CS) conditions: p(i)  cij + p(j ) 8(i; j ) (3) p(i) = cij + p(j ) 8(i; j ) 2 P where cij is the cost of arc (i; j ). The algorithm consists of three basic operations: path extension, path contraction and dual price raise. At each iteration, the candidate path P is possibly extended, by adding a new node at the end of the path without violating (3). When no extensions are possible, the dual price of the terminal node i in P is raised, and if i 6= s the path is contracted by deleting node i. For the single{origin, single{destination case the algorithm terminates when the destination node is reached; several variants have been devised, also for the multiple{destination case. Consider the case of nonnegative costs and dual prices initially set to zero. At the rst scan of a node i (i.e. when node i becomes the last node in P for the rst time) the optimal distance of node i is determined, indeed, it is equal to p(s). As a consequence, since p(s) is never decreased during the algorithm, the sequences of rst scan operations ranks the nodes in increasing order of distance from the origin s. Based on the above property, the auction{reduction method [16] introduces the following reduction operation: at the rst scan of node i, delete each arc entering i, except the last arc in P . By means of these reduction operations, the graph is transformed into the shortest path tree, and a strongly polynomial time complexity can be obtained. Further reduction operations, including deletion of nodes, have been proposed in [7], improving the complexity bound. The following observation is at the core of our auction shortest hyperpath method: Observation 3.1 According to the de nition of value, distance, and time weighting functions, for an arc a = (fug; v) we have F (a) = W (u). In other words, the weighting functions above de ne a standard SPT problem if the hypergraph is a directed graph. This suggests the following technique:  apply the auction{reduction SPT algorithm to the arcs of the hypergraph;  at the rst scan of node i, apply hyperarc reduction operations according to Properties (2.1),. . . ,(2.3), possibly generating new arcs. Note that the hypergraph is modi ed during the algorithm; each step is applied to the current hypergraph, as returned by the previous reduction operations. In practice, during the execution the proper hyperarcs lay in the not yet explored part of the hypergraph, and they are not considered until they are replaced by arcs as a result of successive reductions. Our auction algorithm for the minimum value problem is described in procedure MinValue. Remark that procedure MinValue applied to a graph becomes the auction algorithm with graph reduction described in [7]. 6

For each node i, the predecessor pred(i) gives the last arc in the best s-i path determined so far; for notational convenience, we consider pred(i) as a set; initially, pred(i) = ;. The label l(i) is the minimum s-i hyperpath value determined so far, which becomes the optimum s-i hyperpath value V (i) at the rst scan of node i. We denote by FSA(i) and FSH (i) the arcs and proper hyperarcs in FS (i), respectively; thus FS (i) = FSA (i) [ FSH (i). Replacing hyperarc a by its reduction a n i is denoted by a := a n i; note that a n i may be an arc. The last node in P is denoted by last(P ). During the execution of the algorithm, the contained graph HA = (VA ; EA ) is the directed graph de ned by the nodes and arcs in the current hypergraph H = (V ; E ), i.e., VA = V and [ EA = FSA(i): i2V

Proposition 3.1 At each step of the algorithm, for each node i 2 VA such that V (i) < +1 the quantity V (i) gives the shortest s-i path length in the current contained graph HA . Proof: The property follows from the correctness of the auction algorithm for SPT, observing that a new arc (i; j ) is created only before the rst scan of node i.

Theorem 3.1 The vector V determined by the algorithm gives the minimum hyperpath values in the original hypergraph.

Proof: The theorem can be proved by induction considering nodes in order of rst scan, that is, in increasing order of value V (). The claim is clearly true at the beginning because to node s is assigned V (s) = 0. Assume that all the previously assigned V are correct at the rst scan of node i. It follows from Proposition 3.1 that l(i) is a lower bound on the length of any path in HA from node s to each node j such that p(j ) = 0. Therefore, in the current hypergraph, the value of any hyperpath containing a proper hyperarc cannot be less than l(i). This implies that V (i) = l(i) is correct; as a consequence, Step 1(c) does not change the optimal solution (Proposition 2.1).

3.1 Other Weighting Functions

The auction algorithm for minimum value can be easily adapted to the minimum distance problem. To this aim, it suces to skip the weight update w(a) := w(a) + V (i) in Step 1(c). This follows from Property (2.2) since, when a is replaced by a n i, V (i)  V (j ) for each node j 2 T (a n i). At the end of the algorithm, D = V gives the vector of optimal distances. The proof of correctness for the distance function is similar to the one of Theorem 3.1. 7

Procedure MinValue(H; s) Step 0 (inizialization) for each u 2 V : pred(u) := ;, p(u) := 0, V (u) := l(u) := +1; l(s) := 0, P := fsg; Step 1 i := last(P ); if i = s and FSA(s) = ; return V ; if V (i) = +1: perform steps (a). . . (d) ( rst scan of i) (a) (set value) V (i) := l(i); (b) (delete BS (i)) E := E n BS (i) [ pred(i); (c) (reduce hyperarcs) for each a 2 FSH (i): a := a n i, w(a) := w(a) + V (i); (d) (update labels, delete arcs) for each a = (i; j ) 2 FSA (i): if l(i) + w(a) < l(j ) : E := E n pred(j ), pred(j ) := fag, l(j ) := l(i) + w(a); otherwise, E := E n fag; Step 2 (node deletion, contraction, or expansion) if FSA (i) = ;: V := V n fig E := E n pred(i), contract P , go to Step 1; if p(i) = minfw(a) + p(j )j a = (i; j ) 2 FSA(i)g: go to Step 4; Step 3 (contraction) contract P ; set

p(i) := a=(i;jmin fw(a) + p(j )g; )2FS (i) A

go to Step 1; Step 4 (expansion) expand P by node ji , where:

ji := arg a=(i;jmin fw(a) + p(j )g; )2FS (i) A

go to Step 1.

8

The situation is slightly more complex for travel times. Recall that our goal is to work with the support transit hypergraph, thus we must deal with the corresponding full hypergraph implicitly. To this aim, we replace hyperarc reductions by arc insertion operations, as described below. Consider a proper hyperarc a in the support, with T (a) = fu1 ; : : : ; uk g and E (ui )  E (ui+1 ), 1  i < k. We know that it suces to consider the k reductions ai, 1  i  k, with T (ai ) = fu1 : : : ui g (see Section 2.1.1). At the rst scan of node ui 2 T (a), we compute the value t(ai ); if t(ai ) > V (ui ) we generate an arc (ui ; h(a)) with weight t(ai ) ? V (ui ), according to Proposition 2.3. Otherwise, i.e., if t(ai )  V (ui ), we conclude that ai?1 is the reduction e(a) of a yielding minimum time, and we delete a. If necessary, a is removed at the rst scan of node uk . In conclusion, for a proper hyperarc a, up to jT (a)j arcs can be generated. In order to compute each t(ai ) eciently, for each proper hyperarc a in the support hypergraph we keep two values, initially set to 0:

(a) =

X

u2T (a)

uV (u);

V (u)