Metaheuristic for the Capacitated Multiple Traveling Repairman Problem

The Capacitated Multiple Traveling Repairmen Problem (CmTRP) is an extension of the Multiple Traveling Repairmen Problem (mTRP). In the CmTRP, the number of vehicles is dispatched to serve a set of customers, while each vehicle’s capacity is limited by a predefined-value as well as each customer is visited exactly once. The goal is to find a tour that minimizes the sum of waiting times. The problem is NP-hard because it is harder than the mTRP. Even finding a feasible solution is also NP-hard problem. To solve medium and large size instances, a metaheuristic algorithm is proposed. The first phase constructs a feasible solution by combining between the Nearest Neighborhood Search (NNS) and Variable Neighborhood Search (VNS), while the optimization phase develops the feasible solution by the General Variable Neighborhood Search (GVNS). The combination maintains the balance between intensification and diversification to escape local optima. The proposed algorithm is implemented on benchmark instances from the literature. The results indicate that the developed algorithm obtains good feasible solutions in a short time, even for the cases with up to 200 vertices. Keywords—CmTRP; NNS; VNS; GVNS


A. Motivation and Definition
A particular variant of the CmTRP is the Multiple Traveling Repairmen Problem (mTRP) that considers multiple vehicles or travelers to find a tour minimizing the waiting time of all customers [1], [7], [9]. Applications of the mTRP can be found in [1], [7], [9]. The mTRP is based on an assumption that there is no limit to the capacity of each vehicle. That means vehicles can carry as many goods as they want. However, real situations imply that it does not always hold because vehicles have strict regulations on capacity. In this work, the mTRP is involved the capacity constraint. In the CmTRP, the maximum capacity of each vehicle does not exceed a predefined capacity (Q). In the CmTRP, there are k vehicles at a main depot s, and n customers. The goal is to find a tour such that each vertex is visited exactly once, while the capacity constraint is satisfied, and the total waiting time of overall customers is minimized.
In this paper, we formulate the CmTRP as followings: We consider a complete graph K n that has the vertex set V = {1, 2, ..., n} and a symmetric distance matrix C = {c(i, j) | i, j = 1, 2, ..., n} (c(i, j) is the traveling cost between vertex i and vertex j). Each vertex i has the demand d i . Let R = (1, 2, ..., k) be the number of k vehicles which begin at a main depot v 1 . Let Q denote the capacity of a vehicle. Assume that a tour T = (R 1 , ..., R l , ..., R k ) includes a set of routes from k vehicles. R l = (v 1 , ..., v h , ..., v m ) (1 < m ≤ n) is a route of vehicle l. Let P (v 1 , v h ), l(P (v 1 , v h )) be respectively the path from vertex v 1 to vertex v h on R l , and its length. The waiting time of v h (1 < h ≤ m) on R l is the cost of the path from v 1 to v h : Let W (R l ) be the sum of waiting times of all vertices. The capacity of this route must satisfy the following constraint: The objective function of the problem is: The CmTRP asks for a tour, which starts at a depot v 1 , visits each vertex once exactly with the waiting time of all vertices being minimized.

B. Related Works
In the general case, the CmTRP has, to the best of our knowledge, previously not been studied much, even though it is an extension of the mTRP case. However, some variants of the CmTRP are introduced in numerous works in the literature as follows: • The mTRP is a particular case when the capacity constraint does not involve. Numerous works for mTRP can be found in [1], [7], [9]. In the metaheuristic approach, several algorithms [1], [7], [9] produce good solutions fast for instances with up to 200 vertices.
• The mTRP with distance constraint (mTRPD) is a particular case since the route length or maximum duration of each vehicle cannot exceed a predetermined limit. Metaheuristic algorithms in [3], [12] can solve the problem well for instances with up to 200 vertices.
• The mTRP with Profits (mTRPP) aims is to find a travel plan for server maximizing the total revenue. In this problem, not all customers need to be visited. Metaheuristic algorithm in [11] solves the problem well with up to 200 vertices.
• The Traveling Repairman Problem is a special case where there is only a repairman. Numerous metaheuristic algorithms [2], [4], [5], [17] for the problem have proposed in the literature.
The above algorithms are the state-of-the-art algorithms for some variants of the CmTRP case. However, they do not include the capacity constraint, and their corresponding algorithms cannot be adapted to the CmTRP. That means that we cannot use the above algorithms to solve the CmTRP.

C. Our Methodology
Like other NP-hard problems, the CmTRP can be solved by exact or heuristic methods. Exact algorithms obtain the optimal solution but they often take exponential time in the worst case. Heuristic approaches are divided into the classical heuristic and metaheuristic approach. The classical heuristic approach finds one solution quickly, but this solution may have a large disparity in comparison with the best solution. The metaheuristic approach, on the other hand, obtains near-optimal or even global optimal solutions. Therefore, metaheuristic is usually used to reach optimal solutions for the problem with large sizes.
The CmTRP is also NP-hard because it is a generalization case of the mTRP. In many constrained optimization problems like the CmTRP, even building a feasible solution to the problem is also NP-hard problem. It indicates that obtaining a good feasible solution is a challenge. A good metaheuristic needs to ensure the balance between diversification and intensification. In [14], H. Mladenovic et al. show that the VNS generates local optima that are close to the global optimum, in a more straightforward manner than the other metaheuristics. However, the VNS only implements the intensification well. In this work, we developed a metaheuristic consisting of the constructive and optimization phase. The first phase constructs a feasible solution by combining between the Nearest Neighborhood Search (NNS) and Variable Neighborhood Search (VNS), while the optimization phase develops the feasible solution by the General Variable Neighborhood Search (GVNS). The metaheuristic uses the shaking technique to maintain diversification, while the VNS, and GVNS implement intensification. Extensive numerical experiments on benchmark instances show that the proposed algorithm reaches good feasible solutions at a reasonable amount of time, even for the instances with up to 200 vertices.
The rest of this paper is organized as follows. Section 2 introduces our algorithm. Computational evaluations are presented in Section 3, and Sections 4 and 5 discusses and concludes the work, respectively.

A. Several Variants of VNS
We describe some variants of VNS [14] such as the original VNS, VND, and GVNS, shaking technique [13], respectively.
• The Variable Neighborhood Search (VNS) algorithm is introduced by Mladenovic et al. [14]. It executes neighborhood procedures alternately, and shaking technique to escape from the local optima. At each iteration, the best neighboring solution is chosen from neighboring solutions that are generated from a neighborhood procedure. If it is better than the current best one, the procedure is repeated. Otherwise, the search goes to the next neighborhood procedure.
• The Variable Neighborhood Descent (VND) algorithm, which is a VNS variant, is proposed by Mladenovic et al. [14]. In the VND, a change of neighborhoods is performed in a deterministic way. Assume that an initial solution is given. Local search procedures in their descent phase are used to generate neighborhoods. The final solution is the best solution in all neighborhoods. The difference between the VNS and VND is that the VNS uses Shaking.
• The General Variable Neighborhood Search (GVNS) algorithm [14] is a variant of the VNS. It includes an initial feasible solution, and a shaking procedure followed by the VND local search. The GVNS is a VNS variant where the VND is used as the improvement procedure.

B. Neighborhoods
We use seven neighborhoods in the literature to explore the search space of the problem. Let N k (k = 1, ..., k m ) be a finite set of pre-selected neighborhood structures. We describe more details about seven neighborhoods: For Inter-route: It is used to optimize on each route. We then describe five neighborhoods' structure in turn. Assume that, R, and m are a route and its size, respectively.
• Remove-insert places each vertex in the route at the end of it. Obviously, the complexity time of • Swap adjacent tries to swap each pair of adjacent vertices in the route. The complexity time of • Swap neighborhood attempts to swap the positions of each pair of vertices in the route. The complexity • 3-opt neighborhood attempts to reallocate three vertices to another position of the route. The complexity • 4-opt neighborhood attempts to involve deleting four edges and reconnecting the four sub-tours without changing the orientation of them. The complexity time For intra-route: Intra-route is used to swap vertices between two different routes or remove vertices from a route and then insert them to another.Let R l , R h , ml, and mh be two different routes and their sizes in T , respectively.
• swap-2-routes tries to exchange two vertices belonging to different routes R l and R h . The complexity time of N 6 (R) is O(ml × mh) • insert-2-routes removes one vertex R l and inserts it at the best possible position in R h . The complexity Find the best neighborhood T of T ∈ N k (T ); {T must be feasible solution} 4: if (W (T ) < W (T )) (W (T ) < W (T * )) then The proposed algorithm includes two phases. The construction phase finds a feasible solution, whereas the improvement phase tries to improve it. Algorithm 1 depicts the whole process.

Algorithm 3 Construction
Input: v 1 , K n , k, α are a depot, the graph, the number of vehicles, the length of NL, respectively. Output: An initial solution T . 1: for (l = 1; l < k; l + +) do 2: {All routes start at v 1 } 3: end for 4: while all vertices are not visited do 5: l = random(k);{a route randomly is chosen} 6: {v e is the last vertex in R l } 7: Generate NL list that includes α nearest vertices to v e in V ; 8: R l ← {v i } 10: end while 11: if T is feasible then T ← arg min N 1 (T );

C. Construction
Algorithm 2 shows the constructive procedure. The objective function used in this procedure is the sum of all positive differences between the capacity of all vehicles and the capacity limit Q, that is, min k l=1 max(0, D(R l ) − Q). The algorithm works until it finds a feasible solution. In the first step, a solution is created by Nearest Neighborhood Search [8]. If the solution is feasible, the construction phase stops and outputs it. On the other hand, a local search iterates until finding a feasible solution or l max is reached. The solution is shaken to escape from the current local optimal. Next, the VNS is applied to obtain the best solution from neighboring solutions. If it is better than the found best solution, it is set to the current solution. Last, Lvel is increased by one if the current solution is not improved, or set to 1, otherwise.

D. Improvement
After the construction, the heuristic tries to improve the feasible solution created by the previous phase. In this phase, the objective function is to minimize W (T ).
Local search procedure that is developed by combining the seven neighborhoods generates various neighborhoods. The final solution should be a local minimum with respect to all neighborhoods. The order of neighborhoods is fixed.
The Perturbation mechanism is very important to achieve success. When the mechanism has too small perturbation moves, the search can return to the previously visited solution space. Therefore, the search can get stuck into local optimal. On the other hand, large perturbation moves drive the search to undesirable space. In order to overcome these issues, we propose a new shaking technique based on the original doublebridge technique [13]. The detail is described in Algorithm 3.
The algorithm stops after t max seconds or the best-solution is found (t max is the parameter of the algorithm, and its value is determined from preliminary experiments).

III. EVALUATIONS
The proposed algorithm is run on a Pentium 4 core i7 2.40 GHz processor with 8 GB of RAM. On all experiments, parameters α, l max, ρ, nloop are respectively set to 10, 5, 0.3, and 50. These parameters are chosen through empirical tests and, with them, the algorithm seems to produce good solutions at a reasonable amount of time in comparison with the other parameter values.
We also implement the performance of the whole implementation against the state-of-the-art algorithms. We compare both of the numerical results and computational time on the same instances.

A. Instances
The experiments are performed on a set of benchmark for Capacitated VRP in [12], [18]. As testing the proposed algorithm on overall instances can be computationally too expensive, some selected instances as follows: 1) to eliminate the effects of size, instances with approximately from 50 up to 200 customers are chosen; 2) in order not to bias the results by taking "easy" or "hard" instances, we randomly select them.

B. Results
We define the improvement of our algorithm with respect to Best.Sol (Best.Sol is the best solution found by the proposed algorithm) in comparison with the initial solution from the construction phase as followings: In the tables, OPT, Init.Sol, Best.Sol, Aver.Sol and T correspond to the optimal solution, initial solution, best solution, average solution, and the average time in seconds of ten executions obtained by our algorithm, respectively. In this work, we choose several state-of-the-art metaheuristic algorithms for some variants of the CmTRP [1], [6], [10], [12], [15], [16] as a baseline in our research. Tables I to III show the average gap of the improvement phase in comparison with the construction is 8.70%. The average gap value is not too large. This indicates that the construction phase gives good feasible solutions fast. The proposed algorithm consumes much time for the instances with up to 200 vertices. Therefore, the fist way to decrease the running time is only to run the construction phase. In this case, the proposed algorithm suffers from a slightly loss of 8.70% solution quality on average. Although we cannot compare the results directly to other algorithms in the literature (note that in the algorithms for some variants of the mTRP, the capacity constraint is removed), we succeed in producing feasible solutions for instances with 200 customers. It is an important contribution when finding feasible solutions is also NP-hard. Table IV shows the evolution of average gap during the iterations. The average gaps are 6.35%, 6.85%, 7.28%, 7.99%, 8.30%, 8.70%, and 8.70% in comparison with the initial solution, obtained by one, five, ten, twenty, thirty, forty, fifty, and one-hundred iterations, respectively. No improvement obtains from fifty to one-hundred iterations. Therefore, additional iterations give a minor improvement while it consumes much time. Hence, the second way to reduce the running time is to use no more than fifty iterations, and the improvement reaches about 8.70%. The fastest option is to run the construction phase and then improve it by using a single iteration, which obtains an average gap of 6.35% and average time of 0.5 seconds. Table V shows the difference between the objective function of two problems on the same instances. The average

IV. DISCUSSIONS
Due to NP-hard problem, metaheuristic approach is suitable approach to solve the problem with large sizes in a short time. Currently, several algorithms for the close variants of CmTRP have been proposed. However, these algorithms cannot apply to the CmTRP because the capacity constraint does not include in them. The results in Table V indicate that the algorithms for the mTRP produce infeasible solutions for the CmTRP. Therefore, developing efficient algorithm for the CmTRP is our contribution. The VNS, and GVNS [14] are a general schemes that are used widely to solve many optimization problems. However, to apply them for a specific problem, they require many efforts. Specifically, how to use and combine neighborhoods to explore and exploit good solution space, how many neighborhoods are used to balance between solution quality and running time, and how to balance between diversity and intensification. Therefore, in the literature, many algorithms are developed on the VNS scheme for a specific problem, but the solution quality of them is different. Applying the VNS scheme to solve the problem effectively is our contribution in this work.
For a metaheusitic approach, a classical and successful recipe is to combine 1) efficient "intensification" procedures via local searches with 2) "diversification" methods. Diversification means to generate diverse solutions to explore the search space on a global scale, while intensification means to focus on the search in a local region by exploiting the information that a current good solution is found in this region. Our algorithm uses the VNS, GVNS to implement intensification while shaking maintains diversification. Though the initial solution is generated far from the global minima, the explored solution region is extended. Therefore, the chance for finding good solutions is high. The CmTRP is harder than the mTRP because it is the general case of the mTRP. For constrained NP-hard problem like the CmTRP, finding feasible solution is also NP-hard. The new contribution in this work is applied the VNS in both of two phases. The first phase generates feasible solution while the post one improve solution quality.
With respect to the instances, it indicates that the proposed algorithm can be used as follows: • The fist way is to only run the construction phase with a rather loss of 8.7% solution quality on average. It is the fastest option.
• The second way is to run the construction phase and then enhance it by using one iteration. As the result, our algorithm obtains an average improvement of 6.35%, and an average time of 0.5 seconds. It balances between solution quality and running time.
• The last is to run the construction phase and improve it no more than fifty iterations, and the average improvement reaches about 8.7%, and an average time of 29.07 seconds. It is the best option in terms of solution quality.
Moreover, in comparison with some close variants of the mTRP, the proposed algorithm obtains the optimal solutions for the instances with up to 80 vertices in a short time. Moreover, it also reaches the better solutions than the algorithms in [1], [6] while it is comparable with the algorithms in [10], [12], [15], [16]. It shows that our algorithm is still effective for various problems.

V. CONCLUSIONS
In this paper, we propose a metaheuristic algorithm which applies the VNS in both of phases. The first phase creates a feasible solution while the post one improve it. The optimal solutions can be reached for the problem with up to 80 vertices in several seconds. The solution's quality is comparable with the previous algorithms for the other cases. Moreover, we give three options to use the proposed algorithm effectively. However, the running time needs to enhance to meet practical situations. It will be our aim in future research.