# A Swarm Intelligence Solution for the Multi-Vehicle Profitable Pickup and Delivery Problem
## 4 Proposed Method
### ABC without Clustering (ABC)
The outline of the routing phase of our ABC is presented in Algorithm 1, where each notation is defined as follows: Pop Size represents the population size; Max Iter: the maximum number of iterations; Num Vehicles: the quantity of vehicles; US: pairs of customers who have not been served; \(\Delta E\): the difference between OF values for an old and new solution; \(D:\): demon value; and \(Non-improvement:\) a counter to count the number of unsuccessful attempts to improve the solution. ```
Pop = \(\{S_{1},S_{2},S_{3},..,S_{n}\}\); /* Initial solutions that have been generated using GRASP(V2)*/  Limit = initial limit value, \(D\) = initial demon value, Non-improvment = 0, Global_Best = Best  solution in Pop; For\(M=1\) to Max_Iter /*** Employed bee phase ***/ For\(i=1\) to Pop_Size  Select randomly one route of solution \(S_{i}\);  Apply one randomly selected neighbourhood operator to the current route of solution \(S_{i}\) to obtain a new solution \(S_{i}^{\prime}\); If\(S_{i}^{\prime}\) is feasible Then Compute the \(OF\) of \(S_{i}^{\prime}\); End If If\(\big{(}OF\big{(}S_{i}^{\prime}\big{)}\big{)}>OF(S_{i})\big{)}\)  Memories the new solution \(S_{i}^{\prime}\); Else if\((\Delta E\leq D_{i})\)  Memories the new solution \(S_{i}^{\prime}\);  update the demon value: \(D_{i}=D_{i}-\Delta E\); Else Memories the old solution \(S_{i}\);  update the demon value: \(D_{i}=D_{i}+\Delta E\);  Non-improvement\((i)\) = Non-improvement\((i)+1\); End If End For /*** Onlooker bee phase ***/  Select \(N\) solutions from the employed bees using roulette wheel selection strategy; For\(i=1\) to \(N\)  Select randomly one route of solution \(S_{i}\); For\(j=1\) to number of neighbourhood operators  Apply a selected neighbourhood operator (\(j\)) to the current route of solution \(S_{i}\) to obtain a new solution \(S_{i}^{\prime}\); If\(S_{i}^{\prime}\) is feasible Then Compute the \(OF\) of \(S_{i}^{\prime}\); End If If\(\big{(}OF\big{(}S_{i}^{\prime}\big{)}>OF(S_{i})\big{)}\)  Memories the new solution \(S_{i}^{\prime}\);  Break; End if End For
```  
**Algorithm 1**The pseudocode of the proposed ABC. ``` Pop = \(\{S_{1},S_{2},S_{3},..,S_{n}\}\); /* Initial solutions that have been generated using GRASP(V2)*/  Limit = initial limit value, \(D\) = initial demon value, Non-improvment = 0, Global_Best = Best  solution in Pop; For\(M=1\) to Max_Iter /*** Employed bee phase ***/ For\(i=1\) to Pop_Size  Select randomly one route of solution \(S_{i}\);  Apply one randomly selected neighbourhood operator to the current route of solution \(S_{i}\) to obtain a new solution \(S_{i}^{\



### ABC with Clustering (ABC(C))

In this part of the study, the ABC method described in Section 4.1 was used to improve the initial solutions that were constructed using the various GRASP(C) methods reported in [7], namely K-means-GRASP(C), modified-K-means GRASP(C), and ACO-GRASP(C). Again, there are some modifications that must be considered when using the ABC with those algorithms. When using the following operators, the insertion process should be restricted to the customer pairs inside the same cluster only: remove one customer pair randomly and insert an unvisited one, remove a customer pair with a low IR and insert an unvisited pair with a high IR, and insert a customer pair with a high IR. Also, the insertion restriction should be applied in the scout bee phase in both strategies (S1 and S2). We used the same parameter values that have been used in the ABC (without clustering) to improve the initial solutions in this part of the study. Moreover, the same strategies from the scout bee phase (S1 and S2) have been used in the ABC(C)) algorithms. Therefore, overall, we have six algorithms that use the ABC(C): (1) K-means-GRASP(C)-ABC(C)S1, (2) K-means-GRASP(C)-ABC(C)S2, (3) modified K-means-GRASP(C)-ABC(C)S1, (4) modified K-means-GRASP(C)-ABC(C)S2, (5) ACO-GRASP(C)-ABC(C)S1, and 6) ACO-GRASP(C)-ABC(C)S2.