Hamiltonian paths in large clustered routing problems 1 ... - CiteSeerX

17 downloads 5212 Views 102KB Size Report
Oct 23, 2008 - tomers call to demand the pickup of a parcel. The parcel is picked ... the following day, and brought to a nearby distribution center. From there ...
Hamiltonian paths in VRP

M. Sevaux and K. S¨ orensen

Hamiltonian paths in large clustered routing problems Marc Sevaux∗

Kenneth S¨orensen†

∗ Universit´ e

de Bretagne-Sud UEB – CNRS, Lab-STICC – Lorient, France [email protected] † Katholieke

Universiteit Leuven Centre for Industrial Management – Leuven, Belgium [email protected]

Abstract When a company is faced with an extremely large vehicle routing problem, an interesting option is to divide the customers into zones and perform the routing using the zones rather than the individual customers. Although this greatly reduces the complexity of the original routing problem, customers within each zone still have to be scheduled. In this paper we discuss the shortest pre-Hamiltonian path problem, and argue that this problem provides a good basis to determine the order in which to visit all customers in a zone. We give a milp formulation for this problem and discuss its performance. In addition to the present work, we then discuss how this exact method will be embeded in a global metaheuristic framework that will solve the problem.

1

Introduction

The activities of parcel delivery or courier companies follow a typical chain of actions. Customers call to demand the pickup of a parcel. The parcel is picked up later that day or the following day, and brought to a nearby distribution center. From there, large trucks or airplanes bring the parcel to a distribution centre close to its final destination. There, it is sorted and loaded into bins (containers). These containers usually contain the orders to be delivered in a geographically restricted region or zone. If possible, they are defined by postal code for easy sorting. As soon as the parcel delivery company can estimate the amount of work required in a given zone, the assignment of zones (containers) to delivery trucks can be determined. Pre-sorting the items in containers has several advantages, most of them organizational. One important advantage is that late-arriving parcels can be added to the correct container at the last minute. A second advantage is that routing can be done on a zone-basis instead of on a parcel basis, reducing the complexity of the resulting vehicle routing problem by an order of magnitude. When calculating the optimal routes of the delivery trucks, care is taken that EU/MEeting 2008 - Troyes, France, October 23–24, 2008

1

M. Sevaux and K. S¨ orensen

Hamiltonian paths in VRP

containers on a specific truck correspond to geographical regions that are in close proximity, to minimize unproductive travel of the trucks. When all containers have been loaded, the trucks leave the depot and visit each geographical region corresponding to a container. In each geographical region, all delivery points are visited in milk runs. By working with one of the largest parcel delivery companies in the world, we observed that to respond to the customer in an efficient way, the complete distribution problem is transformed in four different sub-problems: (1) the regions for delivery (zones) are determined, (2) the assignment of zones (containers) to trucks is determined, (3) the order in which zones should be visited is determined and (4) the order in which customers are visited in each zone is determined. Step (1) is a long-term decision, a so-called districting problem. Steps (2) and (3) result in a vehicle routing problem using the zones and can be solved as a classical vrp [6]. In this paper, we first focus on step (4), then a more global metaheuristic framework is discussed. Inside each region, the driver should perform a milk-run over the final customers in such a way that the traveled distance or time is minimized. We describe this routing problem in terms of graph theory (section 2) and explore various extensions. In section 3, we proposed a mixed-integer linear programming formulation for this problem. Some experiments are described in section 4. The global metaheurisitcs framework which will use the results of the Hamiltonian path problem exact solution method will be described in section 5.

2

Problem definition

In Figure 1, the final customers are represented as small black dots. The districting problem separates them in different subsets or zones drawn as boxes. With each zone, a virtual center (circles) is associated. Using those centres and an estimate of the amount of work to spend in each zone, a simple vrp formulation can be used to determine a high-level solution [6].

Figure 1: vrp solution after the districting problem Each route in this high-level solution is given to a truck driver, who is asked to visit each region (cluster) in the specified order. Inside each region, the order of the visits is often left to the responsibility of the driver (who is commonly familiar with the zones assigned to him/her). The aim of this paper is to determine a procedure that may be used to find the optimal order in which to visit all customers in a zone. Figure 2 gives a zoomed view of a cluster. In this 2

EU/MEeting 2008 - Troyes, France, October 23–24, 2008

Hamiltonian paths in VRP

M. Sevaux and K. S¨ orensen

figure, all customers (small black dots) have to be visited. The virtual center (big circle) was determined only for the computation of the previous phase. Inside this cluster, we need to determine a path that includes each customer at least once. Reasonable starting points can be determined based on the entry and exit points of this zone, which are in turn determined by the entry and exit points of the next and previous zone in the tour respectively.

Figure 2: Zoom on a specific cluster In graph theory this problem is known as the shortest Hamiltonian path problem (if the criterion is to minimize the total distance travelled), a problem closely related to the travelling salesman problem (tsp). Hamiltonian in graph theory refers to the fact that each node has to be visited exactly once. Different variants of the shortest Hamiltonian path problem exist, depending on the structure of the graph and the demands of the customers: • The shortest Hamiltonian path problem between two nodes This problem occurs when the underlying graph is complete (an edge between each pair of nodes exist), the distance measure is Euclidean (the triangle inequality condition holds), and the first and last nodes to visit are known. In that specific case, a shortest path between two nodes never goes via a third node (except if they are aligned). • The shortest Hamiltonian path problem is identical to the one above, except that we have no information on the first and last node. • The shortest pre-Hamiltonian path problem When the graph is incomplete, it is sometimes impossible to find any Hamiltonian path (the graph itself is not Hamiltonian). In this case, instead of visiting each node exactly once, each node should be visited at least once. As for the Hamiltonian circuit problem on an incomplete graph, it is always possible to make a simple transformation of the original graph by adding the missing edges as the shortest path between any pair on non-adjacent nodes and solve the shortest Hamiltonian path problem. • The shortest pre-Hamiltonian rural path problem is the same as above, but only a subset of the customers have to be served, as is often the case courier companies. In this situation, a large set of regular customers is known and only a subset of them require service on a specific day. Here, the term “rural” is employed in the same way as in the rural postman problem. Note that all problems mentioned before are N P-hard [2]. All of these variants can be solved by solving the shortest pre-Hamiltonian path problem. In the next section, we model this problem as a mixed-integer linear programming (milp) model. EU/MEeting 2008 - Troyes, France, October 23–24, 2008

3

M. Sevaux and K. S¨ orensen

3 3.1

Hamiltonian paths in VRP

Graph transformation and MILP formulation Graph transformation

Given a connected, non-directed and weighted graph G = (V, E), we search for a shortest pre-Hamiltonian path (sphp), i.e. a path that visits each node at least once. The objective is to find this path at a minimum cost, defined as the sum of the weight of the edges along this path. A pre-Hamiltonian path can be represented as a sequence of nodes or edges. A simple representation of the solution is a permutation of size n = |V | of the visited nodes as they appear for the first time in the path. We use this representation instead of the sequence of visited nodes in which each node may appear several times. With this representation, two consecutive nodes in the permutation may no longer be connected by a single edge. Figure 3(a) presents a graph with four nodes. In G, the sphp is given by the following node sequence: {3, 2, 1, 2, 4}. As node 2 appears twice, its second occurrence is removed, and the permutation {3, 2, 1, 4} will represent our solution. Of course, in G, there is no edge connecting nodes 1 and 4. However, this permutation can be understood as follows: “visit the nodes in the given order, by taking the shortest path from each node to its successor in the permutation”. Doing so leads back to the original sphp since the shortest path from node 1 to node 4 is {1, 2, 4}.

1

1 1

1 3

2 3

2

2

3 4

9 (a) G = (V, E)

4

3

2

3

5

4

(b) G′ = (V, E2 )

Figure 3: A simple graph G = (V, E) and its transformation G′ = (V, E2 ) More formally, finding a sphp in the graph G = (V, E) is equivalent to finding a shortest Hamiltonian path (i.e. a shortest path in which each node is visited exactly once) in the graph G′ = (V, E ′ ), where G′ (called in the sequel, the secondary graph of G) is built from G as follows: (1) G′ has the same nodes as G, (2) G′ is complete and (3) the edge connecting nodes i and j is weighted by the cost of the shortest path (in G) between these nodes. From a practical point of view, G′ can be built by running the Floyd-Warshall algorithm on G (see [1]). This algorithm computes the shortest path between all the pairs of nodes in a graph in O(n3 ). G′ is shown in Figure 3(b). Once G′ has been calculated, finding a sphp in G can be achieved by finding a shortest Hamiltonian path (shp) in its secondary graph G′ [5]. 4

EU/MEeting 2008 - Troyes, France, October 23–24, 2008

Hamiltonian paths in VRP

3.2

M. Sevaux and K. S¨ orensen

MILP formulation

This formulation to find the shp in G′ is based on a classical formulation for the TSP (see [3,4] for example) and uses the classical edge formulation. A solution is now modeled as a (non ordered) set of edges in the secondary graph, with two nodes modeling the path boundaries. As paths are reversible (the underlying graphs are non-directed), each boundary node can either be the starting or the ending node of the path. As an example, the shp for G′ in Figure 3(b) defined by the nodes permutation {3, 2, 1, 4} is now modeled as the three edges: (3, 2), (2, 1), (1, 4) and the two boundaries: node 3 and 4. In this formulation we use the following boolean decision variables. Variable xij is equal to one if the edge connecting i and j is part of the shp and 0 otherwise. It must be stressed that xij is defined only for i > j. Variable yi is equal to one if node i is a path boundary and zero otherwise. cij is the cost of the edge between nodes i and j and n is the number of nodes in the graph. The shp formulation can be described as follows:

min

i−1 n X X

(1)

cij xij

i=1 j=1

Subject To i−1 X

n X

xij +

j=1 n X

yi i=1X

xji = 2 − yi ∀i ∈ [1, n]

(2)

j=i+1

=2 xij ≤ |S| − 1

(3) ∀S ⊂ E

(4)

∀i ∈ [1, n], ∀j ∈ [1, i − 1] ∀i ∈ [1, n]

(5) (6)

(ij)∈S×S i>j

xij ∈ {0, 1} yi ∈ {0, 1}

Equation 1 is the objective function, minimizing the total distance traveled. Constraints 2 determine the degree of each node in the graph. Since the shp is a subset of edges and each node is visited once the degree of a node in the shp has to be 2 except for the boundaries of the path (for which yi = 1 and the degree is 1). Constraint 3 specifies that there are only two boundaries in the graph. Finally, the classical sub-tour elimination constraints are enforced as constraints 4.

4

Experiments

For the computational experiments, the Floyd-Warshall algorithm has been implemented in C R R (gcc compiler version 4.2.3) and run on a PC with Intel Pentium 4 CPU 3.2 GHz. The R

milp formulation is implemented using the Xpress-Mosel language version 2.0.0 and solved R with the Xpress-Optimizer version 19.00.00. We are currently negotiating with a courier service company to obtain up-to-date real-life EU/MEeting 2008 - Troyes, France, October 23–24, 2008

5

M. Sevaux and K. S¨ orensen

Hamiltonian paths in VRP

instances to run large instance test cases. At this moment our model is fully operational and is able to find optimum solutions on randomly generated instances of various size. Extended results will be presented at the conference. As an example, the problem presented in Figure 2 is solved using the Manhattan distance. The solution is proposed in Figure 4.

Figure 4: A small example solved using the Manhattan distance

5

Metaheuristics extensions

We now wish to use the above results in a more general approach that will be able to provide solutions to the company and have a more precise view of the whole problem. As stated in section 1, the global problem has been transformed in four sub-problems. Sub-problem (1) concerns the districting problem for which the company is not yet ready for implementing another solving approach. Sub-problems (2) and (3) can actually be solved with classical VRP solving methods (e.g. classical VRP metaheuristics) by considering cluster centers as customers. For sub-problem (4), what has been done, up to now, is to solve the general pre-Hamiltonian path problem inside each cluster. The pre-Hamiltonian path for each cluster is searched separately and paths are provided without taking into account connections between clusters. To handle this additional constraint, a metaheuristic and a slight modification of the milp model are described below. First, the mathematical model should be able to take into account a limited number of possible beginning and ending nodes for the pre-Hamiltonian path. This can be done very easily by forcing variables yi to be equal to zero for the subset of nodes that are not possible bounds of the path. Second, a metaheuristic will specify an order of clusters in which the pre-Hamiltonian paths will be computed. The coding for this metaheuristic is a simple permutation of the cluster identifiers. To evaluate a permutation, the pre-Hamiltonian path of the clusters are computed in the specified cluster order one by one. For each calculation, the next pre-Hamiltonian path should start not too far from the end of the current pre-Hamiltonian path. This means that the subset of possible beginning and ending nodes is adjusted progressively. The cost of the permutation is the final cost of the complete vehicle tours. A simple Simulated Annealing method is now implemented to test the efficiency of such 6

EU/MEeting 2008 - Troyes, France, October 23–24, 2008

Hamiltonian paths in VRP

M. Sevaux and K. S¨ orensen

an approach. The first results are encouraging and we plan ot make a more powerful implementation of a Tabu Search approach which will be more closely embeded with the milp model.

6

Conclusion

For many reasons, parcel delivery (and other) companies divide their customers into zones. This gives rise to a vehicle routing problem using the zone centres as customers. The problem of visiting all customers within a zone can be described as a shortest pre-Hamiltonian path problem. This paper describes a milp formulation for this problem which covers large number of variants of the initial problem. In addition, the specific way of connecting clusters between them is taken into account using a simple metaheuristic. We have tested our formulation and will discuss its performance on a set of benchmark data.

References [1] T.H. Cormen, C.E. Leiserson, and R.L. Rivest. Introduction to Algorithms. MIT Press and Mac-Graw-Hill, New York, 1990. [2] M.R. Garey and D.S. Johnson. Computers and intractability: a guide to theory of N Pcompleteness. Freeman, San Franscisco, 1979. [3] C. Gu´eret, C. Prins, and M. Sevaux. Programmation lin´eaire. Eyrolles, 2000. ISBN 2-212-09202-4, 365 pages. [4] C. Gu´eret, C. Prins, and M. Sevaux. Applications of optimisation with Xpress-MP. Dash optimization, 2002. ISBN 0-9543503-0-8, Translated by S. Heipke. [5] A. Rossi, M. Sevaux, and K. S¨orensen. Pre-Hamiltonian path problems and exact solution approaches. Technical Report TR-08-06, Universit´e de Bretagne-Sud, UEB – CNRS LabSTICC, Lorient, France, 2008. [6] K. S¨orensen, J. Van den Bergh, D. Cattrysse, and M. Sevaux. A multiobjective distribution problem for parcel delivery at TNT. In Invited talk at the International Workshop on Vehicle Routing in Practice, VIP’08, Oslo, Norway, 12-14 June 2008.

EU/MEeting 2008 - Troyes, France, October 23–24, 2008

7

Suggest Documents