Next Article in Journal
Bayesian Networks Applied to the Maritime Emissions Trading System: A Tool for Decision-Making in European Ports
Previous Article in Journal
CrySPAI: A New Crystal Structure Prediction Software Based on Artificial Intelligence
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

XGBoost-Based Heuristic Path Planning Algorithm for Large Scale Air–Rail Intermodal Networks

1
Postgraduate Department, China Academy of Railway Sciences, Beijing 100081, China
2
Institute of Computing Technologies, China Academy of Railway Sciences Corporation Limited, Beijing 100081, China
*
Author to whom correspondence should be addressed.
Inventions 2025, 10(2), 27; https://doi.org/10.3390/inventions10020027
Submission received: 11 January 2025 / Revised: 26 January 2025 / Accepted: 4 March 2025 / Published: 7 March 2025

Abstract

:
It is particularly important to develop efficient air–rail intermodal path planning methods for making full use of the advantages of air–rail intermodal networks and providing passengers with richer and more reasonable travel options. A Time-Expanded Graph (TEG) is used to model the timetable information of public transportation providing a theoretical basis for public transportation path planning. However, if the TEG includes a large amount of data such as train stations, airports, train and air schedules, the network scale will become very large, making path planning extremely time-consuming. This study proposes an XGBoost-based heuristic path planning algorithm (XGB-HPPA) for large scale air–rail intermodal networks, which use the XGBoost model to predict transfer stations before path planning, and quickly eliminate unreasonable transfer edges by adding a heuristic factor, reducing the network scale, thus accelerating the computation speed. Comparative results indicate that XGB-HPPA can markedly enhance computational speed within large-scale networks, while obtaining as many valid solutions as possible and approximating the optimal solution.

1. Introduction

With the rapid urbanization and economic development in China, the demand for efficient passenger transport has never been greater. Air–rail intermodal transport is perceived as a strategic approach to accommodate the escalating demand for efficient travel. China’s high-speed rail network, which is among the world’s leading infrastructures, covers over 45,000 km and connects major cities with unprecedented speed and reliability, making the scale of China’s air–rail intermodal network considerable [1]. Launching integrated passenger travel services is beneficial for making full use of the resources of various modes of transportation to form complementary advantages, providing passengers with a more rational and convenient new service model for cross-modal travel. To fully leveraging the transportation advantages of both air and rail and maximize the value of the air–rail intermodal network, it is extremely important to study efficient methods for air–rail intermodal path planning.
Fundamentally, the air–rail intermodal path planning problem entails identifying the K shortest paths within an air–rail intermodal network [2]. In the research on shortest path search algorithms, scholars both domestically and internationally have conducted extensive research on the problem, with primary emphases on the construction of networks [3] and the search for the K shortest paths [4,5]. Among these, the shortest path search algorithms have become relatively mature as core issues, such as Dijkstra’s algorithm [6], Breadth First Search (BFS) [7], Depth First Search (DFS) algorithm [8], A* algorithm [9], as well as various heuristic algorithms such as Ant Colony algorithm [10], Genetic Algorithms [11], and hierarchical search algorithms like Heuristic Hierarchical Search (HHS) [12].
As long as a rational air–rail intermodal network structure is designed and the shortest path search algorithm is implemented on the designed network, the result of path planning can be obtained, these shortest path search algorithms have also been widely applied in the research of intermodal route planning. Some studies take stations and airports as nodes and take air routes and railway tracks as edges, constructing an intermodal transport network for path planning. Xu designed an air–rail network model with minimum total transportation cost as the objective function and designed an algorithm to search for paths with minimum total transportation cost [13]. Zheng designed an air–rail intermodal network model based on a hyper-graph model [14]. These algorithms mainly focus on quickly obtaining the optimal path in a static network, they do not fully consider the impact of factors such as hub connection conditions, operation time constraints between different transportation modes, and passengers’ transfer preferences, which cannot meet actual travel planning needs [15,16]. Therefore, some scholars have proposed using a Time-Expanded Graph (TEG) to represent the intermodal transport route planning problem involving transfers, which has been widely applied in the optimization of public transportation routes, transfer strategies, and other areas, achieving good results [17]. However, when using TEG to construct an air–rail intermodal network, the number of nodes and edges in the network can become large. China has nearly 3000 train stations with over 10,000 trains operating daily. At the same time, it has about 300 civil airports with approximately 20,000 flights operating daily, so the network scale would be extremely large. Moreover, in practical application scenarios, a single path is hardly sufficient to meet the travel plans of passengers, we need to provide multiple alternative paths to meet the travel needs of passengers for selection. Considering the network scale and computational complexity, it is difficult to quickly calculate all the paths in such a vast network. Therefore, high computational efficiency is required for the shortest path search algorithms. Some scholars have attempted to accelerate route planning by reducing the scale of the network; Geisberger et al. proposed the Contraction Hierarchies algorithm to accelerate path planning [18]. However, the process of network contraction requires determining the weights of edges, which cannot meet the dynamic weight requirements during route planning. Other scholars have turned to heuristic algorithms to speed up the route planning process. Shi et al. proposed an improved A* algorithm to improve the searching efficiency by reducing the route searching space through the heuristic function [19]. Current research generally uses spatial distance, user preferences, and other conditions as heuristic factors to make path planning converge more quickly to the optimal solution. However, there is relatively little research on using the prediction results of models similar to XGBoost as heuristic factors to accelerate path planning algorithms.
In this study, we propose an XGBoost-based heuristic path planning algorithm (XGB-HPPA). Specifically, to address the need for swiftly solving the K shortest paths from an extremely large-scale network within a limited timeframe. The XGB-HPPA algorithm utilizes the XGBoost model to predict potential transfer stations, and the heuristic factors of relative transfer edges are set according to the predicted results in the route planning process, quickly eliminating unreasonable transfer edges, thus accelerating calculation speed.
The structure of the paper is as follows. In Section 2, we provide essential information of the air–rail intermodal path planning problem and the mathematical model we build based on TEG and describe the methods. In Section 3, we analyze the results of the numerical experiments. Finally, we close the paper with some conclusions and future research ideas in Section 4.

2. Methodology

2.1. Problem Description

Air–rail path planning entails furnishing passengers with a multi-modal transportation plan spanning from the point of origin to the destination terminal. This kind of problem needs to consider many factors, such as operational time constraints between disparate transportation modes and hub connectivity constraints, etc., in order to provide effective results. The purpose of this study is to obtain effective results based on air–rail intermodal networks with high search efficiency.

2.2. Network Design

2.2.1. Time-Expanded Graph Based Network

Conventional transport networks employ weighted and directed graphs wherein nodes represent stations and airports, and edges represent air routes and railway tracks. Factors such as travel time and expenses are considered as generalized travel costs for the edges, which are used to find the optimal travel plan. This methodology, however, fails to directly encapsulate the connection information pertaining to the operational times of vehicles and the transfer behaviors of passengers within stations. Therefore, it is necessary to dynamically adjust the weights of edges based on the connection status of the running time of vehicles at both ends of the node, which poses a problem of complex calculation methods.
This study endeavors to model the air–rail intermodal transportation network based on TEG forming a directed graph network N = ( V ,   W ) , where V denotes the set of nodes representing various events during the passengers’ traveling process, and W represents the set of edges symbolizing the transitions between these events. S is the set of stations and airports, and U is the collection of vehicles.
The node set V is constituted of four types of node sets, V = E L A D . The specific explanation is as follows:
  • E = ( e 1 , e 2 , e 3 , , e s ) , s S , e s represents the set of events corresponding to passengers entering a station or airport s .
  • L = ( l 1 , l 2 , l 3 , , l s ) , s S , l s represents the set of events corresponding to passengers leaving a station or airport s .
  • A = ( a 1 1 , a 2 1 , a 1 2 , , a s u ) , s S , u U , a s u represents the set of events corresponding to vehicle u arriving at a station or airport s .
  • D = ( d 1 1 , d 2 1 , d 1 2 , , d s u ) , s S , u U , d s u represents the set of events corresponding to vehicle u departing from a station or airport s .
Let t ( v ) be the time of occurrence of the event v ( v V ), the process between events (edges) can be represented by ( v i , v j ) . Based on the different types of nodes at the start and end of the edges, the edges can be categorized into the following six types:
  • ( e s , a s u ) represents the entering process in which a passenger enters a station and waits for the arrival of the train or airplane.
  • ( a s u ,   l s ) represents the leaving process in which a passenger gets off a train or airplane and ultimately leaves the station or airport.
  • ( a s u ,   d s u ) represents the waiting process in which a train or an airplane arrives at a station or airport, stops for a period of time and departs, during which the passenger remains inside the vehicle without leaving.
  • ( d s u ,   a s u ) represents the hopping process in which a passenger travels in a vehicle from one station or airport to the next.
  • ( a s u ,   d s u ) t represents the intra-station transfer process in which a passenger transfers to a different mode of transportation without leaving the station or airport.
  • ( l s ,   e s ) represents the inter-station transfer process in which a passenger transfers between two different stations or an airport to continue their journey on different modes of transportation.
We denote the time taken for the event transformation process (edge) as f ( w ) . For transportation modes adhering to a fixed timetable, such as trains and airplanes, a comprehensive TEG can be meticulously designed based on the timetable. The schematic of the network structure is illustrated in Figure 1.
In Figure 1, the occurrence times of events like a s u and d s u are determined by the timetable. The latest arrival time of event e s 1 is determined by the actual time needed for passengers to enter station s 1 and t ( a u 1 s 1 ) , the time of occurrence of the event a u 1 s 1 . The earliest departure time of event l s 3 is determined by the actual time needed for passengers to leave station s 3 and t ( d s 3 u 1 ) , the time of occurrence of the event d s 3 u 1 .

2.2.2. Transfer Edge Generation

Based on the train and airplane schedules generated for TEG, they are independent of each other, and we cannot get the air–rail intermodal route out of two separated TEGs. We establish transfer edges that connect nodes both within the same TEG and across different TEGs, thereby facilitating air–rail intermodal travel path planning. Establishing transfer edges can create potential quicker paths by transfer between different stations, breaking the constraints of same-station transfers to support the generation of more optimal travel plans. An example of a TEG graph with transfer edges is illustrated in Figure 2.
The condition for intra-station transfers and inter-station transfers differ, and so do the strategies for establishing transfer edges. Different edge establishing strategies need to be selected based on actual conditions.
The intra-station transfer strategy is suitable for passengers who achieve transfers within the same stations through quick transfer corridors. In the transportation network, it is represented by the edge ( a s u , d s u ) t , and the structure of the intra-station transfer is illustrated in Figure 3.
Inter-station transfer is suitable for passengers transferring between different stations, or a transfer process in which procedures such as security checks are required within the same station. In the transportation network, it is represented by the edge ( l s ,   e s ) , and the structure of the inter-station transfer is shown in Figure 4.
Establishing transfer edges not only increases the number of available travel options but also significantly increases the number of nodes and edges in the existing network, however, it introduces a significant computational challenge, as it prolongs the time required for path planning calculations. Therefore, it is crucial to establish transfer edges reasonably to ensure the quality and speed of the path planning results. It is advisable to implement differentiated strategies for the generation of transfer edges, tailored to the specific modes of transport being interconnected.
Intermodal transfers between railway trains and airplanes support both intra-station and inter-station transfer modes. To keep the scale of the air–rail intermodal network within a reasonable range, the number of transfer paths established should be limited. By defining the maximum permissible transfer distance between stations and airports, and by setting the allowable transfer time intervals for trains and airplanes, we can control the number of transfer edges within a certain range, thereby controlling the overall scale of the air–rail intermodal network, ensuring its operational feasibility and efficiency.
Establishing intra-station transfer edges must meet the following constraints:
t d s u 2 t a s u 1 T
where
T represents the minimum transfer time interval between different modes of transportation within the station, with the unit being minutes (min).
t d s u 2 represents the time when the train u 2 arrives at the station s .
t a s u 1 represents the time when the train u 1 arrives at the station s .
Establishing inter-station transfer edges must meet the following constraints:
d s i , s j D t d s j u 2 t d s i u 1 T , s i = s j , u 1 u 2 t d s j u 2 t d s i u 1 g s i , s j * + f a s i u 1 , l s i + f e s i , d s j u 2 , s i s j , u 1 u 2
where
d s i , s j represents the straight-line distance between station s i and station s j , with the unit being kilometers (km).
D is the maximum distance within which transfer paths can be established based on the types of preceding and succeeding stations, with the unit being kilometers (km).
g s i , s j * represents the estimated shortest navigation time from station s i to station s j , with the unit being minutes (min).
f a s i u 1 , l s i represents the time taken for a passenger to travel from station s i on transportation mode u 1 until they leave the station, with the unit being minutes (min).
f e s i , d s j u 2 represents the time taken for a passenger to enter station s j until they leave the station on transportation mode u 2 , with the unit being minutes and seconds (min).

2.3. General Travel Cost

The function representing general travel cost for edge w = ( v 1 ,   v 2 ) is shown as follows:
C v 1 , v 2 = 1 + α v 1 , v 2 + β u v 1 , v 2 × f v 1 , v 2
where
α v 1 , v 2 is the transfer cost coefficient. If v 1 , v 2 is not a transfer edge, then α v 1 , v 2 = 0 . If v 1 , v 2 is a transfer edge and passengers prefer to minimize the number of transfers, then α v 1 , v 2 > 1 .
β u v 1 , v 2 is the cost coefficient of the transportation vehicle u on v 1 , v 2 . If the type of transportation corresponding to v 1 , v 2 matches the passenger’s preference, then let β u v 1 , v 2 < 1 , otherwise let β u v 1 , v 2 1 .
In summary, besides the basic travel time cost, there will be lower additional costs on the paths that match the passengers’ travel preferences.

2.4. The Mathematical Model

In TEG, a passenger’s journey commences at nodes symbolizing the event e s and concludes at nodes indicating the event l s . The path taken between nodes represents the travel plan of the passenger. The path is denoted as follows:
P = v 1 , v 2 + v 3 , v 4 + + v m 1 , v m
The “+” symbol denotes the concatenation of transitions across various segments of the journey.
The objective is to identify paths between the e s and the node l s that minimize the aggregate cost. To sum up the generalized costs of each segment of the scheme P to represent the total cost of the route, denoted as | P | :
P = C v 1 , v 2 + C v 3 , v 4 + + C v m 1 , v m
In summary, the general description of the air–rail intermodal path planning problem is as follows: Based on the given schedule data of trains and airplanes, construct the air–rail intermodal network G in the form of TEG, set up the generalized cost function C , locate the e s node and the l s node corresponding to the user’s search criteria, and try to find path P with lowest total cost P .

2.5. XGBoost-Based Heuristic Path Planning Algorithm

2.5.1. General Travel Cost Function with Heuristic Factor

XGBoost is the short name for ‘Extreme gradient boosting’ proposed by Chen and Guestrin and has a recognized impact in solving machine learning challenges in different application domains [20].
The XGB-HPPA proposed in this study utilizes the XGBoost model to forecast the most suitable stations or airports to serve as potential transfer stations, based on user inputs, with the ultimate goal of reaching the destination terminal. The heuristic factor of the transfer edges is set to quickly eliminate unreasonable edges in the path planning process, thereby accelerating the speed of calculation. The general travel cost function C ( w ) for the edge w = ( v 1 ,   v 2 ) is rewritten as follows:
C v 1 , v 2 = 1 + α v 1 , v 2 + β u v 1 , v 2 × f v 1 , v 2 × ρ v 1 , v 2
where
ρ v 1 , v 2 is a heuristic factor which will be updated by the XGBoost model, with a default value of 1.

2.5.2. XGBoost Algorithm

Generally, XGBoost model is described as follows [21]:
O b j Θ = L Θ + Ω Θ
where
O b j Θ is the objective function.
L Θ measures how well the model fit on training data.
Ω Θ measures the complexity of the model.
The complexity is defined as:
Ω f = γ T + 1 2 λ j = 1 T ω j 2
where
T is the number of leaf nodes.
γ is the penalty conefficient of the number of leaves.
λ is the penalty coefficient of regularization.
ω j is tab1he score of leaf j .
In this study, we use an XGBoost multi-class classification model to predict potential transfer stations. It is defined as:
y ^ i = F k x i = F k 1 x i + f k x i
Let f k x represents the k th decision-tree based learner. The objective function of XGBoost is defined as follows:
O b j = i = 1 n y i y ^ i 2 + k = 1 K Ω f k
The optimization goal of the model is to find the optimal f ( x i ) so that the objective function O b j is minimized. XGBoost adopts the method of objective function approximation. For this purpose, Equation (10) is rewritten as follows:
O b j s = i = 1 n l y i , y ^ i ( s 1 ) + f s x i + Ω f s
Equation (11) is further subjected to second-order Taylor expansion:
O b j s = i = 1 n l y i , y ^ i ( s 1 ) + g i f s x i + 1 2 h i f s 2 x i + Ω f s
where
g i = y ^ i ( s 1 ) l ( y i , y ^ i ( s 1 ) ) , which is the first order partial derivative of the function.
h i = y ^ i ( s 1 ) 2 l ( y i , y ^ i ( s 1 ) ) , which is the second order partial derivative of the function.
Since the constant term does not affect the optimization results of the model, Equation (12) is simplified as follows:
O b j s = i = 1 n g i f s x i + 1 2 h i f s 2 x i + Ω f s = i = 1 n g i f s x i + 1 2 h i f s 2 x i + γ T + 1 2 λ j = 1 T ω j 2 = j 1 T i I j g i ω j + 1 2 i I j h i + λ ω j 2 + γ T
where I j = { i | q x i = j } is an instance set assigned to the j th leaf. We find Equation (13) is a unary quadratic function with independent variable ω j and dependent variable O b j s . The optimal ω j * of leaf node j is:
ω j * = i I j g i 2 × 1 2 i I j h i + λ = i I j g i i I j h i + λ
The optimal objective function value of O b j s is:
O b j s = 1 2 j = 1 T i I j g i 2 i I j h i + λ + γ T
In Equations (14) and (15), G j denotes i I j g i , and H j denotes i I j h i , then:
ω j * = G j H j + λ
O b j s = 1 2 j = 1 T G j 2 H j + λ + γ T
Equation (17) is the scoring function of a decision-tree-based learner with training. O b j s denotes the aggregate of all objective function values at the leaf nodes. For each iteration of the training process, the optimal decision tree model can be obtained by calculating the evaluation scores for all candidate decision tree models. To solve the problem in which a number of candidate decision trees is infinite, we use a greedy algorithm.
When there is only one node, the objective function becomes as follows:
O b j j = 1 2 G j 2 H j + λ + γ
The difference between the objective functions of two trees before and after a node splitting is that the splitting node splits into two new nodes, with the rest of the nodes remaining invariant. After the node is split into two child nodes, the objective function contribution of the two child nodes becomes:
O b j s = 1 2 G j L 2 H j L + λ + G j R 2 H j R + λ + 2 γ
The objective function changes to:
O b j s p l i t j = O b j j O b j s = 1 2 G j L 2 H j L + λ + G j R 2 H j R + λ G j 2 H j + λ γ
Finally, the objective function can be rewritten as follows:
O b j s p l i t = 1 2 G L 2 H L + λ + G R 2 H R + λ G 2 H + λ γ

2.5.3. Evaluation Index Construction

For the multi-class classification problem, True Positive (TP), False Positive (FP), True Negative (TN), and False Negative (FN) are distinct combinations of the real category of data samples and the model prediction category [22]. It is usually necessary to calculate these metrics for each class individually and then aggregate them through methods such as micro-averaging or macro-averaging, according to the actual needs of the research problem. The confusion matrix is shown in Table 1.
This study uses Accuracy, Recall, Precision, and F-Score to evaluate the quality of the model. The indicators of the model are defined as follows.
  • Accuracy is the ratio of correct prediction. The formula is expressed as:
A c c u r a c y = T P + T N T P + T N + F P + F N
  • Recall is the possibility of finding all positive samples. The formula is expressed as:
R e c a l l = T P T P + F N
  • Precision as the correlation of classifying a negative sample as a positive is measured. The formula is expressed as:
P r e c i s i o n = T P T P + F P
  • F-Score considers both precision and recall indicators and is expressed as:
F = α 2 + 1 P × R α 2 P + R
  • When the parameter α = 1 , the most common F1 is the harmonic mean of precision and recall. The formula is expressed as:
F 1 = 2 × P × R P + R

2.5.4. Heuristic Route Algorithm

In XGB-HPPA, prior to the search for the K shortest paths, an initial step involves training an XGBoost model leveraging users’ historical travel data. This model is capable of recommending transfer stations by classifying based on the user’s origin and destination station information.
Since the process of prediction transfer stations is a multi-class classification problem, the model’s accuracy is usually not high when there are too many target classes. Therefore, we use the XGBoost model to predict transfer cities instead of stations first, thus limiting the number of target classes, and then all stations within the city are considered as recommended transfer stations. For these recommended stations, we regard all transfer edges originating from them as recommended, and we adjust ρ factors of these transfer edges. When all transfer edges’ ρ factors are set, then we search for K shortest paths. The specific processes are shown in Figure 5.
  • Load railway and airplane operation plan data, generate TEG for train and airplane.
  • Establish transfer edges between train and airplane TEG to form an air–rail integrated TEG.
  • Load users’ historical data.
  • Train the XGBoost model and perform parameter tuning.
  • Use the pre-trained XGBoost model to determine which transfer edges can be kept based on the user’s query conditions.
  • Update ρ of the edges that will be kept to 1 and set the ρ of the other transfer edges to + .
  • Run K shortest path algorithm, this paper utilizes the bidirectional Dijkstra for the K shortest path search process.

3. Numerical Experiments and Analysis

3.1. Data Prepareation

3.1.1. Air–Rail Intermodal Network Construction Dataset

We obtained all the train and civil aviation flight data from October to December 2023. Based on the rules described in this paper, we constructed an integrated air–rail multimodal network in TEG (Time-Expanded Graph) mode. The data includes 3174 railway stations, 259 airports, 23,748 train services, and 5800 civil aviation flights. The final integrated air–rail multimodal network consists of 2,386,214 nodes and 23,690,182 edges.

3.1.2. XGBoost Model Training Dataset

To train the XGBoost model, we first need to obtain the itinerary data of passengers using air–rail intermodal transport. We consider it as a single air–rail intermodal transport journey if the trip combination meets the following conditions:
  • The first segment and the second segment of the journey are by train and by airplane separately.
  • The arrival time of the first segment of the journey and the departure time of the second segment differ by less than 4 h.
  • The straight-line distance between the destination of the first segment of the journey and the origin of the second segment is within 50 km.
This study utilizes passenger air and train ticket purchase data sourced from China’s online ticketing platform between October 2023 and December 2023, then processed according to the method mentioned before to form an air–rail intermodal transport dataset which contains 450,000 valid entries. The dataset includes the start and terminal station information as well as the information about transfer locations during intermodal travel.
In practical application contexts, passengers generally use the start and terminal station as search criteria. Accordingly, this study only focuses on information related to the starting and terminal station as model inputs. Table 2 below summarizes the basic information on the features used for this study.
Among the above features, the names of the start, transfer and terminal stations, as well as the cities and provinces in which these stations are located, are represented in string format. To enable the XGBoost model to process these labels correctly, the unique identification labels of the feature are mapped to integers.

3.2. XGBoost Model Training

3.2.1. Feature Selection and Processing

To train the XGBoost model, we use the unique identification label and coordinate feature of start and terminal stations, the unique identification label of the cities and provinces where the stations are located as input parameters, and the unique identification label of cities where the transfer stations are located as an output value.
The XGBoost algorithm incorporates a feature importance function that quantitatively assesses and compares the significance of various features. Feature importance score illustrates the computation of relevance scores for feature variables subsequent to the completion of data ingestion. This process follows the experimental determination of feature importance scores, where metrics such as weight, gain, and cover yield congruent results.
Figure 6 illustrates the scores assigned to each feature, thereby reflecting their respective impacts to the prediction of transfer cities. The optimal feature subset is determined based on the evaluation index of the XGBoost model. In this study, the parameters of the XGBoost model were initialized using the learner’s default settings, wherein we sequentially select different numbers of features to train the XGBoost model and calculate the corresponding evaluation indexes. Table 3 below shows the evaluation indexes for different numbers of selected features.
Figure 7 illustrates that as the number of selected features increases, the evaluation indexes of the model exhibit significant improvement. However, when the number of selected features exceeds four, the improvement in the evaluation indexes becomes negligible. Therefore, we select the first four features, namely the latitude and longitude of the start and terminal stations, for subsequent model training.

3.2.2. Parameter Tuning

Parameter tuning of the model is an integral aspect of the modeling process; good parameter tuning can improve the performance of the model. The prior XGBoost model utilized the default parameters of the learner, as follows: n _ e s t i m a t e r s = 150 , m a x _ d e p t h = 5 , l e a r n i n g _ r a t e = 0.1 , g a m m a = 0.1 . This section focuses on parameter tuning. Common approaches for tweaking model parameters include random parameter selection, grid search parameter selection and others.
After grid parameter adjustment of the XGBoost model, experimental results indicate that n _ e s t i m a t e r s = 250 , m a x _ d e p t h = 7 , l e a r n i n g _ r a t e = 0.1 and g a m m a = 0.1 are the ideal parameter settings for the XGBoost model. It shows that a larger number of trees and a higher m a x _ d e p t h value can help to increase the accuracy level. Table 4 compares the XGBoost model before and after parameter adjustment.

3.2.3. Robust Validation

To assess the robustness of the trained XGBoost model, we conducted a k-fold cross-validation with k set to 5. The dataset was randomly divided into five equal folds, and in each iteration, one fold was used as the validation set while the remaining four folds were combined to form the training set.
The performance of the model was evaluated based on the accuracy metric. The cross-validation results are presented in Table 5, which shows the accuracy of the model on each fold as well as the mean and standard deviation of the accuracy across all folds.
As can be seen from the table, the model achieved a relatively high level of accuracy on each fold, with the accuracy ranging from 0.8835 to 0.8857. The mean accuracy across all folds was 0.8848 and the standard deviation was 0.00087. The result of the k-fold cross-validation indicates that the XGBoost model has good robustness.

3.3. XGBoost Acceleration Analysis

To evaluate the acceleration impact of the XGBoost model on the path planning algorithm, as well as to assess the quality of the path planning results, this study randomly selects 1000 OD pairs that are reachable in the air–rail intermodal network as samples. In the absence of XGBoost acceleration, the K shortest path planning algorithm would traverse all edges to achieve optimal results, which serves as a benchmark for comparison with the results using XGBoost. Path planning queries were conducted for these 1000 OD pairs under the following computational configurations:
  • Run K shortest path planning algorithm directly Without XGBoost.
  • Use XGB-HPPA.
The XGB-HPPA is written in Java and was compiled using JDK1.8. All experiments were executed on a 2.9 GHz Intel i7-10700 CPU PC with 16 cores and 16 GB of RAM running Windows 10. By conducting a detailed analysis of the network scale, calculation time and quality of path planning results, the XGBoost model’s effect on the path planning process was analyzed.

3.3.1. Analysis of Algorithm Complexity and Scalability

The XGB-HPPA algorithm mainly consists of two major steps. The first step involves using the XGBoost model to predict transfer cities and setting the heuristic factor for the transfer edges. The second stop involves the K shortest path planning algorithm.
Since the training process of the XGBoost model is conducted offline, only the prediction calculation is utilized during user queries. Therefore, we focus solely on computational complexity in the prediction phase. The computational complexity in the prediction phase of XGBoost is relatively lower compared to the training phase. The prediction involves traversing each decision tree in the ensemble to obtain the predicted value for each sample. The time complexity for predicting a single sample is approximately O ( K * l o g ( n ) ) , where K is the number of trees and n is the maximum depth of the trees. Since the number of trees ( K ) and depth of trees ( n ) are fixed, theoretically, the prediction time of XGBoost is not affected by changes in the scale of the network.
As for the K shortest path planning, the traditional Dijkstra algorithm has a time complexity of O ( ( V + E )   l o g   V ) when using a priority queue, where V is the number of vertices and E is the number of edges in the graph. The time complexity of the bidirectional Dijkstra algorithm can be approximated as O ( ( V + E )   l o g   V / 2 ) , as the search is performed in both directions and the algorithm stops when the two searches meet. The actual performance improvement can vary depending on the specific graph structure and the distance between the start and goal nodes.
To analyze the effect of the XGBoost model on K shortest path planning, we collected statistics on the number of edge weights that need to be computed for path planning of 1000 OD pairs, both with and without XGBoost.
Figure 8 shows that, during the path planning calculation process for 1000 OD samples, the maximum number of edges that require weight computation is relatively large, and the distribution is concentrated in most cases. After acceleration with the XGBoost model, the maximum value has significantly decreased, the data distribution has become more concentrated, the box has noticeably shrunk, and the median has also decreased markedly.
In terms of algorithm scalability, the XGB-HPPA can independently handle each user query, thus it can be easily parallelized, with each search running on separate threads or processors. Moreover, further acceleration can be achieved by fine-tuning the XGBoost model.

3.3.2. Comparison of Calculation Time

We compared the average path planning calculation time, maximum calculation time and XGBoost calculation time for 1000 OD pairs, and the comparison results are as follows.
In Figure 9, the horizontal axis denotes the number of cities selected as transfer cities predicted by the XGBoost model, with 0 indicating no use of XGBoost. It can be observed that the average calculation time without using XGBoost is 673 ms. The implementation of XGBoost markedly diminishes this average time to 337 ms, which is approximately 50% of the original computation time. As the quantity of selected cities for transfers escalates, there is a corresponding rise in the average calculation time. Nevertheless, once the number of selected cities surpasses 10, the augmentation in average calculation time becomes negligible. This observation underscores the efficiency gains achieved through the strategic use of XGBoost in optimizing the path planning process, particularly when a moderate number of transfer cities are considered.
Figure 10 illustrates the maximum calculation time required among all 1000 OD pairs. It is evident that without the acceleration provided by XGBoost, certain OD queries may experience excessively prolonged path planning computation times, reaching up to 4772 ms. Upon the incorporation of XGBoost, this maximum calculation time is significantly reduced to 1657 ms, which is approximately 35% of the original computation time. In practical application settings, particularly when a website handles a high volume of concurrent queries, such lengthy query times could lead to network congestion and potentially hinder the website’s ability to function properly. The acceleration facilitated by XGBoost notably diminishes the upper limit of query times, enhancing the overall efficiency and responsiveness of the system. Furthermore, it is observed that when the number of selected cities for transfers exceeds seven, the increase in maximum calculation time becomes insignificant, suggesting an optimal balance between the number of transfer options and computational efficiency.
Figure 11 shows the maximum XGBoost prediction calculation time needed among all 1000 OD pairs. It is noteworthy that the time required to execute XGBoost predictions in the path planning calculations remains constant regardless of the number of cities selected for transfers. This observation underscores the efficiency of XGBoost in providing rapid predictions irrespective of the complexity introduced by the number of transfer cities.
The principle of acceleration based on XGBoost is to refine the original transportation network by excluding transfer nodes outside the model-recommended cities, thereby reducing the network scale and accelerating the speed of path planning calculations. The fewer selected cities, the smaller the refined network scale, and the faster the computation speed.

3.3.3. Comparison of Path Planning Results Quality

To assess the influence of XGBoost’s network refinement on the quality of path planning outcomes, a comparative analysis was conducted. This analysis focused on following three aspects: distribution of travel time for optimal paths of OD samples, the average number of viable paths within the sample results and the proportion of resolvable OD pairs in relation to the original dataset. Through comparative analysis, insights were gleaned into how the refined network affects the diversity and feasibility of path planning options, as well as the algorithm’s ability to provide solutions across a range of OD queries. This evaluation is crucial for understanding the trade-offs between computational efficiency and solution quality in the context of air–rail intermodal path planning.
Figure 12 indicates that when only one transfer city is selected using XGBoost, there is a noticeable increase in both the upper quartile and median of the travel time for the optimal paths of OD samples, suggesting a slight deterioration in the overall quality of the generated paths. However, when XGBoost selects two or more transfer cities, the distribution of the travel time for the optimal paths of OD samples is essentially the same as when the XGBoost model is not used.
Figure 13 shows the average number of available paths the algorithm can get when the number of OD pairs is 1000; it is evident that without XGBoost the algorithm can get about 10 paths. After using XGBoost, this average reduces to around eight paths. Furthermore, it is observed that as the number of selected cities for potential transfers decreases, so does the average number of available paths. Conversely, an increase in the number of selected cities leads to a corresponding increase in the number of viable paths. However, once the number of selected cities surpasses nine, the average number of available paths stabilizes, indicating that further increases in the number of cities do not significantly enhance the diversity of path planning options. This finding suggests an optimal balance between the number of transfer cities and the richness of the solutions, highlighting the importance of judiciously selecting the number of cities to include in the path planning strategy.
Figure 14 demonstrates the impact of using XGBoost on the proportion of OD pairs that can still obtain optimal paths, it can be seen that as the number of selected cities increases, the proportion of solvable OD pairs also rises. When the number of selected cities exceeds nine, the proportion of solvable OD samples no longer increases significantly. When using XGBoost acceleration and selecting more than nine cities, approximately 98% of the samples can still obtain valid routes.
Taking the path planning results without using XGBoost as the optimal solution, it can be observed in Figure 15 that when merely one city is chosen for transfers, a mere 20% of the samples attain the optimal solution. As the number of selected cities for potential transfers grows, so does the percentage of samples that successfully reach the optimal solution. Once the number of selected cities surpasses ten, the proportion of samples achieving the optimal solution does not increase significantly. At this juncture, approximately 83% of the samples are able to secure the optimal solution.
In conclusion, while XGBoost acceleration offers significant improvements in computational efficiency, it may introduce a trade-off with the quality of the results. The expansion of the number of selected cities for transfers can enhance the quality of the path planning outcomes up to a certain threshold. However, beyond this point, the increase in the number of cities also escalates the computational time required to resolve path planning queries. Thus, the selection of an optimal number of cities is pivotal in striking a balance between the speed of solution delivery and the preservation of result quality. Drawing from the empirical data presented, it is reasonable to infer that the selection of seven to ten cities provides a pragmatic approach, effectively harmonizing the dual objectives of swift computation and robust solution quality within the context of air–rail intermodal path planning.

4. Conclusions

This study developed a methodology to apply the XGBoost model to accelerate path planning algorithm. Real-world ticket purchase data and train and airplane schedule data are selected as the case study to examine the XGBoost model’s acceleration rate and how the acceleration affect the result. According to the experimental results, the following conclusions can be drawn:
  • The coordinate features of starting and terminal stations are more influential than unique identification label features.
  • The XGBoost model can significantly enhance the computational speed of the path planning algorithm, reducing the average computation time by 50% in this paper’s experiments, with the maximum time reduction reaching 31%.
  • The XGBoost model introduces a degree of compromise in path planning outcomes. This is observed through a modest decrease in the average number of viable paths for OD pairs. Additionally, there are instances where certain OD pairs may not readily reach the optimal routes. However, these effects are generally outweighed by the substantial gains in computational efficiency and the enhanced ability to manage complex path planning scenarios within acceptable time frames.
  • Selecting a greater number of cities for transfers using XGBoost can lead to improved results, although this also increases the time required for path planning. Optimal results are generally achieved when selecting between seven and ten cities for transfers.
Despite the significant improvement in computational efficiency demonstrated by the XGBoost model in accelerating path planning algorithms, its application is still subject to certain limitations. Firstly, XGBoost requires meticulous parameter tuning to achieve optimal performance. The vast parameter space of XGBoost, including learning rate, tree depth, and subsampling ratio, necessitates sophisticated optimization techniques to avoid suboptimal configurations. This tuning process can be computationally expensive and time-consuming, especially for large datasets. Additionally, the interpretability of the XGBoost model is relatively weak, which can be a limitation in scenarios where model interpretability is required. Lastly, in the travel data of air–rail intermodal passengers, the passenger flow varies across different cities, which can easily lead to an imbalance in the sample data, XGBoost may not effectively handle minority class samples, which can lead to high accuracy for the majority class but poor performance for the minority class, thereby affecting overall prediction effectiveness.
Future research can explore several promising directions to address the limitations of the XGBoost model and enhance its performance. Combining XGBoost with other machine learning algorithms, such as deep learning models or ensemble methods, could leverage the strengths of multiple approaches. This could lead to more robust predictive models that outperform XGBoost alone in certain scenarios. Exploring ways to improve XGBoost’s performance with imbalanced data, such as adjusting sample weights or using oversampling and undersampling techniques, can enhance the model’s predictive capability for minority class samples, thereby improving overall prediction effectiveness.

Author Contributions

Conceptualization, S.W., N.Z. and X.S.; methodology, S.W. and G.B.; software, S.W. and J.W.; validation, X.S. and N.Z.; formal analysis, S.W., N.Z. and J.W.; investigation, S.W., N.Z. and G.B.; resources, X.S.; data curation, X.S. and S.W.; writing—original draft preparation, S.W. and G.B.; writing—review and editing, X.S.; visualization, S.W.; supervision, X.S. and N.Z.; project administration, X.S.; funding acquisition, S.W. and X.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by China Academy of Railway Sciences Corporation Limited grant number 2023YJ132.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are available in article.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Wang, K.; Jiang, C.; Ng, A.K.; Zhu, Z. Air and rail connectivity patterns of major city clusters in China. Transp. Res. Part A Policy Pract. 2020, 139, 35–53. [Google Scholar] [CrossRef]
  2. Xu, T.; Ding, X.; Li, J. Research on the Connecting Path Search Algorithm for Air-Rail Integration. J. Softw. 2013, 8, 8. [Google Scholar] [CrossRef]
  3. Xu, F.; Zhu, J.F.; Miao, J.J.; Ding, R.R. Simulation of Two Stages-Variant Growth Evolution Model of High-speed Railway and Civil Aviation Compound Network. J. Syst. Simul. 2018, 30, 1369–1375. [Google Scholar]
  4. Xu, W.; He, S.; Song, R.; Chaudhry, S.S. Finding the K shortest paths in a schedule-based transit network. Comput. Oper. Res. 2012, 39, 1812–1826. [Google Scholar] [CrossRef]
  5. Magzhan, K.; Jani, H.M. A review and evaluations of shortest path algorithms. Int. J. Sci. Technol. Res 2013, 2, 99–104. [Google Scholar]
  6. Wang, S.X. The improved dijkstra’s shortest path algorithm and its application. Procedia Eng. 2012, 29, 1186–1190. [Google Scholar]
  7. Donald, G.; Hao, J.X.; Kai, S.R. Shortest path algorithms using dynamic breadth-first search. Networks 1991, 21, 29–50. [Google Scholar]
  8. Aranski, A.W. Depth First Search Algorithm In Solving the Shortest Route Using the Concept of Generate and Test. Int. J. Inf. Syst. Technol. 2022, 6, 353–360. [Google Scholar]
  9. Liu, L.; Wang, B.; Xu, H. Research on path-planning algorithm integrating optimization A-star algorithm and artificial potential field method. Electronics 2022, 11, 3600. [Google Scholar] [CrossRef]
  10. Dirk, S.; Christian, T. Running time analysis of ant colony optimization for shortest path problems. J. Discret. Algorithms 2012, 10, 165–180. [Google Scholar]
  11. Lin, L.; Gen, M. Priority-based genetic algorithm for shortest path routing problem in OSPF. In Intelligent and Evolutionary Systems; Springer: Berlin/Heidelberg, Germany, 2009; pp. 91–103. [Google Scholar]
  12. Fu, L.; Sun, D.; Rilett, L.R. Heuristic shortest path algorithms for transportation applications: State of the art. Comput. Oper. Res. 2006, 33, 3324–3343. [Google Scholar] [CrossRef]
  13. Xu, F.; Zhu, J.F.; Miao, J.J. Optimization Design of Air-rail Network Based on Algorithm of Traversal and Search. In 2016 International Conference on Service Science, Technology and Engineering (SSTE 2016). Available online: https://scholar.archive.org/work/zsoehcritvgnpfxfxdkjp3rvyi/access/wayback/http://dpi-proceedings.com/index.php/dtetr/article/download/6493/6089 (accessed on 10 November 2024).
  14. Zheng, L.X.; Si, B.F. Hyper-graph based stochastic multimodal traffic network assignment problem. Shandong Sci. 2013, 26, 78–83. [Google Scholar]
  15. Gendreau, M.; Ghiani, G.; Guerriero, E. Time-dependent routing problems: A review. Comput. Oper. Res. 2015, 64, 189–197. [Google Scholar] [CrossRef]
  16. Nurhidayat, A.Y.; Widyastuti, H.; Sutikno; Upahita, D.P. Research on passengers’ preferences and impact of high-speed rail on air transport demand. Sustainability 2023, 15, 3060. [Google Scholar] [CrossRef]
  17. Fischer, F.; Helmberg, C. Dynamic graph generation for the shortest path problem in time expanded networks. Math. Program. 2014, 143, 257–297. [Google Scholar] [CrossRef]
  18. Geisberger, R.; Sanders, P.; Schultes, D.; Vetter, C. Exact routing in large road networks using contraction hierarchies. Transp. Sci. 2012, 46, 388–404. [Google Scholar] [CrossRef]
  19. Shi, H.; Cao, W.; Zhu, S.; Zhu, B. Applications of the Improved A* Algorithm for Route Planning. In Proceedings of the Second International Conference on Intelligent Computation Technology & Automation. IEEE Computer Society, Changsha, China, 10–11 October 2009. [Google Scholar]
  20. Chen, T. Xgboost: Extreme Gradient Boosting, R Package Version 0.4-2. 2015; Volume 1, p. 464. 2015. Available online: https://cran.ms.unimelb.edu.au/web/packages/xgboost/vignettes/xgboost.pdf (accessed on 23 December 2024).
  21. Chen, Z.; Fan, W. A freeway travel time prediction method based on an XGBoost model. Sustainability 2021, 13, 8577. [Google Scholar] [CrossRef]
  22. Ren, Q.; Wang, J. Research on Enterprise Digital-Level Classification Based on XGBoost Model. Sustainability 2023, 15, 2699. [Google Scholar] [CrossRef]
Figure 1. A timetable-based passenger transportation network diagram.
Figure 1. A timetable-based passenger transportation network diagram.
Inventions 10 00027 g001
Figure 2. An example of a TEG graph with transfer edges.
Figure 2. An example of a TEG graph with transfer edges.
Inventions 10 00027 g002
Figure 3. Schematic diagram of intra-station transfer mode.
Figure 3. Schematic diagram of intra-station transfer mode.
Inventions 10 00027 g003
Figure 4. Schematic diagram of inter-station transfer mode.
Figure 4. Schematic diagram of inter-station transfer mode.
Inventions 10 00027 g004
Figure 5. The XGB-HPPA algorithm flow chart.
Figure 5. The XGB-HPPA algorithm flow chart.
Inventions 10 00027 g005
Figure 6. Feature importance score results.
Figure 6. Feature importance score results.
Inventions 10 00027 g006
Figure 7. Evaluation indexes with different numbers of features.
Figure 7. Evaluation indexes with different numbers of features.
Inventions 10 00027 g007
Figure 8. Number of edge weights computed.
Figure 8. Number of edge weights computed.
Inventions 10 00027 g008
Figure 9. Average calculation time.
Figure 9. Average calculation time.
Inventions 10 00027 g009
Figure 10. Maximum calculation time.
Figure 10. Maximum calculation time.
Inventions 10 00027 g010
Figure 11. Maximum XGBoost calculation time.
Figure 11. Maximum XGBoost calculation time.
Inventions 10 00027 g011
Figure 12. Boxplot of optimal path travel time distribution for OD samples.
Figure 12. Boxplot of optimal path travel time distribution for OD samples.
Inventions 10 00027 g012
Figure 13. Average number of available routes.
Figure 13. Average number of available routes.
Inventions 10 00027 g013
Figure 14. Proportion of solvable OD samples.
Figure 14. Proportion of solvable OD samples.
Inventions 10 00027 g014
Figure 15. Proportion of OD samples that can achieve the optimal solution.
Figure 15. Proportion of OD samples that can achieve the optimal solution.
Inventions 10 00027 g015
Table 1. Confusion matrix.
Table 1. Confusion matrix.
PositiveNegative
TrueTrue Positive (TP)True Negative (TN)
FalseFalse Positive (FP)False Negative (FN)
Table 2. Summary of the basic information on the features used for this study.
Table 2. Summary of the basic information on the features used for this study.
FeatureDefinitionAttribute
L a b e l s t a r t The unique identification label of start station.Categorical
L a b e l t e r m i n a l The unique identification label of terminal station.Categorical
C i t y s t a r t The unique identification label of start city.Categorical
C i t y t e r m i n a l The unique identification label of terminal city.Categorical
P r o v i n c e s t a r t The unique identification label of start province.Categorical
P r o v i n c e t e r m i n a l The unique identification label of terminal province.Categorical
L a t i t u d e s t a r t The latitude of the start station.Float
L o n g i t u d e s t a r t The longitude of the start station.Float
L a a t i t u d e t e r m i n a l t The latitude of the terminal station.Float
L o n g i t u d e t e r m i n a l The longitude of the terminal station.Float
L a b e l t r a n s f e r The unique identification label of transfer station.Categorical
C i t y t r a n s f e r The unique identification label of transfer city.Categorical
P r o v i n c e s t a r t The unique identification label of transfer province.Categorical
Table 3. Evaluation indexes with different number of features.
Table 3. Evaluation indexes with different number of features.
Number of FeaturesAccuracyRecallPrecisionF1-Score
10.32970.32970.36860.3061
20.67680.67680.66530.6664
30.78310.78310.77870.7767
40.88360.88360.87980.8796
50.88650.88650.88420.8827
60.88730.88730.88510.8837
70.88750.88750.88530.8838
80.88790.88790.88490.8842
90.88770.88770.88410.8841
100.88800.88800.88440.8843
Table 4. Comparison of evaluation indexes before and after parameter tuning of XGBoost model.
Table 4. Comparison of evaluation indexes before and after parameter tuning of XGBoost model.
Evaluation IndexBefore Parameter AdjustmentAfter Parameter Adjustment
Accuracy0.88360.8903
Recall0.88360.8904
Precision0.87980.8877
F1-Score0.87960.8876
Table 5. K-fold cross-validation results.
Table 5. K-fold cross-validation results.
FoldAccuracy
10.8848
20.8835
30.8846
40.8857
50.8855
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Weng, S.; Shan, X.; Bai, G.; Wu, J.; Zhao, N. XGBoost-Based Heuristic Path Planning Algorithm for Large Scale Air–Rail Intermodal Networks. Inventions 2025, 10, 27. https://doi.org/10.3390/inventions10020027

AMA Style

Weng S, Shan X, Bai G, Wu J, Zhao N. XGBoost-Based Heuristic Path Planning Algorithm for Large Scale Air–Rail Intermodal Networks. Inventions. 2025; 10(2):27. https://doi.org/10.3390/inventions10020027

Chicago/Turabian Style

Weng, Shengyuan, Xinghua Shan, Guangdong Bai, Jinfei Wu, and Nan Zhao. 2025. "XGBoost-Based Heuristic Path Planning Algorithm for Large Scale Air–Rail Intermodal Networks" Inventions 10, no. 2: 27. https://doi.org/10.3390/inventions10020027

APA Style

Weng, S., Shan, X., Bai, G., Wu, J., & Zhao, N. (2025). XGBoost-Based Heuristic Path Planning Algorithm for Large Scale Air–Rail Intermodal Networks. Inventions, 10(2), 27. https://doi.org/10.3390/inventions10020027

Article Metrics

Back to TopTop