Anda di halaman 1dari 6

The resource constrained shortest path problem

Jens Kjerrstrm

Abstract
This report is a part of the Transport optimization course at Gteborg University. It denes a variant of the resource constrained shortest path problem, a NP-complete problem, and describes some solution approaches.

1.0 Introduction
The resource constrained shortest path problem (RCSP) is a restriction of the shortest path problem (SP). The reason for the study is that it occurs as a sub-problem for column generation in Tail Assignment, a scheduling problem in the airline industry. It has many other applications among others its present in variants of the vehicle routing problem. The shortest path problem is solvable in polynomial time and has efcient and well-studied algorithms, e.g. Dijkstra. The resource constrained shortest path problem is NP-complete. The added resource constraints can be interpreted as knapsack constraints.

2.0 Formulation and restrictions


Consider a DAG G = (V,A) with vertex set V and arc set A. We can consider G a directed acyclic graph, since the RCSP occurring in Tail Assignment is a time network, and thus has no cycles. Let every arc a A have a cost c a related to it. Furthermore let s and t in V be two special vertices in G, traditionally called source and sink, in our context origin and destination for the shortest path. A shortest, or cheapest, path in G according to these denitions is a set of arcs P = a 1, a 2, , a n that corresponds to a path between s and t in the graph, the initial node of a 1 is s , the terminal node of a n is t and the cost of the path, dened as: CP =

ca
i=1

is less than or equal to the cost of any other ( s, t ) -path in the graph. Now let every arc in A have a vector of resources consumed associated to it. That is, if arc a is used then R a = ( r a1, r a2, , r aq ) , where q is the number of recourses, is a vector showing how
The resource constrained shortest path problem June 1, 2001 1

much of a resource was consumed by this arc. Add a number of resource constraints of the form:

(1)

( Ra )i bi, for i
a=1

= 1, , q

Then the resource constrained shortest path problem is a shortest path that does not violate the constraints (1). A related problem is the k-shortest path problem, where the goal is to nd just not the cheapest path, but nd k cheapest paths in the graph. A solution to this problem is a set of ( s, t ) - paths, that can be arranged like P 1, P 2, , P k with costs C 1 C 2 C k so that all ( s, t ) -path that differs from P 1, P 2, , P k has a greater or equal cost compared to Ck .

3.0 Solution methods


3.1 Generate and test
Since the shortest path problem is easy, it might be a good idea to use it in a strategy to solve the RCSP. A straightforward way to do this is to solve a SP instead of a RCSP, then check if the solution violates some of the resource constraints. If it does not, then the optimal solution to the RCSP is found. If some constraint is violated the second shortest path is produced and so on. The k-shortest path problem is used for this scheme in practise, due to efciency. Produce the k shortest paths and then pick the shortest of these that does not violate the constraints. One problem with this solution method then becomes how to choose the size of k in order to guarantee a feasible solution. In the worst case all paths has to be enumerated, since the most expensive might be the only feasible path. If the constraints are not that limiting in the sense that not many paths are illegal, this might be a good solution technique.

3.2 Dynamic programming


3.2.1 General scheme Dynamic programming is divide and conquer taken to its extreme. Every sub-problem is solved in order to get a solution to the entire problem. In the case of a shortest path problem the dynamic programming approach is to use the fact that an optimal ( s, t ) -path is built up from optimal sub-paths. If a path including node n is used, then the path from s to n is optimal. If you got the optimal path from s to all nodes that are neighbours to the source node, then its easy to compute the shortest path. Dijkstras algorithm uses this, like virtually all SP algorithms. Compute the shortest path to all nodes one arc away from the source save and the distance at every node, then continue with the nodes two arcs away
The resource constrained shortest path problem June 1, 2001 2

from the source, using information from the step before, save the distance from the source and from which previous node the shortest path originated. Since the graphs were dealing with are DAGs there is no need to worry about negative cost cycles in the graph. The scheme loosely described above works ne for SP but for the RCSP there is a problem. In the SP its easy to decide if one path is better than another, if its cheaper, its better. For the RCSP problem a cheap path that consumes a lot of resources early on probably will be worthless in a later step since it will become illegal, but a seemingly expensive path in an early stage might prove to be optimal. Because of this more than one path needs to be stored. How many of the paths should then be saved at each node? For the SP all paths but one (the optimal) can be disregarded at each node, this is impossible for the RCSP. The paths that become infeasible along the way can of course be disregarded, but not counting these there are still a huge number of candidate paths, especially if there are many different types of resources. To save all paths at every node would take too much memory and would make an algorithm slow 3.2.2 Labelling To be able to prune some of the paths that never can be part of a optimal solution a concept of domination is introduced. Recall that all the arcs in the graph has a vector with the resources that are consumed if the arc is used associated to it. At each node the sum of all resources consumed for all paths leading to it can be computed. Consider two paths P a and P b with its associated vectors of resource consumption R a , R b and costs C a and C b . The resource consumption for a path is the sum of the resource consumption of the arcs in the path. Dene the label for a path as the q+1 vector: C a La = R a P a is dominated by P b iff ( L b ) i ( L a ) i, for i = 1, , ( q + 1 ) and i ,( R b ) i < ( R a ) i . That is, P b is at least as good as P a in all aspects and better in at least one. P a can safely be disregarded since there exists an alternative that is better. To relate this to SP the dominating criteria is very easily checked, the cheapest path to a node dominates all other paths to that node. Here every node will have just one label and the two concepts are basically the same. In the case of RCSP each node may have many labels representing non-dominated paths. It is the set of non-dominated path that is of interest to compute, which is not a trivial task. A non-dominated label/path is also called efcient. A lexicographic ordering of the efcient labels have proven useful. Intuitively its there can be a great difference between two labels, the lexicographic order tries the more promising rst. If the labels are lexicographically ordered, its easy to decide which labels a new label might dominate/be dominated by. Consider a label L. The lexicographically less labels are the only ones that can dominate L and it can never dominate any of these, since at least one value of L is greater than the corresponding values of this group of
The resource constrained shortest path problem June 1, 2001 3

labels. The set of labels lexicographically greater than L can be dominated by L and they can in turn never dominate L.

3.3 Pruning techniques


To reduce the network as much as possible it is important since it will save much work. The idea is to remove nodes and edges that cannot form a part of a possible solution. 3.3.1 Node pruning Let the minimum resources needed to travel between node i and j be denoted by the vector R ij . To go between a pair of nodes at least the amount of resources denoted by this vector will be used. For a node j where the following holds: ( R sj ) i + ( R jt ) i > b i for some i { 1, 2, , q } we can conclude that this node will never be part of an optimal solution. This technique can be used to prune away nodes and thus reducing work wasted on paths including nodes that can never be in an optimal solution.
min min min

3.4 Lagrangian relaxation


Since it is the resource constraints that destroys the nice properties of the SP a natural idea is to do a Lagrangian relaxation on the RCSP with respect to the resource constraints. The relaxed problem then is a SP with a modied objective function. Every resource constraint will have a Lagrangian multiplier associated to it and are then added to the objective function. The Lagrangian multipliers can be seen as a penalty for violating a constraint. The problem is to nd the optimal Lagrangian multipliers. If too high penalties are issued then the objective function of the relaxed problem will not be a good estimation of the original, it will be considered good to have much slack in the constraints, but the solution will be feasible. On the other hand, with too low penalties you come closer to the SP you get by just removing the constraints, i.e. the solution will not be feasible. When optimal multipliers are found we have an lower bound on the problem. A upper bound could be achieved through the solution process of the relaxed problem. If we are lucky the lower bound and the upper bound have equal value and thus we know we have an optimum. If there is a duality gap, the lower bound is less that the upper bound then an extra step has to be performed to try and close the gap, if an optimal solution is wanted. In either case, we have an estimate for how good the solution could be, and can compare this to the one we have, if the main objective is not to nd the optimum, but to get a good solution.

The resource constrained shortest path problem

June 1, 2001

3.5 Integrated methods


A scheme described in [5] suggests to attack the problem in three-steps: rst compute bounds on the problem, then prune the graph and last close the gap between the lower and the upper bound. To compute bounds a Lagrangian relaxation could be used, or solving the relaxation of a different way to model the problem, described below. Some pruning techniques are described above, and with a (good) upper bound on the problem more effective pruning can be achieved. If we are very close to optimum intuitively many paths can be pruned. To close the gap one could use the k-shortest path approach, or some pathranking scheme where the lower and upper bounds are used. 3.5.1 Different IP model In the usual IP-model for the SP and RCSP-problems the variables corresponds to the ow on the arcs (usually 0 or 1), with ow-preserving constraints and resource constraints to make sure a solution has the desired attributes. Every arc has a variable, in an optimal solution the variables with values not zero will form a path in the graph/network with the optimal properties. The Lagrangian relaxation methods have been performed on this model. In the recent article [5] another model is proposed. The variables corresponds to the paths in the graph, every ( s, t ) -graph will have a variable. The model then is: min s.t.

cpxp
p

xp = 1
p

( R p x p )i bi
p

i = 1, 2, , q

x p { 0, 1 } Here R p denotes the resources consumed by an entire path and accordingly the cost c p is for a path rather then an arc. This problem is not solved directly, since that would amount to exhaustive enumeration of all possible paths. It has just q + 1 constraints, where q is the number of resource constraints, but an exponential number of variables in the problem size. This formulation is used to get a lower bound on the problem by relaxing the IPmodel by dropping the integrality constraints on x p and then attacking the dual of the relaxed problem. The dual will have a more sensible q + 1 variables but in turn have an exponential number of constraints. The constraints are not present explicitly, but added with cutting-plane techniques. A solution to this problem will produce a lower bound to the problem, since it is a relaxation of the original formulation.

The resource constrained shortest path problem

June 1, 2001

4.0 References
[1] P. H. Hartel, H. Glaser. The resource constrained shortest path problem implemented in a lazy functional language. Journal of Functional Programming, 6(1):29--45, January 1996. M. Desrochers, F. Soumis. A generlized permanent labeling algorithm for the shortest path problem with time windows. INFOR vol. 26 (1988), no. 3. E. Q. V. Martins, J. L. E. Santos. The labeling algorithm for the multiobjective shortest path problem. Universidad de Coimbra, Portugal, 1999. M. Larsson, Z. Miloloza. Heuristic for Shortest Path Problem with Resource Constraint Problem applied to Aircraft scheduling, (Master thesis, preliminary version), 2001. K. Mehlhorn, M. Ziegelmann. Resource Constrained Shortest Paths. http://www.mpi-sb.mpg.de/~mark/rcsp.ps C. C. Ribeiro, M. Minoux. A heuristic approach to hard constrained shortest path problems. Discrete Applied Mathematics 10 (1985) 125-137. H. C. Joksch. The shourtest Route Problem with Constraints. Journal of Mathematical Analysis and Applications 12 (1966), 191-197. R. Saigal, A constrained shortest route problem, OR 16, 205-209. T. Takkula, Dealing with additional constraints in the k-shortest path problem, Chalmers University of Technology, 1999.

[2] [3] [4]

[5] [6] [7] [8] [9]

The resource constrained shortest path problem

June 1, 2001

Anda mungkin juga menyukai