Introduction

The vehicle routing problem with capacity constraints is one of the most important subjects for logistic activities. The main objective of vehicle routing problem is to design the least cost routes for a fleet of vehicles from one depot to a set of points. Vehicles belong to a fleet and located to the central depot and have a capacity. Each customer, which located a point to visit, has amount of demand. The cost depends on the distance. Each route starts from the central depot and finish at the central depot and the vehicle capacity must not be overloaded.

There are several studies about CVRP in the literature over the past decade and heuristic, metaheuristic or hybrid methods were studied overwhelmingly. Mazzeo and Loiseau (2004) developed an ant colony algorithm. They resumed the main characteristics and tried several alternatives for each component of the algorithm. The proposed algorithm was compared with other heuristics on the literature in a different set of problems and the effectiveness of the algorithm was illustrated. Fukasawa et al. (2006) proposed an algorithm based on branch and bound cut and traditional Lagrangian relaxation over q routes. The algorithm was tested on more than a hundred of instances. Mester and Brasys (2007) presented an adaptation of active-guided evolution strategies metaheuristic. The proposed metaheuristic approach is the combination of guided local search and evolution strategies metaheuristics. It was carried out on a set of instances and the results illustrated the proposed approach is highly competitive. Lin et al. (2009) developed a hybrid algorithm which takes the advantages of simulated annealing and tabu search. The developed algorithm included classical large-scaled CVRP instances to verify the effectiveness. Ai and Kachitvichyanukul (2009) presented (n + 2 m)- and (3 m)-dimensional particle swarm optimization with n customers and m vehicles. (n + 2 m) starts with the transformation of particle into a priority list of customer to enter route and priority matrix, 3 m starts with the transformation of particle into the vehicle orientation points and the vehicle coverage radius. The computational results illustrated (3 m)-dimensional particle swarm is better than other. Yurtkuran and Emel (2010) proposed an electromagnetism-like algorithm which is hybridized with a local search method. They stated that the algorithm was straightforward, easy to use and efficient for CVRP. Szeto et al. (2011) proposed an artificial bee colony algorithm and compared with the other methods in the literature. They asserted that the proposed algorithm is an alternative to solve the CVRP. Nazif and Lee (2012) presented a genetic algorithm using optimized crossover operator and showed the effectiveness of the algorithm on the benchmark instances. Cui et al. (2013) developed a new improved quantum evolution algorithm with a mixed local search procedure and illustrated the effectiveness of the algorithm in different cases. Kao and Chen (2013) developed a two-stage hybrid algorithm that integrated a discrete particle swarm optimization and simulated annealing. The algorithm can decrease the computational time in consequence of eliminating the number of infeasible solutions. Jin et al. (2014) presented a cooperative parallel metaheuristic which consists of multiple parallel tabu search threads that cooperate by asynchronously exchanging best found solutions through a common solution pool. They compared the algorithm with the others in the literature and the computational results illustrated the effectiveness and competitiveness of the algorithm. LinHui and Luo (2014) developed a novel fusion algorithm which is a dynamic adaptive immune genetic algorithm with automatic immune monitoring function. They proved success of the proposed algorithm on the small-scale test problems. Mazidi et al. (2016) focused on enhancing the capability of local search algorithms. In this context, they compared six different metaheuristic algorithms (simulated annealing, stochastic hill climbing, ant colony, tabu search, particle swarm optimization, genetic algorithm) and proposed an improved genetic algorithm which uses ant colony algorithm as the initial population creating operator. Yeh et al. (2016) proposed a two-stage iterated local search strategy based on random variable neighbor descent and showed the superiority from the iterated local search. Akpinar (2016) developed a large neighborhood search algorithm which is hybridized with the ant colony optimization algorithm as the solution construction mechanism. They showed the algorithm has satisfactory results on instances.

As exemplified above, there are several studies about heuristics and metaheuristic approach to solve large-scaled CVRP because of NP-hard structure of the problem. In this paper, we developed a new heuristic algorithm based on tabu search and ALNS. Our proposed algorithm is inspired Ropke and Pisinger (2006) in terms of ALNS but we brought three important theoretical contributions and achieve a good efficiency for our problem. The first one is the design of specific destroy/repair operators, which considers both the sequence of the routes and vehicle capacity. The second modification is about the search operator which works to cluster service points. The third one is the design of a diversification technique which depends on the clusters. The proposed algorithm was tested on well-known different instances. The computational experiments illustrate that our heuristic algorithm is competitive with other proposed algorithms for solving CVRP.

The remainder of this paper is organized as follows. In the next section, a brief overview of the vehicle routing problem is given followed by which a new proposed algorithm is explained. The subsequent section deals with computational results on benchmark problems. Results of a numerical investigation which show the comparison of the proposed algorithms on a real-life example are presented before the concluding section. Finally, conclusions are presented.

Vehicle routing problem

The vehicle routing problem (VRP) consists of the problems in which a set of routes for a fleet of vehicles based at one or several depots must be determined for a number of geographically dispersed cities or customers. The aim of the classical VRP is finding a set of routes at a minimal cost (finding the shortest path, minimizing the number of vehicles, etc.) beginning and ending the route at the depot, so that the known demand of all nodes are fulfilled. In the literature, VRP is commonly defined under capacity constraints, so the VRP generally has the same meaning with CVRP. The mathematical formulation of the CVRP is shown below:

A capacity of each vehicle

V maximum number vehicle

F ij the flow of cores from node i to j

Z total transportation cost

d i demand at node i

\(c_{ij}\) Distance between node i and node j

$$x_{ij} = \left\{ {\begin{array}{*{20}l} {1,} \hfill & {{\text{if vehicle moves from node }}i\;{\text {to }}j}\, \hfill \\ {0,} \hfill & {\text{otherwise}} \hfill \\ \end{array} } \right.$$

N number of nodes

The objective function can be written as follows:

$${\text{Min}} \,Z = \mathop \sum \limits_{i = 1}^{N} \mathop \sum \limits_{j = 1,j \ne i}^{N} c_{ij} .x_{ij}$$
(1)

The model constraints are:

$$\mathop \sum \limits_{l = 2, k \ne l}^{N} x_{lk} + x_{1k} = 1\quad \quad \forall k$$
(2)
$$\mathop \sum \limits_{l = 2, k \ne l}^{N} x_{kl} + x_{k1} = 1\quad \quad \forall k$$
(3)
$$\mathop \sum \limits_{k = 2}^{N} x_{1k} \le V$$
(4)
$$\mathop \sum \limits_{j = 1, j \ne i}^{N} x_{ij} = \mathop \sum \limits_{j = 1, j \ne i}^{N} x_{ji} \quad \quad \forall i$$
(5)
$$x_{kk} = 0\quad \quad \forall k$$
(6)
$$x_{lk} + x_{kl} = 1\quad \quad \forall k, \, l_{k \ne 1}$$
(7)
$$\mathop \sum \limits_{j = 1,j \ne i}^{N} F_{ij} = \mathop \sum \limits_{j = 1,j \ne i}^{N} F_{ji} + d_{i} \quad \quad \forall i_{i > 1}$$
(8)
$$d_{i} .x_{ij} \le F_{ij} \quad \quad \forall i,j_{i \ne j}$$
(9)
$$F_{ij} \le \left( {A - d_{j} } \right).x_{ij} \quad \quad \forall i,j_{i \ne j}$$
(10)

The objective function (1) of the model is to minimize the total traveled distance. The constraints (2) and (3) state that there is exactly one departure from node i. The constraint (4) provides not to exceed the total number of vehicles. Constraint (5) provides balance between incoming and outgoing arcs at a given node. Constraint (6) eliminates flow from node i to node i. Constraint (7) is trivial sub-tour elimination constraint. Constraints (8), (9) and (10) provide balance between total inflow and outflow at node.

This mathematical model can be used for only small-scale CVRP because it is quite difficult to achieve an optimal solution with traditional optimization methods due to the high computational complexity for large-scale problems. For this reason, we constructed a novel heuristic algorithm for CVRP in this study.

A novel algorithm for CVRP

In this section, our proposed algorithm is explained. We used following notation in the algorithm. The points to visit are denoted by a set of S which has number of p elements as \(S = \left\{ {1, \ldots , \, p} \right\}\). All the points are also denoted analytically by an arc set of P as \(P = \left\{ {\left( {x_{i} , \, y_{i} } \right):\,\,i\,\, \in \,\,S} \right\}\). \(\Delta_{ij} = \left( {\left( {x_{i} - x_{j} } \right)^{2} + \left( {y_{i} - y_{j} } \right)^{2} } \right)^{0.5}\) is the distance matrix which states the distance between the elements of S set. A solution is the sets R of k routes and also vehicles, R k  ⊆ S and k are less than and equal to the number of free vehicle t. All the points to visit have a demand d i and the capacity of free vehicles meeting the total demand is assumed as \(\varSigma d_{i} \le tC\). We determined the objective function as\(F = \varSigma_{k = 1}^{t} \varSigma_{i = 1}^{p} \varSigma_{j = 1}^{p} \pi_{ijk} \Delta_{ij} \;{\text{for all}}\,\,i, \, j\, \in S, \, i \ne j{\text{ and }}k \le t,\)where

$$\pi_{ijk} = \left\{ {\begin{array}{*{20}l} 1 \hfill & {{\text{from}}\,\,i\,\,{\text{to}}\,\,j\,\,{\text{by}}\,\,{\text{vehicle}}\,\,k} \hfill \\ 0 \hfill & {\text{otherwise}} \hfill \\ \end{array} } \right..$$

The capacity constraints must be kept down while searching for a solution. Therefore, we determined a function to control the feasibility of the candidate solution as \(\sum\nolimits_{k = 1}^{t} {\pi_{ijk} d_{j} \le C }\;{\text{for all}}\;i, j \in S\;{\text{and}}\;i \ne j .\)

One of our motivations is that the quality of initial solution affected the performance of the algorithm. Hence, we prefer to start the solution by these steps:

Step 1: Start from a random i point and determine the π ijk as 1 considering the minimum value of Δ ij , where the S = S* and R k  = R k *.

Step 2: Calculate the \(\bar{C}_{k} = C_{k} + d_{j}\) and \(S* = S\backslash \left\{ j \right\}\) and \(R_{k} * = R_{k} \, \cup \,\left\{ j \right\}\).

Step 3: Repeat steps 1 and 2 until \(\bar{C}_{k} \ge C\). If this is met, increase the value of k as 1.

Step 4: Run the all previous steps until S* \(\in\) ∅. At last all of R k * state us the solution.

After determining the initial solution, new solutions are determined by ALNS. In this study, we constructed a relocation procedure to search neighborhoods. The steps of the procedure consist of these steps:

Stage 1: Select one of each point i from each routes R k * by roulette wheel principle using Eq. (11).

$$p_{k} = \frac{{\sum\nolimits_{i = 1}^{p} {\sum\limits_{j = 1}^{p} {\pi_{ijk} \Delta_{ij} } } }}{{\sum\nolimits_{k = 1}^{t} {\sum\limits_{i = 1}^{p} {\sum\limits_{j = 1}^{p} {\pi_{ijk} \Delta_{ij} } } } }}.$$
(11)

Stage 2: Determine the second closest points to each selected points according to the Δ ij matrix.

Stage 3: Start from the R 1 and relocate the selected point with its second closest point. If the selected point and its second point are in the same route, do not relocate them. So we can prevent to enhance the solution space too much.

Stage 3′: While relocating, \(\bar{C}_{k} = C_{k} + d_{j}\) should be revised and route capacity should be controlled.

Stage 4: Stages 2 and 3 are repeated for all the points which were selected in Stage 1.

The relocation procedure is illustrated in Fig. 1. In the part (a) of Fig. 1D, H, J and P points were randomly selected. The second closest points to them E, I, H and A were chosen respectively. Part (b) of Fig. 1 shows us a neighbor solution after relocation under condition of the capacity constraint in not exceeded.

Fig. 1
figure 1

Relocation

In addition, there is a movement list to prevent cycling in the proposed algorithm. This list prohibits the use of some specific set of solutions for several iterations if one of them is used in recent iterations. Therefore, the search does not travel around the local optimum points. We preferred to determine the size of the list experimentally.

Finally, each iteration of the proposed algorithm that can be achieved by serving two vertices on the same route instead of leaving them on separate routes is implemented to improve the solution and a non-tabu solution is selected as a new solution. The algorithm after determining an initial solution steps can be summarized in Fig. 2 by pseudocodes.

Fig. 2
figure 2

Pseudo codes of proposed algorithm

Computational results on benchmark problems

The proposed algorithm is tested on three (A, M and G) sets of benchmark instances with different number of customers/points in the literature. Data of the problems and results were taken from http://neo.lcc.uma.es/vrp/vrp-instances/capacitated-vrp-instances/. Table 1 illustrates the comparison between the optimal/best objective values of our best objective values in the literature for these benchmark instances.

Table 1 Comparison between the solutions of proposed algorithm and best well-known solutions

The proposed heuristic algorithm can find the optimal solution immediately for small-scale problems. We mean with small scale that which has less than fifty points. When the scale of the problem gets larger, the algorithm converged to the optimal solution with 0.01% difference approximately. In addition to this, we found the new best solutions for the problems whose optimal solutions have not been found yet. The new best routes are shown in “Appendix 1” for 28th, 29th and 30th problems of Table 1.

A real-life application

In this section, we will summarize a project which motivated us to study this problem. We studied on the CVRP problem of a company which produces office furniture in Sakarya City, Turkey. The company produces and distributes the office furniture products (staff tables, meeting tables, workstations, working chairs, guest chairs, etc.) to the customers. The company has sufficient number of identical vehicles for carrying. The vehicles distribute orders from 09:00 a.m. to 18:00 p.m. That is to say, there are only 9 h for distribution and assembly per day. Based on this, the vehicles can be loaded up to 15 customers’ orders. In addition, the weight capacity is 1500 kg and volumetric load capacity is 5500 L of the vehicles.

We handled the 30-day transportation problem of the company and we solved these 30 different problems and run up to 21,600 s by the proposed algorithm and compared with company’s previous solutions. Then we applied paired sample t test to evaluate the performance of these solutions to illustrate the efficiency of our algorithm.

T test is applied to compare the solutions illustrated in Table 2. It illustrates that the company’s solutions and the proposed algorithm’s solutions are different in a given confidence interval and proposed algorithm’s solutions are better than company’s solutions.

$$H_{0} = \mu_{\text{A}} = \mu_{\text{B}}$$
$$H_{1} = \mu_{\text{A}} \ne \mu_{\text{B}}$$

where μ A average cost of 30 problems solved by the companyμ B average cost of 30 problems solved by the proposed algorithm.

Table 2 Comparison between our solutions and company’s solutions for 30 days

First hypothesis is average cost of 30 problems solved by the company is equal to average cost of 30 problems solved by proposed algorithm. Second hypothesis is average cost of 30 problems solved by the company is not equal to average cost of 30 problems solved by proposed algorithm. The paired samples statistics are shown in Table 3.

Table 3 Paired samples statistics

According to the p value in Table 3, hypothesis \(H_{0}\) is rejected. Because it is less than 0.05 in 95% confidence interval. This means that there is strong evidence that these two solutions are different. Because of the positive of the value, company’s solutions are worse than our solutions. In conclusion, this test shows that the solutions of our algorithm decrease the transportation cost of the company.

Conclusion

In this paper, we considered capacitated vehicle routing problem. There are various studies done and tested on this problem. These studies highly succeeded in studying this NP-hard problem. Some features of tabu search and ALNS providing this success are: allowing infeasible solutions, flexible parameters, destroy/repair operators, diversification strategy, intensification strategy, and adaptive memory. To this respect, we proposed a new heuristic algorithm based on tabu and ALNS for CVRP. We tested the proposed algorithm and the algorithm provides compatible results on benchmark instances. For three of benchmark instances, the proposed algorithm generated better solutions compared with best well-known solutions in the literature. In the first 11 benchmark instances, our algorithm found optimal solutions. However, it converged to the optimal solution with 0.01% difference approximately in the case of not to find optimal solution. Finally, when we applied the algorithm on a real-life problem the results satisfied us in terms of effectiveness and productiveness. Using the proposed algorithm substituted for the current method provides advantage to the company because the results are better than current methods and CPU time is allowable.