# Large-Scale Scheduling Model Based on Improved Ant Colony Algorithm

Authors: Suyao Zhao; Chengyi Li; Mengmeng Tian; Hengyuan Zhang; Zhixuan Xiao; Runjiu Hu
Journal: Mobile Information Systems
 (2022)

---

## Abstract

With the rapid development of the city, shared bicycle travel has also entered a stage of rapid development. In order to ensure the happiness of citizens traveling, in view of the current supply and demand resources and bicycle scheduling problems, a model of supply and demand resource forecasting and multisite and multivehicle scheduling are established. Supply and demand resource prediction uses characteristic variables based on the graph structure itself as input variables of the prediction model XGBoost (extreme gradient boosting). Combined with the actual situation, the improved ant colony algorithm is used to design a reasonable scheduling for the multisite and multivehicle routing problem (VRP). Using Xiamen City shared bicycle data for simulation training, the results show that the shared bicycle scheduling method proposed in this paper has strong robustness and rationality.


---

## Body

## 1. Introduction

With the rapid development of the city, the urban population continues to expand, and shared bicycle travel has also entered a stage of rapid development. During peak periods, however, there are still insufficient automobiles in key starting places, and citizens do not have access to vehicles. During the morning and evening peaks of “a car is hard to find” and “no place to stop,” automobiles in some destination areas are saturated or even stacked up, resulting in a contradiction between supply and demand. As a result, establishing a realistic design system for supply and demand resource forecasting and scheduling systems is critical to solve such difficulties.In the short-term demand prediction of shared bicycle, Chen et al. [1] used BP neural network to predict the demand of public bicycle single station dispatch and found the pattern of bicycle traffic distribution over time; Liu [2] found that the usage of shared bikes can be affected by season, day of the week, time of day, and other factors. Faghih-Imani et al. [3] developed a mixed linear model to estimate the effects of bicycle infrastructure, socio-demographic characteristics, and land use characteristics on customer arrivals and departures. Ying Hong and Yong [4] used a serialized neural network model which was able to extract the temporal variation pattern of traffic. Li et al. [5] proposed a multisimilarity-based inference model for cluster rental ratio and intercluster migration which can easily infer the number of bicycles rented/returned by each cluster. Li and Ma [6] establish a linear regression prediction model based on LSTM for the time-series characteristics of travel patterns. Zi et al. [7] proposed a new deep graph convolutional network model (GCN) with temporal attention for the prediction of the number of bicycle exits at each station. Yang et al. [8] proposed a new feature variable as the input to the model, i.e., a feature variable based on graph structure. In the current study, the XGBoost [9] is used for prediction. It is a gradient-boosted decision tree (GBDT) machine learning package that is scalable and distributed. It is the premier machine learning library for regression, classification, and ranking problems [10] and includes parallel tree boosting.There has been long research in the scheduling of shared bicycles. Daneshzand [11] detailed the VRP problem: there are N vehicles, all of which are required to traverse all the points from the starting point and require the shortest sum of distances. Cui et al. [12] proposed a genetic hybrid ant colony algorithm-based scheduling distribution method. Yin et al. [13]studied the scheduling algorithm of shared bicycle. Hu [14] discussed the applicability of ant colony algorithm in solving vehicle path selection problem and the advantages and disadvantages in its application and finally proposed improvement measures to adjust its parameters accordingly in different search stages. Cui et al. [15] proposed an ant search algorithm based on the VRP problem. Based on the analysis of public bicycle scheduling problem, Liu et al. [16] used genetic algorithm to establish VRP model. Xu et al. [17] proposed a bike-sharing dispatching method with customer participation. Yu et al. [18] improved the genetic algorithm and conducted simulation tests with a region in Beijing. Wu and Wang [19] conducted a study of the scheduling distribution problem based on an improved ant colony algorithm for a small area within a school.The above works have some shortcomings: most of them only consider the method of using weather for bike-sharing demand prediction, which is not robust. Most of them only involve the scheduling between small areas and few stations and fail to conduct experiments on a large scale. They do not combine the supply and demand prediction and scheduling scheme effectively.Based on the existing literature experience and practice, this paper makes future demand and supply forecasts for shared bikes by extracting feature variables based on the graph structure itself [19] and uses an improved ant colony algorithm design, a scheduling scheme for large-scale urban s sites in combination with the VRP problem.Ant colony optimization is an optimization technique that was first developed in the early 1990s. The foraging behavior of genuine and real ant colonies is a source of inspiration for ant colony optimization. Artificial ant colonies use this behavior to find approximate solutions to discrete optimization issues, continuous optimization problems, and major telecommunication problems such as routing and load balancing [20].


## 2. Methods

### 2.1. Overall Framework

We investigate bicycle sharing data in Xiamen. First, we extract the predicted values of supply and demand resources of each parking site from the dataset as input to the XGBoost model, and then we feed them into the ant colony algorithm’s scheduling scheme to obtain the scheduling routes and realize the allocation of supply and demand resources to each parking site.Figure1 illustrates the overall process.Figure 1
Overall framework diagram.


### 2.2. Supply and Demand Resource Forecast

In this paper, we advance feature variables from the structure of the graph and the relationship between nodes, including node outer intensity, inner intensity, out-degree, in-degree, and PageRank value. Using these features as the input of XGBoost algorithm, the predicted amount of supply and demand resources for each parking site is output. Their meanings are as follows:(i)
Deposit: the amount of supply and demand resources for shared bicycle parking sites.(ii)
Intensity: the outgoing intensity indicates the number of orders starting from the node, and the incoming intensity expresses the number of orders ending at this node.(iii)
Degree: the out-degree and in-degree indicate the number of edges in the outgoing and incoming directions of a node in a directed graph. If a node is connected to many adjacent nodes, the node is considered important.(iv)
Page Rank: to illustrate the importance and centrality of nodes in a graph, PageRank can be utilized as an additional indicator. PageRank can assist in identifying crucial nodes in the urban transportation network that have a significant impact on traffic flow. For a nodeA, its PageRank value is(1)PRA=1−d+dPRT1CT1+PRT2CT2+⋯+PRTnCTn.Among them, PR(A) represents the PR value of the node A, where the nodeTi represents a certain node among all the nodes pointing to A, CTi represents the out-degree of the node Ti, and d is the damping coefficient.


### 2.3. Scheduling Solutions

Our scheduling system aims to meet demand for supply and demand resources across all parking lots. That is, when a dispatched vehicle drives through a parking lot, it must accommodate the site’s requirements. As a result, the objective function is set as follows:(2)minf=total_distance.Here,f represents the objective function and total_distance represents the total distance of the scheduling.At the same time, in order to develop a reasonable vehicle drop-off route, we need to stipulate the following rules:(i)
The sum of the delivery volume on the delivery route cannot exceed the maximum load of the delivery vehicle(ii)
In the delivery route, each parking site has and can only be visited once(iii)
All delivery vehicles depart from the dispatch center and finally return to the dispatch center(iv)
Delivery vehicles cannot exceed the maximum number of stations setCombined with the ant colony algorithm, Figure2 shows the overall flow of the scheduling route design.Figure 2
Ant colony algorithm workflow.


## 2.1. Overall Framework

We investigate bicycle sharing data in Xiamen. First, we extract the predicted values of supply and demand resources of each parking site from the dataset as input to the XGBoost model, and then we feed them into the ant colony algorithm’s scheduling scheme to obtain the scheduling routes and realize the allocation of supply and demand resources to each parking site.Figure1 illustrates the overall process.Figure 1
Overall framework diagram.


## 2.2. Supply and Demand Resource Forecast

In this paper, we advance feature variables from the structure of the graph and the relationship between nodes, including node outer intensity, inner intensity, out-degree, in-degree, and PageRank value. Using these features as the input of XGBoost algorithm, the predicted amount of supply and demand resources for each parking site is output. Their meanings are as follows:(i)
Deposit: the amount of supply and demand resources for shared bicycle parking sites.(ii)
Intensity: the outgoing intensity indicates the number of orders starting from the node, and the incoming intensity expresses the number of orders ending at this node.(iii)
Degree: the out-degree and in-degree indicate the number of edges in the outgoing and incoming directions of a node in a directed graph. If a node is connected to many adjacent nodes, the node is considered important.(iv)
Page Rank: to illustrate the importance and centrality of nodes in a graph, PageRank can be utilized as an additional indicator. PageRank can assist in identifying crucial nodes in the urban transportation network that have a significant impact on traffic flow. For a nodeA, its PageRank value is(1)PRA=1−d+dPRT1CT1+PRT2CT2+⋯+PRTnCTn.Among them, PR(A) represents the PR value of the node A, where the nodeTi represents a certain node among all the nodes pointing to A, CTi represents the out-degree of the node Ti, and d is the damping coefficient.


## 2.3. Scheduling Solutions

Our scheduling system aims to meet demand for supply and demand resources across all parking lots. That is, when a dispatched vehicle drives through a parking lot, it must accommodate the site’s requirements. As a result, the objective function is set as follows:(2)minf=total_distance.Here,f represents the objective function and total_distance represents the total distance of the scheduling.At the same time, in order to develop a reasonable vehicle drop-off route, we need to stipulate the following rules:(i)
The sum of the delivery volume on the delivery route cannot exceed the maximum load of the delivery vehicle(ii)
In the delivery route, each parking site has and can only be visited once(iii)
All delivery vehicles depart from the dispatch center and finally return to the dispatch center(iv)
Delivery vehicles cannot exceed the maximum number of stations setCombined with the ant colony algorithm, Figure2 shows the overall flow of the scheduling route design.Figure 2
Ant colony algorithm workflow.


## 3. Results and Discussion

### 3.1. Experimental Data Preprocessing

We collected the data on shared bicycles in Xiamen. These data are published as a dataset in the big data track of the 2021 Digital China Innovation Competition, which has certain authority and authenticity.Firstly, we do geo-hash coding for 14071 parking sites in the datasets. 192 parking sites are generated in total (the default is calculated from site 0). Secondly, in order to introduce the dispatching center, we got the latitude and longitude coordinates of the operation center of the shared bicycle in Xiamen city (118.147021,24.496151) on Baidu map by actual investigation and set it as site 8. Finally, to make our distance computation easier, we utilize a coordinate converter to convert the parking location’s latitude and longitude data into plane coordinates.


### 3.2. Parameter Setting and Evaluation Indicators

For the parameter setting, we mainly set the parameters of XGBoost and the parameters in the ant colony algorithm. Table1 shows the results of the parameter settings.Table 1
Model parameters (∗1 represents XGBoost; ∗2 represents ant colony algorithm).
Parameter nameValueMeaningMax_depth15Maximum number of iteration layersLearning_rate10.1Learning raten_estimators140Maximum number of iterationsALPHA22Pheromone importance factorBETA21Heuristic function importance factorRHO20.6Pheromone volatility factorQ2200Number of iterationsT2200Initial carrying capacityState215Maximum number of stationsTo evaluate the performance of supply and demand resource forecasting, we used regression model metrics MSE, MAE, andR2, often used as indicators in forecasting models. MAE stands for Mean absolute error which shows variation between predicted values extracted by averaged absolute difference over the data se. MSE stands for mean squared error which shows variation between predicted values extracted by squared average difference over the dataset. R2 or R-squared is the coefficient of determination). In addition, we use random forest and Bayesian models as comparison experiments.In the scheduling scheme, we use distance as an evaluation metric and continuously iterate to optimize it.


### 3.3. Supply and Demand Resource Forecast

The variables including in/out intensity, in/out-degree, and PageRank value were obtained by processing the datasets. Figures3–6 show the effect of sites, degree, intensity, and PageRank value on the graph, respectively.Figure 3
Sites.Figure 4
Degree.Figure 5
Intensity.Figure 6
PageRank.By inputting the characteristic variables of the graph structure, three models in the supply and demand resource design were used to go through the experiment and by using MSE, MAE, and R2 as the evaluation index of the experiment. Table2 shows the comparison of the models. It can be seen that the results obtained under using the XGBoost model are generally better than the remaining two models.Table 2
Results of supply and demand resource evaluation indicators.
ModelMSEMAER2Bayes6772.52351.59140.49664Random forest5885.91248.82750.56253XGBoost5608.24351.60560.58317We compared the predicted supply and demand resources with the average of the previous days at the site, and Figure7 illustrates their comparison.Figure 7
Comparison of predicted and real value.As can be seen, the final result of our prediction has a general trend with its average situation, which also shows the reasonableness of our prediction from the side.


### 3.4. Scheduling Solutions

By inputting the amount of supply and demand resources obtained in the previous step and their corresponding latitude and longitude coordinates, the resulting coordinates of latitude and longitude which are brought into the ant colony algorithm, the specific results of the scheduling scheme are finally derived. Figure8 shows the experimental comparison between using the improved ant colony algorithm and the basic ant colony algorithm, and it can be seen that using the improved ant colony algorithm, better path results can be obtained in a shorter time. The final convergence is around 480,000 meters.Figure 8
Iteration results graph.


## 3.1. Experimental Data Preprocessing

We collected the data on shared bicycles in Xiamen. These data are published as a dataset in the big data track of the 2021 Digital China Innovation Competition, which has certain authority and authenticity.Firstly, we do geo-hash coding for 14071 parking sites in the datasets. 192 parking sites are generated in total (the default is calculated from site 0). Secondly, in order to introduce the dispatching center, we got the latitude and longitude coordinates of the operation center of the shared bicycle in Xiamen city (118.147021,24.496151) on Baidu map by actual investigation and set it as site 8. Finally, to make our distance computation easier, we utilize a coordinate converter to convert the parking location’s latitude and longitude data into plane coordinates.


## 3.2. Parameter Setting and Evaluation Indicators

For the parameter setting, we mainly set the parameters of XGBoost and the parameters in the ant colony algorithm. Table1 shows the results of the parameter settings.Table 1
Model parameters (∗1 represents XGBoost; ∗2 represents ant colony algorithm).
Parameter nameValueMeaningMax_depth15Maximum number of iteration layersLearning_rate10.1Learning raten_estimators140Maximum number of iterationsALPHA22Pheromone importance factorBETA21Heuristic function importance factorRHO20.6Pheromone volatility factorQ2200Number of iterationsT2200Initial carrying capacityState215Maximum number of stationsTo evaluate the performance of supply and demand resource forecasting, we used regression model metrics MSE, MAE, andR2, often used as indicators in forecasting models. MAE stands for Mean absolute error which shows variation between predicted values extracted by averaged absolute difference over the data se. MSE stands for mean squared error which shows variation between predicted values extracted by squared average difference over the dataset. R2 or R-squared is the coefficient of determination). In addition, we use random forest and Bayesian models as comparison experiments.In the scheduling scheme, we use distance as an evaluation metric and continuously iterate to optimize it.


## 3.3. Supply and Demand Resource Forecast

The variables including in/out intensity, in/out-degree, and PageRank value were obtained by processing the datasets. Figures3–6 show the effect of sites, degree, intensity, and PageRank value on the graph, respectively.Figure 3
Sites.Figure 4
Degree.Figure 5
Intensity.Figure 6
PageRank.By inputting the characteristic variables of the graph structure, three models in the supply and demand resource design were used to go through the experiment and by using MSE, MAE, and R2 as the evaluation index of the experiment. Table2 shows the comparison of the models. It can be seen that the results obtained under using the XGBoost model are generally better than the remaining two models.Table 2
Results of supply and demand resource evaluation indicators.
ModelMSEMAER2Bayes6772.52351.59140.49664Random forest5885.91248.82750.56253XGBoost5608.24351.60560.58317We compared the predicted supply and demand resources with the average of the previous days at the site, and Figure7 illustrates their comparison.Figure 7
Comparison of predicted and real value.As can be seen, the final result of our prediction has a general trend with its average situation, which also shows the reasonableness of our prediction from the side.


## 3.4. Scheduling Solutions

By inputting the amount of supply and demand resources obtained in the previous step and their corresponding latitude and longitude coordinates, the resulting coordinates of latitude and longitude which are brought into the ant colony algorithm, the specific results of the scheduling scheme are finally derived. Figure8 shows the experimental comparison between using the improved ant colony algorithm and the basic ant colony algorithm, and it can be seen that using the improved ant colony algorithm, better path results can be obtained in a shorter time. The final convergence is around 480,000 meters.Figure 8
Iteration results graph.


## 4. Conclusion

The findings of this study include experimental data preprocessing, parameter setting, and evaluation indicators, supply and demand resource forecast, and the resulting scheduling solution in the form of coordinates of latitude and longitude, finally generating the exact outcomes of the scheduling system using the ant colony algorithm. The experimental results show that the shared bicycle distribution scheduling scheme proposed in this paper can predict the short-term demand for shared bicycles more accurately and can obtain the optimal distribution path in a short time to meet the demand for reasonable scheduling of shared bicycles during peak periods. We will further improve the prediction model and scheduling algorithm and consider more realistic factors such as actual road conditions to obtain the optimal route in a shorter time. Using Xiamen City shared bicycle data for simulation training, the results show that the shared bicycle scheduling method proposed in this paper has strong robustness and rationality.



---

*Source: 9116121-2022-05-31.xml*