The Generalized Shortest Path Problem

32 downloads 0 Views 181KB Size Report
We consider generalized shortest path problems with cost and weight func- tions for the arcs of a graph. According to their weight arcs may generate or consume ...
The Generalized Shortest Path Problem Vladimir Batagelj University of Ljubljana, Department of Computer Science Jadranska 19,1000 Ljubljana, Slovenia

E-mail: [email protected]

Franz J. Brandenburg* University of Passau, 94030 Passau, Germany

E-mail: [email protected]

Patrice Ossona de Mendez EHESS, 54 bd. Raspeil, 75006 Paris, France

E-mail: [email protected]

and Arunabha Sen Arizona State University, Department of Computer Science and Engineering Tempe, Arizona 85287-5406, USA

E-mail: [email protected] Received March 13, 2000; revised ; accepted

We consider generalized shortest path problems with cost and weight functions for the arcs of a graph. According to their weight arcs may generate or consume ow. Weights may be additive or multiplicative on a path. More precisely, if units enter an arc = ( ) then + ( ) resp. ( ) leave it. The cost is charged per unit and summed over the edges of a path. If the weights multiply, then the generalized shortest path problem can be solved eciently by the reverse Dijkstra algorithm. By a generalization we can capture consuming ows, negative costs and cost decreasing cycles. If the weights sum up, then there is a dynamic programming approach in pseudopolynomial time. If the cost and the weight are bounded simultaneously, then we have the constraint shortest path problem, which is NP-complete. The generalized shortest path problem is a special generalized min-cost network ow problem. These arise in several application contexts and have been studied intensively in the literature, see e.g. [1]. Since the integer generalized max- ow problem is NP-hard our result gives evidence that there are no ecient ow augmenting path algorithms for generalized network ow problems. x

* corresponding author

a

u; v

1

x

w a

x w a

2

BATAGELJ, BRANDENBURG, OSSONA DE MENDEZ, SEN

1. INTRODUCTION

What is the cheapest way to send data through a communicationnetwork when links are charged per unit and each link expands the data e.g., by attaching routing information? How much does it cost transporting a unit commodity in a generalized network? In generalized networks each arc has a weight or a gain w(a) which might expand or consume ow in a multiplicative or additive fashion. If x units enter an arc, then x  w(a) respectively x + w(a) leave it. An arc may be gainy or lossy. Generalized network ow problems have been studied extensively in the literature. They arise in several application contexts and can be used to model many situations which are impossible to express using standard network ows. The generalized min-cost ow problem has been investigated in depth by Ahuja et al. [1]. There networks with arc capacities and multiplicative gains are considered. This is one of the more general forms of network

ow problems and includes the generalized maximum ow problem as a special case. Generalized min-cost ow problem have a canonical linear programming formulation subject to

MIN cij xij xij ? wji xji = b(i) for all nodes i 0  xij  uij ,

where cij and wij are the cost and the gain of the arc (i; j), uij is the arc capacity and b(i) is the ow created in node i with b(i) = 0 if i is ow conserving. Ahuja et al. [1] solve the generalized min-cost ow problem by their generalized network simplex algorithm. They also investigate the complexity of the generalized min-cost ow problem. Since the generalized min-cost ow problem is a special case of a linear programming problem (LP), it can be solved in polynomial time using the ellipsoid method [7] or Karmarkar's algorithm [6]. However, there is no polynomial bound on the worst-case complexity of the generalized network simplex algorithm. Goldberg et al. [4] state that no polynomial-time bounds are known for combinatorial algorithms for generalized maximal

ow problems. This gap is explained by the fact that the integer generalized maximum ow problem is NP-complete as shown by Ahuja et al. [1], p. 798. The generalized shortest path problem is a special case of the min-cost generalized network ow problem, where a unit ow is transported through a generalized network without capacities. The objective is a cheapest path for a unit ow from a source to a target. Hence the generalized shortest path problem can be solved in polynomial time using general LP algorithms. However, we do not have an LP formulation in case of additive weights.

THE GENERALIZED SHORTEST PATH PROBLEM

3

Then an arc (i; j) increases a ow xij along the arc (i; j) from xij to xij + wij , if xij > 0. However, if there is no ow, then there is no increase. Our focus is on combinatorial algorithms for these problems. However, the generalized shortest path problems cannot be solved directly by the classical algorithms of Dijkstra, Bellman-Ford and Floyd-Warshall, see [2]. The cost of a path is the sum of the cost of its arcs. In the traditional setting the arc weight is static and set to one. In the generalized version the weight of an arc depends on its history on a path. The weights may accumulate or grow progressively, if they sum or multiply along a path. Both cases have many applications. Additive weights are used, if the variation is independent of the actual ow. Then a xed amount of the commodity is added or kept when leaving an arc. As an example, a header with routing information is attached to the transmitted data. If the weight is charged per unit, then it accumulates in a multiplicative fashion. This is used to represent the fact that some ow or commodity is lost while transporting, due to damage, evaporation, theft, toll etc. The combination of costs and weights introduces various ways of cost decreasing cycles. There may be negative cost cycles which give raise to unde ned instances and minus in nity cost. And there may be weight decreasing cycles which give raise to a sink such that it is cheaper to absorb a ow in an in nite cycle than transporting it to the destination. Both situations are detected by our algorithm, and settled in a plausible way. In this paper we show that the generalized shortest path problem can be solved eciently for multiplicative weights. The solution is running Dijkstra's algorithm in reverse. In the case of additive weights there is a dynamic programming approach and a pseudo-polynomial algorithm. Finally, if there are restrictions both on the cost and on the weight of a path, then a simple reduction of PARTITION shows that the constrained shortest path problem is NP-complete. This fact was already known from [1].

2. BASIC NOTIONS

Let G = (N; A) be a directed graph with n nodes and m arcs. There are two weighting functions for the arcs, a cost function c : A ! R and a weight function w : A ! R assigning real values to the arcs. In mincost network- ow problems there are also two weighting functions for the cost and the capacity of the arcs. Here, the weight function increases or decreases the ow along each arc. The cost of a path is the sum of the cost of its arcs. The cost of each arc is c(a) per unit of ow. The weight w(a) of each arc increments or decrements the amount of ow along the arc by an additive or multiplicative term. If x units of ow enter arc a, then x + w(a) or x  w(a) units leave it. Examples

4

BATAGELJ, BRANDENBURG, OSSONA DE MENDEZ, SEN

for the additive case are the attachment of some data to the header of a message, or a fee at the end of each arc payable in terms of the transported commodity. If each package of a message is extended by some data or if a percentage of the ow evaporates, then the weight function progressively changes the amount of data or ow and these changes multiply. For a path p = (a1 ; a2; : : : ; ar ) with arcs a1 ; a2; : : : ; ar the additive weight of the i-th arc of p is wp+ (ai ) = w(a1) + : : : + w(ai?1) = j