Als Manuskript gedruckt Technische Universität Dresden Herausgeber: Der Rektor On a Railway Maintenance Scheduling Problem with Customer Costs and Multi-Depots F. Heinicke (1), A. Simroth (1), G. Scheithauer (2) and A. Fischer (2) (1) Fraunhofer IVI, Zeunerstrae 38, 01069 Dresden, Germany. (2) TU Dresden, 01069 Dresden, Germany. MATH-NM-01-2014 Januar 2014
Contents 1 Introduction 3 1.1 Background.............................. 3 1.2 Modelling as Vehicle Routing Problem............... 4 2 The Routine Maintenance Scheduling Problem 5 3 Mathematical Modelling of the VRP-CC 6 3.1 The Basic Three-Index Model.................... 6 3.2 Alternative Linearisations of the Time Constraints........ 8 3.2.1 The big-m linearisation................... 8 3.2.2 Time flow model....................... 9 3.2.3 Another Splitting of the Execution Time.......... 11 3.3 Alternative Route Formulations: Two-Index Models....... 12 3.3.1 MTZ constraints....................... 13 3.3.2 Flow formulation of the MTZ constraints......... 14 3.3.3 Binary machine allocation.................. 15 3.3.4 Integer machine allocation.................. 16 4 Benchmarks 17 5 Solving Method 17 6 Results 20 6.1 Time Formulations.......................... 20 6.2 Route Models............................. 21 6.3 Benchmark characteristics...................... 23 7 Conclusion 24
On a Railway Maintenance Scheduling Problem with Customer Costs and Multi-Depots Franziska Heinicke, Axel Simroth, Guntram Scheithauer and Andreas Fischer Abstract An important aspect of infrastructure management is the scheduling of maintenance tasks. That implies the allocation of tasks to different crews or machines and the determination of an execution order. To this end, different aspects have to be considered. On the one hand, the maintenance operator is interested in reducing the direct maintenance costs. On the other hand, priorities must be considered by scheduling maintenance tasks. Often, this is done by urgency rules, an inflexible method that resolves prioritised tasks first. In this paper, another approach is discussed. Instead of urgency rules, the maintenance tasks are afflicted with penalty costs that have to be paid for every day until the task is resolved. Then, the later the resolving time of such a job, the higher are the penalty costs. By minimising penalty costs and travel costs in one objective function, a solution with small travel costs and also small penalty costs can be found. For the resulting scheduling problem, a multi-depot vehicle routing problem with customer costs, different mixed-integer linear programming models are developed and compared in respect of their runtime in a solving method using CPLEX. Keyword: Integer Programming, Railway Infrastructure Maintenance Scheduling, VRP, Mathematical Modelling 1 Introduction 1.1 Background An important issue of railway infrastructure maintenance is ballast tamping because a good tamped track bed stabilises the whole track line. Dependent on geometry and traffic volume, the tamping period differs from track section to track section. So, it is impractical to have one big plan that is repeated every tamping-period because then some sections are tamped too late and other sections are tamped not necessarily. Instead, the tamping machines have to be routed regarding actual requirements. If the track bed is in a bad condition, the train speed has to be decreased or the axle load has to be reduced in order to prevent damage and accidents. These limitations in railway service lead to penalty costs for the maintenance operator that have to be paid until the track is maintained so that the limitations can be removed. By scheduling the tamping tasks, these penalty costs can be reduced by resolving the corresponding tasks earlier. However, this may lead to increased travel costs. In order to reduce the 3
overall maintenance costs, the aim of ballast tamping scheduling is to compute of a maintenance plan that minimises the sum of travel and penalty costs. In (Miwa, 2002; Oyama and Miwa, 2006), an integer programming model for scheduling a multiple tie tamper is shown. The objective is to maximise the improvement of track condition subject to bounded maintenance costs. The resulting schedule defines for each 10 day term where to locate the tamper and which lots have to be maintained. An integer programming model to minimise the tamping effort is presented by Vale et al. (2012). The optimal time allocation for 90 day terms is determined such that the track quality does not fall below a given level. The authors take into account four aspects of tamping: the time dependent deterioration process, the track layout, the imperfect track quality after maintenance, and the track quality limits that depend on the maximal permissible train speed. In (Quiroga and Schnieder, 2010), a heuristic approach for the tamping scheduling problem is presented. The aim is to find a set of N interventions, one per night, which maximise a defined objective function, e.g., the expected track condition one year later. An intervention is defined by a start depot, the tamping works, and an end depot. The model presented here is different. On the one hand, the planning horizon is short-termed a few weeks or months and the schedule defines explicitly the execution time of small tamping works. On the other hand, time-dependent customer costs penalty costs for restrictions in railway services caused by the untamped track are considered in the decision process and will be minimised together with the costs for travelling between the tamping works. For the case of tamping with a single maintenance machine, we already developed a greedy heuristic (Heinicke et al., 2013) and an application of simulated annealing (Heinicke and Simroth, 2013). 1.2 Modelling as Vehicle Routing Problem The scheduling of railway tamping tasks to different machines is modelled as a vehicle routing problem (VRP) with time constraints and multi-depots. But the problem differs from common VRPs. Usually, the aim of VRPs is to minimise the travel costs or the waiting times of the customers. In our VRP model, both are considered. The classical travel costs have to be minimised, and also the time-dependent customer costs are part of the objective function. Minimising customer costs is equivalent to minimising the waiting time of the corresponding customers. Due to the different customer costs, the waiting times of some customers are more weighted and they should be allocated to the beginning of the order. But the detours that may occur should be as small as possible. All in all, this leads to a new objective function with contrary aims. Also the time constraints are different. In a common VRP with time windows, every customer has one time window for delivery or execution. In our case, execution is possible in a daily time window and travelling is possible always. This is covered through splitting the execution time in an execution day and an execution minute. The last one is limited by the time window. The multi-depot feature is rarely part 4
of VRP models. Usually, all machines start and end in the same depot. In our case, for each machine an own start and end depot is given. Since the main difference to a common VRP are the customer costs, we call the problem VRP with customer costs, shortly VRP-CC. The presented model can be adapted to similar problems with direct and indirect costs. The direct costs are the costs occurring for execution (in our case the travel costs). The indirect costs occur for do nothing and depend on the execution time (these are the penalty costs that have to be paid until the track is tamped). Both kind of costs are summed and minimised together. Problems similar to VRP-CC are routing and scheduling problems with penalty costs for delays, and maintenance planning problems with maintenance costs increasing over time. Recent research on VRPs is reviewed by Eksioglu et al. (2009). In (Laporte, 2007) and (Kumar and Panneerselvam, 2012), different models, methods and variants are presented. In the literature, many heuristics and meta-heuristics to solve VRPs are introduced, for example, the well-known saving algorithm from Clarke and Wright (1964), the sweep algorithm from Gillett and Miller (1974), and more complex approaches as presented by Tan et al. (2001). Also methods to solve smaller VRPs exactly exists, e.g., the methods proposed by Macedo (2011) and Baldacci (2007). Both are based on a set partition model. Thereby, from a set of predefined routes one route is selected for each machine such that each job is contained in exactly one route. The crux of this model is the large number of routes that have to be created and evaluated in advance. Because of the multi-depots and the time-dependent customer costs, there are less dominance criteria for a sequential composition of routes and the evaluation is more time-consuming in VRP-CC than in common VRPs. Hence, we decide against set partition models. The paper is organised as follows: At first the VRP-CC is described and different mixed-integer linear programs (MILPs) are derived. Then, the solution method to solve the different MILP formulations by the help of the commercial solver CPLEX of IBM is explained. Finally, the performance of all MILP formulations is compared by means of 100 randomly generated benchmarks. 2 The Routine Maintenance Scheduling Problem Given is a set of jobs N = {1, 2,..., n}. The jobs have to be scheduled to a set of machines M = {1, 2,..., m}. Each machine k M has a start depot s k and an end depot z k modelled as artificial jobs. Hence, N c := N {s k, z k : k M} contains all jobs and the jobs representing the depots, and n c := N c = n + 2m denotes its cardinality. Each job i N c is characterised by its customer costs c i, its working duration a i, 5
the travel costs d ij from job i N c to job j N c, j i, and the travel time r ij from job i N c to job j N c, j i. For the depots, we have c sk = c zk = 0 and a sk = a zk = 0, for all k M. All values are assumed to be non-negative integers. We assume that some jobs have zero customer costs and that for all jobs j N is a j > 0. A solution of the VRP-CC is a set of m routes describing the execution order of the jobs. The route of machine k M starts in the depot s k and ends in the depot z k. Each job has to be contained exactly once in exactly one of the m routes. Based on these routes, the execution times of the jobs are calculated starting in the start depots at time t 0. The execution of job i cannot start before the previous job is finished and the machine has travelled to the location of i. A special feature of tamping scheduling is that job resolving is only possible during an eight hour working shift in the night, but travelling is possible all the day. Each day, the working shift starts at minute 0 and ends at minute u = 480. So, the execution of job i cannot start if the machine reaches the location after minute u i = 480 a i of any day. In this case, the job has to be postponed to the next day. To model that condition and determine the execution time correctly, the execution time is split into two components: t i = (t d i, tm i ). The first component represents the execution day and is the base for calculating the customer costs. The second component is the execution minute on day t d i that is restricted through the working shift, thus it is 0 t m i u i. Naturally, it is essential that the working duration of job i holds a i 480, for all i N c. Since travel time and working duration are in minutes, the execution time also has to be converted into minutes to calculate the correct time allocation. The execution time in minutes is t e i := h td i + tm i, with h = 1440, the minutes per day. The costs of the so defined schedule are the sum of the travel costs plus the sum of the customer costs paid for every day until the job is resolved. 3 Mathematical Modelling of the VRP-CC In this section, different MILP formulation of the VRP-CC are presented. At first, the VRP-CC is introduced by a non-linear mixed-integer problem with a three-index route model. Then, three linearisations of the time constraints are given. At last, models using two-index binary variables to define the routes of the machines are presented. 3.1 The Basic Three-Index Model The basic three-index model of the VRP-CC is a non-linear mixed-integer program. The decision variables are the binary three-index variables x k ij and the variables t d i and tm i for the execution time. The variable x k ij is 1 if and only if machine k M travels from job i N c to job j N c, i j, and resolves both jobs. 6
(NLP) min s.t. c i t d i (1) k M i N c k M d ij x k ij + i N x k ij = 1 i N (2) x k ji x k ij = 0 i N, k M (3) x k s k i = 1 k M (4) i N x l s k i = 0 k, l M : k l, i N c (5) x l is k = 0 k, l M, i N c (6) x k iz k = 1 k M (7) i N x l iz k = 0 k, l M : k l, i N c (8) x l z k i = 0 k, l M, i N c (9) x k ij {0, 1} i, j N c, k M (10) t sk = t 0 k M (11) h t d j + t m j h t d i + t m i + a i + r ij i, j N c : k M : x k ij = 1 (12) t d 0 t d i d max, t d i N i N c (13) 0 t m i u i, t m i R + i N c (14) Equation (1) is the objective function, the sum of the travel costs and the customer costs that have to be minimised. The travel costs depend on the order of the jobs and the customer costs depend on the execution time. By means of conditions (2) (10) is ensured that with the binary variables x k ij for each machine a route is defined. Equations (2) and (3) control that each job i N is covered by one machine and that the same machine enters and leaves job i. Constraints (4) (9) define that machine k starts in the depot s k, visits at least one job, and ends in the depot z k. The definition of the execution times of the jobs is regulated by constraints (11) (14). Equation (11) defines the start times of the machines through the definition of the execution time of the start depot as t 0 = (t d 0, t m 0 ). Condition 7
(12) is non-linear and ensures that job j does not start before the previous job i is finished and the machine has travelled to j. It is not a linear condition because it only occurs for i, j N c with x k ij = 1 for any k M. By (13), the execution day is required to be an integer not larger than d max. We assume that the bound d max is chosen high enough to allow a correct time schedule for each route feasible in respect of (2) (10). Thus, it is not forbidden that one machine serves n m + 1 jobs and each other machine resolves only one job. Finally, the execution minute is bounded by u i (14) to ensure that the execution of job i is completed during the working shift. Additional subtour elimination constraints are not necessary since the execution times do not allow the occurrence of cycles. The reason is that it is impossible to assign time variables that fulfil (12) if by means of the route variables x k ij a subtour is defined, as the following lemma shows. Lemma 1. All solutions feasible to (2) (14) cannot contain subtours. Proof. Assuming, C = (i 1, i 2,..., i l ) is a cycle defined by (2) (10). Then, for some k M, we have x k i pi p+1 = 1, for all p = 1, 2..., l 1, and x k i l i 1 = 1. According to (6) and (9), C cannot contain a depot. From (12) results that t e i p+1 t e i p + α ipi p+1, for all j = 1, 2..., l 1, and t e i 1 t e i l + α il i 1, with α ij := a i + r ij > 0, for all i, j N. This leads to the contradiction Thus, a cycle cannot exist. t e i 1 < t e i 2 <... < t e i l < t e i 1. 3.2 Alternative Linearisations of the Time Constraints To use a MILP solver, it is necessary to linearise the model by reformulating the time constraints (11) (14). This will be done in different ways. 3.2.1 The big-m linearisation A common way to linearise if-conditions is the big-m linearisation. Given a constraint x = 1 f(y) b for a decision variable y Y R r, a bounded linear function f : Y R, b R, and a binary variable x. By linearising this condition with the big-m method, a sufficient high value M is added if x = 0 through f(y) b + (1 x) M. Then, if x is 1, M is multiplied with zero and the constraint has to be hold. Contrariwise, if x = 0, the big-m term leads to the trivial compliance if M sup y Y f(y) b. Using the big-m linearisation leads to our first linear model for VRP-CC. It equates to (NLP) but the non-linear condition (12) is replaced by its big-m linearisation. 8
(LP1) min k M i N c d ij x k ij + i N c i t d i s.t. (2) (11), (13), (14) h t d i + t m i h t d j t m j + (M + a i + r ij ) k M x k ij M i, j N c, i j (15) Constraint (15) is the big-m linearisation of (12). If k M x ij = 1, it is ensured that j not starts before the previous job i is finished and the machine has travelled to j. Contrariwise, k M x ij = 0 leads to h t d i +tm i h td j tm j M that does not restrict the execution times. So, it is ensured that each job j N c has the correct allocation time. The advantage of this method is that the number of variables does not increase. But the big-m linearisation is known to lead to weak LP relaxations and also to be able to cause numerical problems if M is chosen too large. So we set M := (d max + 1) h that is close to the greatest possible execution time. Since the customer cost function is monotonically increasing with the execution day, the minimal value for the execution time of a job j N c can be chosen. Therewith condition (15) can be strengthened through adding an upper bound for the execution time. If the machine reaches job j outside the time window, the execution has to be postponed at most by one day, thus h minutes. Therewith if for i N c, k M xk ij = 1, then the execution time of j N c can be bounded by h t d i + t m i + a i + r ij h t d j + t m j h t d i + t m i + a i + r ij + h. So, constraint (15) can be augmented by h t d i + t m i h t d j t m j + (M + a i + r ij ) k M x k ij +(M a j r ji h) x k ji M i, j N c (16) because if k M xk ji = 0, (16) equals (15). Contrariwise, from k M xk ji = 1 follows k M xk ij = 0 and with it h td i +tm i h t d j tm j +(M a j r ji h) M. That equals to h t d i + tm i h t d j + tm j + a j + r ji + h and means that if job i is resolved immediately after job j, job i is executed not later than one day after the machine has finished j and has travelled to the location of i. In essence, (16) is not a valid inequality of (LP1), since it is not stipulated to use a small execution time. But if the customer costs monotonically increase with t d i, for all i N, there is an optimal solution of (LP1) that also fulfils (16). 3.2.2 Time flow model Another possibility to linearise condition (12) is the substitution of the time variables t i by the flow variables t ij, with i, j N c, as proposed by van Eijl k M 9
(1995). These variables are always zero if x k ij = 0, for all k M. Contrariwise, if any machine travels from job i to j, the pair t ij := (t d ij, tm ij ) is the execution time of job i. The corresponding linear model is (LP2) min d ij x k ij + c i t d ij (17) k M i N j N c i N c s.t. (2) (10) t d 0 x k ij t d ij d max x k ij i, j N c (18) k M k M 0 t m ij u i x k ij i, j N c (19) k M t sk i = t 0 k M (20) i N c (h t d ij + t m ij ) (h t d ji + t m ji + (a j + r ji ) k M i N (21) t d ij N, t m ij R + i, j N c (22) x k ji) In the objective function, t d i is replaced by j N c t d ij that represents the execution day of job i. The route conditions are the same as in the basic threeindex model (NLP), see constraints (2) (10). By means of conditions (18) and (19), it is ensured that t d ij = tm ij = 0 if j is not the successor of i, thus if k M xk ij = 0 with i, j N c. Contrariwise, the execution day is bounded by the start day t d 0 and the maximally allowed day d max, and the execution minute is bounded by 0 and u i. Equation (20) defines the execution time of the start depots. By condition (21), the correctness of the execution times is guaranteed. The left side is the execution time of job i. The right side gives the execution time of the job resolved before i, because this is the only one where a k M exists such that x k ji = 1 and, hence, the only one with time variables t d ji and tm ji representing the execution time of the predecessor of i. Condition (21) cannot be required for the depots, because a start depot has no predecessor and its execution time is fixed, and an end depot has no successor so that t zk i = (0, 0), for all i N c and k M, as follows from (18) and (19). Since the customer costs of the depots are zero, the execution time of the end depot must not be determined. If necessary, the definition of an execution time for the end depots can be realised through small changes in the route definition, e.g., adding an artificial travel from the end depot back to the start depot. The advantage of formulation (LP2) is that no big-m term is needed. But the number of time variables increases drastically. Instead of 2n c time variables, this model requires 2n 2 c. Also the number of constraints is increased, even though 10
the most of them are less complex. 3.2.3 Another Splitting of the Execution Time To reduce the number of variables of the time flow model, the execution time in minutes t e i = h td i + tm i can be used instead of calculating it from the execution day and minute. With it, one flow variable t e ij is sufficient to determine the execution time. The execution day t d i, necessary to calculate the customer costs, is the integer between 1 h j N te ij 1 and 1 h j N te ij. Since the execution minute is bounded, the remainder of the division 1 h j N te ij has to be at most u i, for all i N c. Therewith, the number of time variables is n 2 c + n c, a reduction compared to (LP2), but some additional constraints are necessary to calculate the execution day. (LP3) min k M i N c s.t. (2) (10) (h t d 0 + t m 0 ) d ij x k ij + i N k M c i t d i x k ij t e ij (h d max + u i ) k M x k ij i, j N c (23) t e s k i = h t d 0 + t m 0 k M (24) i N c t e ij (t e ji + (a j + r ji ) x k ji) k M i N (25) 1 h ( j N c t e ij u i) t d i 1 h j N c t e ij i N c (26) t e ij R + i, j N c (27) t d i N i N c (28) The objective function is equal to the objective function of (LP1). The execution time in minutes t e ij is bounded by the start time in minutes h td 0 + t m 0 and h d max + u i if any machine travels from job i to j, with i, j N c. Contrariwise, t e ij = 0. These bounds are given by (23). By means of equation (24), the execution times of the start depots are defined. Constraint (25) represents the time condition (12) of the non-linear model (NLP). The execution of job i N cannot start before the execution of the previous job is finished and the machine has travelled to the location of i. The execution day is defined by (26). Also the com- 11
pliance of the working shift is ensure. If the remainder of 1 h j N c t e ij is greater than u i, there is no integer in the interval [ 1 h ( j N c t e ij u i), 1 h j N c t e ij ]. At last, the execution time in minutes t e ij are real numbers and the execution days t d i are integers as defined by (27) and (28). Further formulations of the execution time are possible. For example the second kind of splitting the execution time can also be used for the big-m model of the time constraint. Another possibility to model the execution day is the usage of binary variables d ip that define that job i N c is resolved on day p {t d 0, t d 0 +1,..., d max }. That allows some additional constraints to the execution times, e.g., if a i + min{r ij, r ji } + a j > 480, then the jobs i and j cannot be executed at the same day by the same machine. That can be defined by d ip + d jp 2 k M (xk ij + xk ji ), for all p {td 0, t d 0 + 1,..., d max }. But for the defined benchmarks, the working durations and travel times are too small to formulate such constraints. 3.3 Alternative Route Formulations: Two-Index Models To reduce the number of variables, the m routes of the m machines can be formulated as one large route through all depots with two-index binary variables. The variables x ij code whether a machine travels from job i to job j. Additionally, there are artificial travels from end depot z k to start depot s k+1, for all k = 1, 2,..., m 1, and from z m to s 1. Then the routing constraints can be written as follows: (LP4) min s.t. i N c c i t d i (29) d ij x ij + i N x ij = 1 i N c (30) x ji = 1 i N c (31) x zms 1 = 1 (32) x zk s k+1 = 1 k M \ {m} (33) x sk z l = 0 k, l M (34) x ij {0, 1} i, j N c, k M (35) 12
v i n c 1 i N c (36) v s1 = 0 (37) v i v j + (n c 1) x ij n c 2 i, j N c \ {s 1 } (38) v sk v sk 1 + 3 k M \ {1} (39) v i N i N c (40) h t d j + t m j h t d i + t m i + a i + r ij (11),(13),(14) i N c, j N \ {s k : k M} : x ij = 1 (41) The equations (30) and (31) ensure that each job is visited and leaved exactly once. The artificial travellings between the depots are defined with (32) and (33). Empty routes are forbidden through (34). In the two-index route formulation, the start depots have a predecessor in the route. Therewith the start depots have to be excluded from the time constraints, see (41). But constraints (30) (35) are not sufficient to define a correct route through all the depots in the correct order. Two problems occur: The first problem is the order of the depots. It is possible to start in depot s 1, visit some jobs and go to z k, k 1, without visiting z 1 or s k. Then the first machine starts in s 1 but does not end in z 1. And it is no problem to close the cycle, e.g. the depot order s 1... z 2 s 3... z 1 s 2... z 3 fulfils all constraints but is not allowed. The second problem is that subtours are not avoided. In difference to the three-index models (LP1) (LP3), the cycle C = {i 1, i 2,..., i l } can contain depots. In the threeindex models, this is impossible because start depots are only leaved and end depots are only arrived. But in the two-index formulation, also the depots are arrived and leaved exactly once and therewith a subtour with depots is possible. Since the execution time of the start depots is fixed, the time constraint (41) must not be met and the contradiction t e i 1 <... < t e i l < t e i 1 of Lemma 1 is resolved in the start depot t e i 1 <... < t e z k t e s k+1 <... < t e i l < t e i 1. So, additional constraints are necessary to exclude subtours and guarantee the correct order of the depots in the large route generated by the two-index variables. 3.3.1 MTZ constraints One possibility for a well-defined large route with two-index variables is the usage of the subtour elimination constraints from Miller, Tucker and Zemlin 13
(1960), see constraints (36) (38), (40). The additional decision variable v i is the position of job i N c in the large route with s 1 in position 0. By means of condition (38) is ensured that job j has a larger position than job i if x ij = 1. If the route contains subtours, this condition leads to a contradiction and the solution is infeasible. The chosen linearisation equals to a big-m formulation with M = n c 1. With the position variables v i can also be ensured that the start depots are visited in the correct order, see constraint (39). Then the first depot reached after s k is the corresponding end depot z k and all jobs between s k and z k are executed with machine k. This route model can be combined with the time constraints of the three models (LP1) (LP3) by replacing k M xk ij with x ij and excluding the start depots from constraint (15) when using (LP1). In Desrochers (1991), an improved formulation of the MTZ constraint is given: v i v j + (n c 1) x ij + (n c 3) x ji n c 2 i, j N c \ {s 1 } (42) With it, two inequalities have to be considered if x ij = 1, and it is v i v j 1 and v j v i + 1, thus v j = v i + 1. 3.3.2 Flow formulation of the MTZ constraints Also the formulation of the MTZ constraints can be transformed in a flow model to avoid the big-m term. Therefore the variables v i are replaced by the flow variables v ij with v ij = 0 if x ij = 0, and v ij is the position of i (equals v i ) if x ij = 1. (LP5) min i N c s.t. (30) (35) d ij x ij + i N c i t d i v s1i = 0 i N c (43) v ij (n c 1) x ij i, j N c \ {s 1 } (44) i N c v sk i v ij = (v ji + x ji ) i N c \ {s 1 } (45) i N c v sk 1 i + 3 k M \ {1} (46) v ij N i, j N c (47) (11), (41), (13), (14) Equation (43) sets s 1 as start of the job sequence. By means of constraint (44) is ensured that the position variable v ij is zero if x ij = 0. Otherwise, v ij is 14
bounded by n c 1. Equation (45) sets the position of job i by one greater than the position of the previous job. And (46) ensures the correct order of the start depots. As stated previously, the advantage of the flow formulation is that the big- M term is avoided at the expense of an increased number of variables and constraints. 3.3.3 Binary machine allocation Another possibility to avoid subtours and to guarantee the correct order of the depots is the allocation of jobs to machines. The binary variable y ik is 1 if job i is resolved by machine k, and 0 otherwise. Then, the problem can be modelled as (LP6) min i N c d ij x ij + i N c i t d i s.t. (30) (35) y ik = 1 i N c (48) k M y sk k = 1 k M (49) y zk k = 1 k M (50) y ik y jk 1 x ij k M, i N {s k }, j N {z k } (51) y ik {0, 1} i N c, k M (52) (11), (41), (13), (14) Condition (48) ensures that each job is resolved by exactly one machine. The start and end depot of machine k are allocated to machine k, as defined with (49) and (50). By constraint (51) is ensured that two successive resolved jobs are resolved with the same machine. Therewith is guaranteed that all jobs allocated between the start depot s k and the end depot z k are resolved with machine k. Thus it is excluded to visit another depot before reaching z k. Also the occurrence of subtours is avoided: Assuming C := {i 1, i 2,..., i l } is a cycle defined by the route variables. Because of the time constraints, C must contain depots (compare Lemma 1). Let i q 1 := z k 1 and i q := s k be the depots. Then follows from (49), y sk k := y iqk = 1 and from (51) that y iqk = y iq+1k =... = y il k = y i1k =... = y iq 1k =: y zk 1 k = 1. But (50) defines y zk 1 k 1 = 1. Together with (48), this leads to a contradiction. 15
Condition (51) can also be formulated in a stronger way by y ik y jk 1 x ij x ji k M, i N {s k }, j N {z k }. (53) 3.3.4 Integer machine allocation Instead of binary variables, also integer variables y i can be used to represent the machine allocation of job i N c. (LP7) min d ij x ij + c i t d i i N i N c s.t. (30) (35) y sk = k k M (54) y zk = k k M (55) y i y j (1 x ij ) m i N {s k : k M}, j N {z k : k M} (56) y i {1, 2,..., m} i N c (57) (11), (41), (13), (14) Similar to (LP6), the depots s k and z k are resolved by machine k, defined with constraints (54) and (55). Through (56) is ensured that each job is resolved with a machine that has the same or a larger value than its predecessor. Therewith all jobs between s k and z k are resolved with the same machine k. Constraint (57) defines that y i is an integer with 1 y i m, for all i N c. As proposed in the binary machine allocation formulation, constraint (56) can be strengthened by y i y j (1 x ij x ji ) m i N {s k : k M}, j N {z k : k M} (58). Then, it is necessary to allocate each job to the same machine as the predecessor since if x ij = 1 two inequalities are considered and it follows y i y j 0 and y j y i 0, i.e. y j = y i. Compared to (LP6), the number of variables and constraints is reduced, but integer variables are a bit more difficult because they can produce probably more branching nodes. 16
4 Benchmarks To test the performance of the different MILP formulations, 100 random benchmarks are created and solved. On request, these benchmark can be provided. Each benchmark contains 20 jobs randomly and non-clustered allocated in a square of 100x100 points. The coordinates are given by uniformly distributed integers in the interval [0, 100].The number of machines is selected from {2, 3, 4} and the execution starts with the working shift on the next day, so t 0 := (1, 0). The x- and y-coordinates of the depots are chosen randomly in [25, 75]. Therewith, the depots are allocated in an inner square of the map. All coordinates are integers. The travel costs are the Euclidean distance multiplied with 10 and rounded. The number of jobs afflicted with non-zero customer costs is r n n for a given random value r n [0.25, 0.75]. The amount of customer costs is also chosen by random for each job that has non-zero customer costs, regulated by a given random value r c. Therewith the map contains jobs with high customer costs, but also jobs with low (and non-zero) customer costs. Thus, by means of r n and r c very different benchmarks can be created. It is not possible, to know in advance how big the influence of the customer costs is, but in general, a high value for r n leads to more jobs with non-zero customer costs and a high value for r c results in higher customer costs of the jobs. But the hardness of a benchmark does not only depend on the number of jobs afflicted with customer costs and their values, but also on the allocation of the jobs and the depots on the map. If the jobs with high customer costs are far away from the start depots, them preference leads to a long detour and the optimal solution differs more from the optimal solution of the problem without customer costs. Contrariwise, if the jobs close to the start depots are afflicted with non-zero customer costs, the influence of the customer costs on the solution is small. The reason is that also in the problem without customer costs, these jobs are scheduled at the beginning of the planning process. 5 Solving Method In order to tight the MILP formulations of the VRP-CC, we use an approach known from solving the Travelling Salesmen Problem (TSP), which is very close to VRPs. It has been shown, that the subtour elimination constraints from Dantzig, Fulkerson and Johnson (1954), in the following called DFJ constraints, are better than the subtour elimination constraints from Miller, Tucker and Zemlin (1960) used in (LP4) and similar to the time constraints. The DFJ constraints are formulated as follows: x ij S 1 S N c, S > 1 (59) i,j S Constraint (59) guarantees that S is not a subtour, since, if S is a subtour, then for all i S, and q N c \ S is x iq = 0. Consequentially j S x ij = 1, for all i S, and therewith i,j S x ij = S. The DFJ constraints lead to a stronger 17
formulation than the MTZ constraints; they are even facets of the polytope of the TSP (Nemhauser, 1988). The disadvantage of the DFJ constraints is the high number of subsets S that have to be probed. Even it is sufficient to test all subsets with 2 S nc 2, since if S is a subtour, then also N c \ S, the number of subsets is exponentially in the number of jobs. An elementary approach to tighten the TSP formulation with MTZ constraints is the step-by-step inclusion of DFJ constraints for occurring subsets (Pataki, 2003). At first, the TSP is solved without any subtour elimination constraints. The obtained solution normally contains subtours (if not, it is an optimal solution and the solving process can be stopped). Based on these subtours, DFJ constraints are generated in order to avoid their occurrence in further solving steps. With this small selection of DFJ constraints, the integer problem is solved again. The steps solving and adding DFJ constraints are repeated β-times (or until the obtained solution does not contain subtours). If in the β runs no solution without subtours was found, the MTZ constraints are added. The problem containing the MTZ constraints and also the generated set of DFJ constraints is solved to obtain an optimal solution. As computational tests have shown, using such a small set of DFJ constraints leads to better running times than solving the problem without any DFJ constraints. To use this approach, the time constraints have to be relaxed because they work as MTZ constraints and does not allow any subtours (see Lemma 1). Therefore, the time constraints are only added for a small subset of jobs with high customer costs N T N with c i c j, i N T, j N c \ N T and N T = (n + m) α with α [0, 1] a chosen value. So, in (LP1) the time constraints (15) are limited to h t d j + t m j h t d i + t m i + (M + a i + r ij ) x k ij M i N c, j N T. The other time formulation variants are relaxed in the same way, only for the jobs j N T is stipulated that its execution starts not before the previous job is finished and the machine reaches j. In the two-index route formulation, the additional part to avoid subtours and to guarantee the correct depot order is also omitted, thus the variables v respectively y do not occur. The relaxed problem is solved β-times. The occurring subtours are the base of the DFJ constraints. The DFJ constraints are generated for the union of at most γ subtours of the current solution and added before the relaxed problem is solved again. Therewith, in every run new subtours occur and new DFJ constraints are formulated. After at most β runs or if the solution of the relaxed problem do not contain further subtours, the VRP-CC formulation is augmented by the generated DFJ constraints and solved. The solution method is shown as pseudo code in Algorithm 1. The procedure of generating DFJ constraints is called preprocess. Different tests were necessary to get suitable values for α, β and γ. Clear is that the higher α, the smaller is the number of occurring subtours since each subtour must contain at least one job without time constraints. If β and γ are k M 18
Algorithm 1: Base solving framework Input: MILP formulation of VRP-CC # Define N T N T N c with c i c j, i N T, j N c \ N T and N T = n α # Store the subsets for DFJ constraints S := Do β-times Solve relaxed problem with DFJ constraints i,j S x ij S 1 S S Let S 1, S 2,..., S l be the subtours of the solution if l=1 then return else forall the P P({1, 2,..., l}) with 1 P min{γ, l 1} do S := S { p P S p} end end end Solve the MILP formulation of the VRP-CC with the additional DFJ constraints i,j S x ij S 1 S S chosen small, only less runs are made to generate DFJ constraints, and based on a given set of subtours only less DFJ constraints are included. Therewith the final problem contains only less additional DFJ constraints that leads to a smaller improvement in the running time. Contrariwise, if β is chosen high, only less DFJ constraints are generated in the last runs since only less subtours occur and mostly subtours similar to the previous runs. Therewith similar DFJ constraints are generated that could not further tight the LP relaxation but increases the number of constraints. Also a high value for γ leads to an increase in the calculation effort. DFJ constraints of large subsets S seem to have a worse performance. To show the advantage of adding DFJ constraints, the average results of solving the 100 random benchmarks are presented in Table 1 for different values of α. For the calculation we used β = γ = 3 and (LP1). Shown is the average running time for the whole solving process, the preprocessing time that is the time to generate the DFJ constraints, the number of obtained DFJ constraints and the number of runs therefore, and at last the number of optimal solved problems during the time limit of 15 minutes. In the case α = 1, no runs to generate DFJ constraints are necessary since the time constraints prohibit the occurrence of subtours. Thus β = 0. The results show the high profit of adding DFJ constraints. Comparing the running time of α = 0.75, where only less DFJ constraints are generated, and α = 1, a small improvement in the running time and a significant increasing 19
α 0.0 0.25 0.5 0.75 1.0 Solving Time (sec) 130 131 138 195 220 Preprocessing Time (sec) 0.19 0.25 0.47 9.71 - DFJ Constraints 86 74 42 6 - Solved problems 92 93 91 89 59 Table 1: Average results of 100 random benchmarks for different α. in the number of solved problems can be seen. So, even this very small set of DFJ constraints strengthened the formulation to improve the performance in CPLEX. The performance can be further improved by decreasing α because of two reasons: On the one hand, a smaller α leads to a smaller preprocessing time, thus less time is necessary to solve the relaxed problems to create DFJ constraints. And on the other hand, a small α leads to more subtours and with it more DFJ-constraints are generated. And the more DFJ constraints, the stronger is the LP relaxation. But more constraints can also lead to more calculation effort. With α = 0 and α = 0.25, the performance is similar, even the number of DFJ constraints differs. Since with α = 0.25, one more benchmark was solved, we decide to use this value in further calculations. 6 Results The tests were executed on a PC with an Intel 2.8Ghz Quad-Core, 8GB RAM and Windows 7 (64-bit). The 64-bit version of CPLEX 12.5 was used as MILP solver with its default settings. The solving time was limited to 15 minutes in all benchmarks. 6.1 Time Formulations At first, the different formulations of the time constraints are compared: the big-m formulation (LP1) the big-m formulation with strengthened constraints, see (LP1) and (16) the flow model (LP2) with execution day and execution minute the flow model (LP3) with execution time in minutes and resultant execution day Table 2 shows the average solving time, the average number of CPLEX nodes and iterations, the number of optimal solved problems, and the quality of the LP bound that is the average distance of the LP bound to the optimal value in per cent. For the test, we used the preprocessing parameters α = 0.25 and β = γ = 3. The results show that the big-m formulation with 2n c time variables has the best performance in CPLEX. The average solving time is significant smaller than the average solving times of the other variants to formulate the time conditions, and 92 of the 100 benchmarks are solved optimally during the time limit of 15 minutes. 20
(LP1) (LP1) (LP2) (LP3) strength. Solving Time (sec) 136 150 287 223 Nodes (in th.) 386 378 192 242 Iterations (in th.) 4480 4801 10074 10929 Solved problems 92 88 81 88 Quality of LP bound 20 12 19 20 Table 2: Average results of 100 random benchmarks for the three-index model with different time formulations. The strengthened variant of (LP1), with a more limited execution time, leads to a better LP bound and to a small reduction in the number of analysed branching nodes. But in each branching node, the linear relaxation has more constraints that leads to a higher solving effort. This can be seen in the higher number of iterations and the greater average solving time. The both variants (LP2) and (LP3) with the flow formulation of the time constraints are also less successful than (LP1). The advantage was to avoid the big-m formulation because it leads to weak LP relaxations. But the increase in variables and constraints leads to greater problem sizes in the LP relaxation and therewith to more calculation effort. That can be seen in the high numbers of iterations compared to the smallish number of branching nodes. The reduction of branching nodes is an indicator for better LP bounds, even if the initial bound is similar to the bound from (LP1). The high increasing in iterations show the high computational effort to solve the LP relaxations. All in all, the performance in CPLEX of the flow formulations is worse than the performance of (LP1). To ensure that (LP1) has the best performance not only because the preprocessing parameters were obtained with this formulation, we made some tests with other preprocessing parameters; all showed similar results. 6.2 Route Models After the best formulation for the time constraint was found, the different route formulations were compared against each other. Based on the high difference in the route definition, the two-index route formulation leads to more subtours using the parameters obtained with (LP1). But different tests have shown that α = 0.25 and β = γ = 3 are also suitable for the two-index route formulations (LP4) (LP7). The two-index formulations are completed with the time formulation of (LP1). In Table 3, the route formulations (LP4) (LP7) are compared with the threeindex model (LP1). Table 4 contains the results of the strengthened variants if exist. Thus in (LP4), constraint (38) is replaced by (42), and in (LP6) and (LP7) the constraints (53) and (58) are used instead of (51) and (56). Shown are the average solving time in seconds, the number of analysed branching nodes and 21
the number of iterations in thousands, the number of optimal solved problems during 15 minutes, and the quality of the LP bound that is the average distance of the LP bound and the optimal value in per cent. (LP1) (LP4) (LP5) (LP6) (LP7) Solving Time (sec) 136 118 136 103 100 Nodes (in th.) 386 298 238 225 313 Iterations (in th.) 4480 4017 6110 3486 4082 Solved problems 92 93 94 95 95 Quality of LP Bound 20 22 21 21 22 Table 3: Average results of 100 random benchmarks for different route formulations with the big-m time formulation. The results show that the performance of the two-index formulations heavily depends on the selected variant to avoid subtours and to ensure the correct order of the depots even all of them have nearly the same LP bound quality. Comparing the average values of two variants of the MTZ constraints, it can be seen that the flow formulation of (LP5) is not better than the common variant (LP4) with the big-m formulation. The results are similar to the case of the time constraint as big-m formulation and flow formulation. In both, with the flow formulation less branching nodes are analysed, but the effort to solve the problem of a branching node is higher. Overall, the solution effort is higher and the big-m formulation should be preferred. The machine allocation variants (LP6) and (LP7) have nearly the same running time. Using binary machine allocation variables results in a higher number of variables and constraints; and therewith in more rows and columns of the LP relaxation. Using integer variables reduces the problem size, but often more branchings are necessary to define an integer variable and therefore the number of branching nodes increases. These effects can be seen when comparing the number of nodes and iterations. By solving the problem with the (LP7) formulation, more branching nodes are analysed. But the LP relaxations are solved faster. So, (LP7) with integer variables has a better performance than (LP6) with binary variables. (LP1) (LP4) (LP5) (LP6) (LP7) strength. strength. strength. Solving Time (sec) 136 120 136 100 85 Nodes (in th.) 386 303 238 247 242 Iterations (in th.) 4480 4444 6110 3582 3347 Solved problems 92 95 94 95 94 Quality of LP Bound 20 14 21 21 13 Table 4: Average results of 100 random benchmarks for different strengthened route formulations with the big-m time formulation. The results presented in Table 4 show the benefit from strengthen the addi- 22
tional constraints of the two-index formulations. Looking to (LP4) and its strengthened variant shows that the solving time, number of analysed branching nodes and number of iterations are increased although the LP bound of the root problem is much better. But with the strengthened variant, two more benchmarks are solved during the 15 minute time limit. Overall, both seem to have a similar performance. The machine allocation variants show very different impacts of strengthen constraint (53) or (58), although the strengthening is very similar. Strengthen (LP6) does not improve the LP bound and the time required for solving. In contrast, (LP7) is much improved through strengthening. The solving time is reduced significantly, less branching nodes are analysed, less iterations were necessary to solve the relaxed problems and the LP bound of the root is better. With it, the integer variant of the machine allocation formulation is much better than the variant with binary variables. All in all, the best results are obtained with the integer machine allocation formulation (LP7). In general, the two-index formulations are better than the three-index formulation. 6.3 Benchmark characteristics At last, we want to show the influence of benchmark characteristics to the performance. Therefore, the 100 random benchmarks were clustered dependent on the ratio of customer costs in the optimal solution value and dependent on the detour length that is the increase in travel costs of the optimal value compared to the optimal value of the same benchmark without customer costs. The results are shown in Figure 1 for the three MILP formulations (LP1), (LP4) and the strengthened variant of (LP7). On the left side, the average solving time of the benchmarks that belong to the different customer cost groups are pictured, and the right side shows the average running times of the benchmarks that belong to different groups of the detour length. To get the groups for the ratio of customer costs, the benchmarks were sorted by the ratio of customer costs in the optimal solution. Then, the benchmarks of the first group are the first fifth of the sorted benchmarks, the benchmarks of the second group are the second fifth, and so on. In the same way, with a sorting based on the length of the detour, the groups that belongs to the detour length are generated. The bars represent the average running time of the MILP formulation. They are plotted on the x-coordinate that is the average ratio of costumer costs or the average detour length of the group. It can be seen that with increasing ratio of customer costs the benchmarks are harder to solve. All three MILP formulations requires more time to solve the benchmarks of the last two customer cost groups. The results of (LP4) in Figure 1 show that (LP4) is worse than (LP1) in the benchmarks with a low ratio of customer costs. In contrast, (LP1) needs more time than (LP4) to solve benchmarks with a high ratio of customer costs. In each group, the strengthened variant of (LP7) has the smallest average running time. Grouping the benchmarks by the detour length leads to similar results, 23
Figure 1: Dependence of solving time on benchmark characteristics. benchmarks with small length of detour are solved faster than benchmarks where a long detour was necessary to reduce customer costs. It seems that (LP1) works worse for benchmarks with very short or very long detours, and that (LP4) is worse by medium length of detour. Again, in each group (LP7) in its strengthened variant has the best performance. Overall, the solution quality depends on both, the ratio of customer costs and the detour length. The group allocation of the benchmarks is different in the both criteria. The reason is that there are benchmarks with a small ratio of customer costs where a long detour is necessary to get this small value. And there are also benchmarks, where the jobs are afflicted with high customer costs but this has hardly influence in the route of the optimal solution. Then the detour length is small, but the ratio of costumer costs in the optimal value can be high. 7 Conclusion Our research has shown that the new kind of cost function in the VRP leads to problems harder to solve. The higher the customer costs, the more time is required to solve the problem with CPLEX even when only a small ratio of jobs is afflicted with non-zero customer costs. So, the VRP-CC is a new challenge in VRP. The results also show the influence of the problem formulation to the performance in CPLEX. In practise, different MILP formulations should be developed and compared to solve a problem as efficiently as possible with a MILP solver. In real applications, different additional restrictions can occur. One example is a limited capacity of the machines. In the presented models is only stipulated that each machine serves at least one job. But in reality, it will be better to split the jobs evenly over all machines. This can be realised by choosing d max smaller, but it will be hard to find a suitable value to ensure that the problem is not infeasible and to restrict the machine capacity. Better ways are restrictions in the number of jobs served by a machine or the pure working time of the machines. It is easy to include such constraints in the three-index model since the three-index binary variables are a good link between a machine and 24
the jobs allocated to it. But for some two-index models, regarding capacity constraints can be difficult. For example, the condition each machine can resolve at most K jobs can be ensured very simple with the MTZ constraints (v zk v sk K + 1). But a condition the pure working time of a machine is at most T hours requires binary variables for the machine allocation because the working times of the jobs allocated to a machine must be summed. Beside the three-index formulation, (LP6) is able to handle such constraints without additional variables. In practise, the number of jobs is much higher than 20. To solve bigger problems, heuristics and meta-heuristics are necessary because MILP solver requires too much time for solving. But they can be used as part of a metaheuristic, e.g., in a multi-level approach. There, jobs are merged to a small set of superjobs. A solution of the resulting VRP-CC for the superjobs can be found with a MILP solver. Also the order of resolving the jobs merged to a superjob can be obtained by means of a MILP solver. References Clarke G, Wright JW (1964) Scheduling of vehicles from a central depot to a number of delivery points. Operations Res, 12(4), 568-581. Dantzig GB, Fulkerson DR, Johnson SM (1959) Solution of a large-scale traveling-salesman problem. J of the Operations Res Society of Am, 393-410. Desrochers M, Laporte G (1991). Improvements and extensions to the Miller- Tucker-Zemlin subtour elimination constraints. Operations Res Letters, 10(1), 27-36. Baldacci R, Christofides N, Mingozzi A (2007) An exact algorithm for the vehicle routing problem based on the set partitioning formulation with additional cuts. Mathematical Programming, 115(2), 351-385. Eksioglu B, Vural AV, Reisman A (2009) The vehicle routing problem: A taxonomic review. Computers and Industrial Engineering, 57(4), 1472-1483. doi:10.1016/j.cie.2009.05.009 Gillett BE, Miller LR (1974) A heuristic algorithm for the vehicle-dispatch problem. Operations Res, 22(2), 340-349. Heinicke F, Simroth A, Tadei R, Baldi MM (2013) Job order assignment at optimal costs in railway maintenance. Proc of the 2nd Int Conf on Operations Res and Enterpr Syst (ICORES2013). Heinicke F, Simroth A (2013) Application of Simulated Annealing to Railway Routine Maintenance Scheduling. 14th Int Conf on Civ, Struct and Environ Eng Comp. 25
Kumar SN, Panneerselvam R (2012) A Survey on the Vehicle Routing Problem and Its Variants. Intelligent Information Management, 4(3), 66-74. Laporte G (2007) What you should know about the vehicle routing problem. Naval Research Logistics (NRL), 54(8), 811-819. Macedo R, Alves C, Valério de Carvalho JM, Clautiaux F, Hanafi S.(2011) Solving the vehicle routing problem with time windows and multiple routes exactly using a pseudo-polynomial model. EJOR, 214(3), 536-545. Miller, C. E., Tucker, A. W., Zemlin, R. A. (1960). Integer programming formulation of traveling salesman problems. JACM, 7(4), 326-329. Miwa M (2002) Mathematical programming model analysis for the optimal track maintenance schedule. Quarterly Report of RTRI, 43(3), 131-136. doi:10.2219/rtriqr.43.131 Nemhauser GL, Wolsey LA (1988) Integer and combinatorial optimization. New York: Wiley. Oyama T, Miwa M (2006) Mathematical modeling analyses for obtaining an optimal railway track maintenance schedule. Jpn J of ind and appl math, 23(2), 207-224. doi:10.1007/bf03167551 Pataki G (2003) Teaching integer programming formulations using the traveling salesman problem. SIAM review, 45(1), 116-123. Quiroga LM, Schnieder E (2010) A heuristic approach to railway track maintenance scheduling. Proc of 12th Int Conf on Computer Syst Des and Operation in Railw and Other Transit Systems, 687699, China. Tan KC, Lee LH, Zhu QL, Ou K (2001) Heuristic methods for vehicle routing problem with time windows. Artif Intell in Eng, 15(3), 281-295. Vale C, Ribeiro I, Calçada R (2012) Integer Programming to Optimize Tamping in Railway Tracks as Preventive Maintenance. J Transp Eng, 138(1), 123-131. doi:10.1061/(asce)te.1943-5436.0000296 Van Eijl CA (1995) A polyhedral approach to the delivery man problem. Technical Report 95-19, Department of Mathematics and Computing Science, Eindhoven University of Technology. 26