# Improvement of Wolf Pack Algorithm and Its Application to Logistics Distribution Problems

Authors: Wei Zheng
Journal: Scientific Programming
 (2022)

---

## Abstract

In logistics distribution systems, the constrained optimisation of the cargo dispensing problem has been the focus of research in related fields. At present, many scholars try to solve the problem by introducing swarm intelligence algorithms, including genetic algorithm, particle swarm algorithm, bee swarm algorithm, fish swarm algorithm, etc. Each swarm intelligence algorithm has different characteristics, but they all have certain advantages for the optimisation of complex problems. In recent years, the Wolf Pack algorithm, an emerging swarm intelligence algorithm, has shown good global convergence and computational robustness in solving complex high-dimensional functions. Therefore, this article chooses to use the Wolf Pack algorithm to solve a multi-vehicle and multi-goods dispensing problem model. First, the principle and process of the Wolf Pack algorithm are introduced, and two improvements are proposed for the way of location update and the way of step update. Then, a mathematical model of the multi-vehicle and multi-goods dispensing problem is developed. Next, the mathematical model is solved using the proposed improved Wolf Pack algorithm. The experimental results show that the proposed improved Wolf Pack algorithm effectively solves the cargo dispatching problem. In addition, the proposed improved Wolf Pack algorithm can effectively reduce the number of vehicles to be dispatched compared with other swarm intelligence algorithms.


---

## Body

## 1. Introduction

With the progress of science and technology, after reducing the cost of raw materials and improving labour productivity, modern logistics has become a “new source of profit” for enterprises and has received widespread attention from the logistics industry and even from the business community [1, 2]. Especially in the field of commodity circulation, different types of large-scale modern logistics enterprises have emerged. With the rapid development of the logistics industry, the study of logistics distribution has also attracted more widespread attention [3, 4]. How to reduce costs and at the same time improve efficiency, as well as obtain more economic and social benefits, has become a topic of research for experts and scholars.In modern logistics, the biggest cost of logistics and distribution is the transport cost, which in turn has a lot to do with the vehicle. Therefore, when carrying out distribution operations, the load capacity and volume of the vehicle should be fully considered [5, 6]. By selecting the right transport vehicle, the optimum utilisation of the transport vehicle (100% utilisation) is achieved as far as possible, which is an effective way to reduce distribution costs. However, in practical situations, the space utilisation and load capacity of the vehicle often cannot be maximised at the same time due to the type of goods, packaging methods, etc. These situations can waste transport power and cause an increase in transport costs. In logistics and distribution systems, the issue of cargo dispensing is the most fundamental item [7, 8]. Reasonable dispensing can improve distribution efficiency on the one hand and reduce distribution costs on the other. At present, in the actual cargo dispensing business, it is usually done based on manual estimation methods. There is no uniform planning based on experience alone, which wastes both manpower and material resources [9, 10]. Therefore, the rational allocation of goods is conducive to improving distribution efficiency, reducing distribution costs, and achieving higher vehicle utilisation. Therefore, due to its extensive application background and important theoretical value, the study of cargo dispensing has become an important research content in the logistics and distribution industry [11, 12].The key to the cargo dispensing problem is how to maximise the vehicle’s capacity and volume, thereby reducing distribution costs and improving distribution efficiency. It is a complex discrete multi-constrained combinatorial optimisation problem, which belongs to the NP problem like the traveler problem and workshop scheduling problem [13, 14]. And for solving NP problems, heuristic algorithms or intelligent optimisation algorithms are the most commonly used techniques. Solving cargo dispensing problems often requires the use of heuristic algorithms or intelligent optimisation algorithms to approximate the optimisation solution.There have been a number of studies on heuristic algorithms for cargo dispensing and loading problems. For example, Tran et al. [15] constructed a three-dimensional multilayer loading layout optimisation model with the maximisation of combined vehicle load and volume utilisation as the optimisation objective and designed a heuristic algorithm that can quickly develop a reasonable loading solution. Chua et al. [16] combined the two problems of vehicle dispensing optimization and transport path optimization into one and used the classical Dijkstra’s algorithm and the improved C–W saving algorithm to solve the optimisation problem for the full-load transportation case and the optimisation problem for the non-full-load transportation case, respectively. Experimental results show that the solution is effective. Du et al. [17] developed an intelligent cargo dispensing model with multidimensional constraints and proposed a hybrid algorithm based on heuristic ideas and fuzzy principles. The test results showed the effectiveness of this intelligent dispensing model. Chao et al. [18] established a cargo dispensing model with the optimisation objective of maximising revenue and minimising expenditure and used a heuristic algorithm to solve it. Finally, the effectiveness of this algorithm was verified by example. However, heuristic algorithms tend to rely too much on personal experience. When the problem is large, heuristics can become “combinatorially explosive.” As a result, heuristics are not very efficient when solving large-scale problems and lack global optimisation capabilities, giving only approximate or locally optimal solutions to the problem.Swarm intelligence algorithms are all inspired by the evolution of organisms in nature, foraging, clustering, and information exchange. At present, the main swarm intelligence optimisation algorithms are simulated annealing algorithms, genetic algorithms, particle swarm algorithms, ant colony algorithms, immune algorithms, etc. These intelligent optimisation algorithms are all easy to implement and have good robustness. When solving complex optimisation problems, the advantages of swarm intelligence algorithms are more obvious. For solving large-scale, multi-constrained complex problems, swarm intelligent optimisation algorithms are more widely used. For example, Jamrus et al. [19] used a genetic algorithm to investigate the optimal placement of containers and developed a corresponding single-vehicle transport dispensing model, while Miao et al. [20] designed a hybrid genetic algorithm and applied it to a multi-species cargo dispensing model. The experimental results showed that the above model could fully utilise the load and volume of the loading tools in a balanced manner. Sicilia et al. [21] used an ant colony algorithm to solve a bi-objective bulk cargo loading model and verified that the proposed model and algorithm were feasible through experiments.As an emerging swarm intelligence algorithm, the Wolf Pack algorithm exhibits good global convergence and computational robustness in the process of solving complex high-dimensional functions [22, 23]. During the hunting process, each wolf is classified into Alpha, Beta, or Omega wolves according to its different roles. Alpha wolves are always the strongest wolves in the pack and are responsible for directing the pack to capture prey without participating in the roaming, running, or siege process; Beta wolf is an elite unit of wolves, responsible for searching for prey; and Omega wolf is the attack force of wolves and is responsible for quickly closing in on the Alpha Wolf's direction when the Alpha Wolf initiates an attack command, in order to capture prey. Zhu et al. [24] proposed a Wolf Pack algorithm based on ant colony optimisation for solving the TSP problem. An ant colony algorithm was used to initialise the population in order to implement a heuristic crossover operator, while adaptive adjustment of the crossover probability and variation probability was employed. This algorithm achieves good optimisation results for smaller TSP problems. However, when the scale is larger, this algorithm needs further improvement. As an efficient intelligent optimisation algorithm, the Wolf Pack algorithm can provide a practical and effective solution to the cargo dispensing problem, thereby effectively reducing logistics costs (improving dispensing efficiency).Therefore, this study aims to use the Wolf Pack algorithm to solve the cargo dispensing problem in logistics distribution, so that it can effectively improve the solution quality. Although the Wolf Pack algorithm has good global search performance and superiority-seeking ability, the number of iterations and convergence speed need to be further improved. Therefore, this article improves the traditional Wolf Pack algorithm. In addition, this article provides a brief introduction to the components and classification of the cargo dispensing problem in logistics distribution and establishes a multi-vehicle, multi-goods mathematical model. The improved Wolf Pack algorithm in this article is used to solve this model in order to reduce the number of vehicles used, which can effectively improve the solution quality. The final experimental results validate the performance and application value of the improved algorithm.The main innovations and contributions of this article include:(1)
Through an in-depth study of the Wolf Pack algorithm, it was found that the location update method of Beta and Omega wolves has certain shortcomings, so the location update and step update of the Wolf Pack algorithm were improved respectively to achieve better optimisation search results.(2)
A mathematical model is described and developed for the multi-vehicle, multi-goods dispensing problem. The constraints of the model are deformed and transformed into a penalty function added to the fitness function. The model is solved using the proposed improved Wolf Pack algorithm to reduce the number of vehicles used, thus effectively improving the quality of the solution.The rest of the article is organised as follows: In Section2, the Wolf Pack algorithm is studied in detail, while Section 3 provides the improvements to the Wolf Pack algorithm. In Section 4, the multi-vehicle, multi-goods dispensing problem based on the improved Wolf Pack algorithm is studied in detail, while Section 5 provides experimental results and analysis. Finally, the article is concluded in Section 6.


## 2. Wolf Pack Algorithm

### 2.1. Principle of the Wolf Pack Algorithm

Each wolf is classified as an Alpha, Beta, or Omega wolf, depending on the role it plays in the hunting process [25, 26]. Alpha wolves are always the strongest wolves in the pack and are responsible for directing the pack to capture prey without participating in the roaming, running, or siege process; Beta wolf is an elite unit of wolves, responsible for searching for prey; and Omega wolf is the attack force of wolves and is responsible for the [27, 28]. The principle of the Wolf Pack algorithm is shown in Figure 1.Figure 1
Principle of the Wolf Pack algorithm.When a wolf perceives a greater concentration of prey than the current Alpha wolf, we consider that wolf to be more likely to capture the prey. That wolf will then replace the Alpha wolf and call the surrounding Omega wolves to approach the current location [29]. When the prey is caught, the earlier the wolf catches the prey, the more food it gets, which approach allows wolves capable of capturing prey to maintain sufficient stamina [30, 31]. Wolves with sufficient physical strength are more likely to catch prey in the later hunting process, thus ensuring the development of wolfs.The total number of wolves is assumed to beN and the total number of variables is D. The state of an artificial wolf is represented as Xi=xi1,xi2,…,xiD, wherexid denotes the position of the ith artificial wolf in the dth dimension. The objective function is Y=fx, where Y denotes the concentration value of prey perceived by a wolf, that is the degree of adaptation.


#### 2.1.1. Generation of Alpha Wolves

An Alpha wolf is an optimal value in the initial solution. An Alpha wolf is not fixed. During the iteration, the position of each wolf is updated continuously. If a better solution appears, the Alpha wolf is replaced by another wolf [32, 33].


#### 2.1.2. The Wandering Process of Beta Wolves

AmongN artificial wolves, the number of Beta wolves is S_num. The scale factor is denoted as a, the number of directions is h, and the wandering step is stepa. The fitness value of the Beta wolves in the initial solution is Yi. The Beta wolves then take a step forward in a direction (p = 1,2, ..., h) based on their current position. The position of the advancing Beta wolves in the dth dimension is updated.(1)xidp=xid+sin2π×ph×stepad.After updating the Beta wolf’s position, the adaptation valueYi of the Beta wolf’s current position is compared with the adaptation value Ylead of the Alpha wolf. If Yi >Ylead, this Beta wolf replaces the Alpha wolf, and the Omega wolf is called to run towards the current position; otherwise the wandering continues until the maximum number of times Tmax is reached.


#### 2.1.3. The Long-Range Raiding Process of Omega Wolves

Except Alpha wolf and Beta wolf, the remaining artificial wolves are Omega wolves. The number of Omega wolves is_num. When an Omega wolf receives a call from an Alpha wolf, it will run in the direction of the Alpha wolf. The step length of the long-range raid is stepb. The position of the Omega wolf in the dth dimension is updated at the (k+1)th iteration.(2)xidk+1=xidk+stepbd×gdk−xidkgdk−xidk,where gdk is the position in the d-th dimension of the Alpha wolf at the (k+1)th iteration.When the distance between the Omega wolf and the Alpha wolf is less thandnear, it enters into a siege process of its prey.(3)dnear=1D×ω×∑d=1Dmaxd−mind,where ω is the decision factor and maxd−mind is the range of values for the dth dimensional variable.


#### 2.1.4. The Siege Process of Prey

Because Alpha wolves are closest to the prey, the position of Alpha wolves is considered to be the position of the preyGdk. The siege step of the wolves in the prey siege process is stepc. Location updates are calculated as follows:(4)xidk+1=xidk+λ×stepcd×Gdk−xidk,where λ is a random number between [1].There is a relationship between the step sizes of the three different stages.(5)stepad=stepbd2=stepcd×2=maxd−mindS.During the siege process of a wolf pack, the position is updated if the adaptation of the current position is greater than the adaptation of the original position; otherwise, the position remains unchanged.


#### 2.1.5. Renewal of Wolf Pack

In order to maintain the quality of the wolf population while preserving the diversity of the pack, the least adapted wolves are selected for culling and new artificial wolves are randomly generated [34–37]. The number of eliminated artificial wolves is the same as the number of newborn artificial wolves. The number of retirements needs to be determined by human experience.


### 2.2. Flow Chart of the Wolf Pack Algorithm

Figure2 shows the flow chart of the Wolf Pack algorithm.Figure 2
Flow of the Wolf Pack algorithm.The detailed steps of the Wolf Pack algorithm are as follows:Step 1: Initialise the number of artificial wolvesN, the position Xi, the maximum number of generations to be selected kmax, the scale factor a, the maximum number of wanderings Tmax, the distance determination factor ω, and the step size factor S.Step 2: Follow equation (1) for position update. If the Beta wolf’s fitness value Yi is greater than the Alpha wolf’s fitness value Ylead, replace Alpha wolf and jump to Step 3; otherwise, the Beta wolf continues to wander until the maximum number of wanderings Tmax is reached.Step 3: Follow equation (2) for position update. If the fitness value of an Omega wolf Yi is greater than the fitness value of an Alpha wolf Ylead, replace the Alpha wolf; otherwise, the Omega wolf continues to long-range raid until the distance to the prey is less than the judged distance dnear.Step 4: Begin the wolf pack siege process and carry out the position update according to equation (5), together with the Alpha wolf update.Step 5: Update Wolf Pack.Step 6: Determine whether the maximum number of iterations is reached or the optimisation accuracy is achieved. If yes, the output of the optimal solution is carried out; otherwise jump to Step 2.


## 2.1. Principle of the Wolf Pack Algorithm

Each wolf is classified as an Alpha, Beta, or Omega wolf, depending on the role it plays in the hunting process [25, 26]. Alpha wolves are always the strongest wolves in the pack and are responsible for directing the pack to capture prey without participating in the roaming, running, or siege process; Beta wolf is an elite unit of wolves, responsible for searching for prey; and Omega wolf is the attack force of wolves and is responsible for the [27, 28]. The principle of the Wolf Pack algorithm is shown in Figure 1.Figure 1
Principle of the Wolf Pack algorithm.When a wolf perceives a greater concentration of prey than the current Alpha wolf, we consider that wolf to be more likely to capture the prey. That wolf will then replace the Alpha wolf and call the surrounding Omega wolves to approach the current location [29]. When the prey is caught, the earlier the wolf catches the prey, the more food it gets, which approach allows wolves capable of capturing prey to maintain sufficient stamina [30, 31]. Wolves with sufficient physical strength are more likely to catch prey in the later hunting process, thus ensuring the development of wolfs.The total number of wolves is assumed to beN and the total number of variables is D. The state of an artificial wolf is represented as Xi=xi1,xi2,…,xiD, wherexid denotes the position of the ith artificial wolf in the dth dimension. The objective function is Y=fx, where Y denotes the concentration value of prey perceived by a wolf, that is the degree of adaptation.


### 2.1.1. Generation of Alpha Wolves

An Alpha wolf is an optimal value in the initial solution. An Alpha wolf is not fixed. During the iteration, the position of each wolf is updated continuously. If a better solution appears, the Alpha wolf is replaced by another wolf [32, 33].


### 2.1.2. The Wandering Process of Beta Wolves

AmongN artificial wolves, the number of Beta wolves is S_num. The scale factor is denoted as a, the number of directions is h, and the wandering step is stepa. The fitness value of the Beta wolves in the initial solution is Yi. The Beta wolves then take a step forward in a direction (p = 1,2, ..., h) based on their current position. The position of the advancing Beta wolves in the dth dimension is updated.(1)xidp=xid+sin2π×ph×stepad.After updating the Beta wolf’s position, the adaptation valueYi of the Beta wolf’s current position is compared with the adaptation value Ylead of the Alpha wolf. If Yi >Ylead, this Beta wolf replaces the Alpha wolf, and the Omega wolf is called to run towards the current position; otherwise the wandering continues until the maximum number of times Tmax is reached.


### 2.1.3. The Long-Range Raiding Process of Omega Wolves

Except Alpha wolf and Beta wolf, the remaining artificial wolves are Omega wolves. The number of Omega wolves is_num. When an Omega wolf receives a call from an Alpha wolf, it will run in the direction of the Alpha wolf. The step length of the long-range raid is stepb. The position of the Omega wolf in the dth dimension is updated at the (k+1)th iteration.(2)xidk+1=xidk+stepbd×gdk−xidkgdk−xidk,where gdk is the position in the d-th dimension of the Alpha wolf at the (k+1)th iteration.When the distance between the Omega wolf and the Alpha wolf is less thandnear, it enters into a siege process of its prey.(3)dnear=1D×ω×∑d=1Dmaxd−mind,where ω is the decision factor and maxd−mind is the range of values for the dth dimensional variable.


### 2.1.4. The Siege Process of Prey

Because Alpha wolves are closest to the prey, the position of Alpha wolves is considered to be the position of the preyGdk. The siege step of the wolves in the prey siege process is stepc. Location updates are calculated as follows:(4)xidk+1=xidk+λ×stepcd×Gdk−xidk,where λ is a random number between [1].There is a relationship between the step sizes of the three different stages.(5)stepad=stepbd2=stepcd×2=maxd−mindS.During the siege process of a wolf pack, the position is updated if the adaptation of the current position is greater than the adaptation of the original position; otherwise, the position remains unchanged.


### 2.1.5. Renewal of Wolf Pack

In order to maintain the quality of the wolf population while preserving the diversity of the pack, the least adapted wolves are selected for culling and new artificial wolves are randomly generated [34–37]. The number of eliminated artificial wolves is the same as the number of newborn artificial wolves. The number of retirements needs to be determined by human experience.


## 2.1.1. Generation of Alpha Wolves

An Alpha wolf is an optimal value in the initial solution. An Alpha wolf is not fixed. During the iteration, the position of each wolf is updated continuously. If a better solution appears, the Alpha wolf is replaced by another wolf [32, 33].


## 2.1.2. The Wandering Process of Beta Wolves

AmongN artificial wolves, the number of Beta wolves is S_num. The scale factor is denoted as a, the number of directions is h, and the wandering step is stepa. The fitness value of the Beta wolves in the initial solution is Yi. The Beta wolves then take a step forward in a direction (p = 1,2, ..., h) based on their current position. The position of the advancing Beta wolves in the dth dimension is updated.(1)xidp=xid+sin2π×ph×stepad.After updating the Beta wolf’s position, the adaptation valueYi of the Beta wolf’s current position is compared with the adaptation value Ylead of the Alpha wolf. If Yi >Ylead, this Beta wolf replaces the Alpha wolf, and the Omega wolf is called to run towards the current position; otherwise the wandering continues until the maximum number of times Tmax is reached.


## 2.1.3. The Long-Range Raiding Process of Omega Wolves

Except Alpha wolf and Beta wolf, the remaining artificial wolves are Omega wolves. The number of Omega wolves is_num. When an Omega wolf receives a call from an Alpha wolf, it will run in the direction of the Alpha wolf. The step length of the long-range raid is stepb. The position of the Omega wolf in the dth dimension is updated at the (k+1)th iteration.(2)xidk+1=xidk+stepbd×gdk−xidkgdk−xidk,where gdk is the position in the d-th dimension of the Alpha wolf at the (k+1)th iteration.When the distance between the Omega wolf and the Alpha wolf is less thandnear, it enters into a siege process of its prey.(3)dnear=1D×ω×∑d=1Dmaxd−mind,where ω is the decision factor and maxd−mind is the range of values for the dth dimensional variable.


## 2.1.4. The Siege Process of Prey

Because Alpha wolves are closest to the prey, the position of Alpha wolves is considered to be the position of the preyGdk. The siege step of the wolves in the prey siege process is stepc. Location updates are calculated as follows:(4)xidk+1=xidk+λ×stepcd×Gdk−xidk,where λ is a random number between [1].There is a relationship between the step sizes of the three different stages.(5)stepad=stepbd2=stepcd×2=maxd−mindS.During the siege process of a wolf pack, the position is updated if the adaptation of the current position is greater than the adaptation of the original position; otherwise, the position remains unchanged.


## 2.1.5. Renewal of Wolf Pack

In order to maintain the quality of the wolf population while preserving the diversity of the pack, the least adapted wolves are selected for culling and new artificial wolves are randomly generated [34–37]. The number of eliminated artificial wolves is the same as the number of newborn artificial wolves. The number of retirements needs to be determined by human experience.


## 2.2. Flow Chart of the Wolf Pack Algorithm

Figure2 shows the flow chart of the Wolf Pack algorithm.Figure 2
Flow of the Wolf Pack algorithm.The detailed steps of the Wolf Pack algorithm are as follows:Step 1: Initialise the number of artificial wolvesN, the position Xi, the maximum number of generations to be selected kmax, the scale factor a, the maximum number of wanderings Tmax, the distance determination factor ω, and the step size factor S.Step 2: Follow equation (1) for position update. If the Beta wolf’s fitness value Yi is greater than the Alpha wolf’s fitness value Ylead, replace Alpha wolf and jump to Step 3; otherwise, the Beta wolf continues to wander until the maximum number of wanderings Tmax is reached.Step 3: Follow equation (2) for position update. If the fitness value of an Omega wolf Yi is greater than the fitness value of an Alpha wolf Ylead, replace the Alpha wolf; otherwise, the Omega wolf continues to long-range raid until the distance to the prey is less than the judged distance dnear.Step 4: Begin the wolf pack siege process and carry out the position update according to equation (5), together with the Alpha wolf update.Step 5: Update Wolf Pack.Step 6: Determine whether the maximum number of iterations is reached or the optimisation accuracy is achieved. If yes, the output of the optimal solution is carried out; otherwise jump to Step 2.


## 3. Improvements to the Wolf Pack Algorithm

After an in-depth study of the Wolf Pack algorithm, it was found that position update methods have certain shortcomings for Beta wolf and Omega wolf. Therefore, in this article, the Wolf Pack algorithm is improved in order to achieve better merit-seeking results.


### 3.1. Location Update

The Beta wolf’s position during the wandering phase [38] was updated as follows:(6)xidp=xid+sin2π×ph×stepad,where h is the number of directions in Beta wolf’s wandering process.In most cases, the value ofh is 4. The calculation shows that there are only two values for updating the position of the Beta wolf.(7)xid1=xid+stepad,xid3=xid−stepad,xid2=xid4=xid.That is, when Beta wolves wander in each of the four directions, they are only able to obtain two values that are different from their original position. This increases the computational effort and weakens the ability of Beta wolves to wander [39].Therefore, the updated formula for the wandering phase has been improved in this article.(8)xidp=xid+cosπ×ph×stepad.Whenh takes the value of 4, the Beta wolf’s position is updated with a value of 3.(9)xid1=xid+22stepad,xid3=xid−22stepad,xid4=xid−stepad.The improvement ensures that when Beta wolves wander in more than one direction, at most one value can be the same as the original position value.


### 3.2. Step Size Update

The step size of the long-range raiding and the step size of the siege are always fixed. However, as the distance between the wolves and their prey decreases (increasing number of iterations), both step values should decrease adaptively.Therefore, this article uses an adaptive approach to improve the update process of the step size.(10)xidk+1=xidk+1−kkmax×stepbd×gdk−xidkgdk−xidk,xidk+1=xidk+λ×1−kkmax×stepcd×Gdk−xidk,where k is the current number of iterations and kmax is the maximum number of iterations.


## 3.1. Location Update

The Beta wolf’s position during the wandering phase [38] was updated as follows:(6)xidp=xid+sin2π×ph×stepad,where h is the number of directions in Beta wolf’s wandering process.In most cases, the value ofh is 4. The calculation shows that there are only two values for updating the position of the Beta wolf.(7)xid1=xid+stepad,xid3=xid−stepad,xid2=xid4=xid.That is, when Beta wolves wander in each of the four directions, they are only able to obtain two values that are different from their original position. This increases the computational effort and weakens the ability of Beta wolves to wander [39].Therefore, the updated formula for the wandering phase has been improved in this article.(8)xidp=xid+cosπ×ph×stepad.Whenh takes the value of 4, the Beta wolf’s position is updated with a value of 3.(9)xid1=xid+22stepad,xid3=xid−22stepad,xid4=xid−stepad.The improvement ensures that when Beta wolves wander in more than one direction, at most one value can be the same as the original position value.


## 3.2. Step Size Update

The step size of the long-range raiding and the step size of the siege are always fixed. However, as the distance between the wolves and their prey decreases (increasing number of iterations), both step values should decrease adaptively.Therefore, this article uses an adaptive approach to improve the update process of the step size.(10)xidk+1=xidk+1−kkmax×stepbd×gdk−xidkgdk−xidk,xidk+1=xidk+λ×1−kkmax×stepcd×Gdk−xidk,where k is the current number of iterations and kmax is the maximum number of iterations.


## 4. Multi-Vehicle, Multi-Goods Dispensing Problem Based on the Improved Wolf Pack Algorithm

### 4.1. Description of Cargo Dispensing Problems

As a fundamental part of logistics and distribution, the quality of the cargo dispensing has an impact not only on the efficiency of distribution, but also on the operational efficiency of the entire logistics centre. Therefore, a reasonable cargo dispensing can reduce logistics costs, on the one hand, and improve the efficiency of distribution on the other. The dispensing problem is a complex discrete multi-constrained combinatorial optimisation problem, which belongs to the same NP problem as the travel merchant problem (TSP) and the workshop scheduling problem. The main components of the cargo dispensing problem are goods, vehicles, constraints, objective functions, etc. [40]. The volume and weight of the cargo are the basis for the decision of vehicle allocation. When the volume or weight of the cargo exceeds the volume or capacity of the vehicle, multiple transport vehicles are required to distribute it. A general description of the cargo dispensing problem is shown in Figure 3.Figure 3
General description of the cargo dispensing problem.


### 4.2. Problem Description and Mathematical Model

Real-life cargo dispensing problems are very complex, and to facilitate modelling and solution, some cases are simplified: (1) the goods are all shipped to the same distribution centre; (2) the goods are intermixable and not incompatible; (3) there is no priority of goods.Problem description: In a distribution centre, there arem vehicles of different types. Each vehicle has a maximum weight and a maximum volume of wk and vk (k = 1,2, ..., m), respectively. There are n different goods to be dispensed, with weights and volumes of wi and vi (i = 1,2, ..., n), respectively. Under the condition that the goods are relatively limited, the number of vehicles to be used is required to reach a minimum value.The mathematical model for the multi-vehicle, multi-goods dispensing problem presented in this article is shown as follows:(11)minf=∑k=1myk,∑i=1nxkiwi≤ykWk,∑i=1nxkivi≤ykVk,∑k=1mxki=1,(12)yk=1,0,Thekthvehicleisselected,Thekthvehicleisnotselected,(13)xki=1,0,Theithshipmentisloadedintothekthvehicle,Theithshipmentisnotloadedintothekthvehicle.The objective function is (11). It can be seen that the objective function is a minimum optimisation problem, that is, the number of vehicles used is the least. The constraint indicates that the total weight of the cargo on the kth vehicle does not exceed the capacity of the vehicle. (12) and (13) represent the constraints on the values taken by the variables yk and xki.


### 4.3. Fitness Function

Fitness function is the optimisation index of wolf pack algorithm and the important basis of survival of the fittest in the siege process. In the mathematical model of multi-vehicle and multi-goods allocation, the objective function cannot be directly used as the fitness function due to more constraints. Therefore, this article uses the penalty function to construct the fitness function.(14)minF=f+c∑kmmax0,gk2+max0,hk2,gk=∑i=1nxkiwi−ykWk,hk=∑i=1nxkivi−ykVk,where c is the penalty factor.The optimisation process of the Wolf Pack algorithm is a maximum value problem, so a further transformation has to be performed to obtain the optimisation fitness function of the Wolf Pack algorithm.(15)maxFitF=−F.


## 4.1. Description of Cargo Dispensing Problems

As a fundamental part of logistics and distribution, the quality of the cargo dispensing has an impact not only on the efficiency of distribution, but also on the operational efficiency of the entire logistics centre. Therefore, a reasonable cargo dispensing can reduce logistics costs, on the one hand, and improve the efficiency of distribution on the other. The dispensing problem is a complex discrete multi-constrained combinatorial optimisation problem, which belongs to the same NP problem as the travel merchant problem (TSP) and the workshop scheduling problem. The main components of the cargo dispensing problem are goods, vehicles, constraints, objective functions, etc. [40]. The volume and weight of the cargo are the basis for the decision of vehicle allocation. When the volume or weight of the cargo exceeds the volume or capacity of the vehicle, multiple transport vehicles are required to distribute it. A general description of the cargo dispensing problem is shown in Figure 3.Figure 3
General description of the cargo dispensing problem.


## 4.2. Problem Description and Mathematical Model

Real-life cargo dispensing problems are very complex, and to facilitate modelling and solution, some cases are simplified: (1) the goods are all shipped to the same distribution centre; (2) the goods are intermixable and not incompatible; (3) there is no priority of goods.Problem description: In a distribution centre, there arem vehicles of different types. Each vehicle has a maximum weight and a maximum volume of wk and vk (k = 1,2, ..., m), respectively. There are n different goods to be dispensed, with weights and volumes of wi and vi (i = 1,2, ..., n), respectively. Under the condition that the goods are relatively limited, the number of vehicles to be used is required to reach a minimum value.The mathematical model for the multi-vehicle, multi-goods dispensing problem presented in this article is shown as follows:(11)minf=∑k=1myk,∑i=1nxkiwi≤ykWk,∑i=1nxkivi≤ykVk,∑k=1mxki=1,(12)yk=1,0,Thekthvehicleisselected,Thekthvehicleisnotselected,(13)xki=1,0,Theithshipmentisloadedintothekthvehicle,Theithshipmentisnotloadedintothekthvehicle.The objective function is (11). It can be seen that the objective function is a minimum optimisation problem, that is, the number of vehicles used is the least. The constraint indicates that the total weight of the cargo on the kth vehicle does not exceed the capacity of the vehicle. (12) and (13) represent the constraints on the values taken by the variables yk and xki.


## 4.3. Fitness Function

Fitness function is the optimisation index of wolf pack algorithm and the important basis of survival of the fittest in the siege process. In the mathematical model of multi-vehicle and multi-goods allocation, the objective function cannot be directly used as the fitness function due to more constraints. Therefore, this article uses the penalty function to construct the fitness function.(14)minF=f+c∑kmmax0,gk2+max0,hk2,gk=∑i=1nxkiwi−ykWk,hk=∑i=1nxkivi−ykVk,where c is the penalty factor.The optimisation process of the Wolf Pack algorithm is a maximum value problem, so a further transformation has to be performed to obtain the optimisation fitness function of the Wolf Pack algorithm.(15)maxFitF=−F.


## 5. Experimental Results and Analysis

### 5.1. Experimental Environment and Setup

In order to verify the effectiveness of a multi-vehicle, multi-cargo dispensing model based on the improved Wolf Pack algorithm, simulation tests were carried out using MATLAB. The hardware and software environments associated with the experiments are shown in Table1. In addition, all experiments involved in this study were carried out in the same hardware and software environment. The parameter settings for the improved Wolf Pack algorithm during the experiments are shown in Table 2.Table 1
Experiment-related software and hardware environment and parameter settings.
SpecificationParametersProcessorIntel Core i7Memory8 GBHard disk500 GBOperating systemsWindows 10 ProfessionalProgramming softwareMATLAB R2012aTable 2
Parameter settings for the improved Wolf Pack algorithm.
ParametersNumerical valuesWolf population50Maximum number of iterations20Scale factor for Beta wolves4Maximum number of wanderings for Beta wolves20Number of directions for Beta wolves4Distance determination factor500Step size factor1000Updating the scale factor6


### 5.2. Typical Test Function Verification

Five typical continuous complexity functions are selected to verify the effectiveness and feasibility of the proposed improved wolf pack algorithm and to compare it with the traditional wolf pack algorithm.(16)F1=x12+x22,−5≤xi≤5,i=1,2,F2=100x12−x22+1−x12,−2.048≤xi≤2.048,i=1,2,F3=1+x1+x2+1219−14x1+3x12−14x2+6x1x2+3x22×30+2x1−3x2218−32x1+12x12+48x2−36x1x2+27x22,−2≤xi≤2,i=1,2,F4=4−2.1x12+13x14x12+x1x2+−4+4x22x22,−3≤xi≤3,i=1,2F5=10cos2πx1+10cos2πx2−x12−x22−20,−5.12≤xi≤5.12,i=1,2.In order to illustrate the convergence and optimisation seeking ability of the improved Wolf Pack algorithm in this article, a comparison was made with the genetic algorithm and the traditional Wolf Pack algorithm on the above five test functions. Figure4 shows the optimisation process curves of the three algorithms on the test function F1. Figure 5 shows the optimisation curves of the three algorithms on the test function F2Figure 4
Optimisation curve for theF1 function.Figure 5
Optimisation curve for theF2 function.It can be seen that the genetic algorithm can only converge to a local optimum. Both the traditional Wolf Pack algorithm and the improved Wolf Pack algorithm can converge to the global optimum, while the improved Wolf Pack algorithm converges faster, indicating that the improved Wolf Pack algorithm in this article can greatly improve the efficiency of the search for the optimum. In order to further illustrate the optimisation finding ability of the improved Wolf Pack algorithm in this article, 100 calculations were carried out for each of the five test functions. Then, four metrics, the best value, the worst value, the average value, and the average deviation value (the deviation of the average value from the theoretical optimum value), were used to evaluate the results. A comparison of the test function optimisation results is shown in Table3.Table 3
Comparison of test function optimisation results.
FunctionsAlgorithmsBest valueWorst valueAverageAverage deviation valueF1Genetic algorithm2.15E-051.01730.13020.1302Traditional Wolf Pack4.55E-111.17E-051.65E-071.65E-07Improved Wolf Pack4.55E-114.55E-114.55E-114.55E-11F2Genetic algorithm8.63E-042.82170.642090.64209Traditional Wolf Pack1.08E-105.76E-022.63E-032.63E-03Improved Wolf Pack1.01E-101.94E-032.30E-042.30E-04F3Genetic algorithm3.009496.990619.877716.8777Traditional Wolf Pack33.00023 + 7.79E-067.79E-06Improved Wolf Pack33 + 5.63E-093 + 1.47E-091.47E-09F4Genetic algorithm−1.03068005−0.122028−0.7549280.2767Traditional Wolf Pack−1.03162779−0.999872−1.02767373.95E-03Improved Wolf Pack−1.03162779−1.03153801−1.031610981.70E-05F5Genetic algorithm−1.0174−12.6704−4.99794.9979Traditional Wolf Pack−9.46E-09−1.2372−0.13190.1319Improved Wolf Pack−9.46E-09−9.46E-09−9.46E-099.46E-09The best, worst, and average values show that the solution quality of the improved Wolf Pack algorithm is significantly better than that of the genetic algorithm and the traditional Wolf Pack algorithm. The highest accuracy was obtained by the improved Wolf Pack algorithm. In terms of the average deviation value, the improved wolf pack algorithm has the smallest value, that is the smallest difference from the theoretical optimum.The global search capability of the three algorithms was then judged by the number of convergences. A comparison of the convergence results on the five test functions is shown in Table4. The maximum number of evolutionary generations was set to 1000. 100 tests were performed for each algorithm. The convergence accuracy was 10−3. These algorithms were considered to have reached the convergence condition when the difference between the optimised value and the theoretical optimum was less than 10−3.Table 4
Comparison of convergence results of test functions.
FunctionsAlgorithmsMaximum number of iterationsMinimum number of iterationsAverage number of iterationsAverage convergence time/sNumber of convergencesF1Genetic algorithm1000849779.1574Traditional Wolf Pack53911460.539100Improved Wolf Pack607260.304100F2Genetic algorithm100029909.43311Traditional Wolf Pack100024425.38761Improved Wolf Pack947122192.681100F3Genetic algorithm1000100010009.5820Traditional Wolf Pack600231151.419100Improved Wolf Pack16221660.823100F4Genetic algorithm100019709.9053Traditional Wolf Pack1000162563.22478Improved Wolf Pack3261520.654100F5Genetic algorithm1000100010009.4620Traditional Wolf Pack1000432933.56089Improved Wolf Pack355171041.282100It can be seen that the improved Wolf Pack algorithm converges 100 times on all five test functions, indicating that it is able to achieve global convergence with 100% probability, that is it is more stable. The genetic algorithm has the worst convergence, with only 4 out of 100 experimental tests, indicating that it is prone to fall into the local extreme value trap. Compared to the traditional wolf pack algorithm, the improved wolf pack algorithm takes 40% less time to reach convergence, indicating that it can converge to the global optimum more quickly. Overall, the number of convergence iterations and convergence time of the improved wolf pack algorithm are the lowest.


### 5.3. Experimental Cases

Suppose a distribution centre has 20 delivery vehicles with a load and volume of 6t and 10 m3, respectively. There are 42 different types of goods to be dispensed. The goods now need to be rationally dispensed and the minimum number of vehicles to be used are required. The numbers, weights, and volumes of all goods are shown in Table 5.Table 5
Number, weight, and volume of goods.
No.Weight/tVolume/m3No.Weight/tVolume/m3No.Weight/tVolume/m311.2211.05151.0402.60291.1022.4621.1561.98160.8051.23302.0412.2030.7002.00171.2200.65311.9002.8041.2433.14181.0002.40322.4003.2031.6002.86191.7820.87331.0293.0061.6122.17201.1001.54343.0001.2072.3004.80211.0305.60351.8401.2081.9305.20220.7304.40361.7963.8991.8502.30231.0301.80372.6501.01101.9003.80242.4303.80381.975123111.1202.00251.5204.00390.8001.00121.4314.02261.8905.46401.1003.20130.6002.78271.3203.54411.2000.80140.3063.22281.1501.60422.0001.10The experiment was carried out for 40 calculations. Both the conventional Wolf Pack algorithm and the modified Wolf Pack algorithm yielded an optimal solution of 12 after 40 calculations, which indicates that a minimum of 12 vehicles are required. An optimal dispensing solution is shown in Table6.Table 6
The solution of dispensing.
Vehicle no.Goods no.Total weight/tTotal volume/m3Load utilisation (%)Volume utilisation (%)122, 23, 30, 355.6419.694.029621, 4, 7, 415.9649.7999.497.959, 16, 18, 274.9759.4782.9294.7720, 36, 40, 425.9969.7399.9397.386, 14, 28, 334.0979.9968.2899.992, 10, 19, 295.949.119991.1125, 17, 264.718.9778.589.71311, 24, 255.079.884.598143, 12, 345.1317.2285.5272.2168, 324.338.472.17841921, 37, 385.6557.8494.2578.42013, 15, 31, 394.349.1872.3391.8When using the improved particle swarm algorithm (IPSO) to solve the same multi-vehicle, multi-goods dispensing problem, the best value is 13 in 35 out of 40 operations and the worst value is 16. When using the improved genetic algorithm (IGA) to solve the same vehicle dispensing problem, the best value is 13 in 36 out of 40 operations and the worst value is 17. The results of the different algorithms are compared in Table7 and Figure 6. It can be seen that the improved Wolf Pack algorithm has better optimisation capability and better stability in solving multi-vehicle and multi-goods dispensing problems.Table 7
Optimisation results.
AlgorithmsBest valueWorst valueProbability of best value (%)IPSO [41]131687.5IGA [42]131790Wolf Pack algorithm1315100Improved Wolf Pack algorithm1212100Figure 6
Comparison results of the optimising performance.


## 5.1. Experimental Environment and Setup

In order to verify the effectiveness of a multi-vehicle, multi-cargo dispensing model based on the improved Wolf Pack algorithm, simulation tests were carried out using MATLAB. The hardware and software environments associated with the experiments are shown in Table1. In addition, all experiments involved in this study were carried out in the same hardware and software environment. The parameter settings for the improved Wolf Pack algorithm during the experiments are shown in Table 2.Table 1
Experiment-related software and hardware environment and parameter settings.
SpecificationParametersProcessorIntel Core i7Memory8 GBHard disk500 GBOperating systemsWindows 10 ProfessionalProgramming softwareMATLAB R2012aTable 2
Parameter settings for the improved Wolf Pack algorithm.
ParametersNumerical valuesWolf population50Maximum number of iterations20Scale factor for Beta wolves4Maximum number of wanderings for Beta wolves20Number of directions for Beta wolves4Distance determination factor500Step size factor1000Updating the scale factor6


## 5.2. Typical Test Function Verification

Five typical continuous complexity functions are selected to verify the effectiveness and feasibility of the proposed improved wolf pack algorithm and to compare it with the traditional wolf pack algorithm.(16)F1=x12+x22,−5≤xi≤5,i=1,2,F2=100x12−x22+1−x12,−2.048≤xi≤2.048,i=1,2,F3=1+x1+x2+1219−14x1+3x12−14x2+6x1x2+3x22×30+2x1−3x2218−32x1+12x12+48x2−36x1x2+27x22,−2≤xi≤2,i=1,2,F4=4−2.1x12+13x14x12+x1x2+−4+4x22x22,−3≤xi≤3,i=1,2F5=10cos2πx1+10cos2πx2−x12−x22−20,−5.12≤xi≤5.12,i=1,2.In order to illustrate the convergence and optimisation seeking ability of the improved Wolf Pack algorithm in this article, a comparison was made with the genetic algorithm and the traditional Wolf Pack algorithm on the above five test functions. Figure4 shows the optimisation process curves of the three algorithms on the test function F1. Figure 5 shows the optimisation curves of the three algorithms on the test function F2Figure 4
Optimisation curve for theF1 function.Figure 5
Optimisation curve for theF2 function.It can be seen that the genetic algorithm can only converge to a local optimum. Both the traditional Wolf Pack algorithm and the improved Wolf Pack algorithm can converge to the global optimum, while the improved Wolf Pack algorithm converges faster, indicating that the improved Wolf Pack algorithm in this article can greatly improve the efficiency of the search for the optimum. In order to further illustrate the optimisation finding ability of the improved Wolf Pack algorithm in this article, 100 calculations were carried out for each of the five test functions. Then, four metrics, the best value, the worst value, the average value, and the average deviation value (the deviation of the average value from the theoretical optimum value), were used to evaluate the results. A comparison of the test function optimisation results is shown in Table3.Table 3
Comparison of test function optimisation results.
FunctionsAlgorithmsBest valueWorst valueAverageAverage deviation valueF1Genetic algorithm2.15E-051.01730.13020.1302Traditional Wolf Pack4.55E-111.17E-051.65E-071.65E-07Improved Wolf Pack4.55E-114.55E-114.55E-114.55E-11F2Genetic algorithm8.63E-042.82170.642090.64209Traditional Wolf Pack1.08E-105.76E-022.63E-032.63E-03Improved Wolf Pack1.01E-101.94E-032.30E-042.30E-04F3Genetic algorithm3.009496.990619.877716.8777Traditional Wolf Pack33.00023 + 7.79E-067.79E-06Improved Wolf Pack33 + 5.63E-093 + 1.47E-091.47E-09F4Genetic algorithm−1.03068005−0.122028−0.7549280.2767Traditional Wolf Pack−1.03162779−0.999872−1.02767373.95E-03Improved Wolf Pack−1.03162779−1.03153801−1.031610981.70E-05F5Genetic algorithm−1.0174−12.6704−4.99794.9979Traditional Wolf Pack−9.46E-09−1.2372−0.13190.1319Improved Wolf Pack−9.46E-09−9.46E-09−9.46E-099.46E-09The best, worst, and average values show that the solution quality of the improved Wolf Pack algorithm is significantly better than that of the genetic algorithm and the traditional Wolf Pack algorithm. The highest accuracy was obtained by the improved Wolf Pack algorithm. In terms of the average deviation value, the improved wolf pack algorithm has the smallest value, that is the smallest difference from the theoretical optimum.The global search capability of the three algorithms was then judged by the number of convergences. A comparison of the convergence results on the five test functions is shown in Table4. The maximum number of evolutionary generations was set to 1000. 100 tests were performed for each algorithm. The convergence accuracy was 10−3. These algorithms were considered to have reached the convergence condition when the difference between the optimised value and the theoretical optimum was less than 10−3.Table 4
Comparison of convergence results of test functions.
FunctionsAlgorithmsMaximum number of iterationsMinimum number of iterationsAverage number of iterationsAverage convergence time/sNumber of convergencesF1Genetic algorithm1000849779.1574Traditional Wolf Pack53911460.539100Improved Wolf Pack607260.304100F2Genetic algorithm100029909.43311Traditional Wolf Pack100024425.38761Improved Wolf Pack947122192.681100F3Genetic algorithm1000100010009.5820Traditional Wolf Pack600231151.419100Improved Wolf Pack16221660.823100F4Genetic algorithm100019709.9053Traditional Wolf Pack1000162563.22478Improved Wolf Pack3261520.654100F5Genetic algorithm1000100010009.4620Traditional Wolf Pack1000432933.56089Improved Wolf Pack355171041.282100It can be seen that the improved Wolf Pack algorithm converges 100 times on all five test functions, indicating that it is able to achieve global convergence with 100% probability, that is it is more stable. The genetic algorithm has the worst convergence, with only 4 out of 100 experimental tests, indicating that it is prone to fall into the local extreme value trap. Compared to the traditional wolf pack algorithm, the improved wolf pack algorithm takes 40% less time to reach convergence, indicating that it can converge to the global optimum more quickly. Overall, the number of convergence iterations and convergence time of the improved wolf pack algorithm are the lowest.


## 5.3. Experimental Cases

Suppose a distribution centre has 20 delivery vehicles with a load and volume of 6t and 10 m3, respectively. There are 42 different types of goods to be dispensed. The goods now need to be rationally dispensed and the minimum number of vehicles to be used are required. The numbers, weights, and volumes of all goods are shown in Table 5.Table 5
Number, weight, and volume of goods.
No.Weight/tVolume/m3No.Weight/tVolume/m3No.Weight/tVolume/m311.2211.05151.0402.60291.1022.4621.1561.98160.8051.23302.0412.2030.7002.00171.2200.65311.9002.8041.2433.14181.0002.40322.4003.2031.6002.86191.7820.87331.0293.0061.6122.17201.1001.54343.0001.2072.3004.80211.0305.60351.8401.2081.9305.20220.7304.40361.7963.8991.8502.30231.0301.80372.6501.01101.9003.80242.4303.80381.975123111.1202.00251.5204.00390.8001.00121.4314.02261.8905.46401.1003.20130.6002.78271.3203.54411.2000.80140.3063.22281.1501.60422.0001.10The experiment was carried out for 40 calculations. Both the conventional Wolf Pack algorithm and the modified Wolf Pack algorithm yielded an optimal solution of 12 after 40 calculations, which indicates that a minimum of 12 vehicles are required. An optimal dispensing solution is shown in Table6.Table 6
The solution of dispensing.
Vehicle no.Goods no.Total weight/tTotal volume/m3Load utilisation (%)Volume utilisation (%)122, 23, 30, 355.6419.694.029621, 4, 7, 415.9649.7999.497.959, 16, 18, 274.9759.4782.9294.7720, 36, 40, 425.9969.7399.9397.386, 14, 28, 334.0979.9968.2899.992, 10, 19, 295.949.119991.1125, 17, 264.718.9778.589.71311, 24, 255.079.884.598143, 12, 345.1317.2285.5272.2168, 324.338.472.17841921, 37, 385.6557.8494.2578.42013, 15, 31, 394.349.1872.3391.8When using the improved particle swarm algorithm (IPSO) to solve the same multi-vehicle, multi-goods dispensing problem, the best value is 13 in 35 out of 40 operations and the worst value is 16. When using the improved genetic algorithm (IGA) to solve the same vehicle dispensing problem, the best value is 13 in 36 out of 40 operations and the worst value is 17. The results of the different algorithms are compared in Table7 and Figure 6. It can be seen that the improved Wolf Pack algorithm has better optimisation capability and better stability in solving multi-vehicle and multi-goods dispensing problems.Table 7
Optimisation results.
AlgorithmsBest valueWorst valueProbability of best value (%)IPSO [41]131687.5IGA [42]131790Wolf Pack algorithm1315100Improved Wolf Pack algorithm1212100Figure 6
Comparison results of the optimising performance.


## 6. Conclusion

In this article, a mathematical model of a multi-vehicle and multi-goods dispensing problem is established and constraints are transformed into penalty functions. Simulation results of five typical test functions show that the proposed improved wolf pack algorithm achieves better performance in terms of accuracy and convergence time. Compared with the traditional Wolf Pack algorithm, the time required for convergence of the improved Wolf Pack algorithm is reduced by 40%. The simulation results of the logistics case show that the improved Wolf Pack algorithm has stronger optimising performance and better stability in solving the multi-vehicle and multi-goods dispensing problem, thus effectively reducing the number of vehicles. As the number of vehicles is often limited in actual logistics distribution, subsequent research will consider more realistic constraints to further improve the dispensing model.



---

*Source: 7532076-2022-09-13.xml*