Method for compiling single-line two-way railway train working diagram based on Lagrange relaxation algorithm
By combining the Lagrange relaxation algorithm and mathematical programming, the train timetable of a single-track railway is decomposed into two sub-problems. The subgradient algorithm is used to solve the problem iteratively, thus solving the problem of efficient optimization of train timetable compilation for single-track railways and realizing a feasible solution under large-scale and high-constraint conditions.
Patent Information
- Application Number
- CN202511495220.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-20
- Publication Date
- 2025-12-12
AI Technical Summary
Existing technologies struggle to generate well-optimized train timetables for single-track railways within an acceptable timeframe, especially when dealing with the large-scale and highly complex challenges of single-track railway train timetable development.
By employing a Lagrange relaxation algorithm combined with mathematical programming and heuristic methods, the optimization objective function and constraints of the train timetable are constructed, decomposed into two sub-problems, and then solved iteratively using the subgradient algorithm to optimize the train timetable.
It can solve for train operation diagrams with good optimization results in a short time, and is applicable to large-scale single-track railway train operation lines with complex constraints, thus improving the solution efficiency and feasibility.
Smart Images

Figure CN121106415A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of railway transportation, in particular to a method for compiling a single-line bidirectional railway train diagram based on a Lagrangian relaxation algorithm, which is used to solve the scheduling problem of single-line bidirectional trains in rail transit. BACKGROUND
[0002] With the start of a new round of technological revolution, China's transportation industry is rapidly developing towards intelligence, greenness and high efficiency. As an important part of the transportation industry, rail transit also needs to integrate the latest technological achievements into the scheduling system of rail transit to liberate manpower, improve energy efficiency, promote the intelligence and automation of scheduling, and thus promote the rail transit industry to meet the trend of the times and national planning, and achieve leap-forward development.
[0003] Single-line railway, as a special component of rail transit, is a special operation mode in which two-way train services run simultaneously on a single track. Unlike ordinary double-track railways, due to the simultaneous operation of two-way train services on a single track, a series of problems such as train avoidance, head-on vehicle section blocking, avoidance point selection and main and side line arrangement are caused, which have higher complexity and difficulty than double-track railways. Although single-line railways are limited in operation, they are widely used in small parks, areas with limited terrain and some small-flow passenger lines, and still have high research value and significance.
[0004] In rail transit scheduling, the most crucial aspect is constructing efficient and feasible train timetables. Train timetables specify detailed routes and platform stops for all trains, ensuring conflict-free operation on the tracks. For single-track railways, train timetables further specify platform avoidance for opposing trains and track occupancy, making their role even more critical. Current research has explored train timetable compilation methods, including exact solutions based on mathematical programming, heuristic methods, metaheuristic methods, and some artificial intelligence approaches. Exact solutions based on mathematical programming often involve establishing complex mathematical models to solve the real-world problem. Metaheuristic methods, such as genetic algorithms, particle swarm optimization, and simulated annealing, obtain a near-optimal solution through large-scale computation and search. These methods have achieved good results on small-scale, simple lines, but for large-scale problems, especially the high-constraint complexity inherent in single-track railway train timetable compilation, these methods struggle to obtain a feasible solution within an acceptable timeframe. Heuristic methods, which construct train timetables based on a series of scheduling rules designed by experts, offer low computational overhead and high speed, but struggle to guarantee optimal timetable performance. These timetables are often used in situations with limited computation time and are unsuitable for long-term, static scheduling. Meanwhile, in recent years, AI-based train timetable construction methods, including random forest algorithms and multi-agent reinforcement learning, have gained widespread application. However, these methods still lag behind heuristic and exact-solution methods in terms of construction efficiency and timetable optimization effectiveness. Therefore, developing a train timetable compilation technique capable of achieving good optimization results within an acceptable timeframe is crucial for the train timetable compilation problem of single-track railways. Summary of the Invention
[0005] To address the aforementioned problems, this invention proposes a method for compiling train timetables for single-track bidirectional railways based on the Lagrange relaxation algorithm, used for the compilation and optimization of train timetables for single-track railways. This invention combines mathematical programming and heuristic methods. It simplifies and decomposes the mathematical model using a mathematical programming approach and a heuristic method for selecting relaxation constraints. The simplified mathematical model is then iteratively solved using a subgradient algorithm, thereby yielding a practically feasible and efficiently optimized train timetable for single-track railways.
[0006] The method for compiling a train timetable for a single-track, two-way railway based on the Lagrange relaxation algorithm of the present invention includes the following steps:
[0007] Step 1: Construct the mathematical model for solving the train timetable and the optimization objective function for train timetable compilation. This mainly includes modeling passenger waiting time and train energy consumption during train operation, with the goal of reducing passenger waiting time and train energy consumption to optimize the train timetable. For passenger waiting time, a passenger arrival distribution matrix is constructed using actual passenger arrival data at each station along the operating line. The number of waiting passengers at each station at different time points is calculated based on the arrival and stop times of each train service. The interval between adjacent time points is the set minimum time interval, thus calculating the waiting time for all passengers before boarding the train at all time points. For train energy consumption, the motion state during train operation is simplified and segmented, and the energy consumption under different operating states is calculated segment by segment. The energy consumption of the train moving from the current station to the next station is divided into four parts: idling energy consumption when the train is stopped at the current station, energy consumption when the train starts from the current station, energy consumption during uniform motion, and energy consumption during braking. The energy consumption during braking is 0. The total energy consumption of all train services is then calculated based on the train timetable.
[0008] Step 2: By mathematically modeling the various requirements and operational constraints during train operation, constraints for train timetable optimization are constructed, and nonlinear constraints are linearized. The mathematical constraints obtained in this step, together with the objective function obtained in Step 1, constitute the mathematical model for solving the train timetable.
[0009] Step 3: The Lagrange relaxation process is applied to the obstacle avoidance constraints of oncoming trains at the platform in the train timetable optimization problem. This Lagrange penalty term is added to the objective function, decomposing the train timetable optimization problem into two subproblems. The arrival and departure times of the up-line trains and the arrival and departure times of the down-line trains are solved separately. Then, the ReLU activation function of the neural network is used to restrict the Lagrange penalty term in the objective function of the subproblems and linearization is performed.
[0010] Step 4: Iterate through the two subproblems until the preset maximum number of iterations is reached, at which point the iteration ends. In each iteration, the two subproblems are solved alternately. While solving one subproblem, the solution to the other subproblem is used as a fixed value, and the Lagrange multipliers are updated using the subgradient algorithm. The solutions to the two subproblems are then merged into the solution to the original problem and transformed into an executable train timetable as the final solution.
[0011] Step 1, the objective function F for optimizing the train timetable is constructed as follows:
[0012] ;
[0013] in, These are the weights of the train operation energy consumption E for all train services and the passenger waiting time TWT for all train services. These are the sets of times when each train departs from each platform and the sets of times when it arrives at each platform, respectively, according to the train timetable.
[0014] In step 2, the modeling of train operation line information, the modeling of train operation safety requirements, and the modeling of train stops, avoidance, and connection operations at platforms are constructed. The constraints include: (1) The running time of a single train in each section of the line is required to be greater than or equal to the minimum running time of the section, and less than or equal to the maximum running time of the section; a section refers to the path between adjacent platforms or between adjacent platforms and avoidance points; (2) Trains stopping at stations must meet the constraints of the minimum stopping time and the maximum stopping time of the platform, that is, the time the train spends on the platform is greater than or equal to the minimum stopping time of the platform, and less than or equal to the maximum stopping time of the platform. (3) For trains of different services in the same direction, the two trains in the same direction cannot be in the same section at the same time; (4) The next service of the same train is required to depart after the previous service of the train, and the departure interval between the two services of the same train must be greater than or equal to the minimum stopping time of the connecting platform and less than or equal to the maximum stopping time of the connecting platform; (5) For trains in opposite directions, the two trains in opposite directions cannot be in the same section at the same time; (6) Trains waiting to give way need to meet the constraints of the minimum stopping time and the maximum stopping time of the point where they are waiting to give way; (7) Two trains in opposite directions cannot stop at the same single-track platform at the same time. In step 2, the Big M method is used to linearize the nonlinear constraints, including linearizing the constraints (5) and (7).
[0015] In step 3, the train timetable optimization problem is decomposed into two sub-problems. After the Lagrange penalty term in the objective function of the sub-problems is restricted by the ReLU activation function, the objective function of the sub-problems is expressed as follows:
[0016] ;
[0017] in, The Lagrange multiplier is used; the objective function X for solving subproblem 1 is the set of arrival times of each train on the uphill route at each platform. and a collection of departure times from each platform. The objective X of subproblem 2 is the set of arrival times of each down-line train at each platform. and a collection of departure times from each platform. I represents the set of all stations and passing points on the entire line, and IS represents the set of stations on the entire line excluding passing points. These are the sets of train schedules for the northbound and southbound train schedules, respectively. For safe time; M is a very large integer. and All are 0-1 decision variables; and They are the train schedules The northbound train in the section Leaving the platform Time and arrival platform Time; and They are the train schedules The down train in the section Leaving the platform Time and arrival platform The time.
[0018] Using the Big M method to activate the function Linearization involves introducing variables y and z, and setting... , For input variables, For 0-1 decision variables, the activation function will be... The linearization constraints of the transformation are as follows:
[0019] ; ; ; ; ;
[0020] Substituting the restricted Lagrange penalty term into x, and applying the linearization constraints described above, we obtain the result after... The processed value is written into the objective function of the subproblem.
[0021] In step 4, the method of updating each Lagrange multiplier using the subgradient algorithm is as follows: Let... If the value of a Lagrange multiplier is given in round m, then update the value of that Lagrange multiplier in round m+1. as follows:
[0022]
[0023] in, Let be the step size of the sub-gradient algorithm in the m-th round; After solving in the m-th round, The subgradient. For the relaxed constraints. The subgradient of the corresponding Lagrange multiplier is the constraint in the m-th iteration. The value of .
[0024] Compared with the prior art, the present invention has the following advantages and positive effects:
[0025] (1) The method of the present invention constructs an optimization objective based on the passenger waiting time and train operation energy consumption during actual train operation. Then, the mathematical model of the original problem is simplified by Lagrange relaxation, which can decompose the original problem into two sub-problems. It can solve the train operation diagram with better optimization effect in a relatively short time and is suitable for large-scale train operation lines with more complex constraints.
[0026] (2) The method of the present invention applies a Lagrange relaxation term. The penalty term constraint alleviates the problem that the Lagrange relaxation algorithm may violate relaxation constraints, leading to an expanded solution space and difficulty in finding a feasible solution to the original problem. This invention optimizes the solution of large-scale Lagrange relaxation problems with many relaxation constraints, accelerating the convergence speed and further improving the efficiency of the Lagrange relaxation algorithm, thus increasing the efficiency of solving large-scale single-track railway train timetables. This invention provides a new method for compiling single-track railway train timetables, enabling the generation of practical train timetables under realistic line conditions. Attached Figure Description
[0027] Figure 1 This is a flowchart illustrating the overall implementation of the method for compiling train timetables for single-track bidirectional railways according to the present invention.
[0028] Figure 2 This is a schematic diagram illustrating the passenger waiting time calculation method used in the present invention.
[0029] Figure 3 This is a motion model diagram of the train running between stations using the method of the present invention. Detailed Implementation
[0030] The present invention will now be described in further detail with reference to the accompanying drawings and examples.
[0031] This invention discloses a method for compiling train timetables for single-track railways based on the Lagrange relaxation algorithm. It is primarily used to address the problem of compiling and optimizing large-scale, complex train timetables for single-track railways. A general implementation flow of this invention is as follows: Figure 1 As shown, the following is a detailed explanation.
[0032] Step 1. Construct a mathematical model and objective function for the optimization problem of single-track railway train timetables. The mathematical model for train timetables mainly includes modeling passenger waiting time and train energy consumption during train operation. The objective function for train timetable optimization is to reduce passenger waiting time and train energy consumption as the optimization goal. Regarding passenger waiting time, the actual passenger arrival data at each station along the line is used to construct the passenger arrival time distribution, and the waiting time before boarding is calculated by combining this with the stop and arrival times of each train. Regarding train energy consumption, the motion states of the train during operation are simplified and segmented, and the energy consumption under different operating states is calculated segment by segment.
[0033] The method for calculating passenger waiting time during train operation in this embodiment of the invention includes the following steps 11 and 12.
[0034] Step 11: Obtain passenger arrival data for each station on the historical operating route, calculate the passenger arrival rate of each station in different time periods based on the historical data, and construct the passenger arrival distribution of each station.
[0035] This embodiment first uses the average of historical data on the time distribution of passengers arriving at each station on the track to obtain an average passenger arrival time distribution. It assumes that all... Passengers arriving within the time frame Arrival at the platform allows historical passenger distribution data to be transformed into a two-dimensional matrix, establishing a usable passenger arrival distribution over time. Indicates the minimum time interval. The set of all times for solving the train timetable. The starting time for solving the train timetable. From Start every time A passenger arrival distribution matrix is established by statistically analyzing the number of arriving passengers at each platform.
[0036] Step 12: Calculate passenger waiting time on the line. This invention combines the arrival and departure times of each train on the line at each platform to calculate the number of waiting passengers at each platform at different times, thereby obtaining the total waiting time of all passengers on the line, which is then constructed as a function of the arrival and departure times of trains at the platforms.
[0037] For simplicity, capacity considerations are ignored. Capacity considerations are often addressed in the next stage of public transport planning—vehicle planning—where sufficient train units can be allocated to meet capacity demands. Platforms on a single-track, bidirectional railway are divided into single-track (ordinary) platforms, passing platforms, and passing points. Passing platforms have two tracks, allowing trains to stop like ordinary platforms and simultaneously pass like passing points. Let N be the set of all platforms (including single-track, passing, and passing points) on the entire single-track, bidirectional railway line; IN be the set of passing points; I be the set of all single-track and passing platforms; and IS be the set of single-track platforms excluding passing platforms. Passengers cannot board at passing points; each train must stop at all single-track and passing platforms. Let the passenger arrival distribution matrix, derived from historical data on passenger arrivals at each platform over time, be represented as a matrix. Each row of the matrix corresponds to a platform, and each column corresponds to a time. Each element in the matrix... This represents the number of passengers arriving at platform i at time t. Since the entire route is a loop, we can assume that the number of passengers traveling in both directions is equal, which is denoted as . When the train arrives at the platform, passengers traveling in the direction of train travel can board; this number is represented as... ( Thus, the waiting time for all passengers... This can be expressed as:
[0038] ;
[0039] in, The total number of people waiting on platform i at time t is calculated as follows:
[0040] ;
[0041] in, for The total number of people waiting on platform i at any given time. Number of people waiting at platform i at any given time Equal to the number of people waiting on the platform at the previous moment Plus Number of people arriving at the platform at any given time Subtract Number of people boarding the train at any given time Specifically, Therefore, the sum of all passengers' waiting times is the sum of the number of passengers waiting on the platform at each time and the minimum time interval. Summing the products of .
[0042] In order to express This invention introduces variables and Let represent the number of passengers waiting to board the train at platform i at time t, and the number of passengers waiting to board the train, respectively. Then it is obvious that:
[0043] ; ;
[0044] in, and They represent the previous time step, respectively. The number of passengers waiting to board the train at platform i (both going up and going down).
[0045] Additionally, set variables. , used to represent the time t at the platform Whether an up / down train has left the platform is considered a given. When a train leaves the platform, it is assumed that passengers waiting on the platform have boarded and stopped waiting. Therefore:
[0046] ;
[0047] After the waiting passengers board the train, they will be on the platform. The number of waiting passengers going up and the number of waiting passengers going down are respectively:
[0048] ; .
[0049] The above is an example of passenger waiting time calculation. Figure 2 As shown. Figure 2 At time 3, 4 new passengers arrive at platform k. At this time, there are 5 waiting passengers going up and 5 waiting passengers going down. The current train is going up, and 5 passengers board. At this time, the number of waiting passengers going up and 5 waiting passengers going down are 0 and 5 respectively. At time 4, 2 new passengers arrive, but no one boards. At this time, the number of waiting passengers going up and 6 waiting passengers going down are 1 and 6 respectively.
[0050] Therefore, the total waiting time of passengers on the line can be calculated simply by constructing the passenger arrival distribution based on the historical passenger arrival data of each station on the line.
[0051] The method for calculating train operation energy consumption in this embodiment of the invention includes the following steps 21 to 23.
[0052] Step 21: Construct a dynamic model of the train during operation, and analyze the forces acting on the train and the work done by traction under different operating conditions. Construct a motion model of the train running between stations, and decompose and simplify the train's operation process.
[0053] like Figure 3As shown, this invention simplifies the train operation process between platforms into three processes: the train starts from this platform, the train runs from this platform to the next platform, and the train stops and brakes at the next platform. Taking into account the train's waiting process at the platform, the train energy consumption is calculated in four parts. Figure 3 In the middle, the train accelerates from a speed of 0 to a speed of... The corresponding time at this time ,from arrive Maintain uniform motion, from Begin to decelerate until stop.
[0054] Step 22: Calculate train energy consumption in segments. Calculate the energy consumption of the train during the acceleration and constant speed operation phases, and calculate the standby energy consumption of the train during the station stop process based on the train's standby power consumption parameters.
[0055] The energy consumption for train startup is the energy required for the train to accelerate from 0 speed to the speed limit between stations. The energy consumed is based on the starting acceleration in the train's basic operating parameters. The time that can be accelerated is The displacement of the vehicle during acceleration is Since the magnitude of the train's traction force during this process is difficult to measure in practice, from an energy perspective, the work done by the train's traction force during this process is equal to the sum of the work done by the train against friction and the train's final kinetic energy. Therefore, the train... Energy consumption during station startup It can be represented as:
[0056] ;
[0057] in, Indicates vehicle weight; This represents the acceleration due to gravity, taken as 9.8 m / s². 2 ; Indicates that the vehicle is in Platform to Speed limits between platforms; This represents the coefficient of friction experienced by the train. Assuming the terrain is flat and the additional resistance caused by the railway gradient is not considered, the resistance experienced by the train only includes its basic resistance, i.e., the resistance experienced by the train when running on a straight track. This includes bearing friction resistance, rolling and sliding friction, and air resistance, etc. Generally, the coefficient of friction of the basic resistance experienced by the train is... It can be represented as:
[0058] ;
[0059] in Let be the coefficient. After solving, the starting energy consumption of the train can be expressed as:
[0060] ;
[0061] Obviously, the energy consumption in this process is a fixed value. After obtaining the basic parameters of the train and the parameters of the train operating section, the starting energy consumption of the train in each section is fixed.
[0062] The train's uniform motion and braking processes are considered simultaneously. During braking, the braking force does no work, therefore there is no energy consumption. However, the train still experiences some displacement during braking, which needs to be distinguished from the uniform motion process. After obtaining the length L of the entire section, the train's displacement X during the uniform motion and braking processes is expressed as:
[0063] ;
[0064] Let the train's travel time in the entire single section be... The train's deceleration process is also a uniform deceleration process. Based on the available information, let the duration of the train's uniform speed travel be... The deceleration braking operation duration is Then we can obtain the following equation:
[0065] ; .
[0066] By combining the above formulas, we can find the answer. The value, .
[0067] Then the train departs from the platform platform Energy consumption during the entire uniform motion process for: .
[0068] The idling energy consumption of a train while stationary is the energy consumed by the engine during standby and other processes when the train is stationary at the platform. Let the energy consumption per unit time of the train in a stationary state be... Then the train is Energy consumption during platform parking and waiting time It can be represented as:
[0069] ;
[0070] in Indicates that the train is Duration of stay on the platform.
[0071] Then the train from Platform to The energy consumption during platform operation is , and The sum is obtained.
[0072] Step 23: Add up the energy consumption of each part of the train operation to obtain the total energy consumption of the train operation on the line, and convert it into a function of the arrival and departure time of the train at each platform.
[0073] Based on the steps above, the energy consumption of a train running one trip (i.e., one circuit) is calculated. for:
[0074] ;
[0075] in, This indicates all the platforms that the train stops at during its journey, including single-track platforms, passing platforms, and passing points. For the train at the platform Energy consumption during idling. For the train from the platform Startup energy consumption For the train from the platform To the next station The energy consumption during uniform motion.
[0076] Therefore, this invention can calculate the total energy consumption of train operation and incorporate it as part of the train timetable optimization objective. After weighting, the objective function F for train timetable optimization can be expressed as:
[0077] ; ;
[0078] in, These are the energy consumption of all train services. Passenger waiting time during all train services The weights; These are the sets of departure times and arrival times for all trains on the train schedule at each platform. These are the sets of train schedules for both the upbound and downbound directions; the objective of train timetable optimization is to find the set that minimizes the F-value. .
[0079] Step 2. By mathematically modeling the various operational requirements of the train, constraints are constructed for the objective function of the train timetable optimization, and nonlinear constraints are linearized.
[0080] This step involves mathematically modeling train operation route information, train operation safety requirements, and constraints such as train stops, avoidance, and connections at platforms, and linearizing the nonlinear constraints generated by the modeling. The mathematical constraints obtained in this step, together with the objective function obtained in step 1, construct a complete and solvable mathematical model for optimizing the train timetable of a single-track railway. To meet various requirements of on-site train operation, the train operation in this embodiment needs to satisfy the following constraints 1 to 7.
[0081] Constraint 1) For a single train service, during its operation on the line, the travel time between any two adjacent platforms must be greater than or equal to the minimum travel time of the segment, and less than or equal to the maximum travel time. Platforms here include avoidance points, i.e., platforms... This constraint can be expressed as:
[0082] ;
[0083] ;
[0084] in, This represents the set of paths between all adjacent stations. and These indicate the sections the train is in. The maximum and minimum allowed runtime. For train schedules The train in the section Leaving the platform Time, For train schedules The train in the section Arrival Platform Time, Indicates that the train departed from the platform. To the next station The section.
[0085] Constraint 2) When the train is on the platform, it must meet the requirement of having a minimum dwell time greater than or equal to the minimum dwell time of the platform, and a maximum dwell time less than or equal to the maximum dwell time. This constraint can be expressed as:
[0086] ;
[0087] ;
[0088] in, For train schedules The train arrived at the platform Time, platform For the platform The previous platform, These represent the maximum and minimum stopping times that a train is allowed to wait at platform i, respectively.
[0089] Constraint 3) For multiple trains traveling in the same direction, the block signaling in the same section needs to be considered. Two trains traveling in the same direction cannot be in the same section at the same time. Therefore, this constraint can be expressed as:
[0090] ;
[0091] in, For train schedules The train arrived at the platform Time; This represents the set of all trains except the first one in the upbound train schedule; This represents the set of remaining train services excluding the first train in the downline train schedule.
[0092] Constraint 4) For connections between two consecutive train services of the same type, the next train service on the same vehicle must depart only after the previous train service has ended. Simultaneously, the maximum and minimum stopping times at the connecting platform must be satisfied. That is, the departure interval between the two train services must be greater than or equal to the minimum stopping time at the connecting platform, and less than or equal to the maximum stopping time at the connecting platform. This constraint can be expressed as:
[0093] ;
[0094] ;
[0095] in, This refers to the number of trains operating simultaneously in one direction on the line, used to indicate the connection relationship between trains traveling in the same direction on the line. For example, after a train with train number 1 completes one circuit, the train number of the next train will change to [missing information]. ; For train schedules The time when the train departs from platform 1; For train schedules The time when the train arrives at platform 1.
[0096] Constraint 5) For yielding between oncoming vehicles, similar to the block constraint in the same direction, no two oncoming vehicles can exist in the same segment at the same time; that is, all oncoming trips should pass through the segment before or after their current trip occupies it. To transform this nonlinear constraint into a linear one, this invention uses the Big M method, where M is a very large integer. The Big M method is used to process nonlinear constraints, such as those in the form of... The constraints are imposed by a large integer M and a 0-1 decision variable. Linearization is performed as follows: .
[0097] Therefore, the following constraints can be established here to replace the original nonlinear constraints, ensuring that opposing trains will not collide within the same section:
[0098] ;
[0099] ;
[0100] ; ;
[0101] in, Safety time indicates the time required to switch the track before and after the passing station; Choose a binary variable; Indicates train number The down train in the section Arrival Platform Time, Indicates train number The down train in the section Leaving the platform The time.
[0102] Constraint 6) For yielding points, vehicles can proceed directly when there are no oncoming vehicles. When oncoming vehicles are present, vehicles on one side need to enter the yielding line in advance to yield, while vehicles on the other side can proceed directly. Vehicles waiting to yield also need to meet the minimum and maximum stopping times constraints at the yielding point. To facilitate the representation of yielding point situations, this invention defines variables... Used to indicate shift Did the train stop at the yielding point?
[0103] ;
[0104] in Let i be the set of avoidance points. Then, the constraints for parking at avoidance point i are constructed as follows:
[0105] ;
[0106] .
[0107] Constraint 7) For ordinary platforms on the line, since they only have one main line, they do not exist as endpoints of block sections and cannot be used to handle avoidance. However, when a train arrives at the platform, it still needs to stop. Two opposing trains cannot stop at the same single-track station at the same time and must meet the isochronous constraint. Similar to the nonlinear constraint handling of opposing train avoidance in constraint (5) above, the isochronous constraint that trains need to meet at ordinary platforms is as follows:
[0108] ;
[0109] ;
[0110] ;
[0111] in, , Choose a binary variable. and It needs to be optimized.
[0112] Step 3. Solve the constructed single-track railway train timetable optimization problem using Lagrange constraint relaxation and subproblem decomposition. This invention employs the Lagrange relaxation algorithm to relax and simplify the constructed single-track railway train timetable optimization problem. The process is as follows: Figure 1 As shown.
[0113] Step 31: Perform constraint relaxation and subproblem decomposition on the original problem. Clearly, the biggest challenge of a single-track railway lies in the shortage of track resources and the resulting train avoidance problem. Therefore, the constraint involving the avoidance of oncoming trains at the platform is identified and treated as a difficult constraint in the problem, and a relaxation operation is performed. The relaxed objective function is shown in the following equation:
[0114] ;
[0115] in, It is a Lagrange multiplier.
[0116] The relaxed constraints are then removed from the constraint set. At this point, there are no constraints in the constraint set that simultaneously involve oncoming vehicles. Therefore, the time variables for uphill and downhill vehicles can be separated, decomposing the original problem into two subproblems, denoted as Subproblem 1 and Subproblem 2, respectively, where each subproblem is only related to the arrival and departure times of uphill and downhill vehicles. In solving the subproblem for the arrival and departure times of vehicles in a certain direction, the solution from the previous round for oncoming vehicles is substituted, treating the arrival and departure times of oncoming vehicles as constants. The objective functions for the two subproblems are:
[0117] ;
[0118] ;
[0119] in This refers to the train number for the northbound journey. This refers to the train schedule for the southbound route. These represent the sets of arrival and departure times of each train on the uphill route at each platform. These represent the sets of arrival and departure times of each downline train at each platform.
[0120] Step 32: Process the simplified relaxation model. The main process includes steps such as Lagrange penalty term restriction and constraint linearization to further optimize the solution process, ensure the linearization of the original objective function, reduce solution time, and facilitate subsequent solutions.
[0121] Because excessive constraint relaxation can lead to an expanded solution space and difficulty in obtaining a feasible solution to the original problem, the Lagrange relaxation algorithm can also cause problems. Since the Lagrange relaxation algorithm relaxes some constraints into the objective function, turning the original hard constraints into penalty terms in the objective function, the solution obtained by this method may still violate the relaxed constraints, thus leading to an infeasible train timetable. To address this problem, this invention draws inspiration from activation functions in neural networks, incorporating commonly used activation functions from neural networks... By introducing constraints into the relaxed constraints, the algorithm is guaranteed to only penalize violations of constraints and not reward compliance. This avoids the solver from over-satisfying certain constraints to obtain sufficient rewards to offset the penalties for violating other constraints, thus obtaining a feasible solution to the original problem to construct the train operation diagram.
[0122] ;
[0123] ;
[0124] for Its formula is as follows:
[0125] ; For input variables.
[0126] Clearly, this constraint is not a linear constraint and needs to be linearized; it cannot be directly applied to the established mathematical model. To handle... The method of this invention introduces new variables y and z, where Let z be a 0-1 decision variable. Using the Big M method, a maximal integer M is introduced, and the variable is linearized as follows:
[0127] ; ; ;
[0128] ; .
[0129] Substituting the relaxed Lagrange penalty term into x and applying the above constraints, we obtain its path. The processed value is written into the objective function. Applying this linearization constraint ensures the linearization of the original problem, allowing the relaxed subproblems to still be solved using a solver.
[0130] Step 4. Use the subgradient algorithm to alternately solve the two subproblems. In the subproblem of solving the arrival and departure times of vehicles in a certain direction, substitute the solution from the previous round for the oncoming vehicles, treating the arrival and departure times of the oncoming vehicles as constants. During the iteration process, gradually reduce the solution tolerance and iteration step size to approach the optimal solution, until the iteration reaches the preset maximum number of rounds and ends. Combine the solutions to the two subproblems into the solution to the original problem, and transform it into an executable train timetable as the final solution result.
[0131] The embodiments of the present invention employ the following steps to iteratively and alternately solve the sub-problems:
[0132] Step 41: Initialize the Lagrange multipliers, and initialize the iteration step size, solution tolerance, and other solution parameters of the Lagrange relaxation model and subgradient algorithm.
[0133] Step 42: Substitute the initial solution or the previous generation solution into subproblem 1, use the solver to solve subproblem 1, obtain the solution to subproblem 1, and construct the train schedule for all upbound train services.
[0134] Step 43: Substitute the solution of subproblem 1 into subproblem 2, use the solver to solve subproblem 2, obtain the solution of subproblem 2, and construct the train schedule for all down-line train services.
[0135] Step 44: Using the subgradient algorithm, obtain the subgradient of the Lagrange multiplier based on the solutions to subproblems 1 and 2, and update the Lagrange multiplier.
[0136] This invention updates the Lagrange multipliers according to the following formula, wherein the Lagrange multipliers in the (m+1)th iteration are updated as follows:
[0137] ;
[0138] ;
[0139] ;
[0140] ;
[0141] Wherein, the superscript m+1 and m correspond to the round number of the current iteration; Let be the iteration step size of the subgradient algorithm in the m-th round; Let be the subgradient of the Lagrange multipliers in the current round. According to the relaxed objective function of the original problem, it is obvious that:
[0142] .
[0143] For a relaxed constraint, the subgradient of its corresponding Lagrange multiplier is the value of that constraint in the m-th iteration.
[0144] Step 45: Decrease the update step size and solution tolerance of the Lagrange multipliers. For the update step size of the Lagrange multipliers, if no better solution is obtained within a certain number of iterations, decrease the iteration step size. Regarding the solution tolerance, this invention decreases the solution tolerance as the number of solution rounds increases, thereby avoiding getting trapped in local optima in the initial solution rounds due to setting too small a tolerance, and gradually approaching the optimal solution of the subproblem in subsequent solution rounds.
[0145] Step 46: Repeat steps 42 to 45 until the preset maximum number of iterations is reached, then stop iterative solving.
[0146] After completing the iterative solution, this invention can obtain the arrival and departure times of the up-line and down-line train schedules at each platform from the solutions of the two sub-problems, and combine the solutions of the two sub-problems to obtain a practical and feasible train schedule optimized according to the objective function.
[0147] Except for the technical features described in the specification, all other technologies are known to those skilled in the art. Descriptions of well-known components and technologies are omitted in this invention to avoid redundancy and unnecessary limitation. The embodiments described above do not represent all embodiments consistent with this application. Various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of this invention are still within the protection scope of this invention.
Claims
1. A method for compiling train timetables for single-track bidirectional railways based on the Lagrange relaxation algorithm, characterized in that, Includes the following steps: Step 1: Construct a mathematical model and objective function for solving the train timetable of a single-track bidirectional railway; the data model includes modeling passenger waiting time and train energy consumption during train operation; the train timetable is optimized by reducing passenger waiting time and train energy consumption. Passenger waiting time during train operation is calculated by constructing a passenger arrival distribution matrix using actual passenger arrival data at each station along the operating line, and then calculating the number of waiting passengers at each station at different time points based on the train's arrival and departure times at each station. The minimum time interval between adjacent time points is also calculated. This allows for the calculation of the waiting time for all passengers before they board the train at all points in time. The energy consumption of a train during its journey from the current platform to the next platform is divided into four parts: the energy consumption of the train starting from the current platform, the energy consumption of the train moving at a constant speed, the energy consumption of the train braking, and the energy consumption of the train idling while it is stopped at the current platform. The total energy consumption of all train services is then calculated based on the train timetable. Step 2: Construct constraints for train timetable optimization based on train operation requirements, linearize nonlinear constraints, and combine them with the objective function from Step 1 to form a mathematical model for the train timetable optimization problem. Step 3: The Lagrange relaxation process is applied to the obstacle avoidance constraints of oncoming trains at the platform in the train timetable optimization problem. This relaxation is then added as a Lagrange penalty term to the objective function. The train timetable optimization problem is decomposed into two sub-problems, and the arrival and departure time sets of the up-line trains and down-line trains are solved separately. The ReLU activation function of the neural network is then used to constrain the Lagrange penalty term in the objective function of the sub-problems, and linearization is performed. Step 4: Iterate through the two subproblems until the maximum number of iterations is completed; in each iteration, solve the two subproblems alternately, and when solving one subproblem, use the solution of the other subproblem as a fixed value, and use the subgradient algorithm to update the Lagrange multipliers; merge the solutions of the two subproblems into the solution of the original problem, and convert it into a train timetable for execution as the final solution result.
2. The method according to claim 1, characterized in that, Step 1, which involves calculating passenger waiting time during train operation, includes: Step 11: Obtain passenger arrival data for each station on the historical operating route, and construct a passenger arrival distribution matrix. Each column of this matrix corresponds to a time point, and each row corresponds to a station. The elements in the matrix... This represents the number of passengers arriving at platform i at time t; the number of passengers arriving at platform i at time t is determined by statistics. The number of passengers arriving at platform i is obtained, among which , The complete set of times obtained for the train timetable. The starting time for solving the train timetable; Step 12: Let I be the set of single-track platforms and passing platforms in the entire line, and calculate the passenger waiting time for all train services. for: ; in, The total number of people waiting on platform i at time t is the sum of the number of people waiting on platform i at the previous time and the number of passengers arriving at platform i at time t. Subtract the number of people who boarded the train at time t. We obtain: Assume the train has sufficient capacity, and at time t, the number of passengers arriving at platform i in both directions is equal. ; The number of people who board the train at time t Represented as: ; These represent the number of passengers waiting to board the train at platform i at time t, respectively, for both upward and downward travel. The number is calculated by adding the number of passengers waiting to board the train at platform i at the previous time step to the number of upward or downward travel passengers. get; These represent the time t at the platform. Whether an up or down train has left the platform is entered; if so, the value is 1, otherwise the value is 0.
3. The method according to claim 1, characterized in that, Step 1, the step of calculating the train's operating energy consumption, includes: assuming the train is at the platform... platform The speed limit between them is The starting acceleration is ; Calculate the train from the platform Startup energy consumption ;in, For vehicle weight, It is the acceleration due to gravity; The coefficient of friction experienced by the train. , For coefficients; The train departs from the platform platform Energy consumption during uniform motion ;in This refers to the travel time of the train during the constant speed running phase. During the braking process, the braking force does not do any work and consumes no energy; The train is at the platform Idle energy consumption during stationary operation ;in This refers to the energy consumption of a train per unit time when it is stationary. For the train at the platform Duration of stay; Then the train from Platform to The energy consumption during platform operation is , and Summation yields the result; Energy consumption of train k-th trip The calculation is as follows: ; in, This indicates all the platforms that the train stops at during its journey, including single-track platforms, passing platforms, and passing points; For trains at the platform or passing point Energy consumption during idling. For trains to pass through the platform or passing point Startup energy consumption For the train from the platform To the next station The energy consumption during uniform motion.
4. The method according to claim 1, 2, or 3, characterized in that, Step 1, the objective function F for optimizing the train timetable is constructed as follows: ; Where E and TWT are the train operation energy consumption and passenger waiting time for all train services, respectively, with weights of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ... ; These are the sets of departure times and arrival times of all trains on the train timetable.
5. The method according to claim 1, characterized in that, In step 2, the train operation requirements include: (1) The running time of a single train in each section of the line shall be greater than or equal to the minimum running time of the section and less than or equal to the maximum running time of the section; a section refers to the path between adjacent platforms or between adjacent platforms and a passing point; (2) Trains stopping at stations must meet the constraints of the minimum and maximum stopping times of the platform, that is, the time a train spends on the platform must be greater than or equal to the minimum stopping time of the platform and less than or equal to the maximum stopping time of the platform. (3) For different trains traveling in the same direction, the two trains traveling in the same direction cannot be in the same section at the same time; (4) The next train of the same train is required to depart after the previous train has finished. At the same time, the departure interval between the two trains must be greater than or equal to the minimum stop time at the connecting platform and less than or equal to the maximum stop time at the connecting platform. (5) For trains traveling in opposite directions, two trains traveling in opposite directions cannot be in the same section at the same time; (6) Trains waiting to give way must meet the constraints of minimum and maximum stopping time at the point of departure; (7) Two trains traveling in opposite directions cannot stop at the same single-track platform at the same time.
6. The method according to claim 5, characterized in that, In step 2, the nonlinear constraints are linearized using the Big M method, including: Linearizing constraint (5) yields: ; ; ; ; Linearizing constraint (7) yields: ; ; ; ; in, Represents the set of paths between all adjacent stations; These are the sets of train schedules for the northbound and southbound train schedules, respectively. For safe time; and They are the train schedules The northbound train in the section Leaving the platform Time and arrival platform Time; and They are the train schedules The down train in the section Leaving the platform Time and arrival platform The time; M is a very large integer. and All are 0-1 decision variables; I represents the set of all single-track platforms and bypass platforms on the entire line, and IS represents the set of single-track platforms on the entire line.
7. The method according to claim 1, characterized in that, Step 3 includes: Step 31: Decompose the train timetable optimization problem into two sub-problems, and the objective functions of the sub-problems are expressed as follows: ; in, The Lagrange multiplier is used; the objective function X for solving subproblem 1 is the set of arrival times of each train on the uphill route at each platform. and a collection of departure times from each platform. The objective X of subproblem 2 is the set of arrival times of each down-line train at each platform. and a collection of departure times from each platform. ; Step 32: Use the ReLU activation function to constrain the Lagrange penalty term in the subproblem objective function, as shown below: ; Using the Big M method to activate the function Linearization involves introducing variables y and z, and setting... , For input variables, For 0-1 decision variables, the activation function will be... The linearization constraints of the transformation are as follows: ; ; ; ; ; Substituting the restricted Lagrange penalty term into x, and applying the linearization constraints described above, we obtain the result after... The processed value is written into the objective function of the subproblem.
8. The method according to claim 1, characterized in that, In step 4, the method of updating each Lagrange multiplier using the subgradient algorithm is as follows: Let... If the value of a Lagrange multiplier is given in round m, then update the value of that Lagrange multiplier in round m+1. as follows: ; in, Let be the iteration step size of the subgradient algorithm in the m-th round; The result obtained after solving the two subproblems in the m-th round. The subgradient, where the subgradient value is the value of the corresponding constraint.
9. The method according to claim 1 or 8, characterized in that, Step 4 includes: Step 41) Initialize the Lagrange multipliers, the iteration step size of the subgradient algorithm, and the solution tolerance; Step 42) Solve subproblem 1 using the initial solution or the solution from the previous round as a fixed value to obtain the train schedule for all upbound train services; Step 43) Substitute the solution of subproblem 1 into subproblem 2, solve subproblem 2, and obtain the train schedule for all down-line train services; Step 44) Using the subgradient algorithm, obtain the subgradient of the Lagrange multipliers based on the solutions to subproblems 1 and 2, and update the Lagrange multipliers; Step 45) Decrease the iteration step size and solution tolerance of the subgradient algorithm; Step 46) Repeat steps 42 to 45 until the preset maximum number of iterations is reached, then stop iterative solving.