# Vehicle Routing Problem with Drones Considering Time Windows and Dynamic Demand
## 4 Solution Approach
### Chimp Optimization Algorithm  
The chimp optimization algorithm (CHOA) is a swarm intelligence optimization algorithm based on chimpanzee hunting behavior that is used to solve optimization problems [51]. During hunting, chimpanzeees find prey by driving, blocking, chasing, and surrounding them to meet the individual's needs. This process involves four types of chimpanzees, namely attackers, barriers, chasers, and drivers, representing the optimal, suboptimal, third, and fourth optimal solutions of the population, respectively. In other words, the process of using CHOA to search for a solution can be regarded as the four types of chimpanzees, constantly updating their individual positions until a satisfactory solution is found. Before using the algorithm, the above process needs to be modeled first. The mathematical model is as follows:  
In the D-dimensional search space, assuming that there is a population composed of NIND chimpanzees \(X=\{X_{1},X_{2},\cdots,X_{NIND}\}\), the position of the \(i\)-th chimpanzee is defined as \(X_{i}=(X_{i}^{1},X_{i}^{2},\cdots,X_{i}^{D})^{T}\), and \(X_{i}^{j}(j=1,2,\cdots,D)\) is the component of the \(j\)-th dimension of the \(i\)-th chimpanzee. In the process of driving, blocking, and chasing prey, the behavior of chimpanzee \(i\) approaching the prey can be described by Formulas (22) and (23):  
\[d_{i}^{j}=\Big{|}c_{i}^{j}X_{prey}^{j}(gen)-m_{i}^{j}X_{i}^{j}(gen)\Big{|}, \tag{22}\]  
\[X_{i}^{j}(gen+1)=X_{prey}^{j}(gen)-a_{i}^{j}a_{i}^{j}. \tag{23}\]  
where \(d_{i}^{j}\) represents the distance between chimpanzee \(i\) and prey in dimension \(j\); \(X_{prey}^{j}\) is the position of prey; \(gen\) is the number of iterations; \(a\), \(m\) and \(c\) are coefficient vectors determined by Formulas (24)-(27).  
\[a_{i}^{i}=2 fr_{1}, \tag{24}\]  
\[c_{i}^{j}=2r_{2}, \tag{25}\]  
\[f=2-\frac{2 gen}{MAXGEN}, \tag{26}\]  
\[m_{i}^{j}=Chaotic\_value. \tag{27}\]  
where \(f\) is a nonlinear disturbance factor; \(MAXGEN\) is the maximum number of iterations; \(r_{1},r_{2}\) is the random number within the range [0, 1]; \(a_{i}^{j}\) is a random variable reflecting the distance between chimpanzees and prey; \(c_{i}^{j}\) is a random variable reflecting the impact of  
Figure 2: Schematic diagram of the two-stage vehicle route planning strategy.  
prey position on chimpanzees' position; and \(m_{i}^{j}\) is a chaotic vector representing the impact of chimpanzees' neutral movement during hunting.  
Finally, the population satisfies the demand by attacking the prey to obtain the optimal solution. A mathematical model of a chimpanzee attacking prey looks like this:  
\[X_{i,1}^{j}=X_{Attacker}^{j}-a_{i,1}^{j}\big{|}c_{i,1}^{j}X_{Attacker}^{j}-m_{i, 1}^{j}X_{i}^{j}\big{|}, \tag{28}\]  
\[X_{i,2}^{j}=X_{Barrier}^{j}-a_{i,2}^{j}\big{|}c_{i,2}^{j}X_{Barrier}^{j}-m_{i,2} ^{j}X_{i}^{j}\big{|}, \tag{29}\]  
\[X_{i,3}^{j}=X_{Chuser}^{j}-a_{i,3}^{j}\big{|}c_{i,3}^{j}X_{Chuser}^{j}-m_{i,3} ^{j}X_{i}^{j}\big{|}, \tag{30}\]  
\[X_{i,4}^{j}=X_{Driver}^{j}-a_{i,4}^{j}\big{|}c_{i,4}^{j}X_{Driver}^{j}-m_{i,4} ^{j}X_{i}^{j}\big{|}, \tag{31}\]  
\[X_{i}^{j}(gen+1)=\frac{X_{i,1}^{j}+X_{i,2}^{j}+X_{i,3}^{j}+X_{i,4}^{j}}{4}. \tag{32}\]  
where \(X_{Attacker}^{j}\), \(X_{Barrier}^{j}\), \(X_{Chuser}^{j}\), \(X_{Driver}^{j}\) represent the positions of the attacker, barrier, driver, and chaser on the \(j\)-th dimension, respectively, and \(X_{i}^{j}(gen+1)\) represents the updated position of the \((gen+1)\)-th generation chimpanzee on the \(j\)-th dimension.