A bus scheduling method and device based on a starling optimization algorithm and a medium

By constructing a bus scheduling method based on the star-sparrow optimization algorithm and combining it with a hybrid search strategy, the problems of dynamic passenger flow adaptability and high operating costs of traditional bus scheduling methods are solved. This achieves an efficient bus dispatching scheme and improves the service quality and economic benefits of the bus system.

CN123159701APending Publication Date: 2026-11-24CHANGSHA CRRC INTELLIGENT CONTROL & NEW ENERGY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510665654.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Traditional bus scheduling methods suffer from poor adaptability to dynamic passenger flow, high operating costs, and low efficiency under multi-objective constraints.

Method used

A bus scheduling method based on the star-sparrow optimization algorithm is adopted to construct an optimization model that integrates time-segmented passenger flow prediction, vehicle resource constraints and operating cost control. An initial population is generated through a discrete encoding mechanism, and a hybrid search strategy combining global search, local search and jump operation is combined to dynamically monitor the improvement of fitness value, trigger jump operation to avoid local optima, and introduce a penalty function to correct individuals that violate constraints.

Benefits of technology

It significantly improves the dynamic adaptability and solution efficiency of bus scheduling, reduces passenger waiting time and operating costs, and enhances the service quality and economic benefits of the public transportation system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123159701A_ABST
    Figure CN123159701A_ABST
Patent Text Reader

Abstract

This invention relates to a bus scheduling method, equipment, and medium based on the star-sparrow optimization algorithm. The method includes: constructing a bus scheduling optimization model, setting a dual objective function of passenger waiting time and departure cost, and constraints such as passenger capacity and departure interval; using the number of departures in each time period as an integer decision variable, generating an initial population that satisfies the constraints through discrete encoding; initiating iterations based on the star-sparrow optimization algorithm, using total cost as the fitness function, dividing the roles into discoverers, followers, and vigilants, and executing a hybrid search strategy; dynamically monitoring the fitness improvement rate, triggering a jump operation and introducing a global mutation perturbation if continuous iterations fail to reach a threshold; applying a penalty function to individuals that exceed the limit and correcting them to the feasible region through discrete encoding; updating the global optimal solution until the termination condition is met, and outputting the optimal scheduling scheme with the minimum total cost, thus achieving efficient solution under strong constraints of multiple objectives.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of thermodynamics engineering, specifically to a bus scheduling method, equipment, and medium based on the star-sparrow optimization algorithm. Background Technology

[0002] With the acceleration of urbanization, urban public transport systems, as a core component of public transport networks, play a vital role in alleviating traffic congestion, reducing carbon emissions, and improving travel efficiency. However, most public transport systems still rely on static scheduling models, developing dispatch plans based on fixed timetables or manual experience, making it difficult to adapt to dynamic passenger flow changes and complex traffic environments. This rigid scheduling method often leads to excessively long passenger waiting times and vehicle overloading during peak hours, while off-peak hours suffer from resource idleness and wasted operating costs, severely restricting the service quality and economic efficiency of public transport systems.

[0003] In recent years, the rise of big data and artificial intelligence technologies has driven the intelligent development of public transportation scheduling. Existing research mainly explores dynamic scheduling schemes by combining passenger flow prediction technology with intelligent optimization algorithms. For example, passenger flow prediction methods based on time series models (such as ARIMA) or deep learning models (such as LSTM and graph neural networks) can partially capture the spatiotemporal evolution of passenger flow; meanwhile, intelligent algorithms such as genetic algorithms (GA) and particle swarm optimization (PSO) have been introduced into scheduling optimization to attempt to solve multi-objective, strongly constrained scheduling problems. However, traditional methods still have significant shortcomings: 1. Most studies are based on the assumption of uniform passenger flow or stable traffic conditions, which makes it difficult to cope with real-world complex scenarios such as peak congestion and vehicle resource constraints; 2. Traditional optimization algorithms (such as GA and PSO) have slow convergence speed when dealing with high-dimensional integer variables, are prone to getting trapped in local optima, and have insufficient ability to handle strong constraints. 3. Existing methods are disconnected in the dynamic coordination between passenger flow forecasting and scheduling decisions, resulting in insufficient real-time scheduling schemes and difficulty in achieving accurate responses.

[0004] While novel algorithms, such as the Sparrow Search Algorithm (SSA), have shown potential in fields such as energy scheduling, they still face bottlenecks in bus scheduling problems, such as unstable solution quality and low computational efficiency. Summary of the Invention

[0005] This invention provides a bus scheduling method, equipment, and medium based on the star-sparrow optimization algorithm. Its purpose is to solve the problems of poor adaptability to dynamic passenger flow, high operating costs, and low solution efficiency under multi-objective and strong constraints of traditional bus scheduling methods.

[0006] To achieve the above objectives, the first aspect of this invention provides a bus scheduling method based on the star-sparrow optimization algorithm, comprising the following steps: A bus scheduling optimization model is constructed that integrates time-segmented passenger flow forecasting, vehicle resource constraints, and operating cost control. The bus scheduling optimization model takes minimizing the average passenger waiting time and departure operating cost as its dual objective functions. Define the constraints for the bus scheduling optimization model; The number of departures in each time period is used as an integer decision variable. An initial population is generated using a discrete coding mechanism. Each individual in the initial population represents a scheduling scheme that satisfies all constraints. The iterative optimization process is initiated based on the star-sparrow optimization algorithm. The fitness function is defined as the dual objective function. The fitness values ​​of individuals in the initial population are calculated, and the current global optimal solution is recorded. In each iteration, a hybrid search strategy including global search, local search and jump operation is executed. The global search updates the departure count based on the current optimal solution, the local search adjusts the departure count in the neighborhood, and the jump operation randomly resets some departure counts to escape the local optimum. The improvement of fitness value is monitored through a dynamic threshold control mechanism. If the improvement of fitness value is lower than the threshold in a preset number of consecutive iterations, a jump operation is triggered and the number of departures is adjusted in conjunction with the global mutation perturbation. A penalty function is applied to individuals that violate the constraints, and the number of departures is corrected to the feasible region through a discrete coding mechanism; Update the global optimal solution. If the termination condition is met, stop the iteration and output the optimal scheduling plan.

[0007] Furthermore, the formula for the dual objective function is as follows:

[0008] in, Operating cost per vehicle trip; For the first t Number of departures within a time period; Weighting coefficients for passenger waiting time costs; Cost per unit of waiting time; For the first t Predicted passenger flow for a given time period; The length of a single time period; This represents the total number of operating time periods.

[0009] Furthermore, the constraints include: Passenger capacity constraint: The number of passengers on each trip within each time period shall not exceed the vehicle's maximum passenger capacity, thus satisfying the requirement. ;in, The maximum number of passengers a single bus can carry; Minimum departure interval constraint: The departure interval within each time period shall not be less than the minimum departure interval, which is determined based on the round-trip travel time of a vehicle and the total number of dispatchable vehicles. And satisfy ,in, This is the minimum departure interval; Indicates the round-trip travel time of a vehicle. The total number of available buses; Vehicle dispatching capacity limit: The number of departures within each time period shall not exceed the maximum dispatchable capacity, i.e. ; Integer constraint: The number of departures in each time period is a positive integer, i.e. ,in, A set of positive integers.

[0010] Furthermore, methods for generating the initial population using discrete coding mechanisms include: For each time period, based on vehicle scheduling capacity constraints and minimum departure interval constraints, calculate the lower and upper limits of the number of departures for that time period; For each time period, randomly generate an integer number of departures within the range of the lower and upper limits; Verify whether the generated integer number of departures satisfies the passenger capacity constraint, minimum departure interval constraint, vehicle scheduling capacity limit, and integer constraint; If there is a time period that violates the constraints, the number of integer departures in that time period will be adjusted to the nearest feasible integer value that satisfies all constraints. Repeat the above steps until a preset number of feasible individuals are generated, forming the initial population.

[0011] Furthermore, the adjustment method for adjusting the number of integer departures during this period to the nearest feasible integer value that satisfies all constraints is as follows: If the passenger capacity exceeds the limit, increase the number of departures in integers until the limit is met. The smallest integer; If the departure interval is less than the minimum value, then reduce the number of integer departures until the minimum value is met. The largest integer.

[0012] Furthermore, methods for monitoring the magnitude of fitness value improvement through dynamic threshold control mechanisms include: Set the fitness value improvement threshold to a preset percentage of the total cost, and set the number of continuous monitoring iterations; In each iteration, the fitness value of the current best solution is calculated and compared with the historical best value, and the improvement is recorded; If the improvement rate of the consecutive monitoring iterations is lower than the threshold, a jump operation is triggered. During the jump operation, a subset of individuals are randomly selected, and their departure frequency is globally mutated and perturbed.

[0013] Furthermore, the fitness function is calculated as follows: The weighted sum of total operating costs and passenger waiting time costs is calculated using the following formula:

[0014] in, Let be the objective function, representing the total operating cost. The weighting coefficient for passenger waiting time costs.

[0015] Furthermore, the termination conditions include: The preset maximum number of iterations has been reached; The fitness value did not change significantly in several consecutive iterations.

[0016] To achieve the above objectives, a second aspect of the present invention provides an electronic device, including a memory and a processor, wherein the memory is used to store a program that supports the processor in executing the bus scheduling method based on the star-sparrow optimization algorithm, and the processor is configured to execute the program stored in the memory.

[0017] To achieve the above objectives, a third aspect of the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, performs the steps of the bus scheduling method based on the star-sparrow optimization algorithm.

[0018] The beneficial effects of this invention are: Compared with existing technologies, this invention provides a bus scheduling method, equipment, and medium based on the Nova Scotia Algorithm (NOA). Through an improved NOA algorithm and a multi-objective dynamic modeling framework, it solves the problems of poor dynamic adaptability, high cost, and low solution efficiency in traditional bus scheduling. Specifically, it first constructs a dual-objective optimization model that integrates time-segmented passenger flow prediction and vehicle resource constraints, with minimizing passenger waiting time and departure costs as the core. Through mathematical modeling, it accurately quantifies the coupled impact of passenger flow dynamics (such as peak congestion) and resource constraints (such as vehicle capacity), breaking through the dependence of traditional static scheduling on the assumption of uniform passenger flow. Secondly, to address the complexity of high-dimensional integer decision variables, a discrete encoding mechanism is designed to generate an initial population that satisfies all constraints. This is combined with dynamic threshold control and a hybrid search strategy (global search, local exploration, and jump operations) to achieve a balance between global exploration and local optimization: the global search guides the population to converge quickly based on the current optimal solution, the local search finely adjusts the departure frequency within the neighborhood to improve solution quality, and the dynamically triggered jump operations effectively avoid the pitfalls of traditional algorithms that easily get trapped in local optima through random resets of departure counts and global mutation perturbations. Simultaneously, a penalty function and discrete correction mechanism are introduced to correct individuals that violate constraints such as passenger capacity and departure intervals in real time, ensuring the feasibility of the solution. Through the synergy of these technologies, this invention significantly improves solution efficiency under strong constraints. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below.

[0020] Figure 1 This is a flowchart of a bus scheduling method based on the star-sparrow optimization algorithm disclosed in an embodiment of the present invention.

[0021] Figure 2 This is a flowchart of a bus scheduling optimization algorithm disclosed in an embodiment of the present invention.

[0022] Figure 3 This is a convergence trend performance graph of an SSA disclosed in an embodiment of the present invention.

[0023] Figure 4 This is a convergence trend performance graph of a NOA disclosed in an embodiment of the present invention. Detailed Implementation

[0024] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0025] According to embodiments of the present invention, it should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the following manufacturing method, in some cases the steps shown or described may be performed in a different order than that shown here.

[0026] like Figure 1 , Figure 2 As shown, this invention provides a bus scheduling method based on the larkspur optimization algorithm, comprising the following steps: Step S100: Construct a bus scheduling optimization model that integrates time-segmented passenger flow forecasting, vehicle resource constraints, and operating cost control. The bus scheduling optimization model takes minimizing the average passenger waiting time and departure operating cost as its dual objective functions. This step aims to establish a dynamic response bus scheduling optimization model to address the poor adaptability of traditional static scheduling to passenger flow fluctuations. The bus scheduling optimization model has two optimization objectives: minimizing average passenger waiting time and departure operating costs, combined with time-segmented passenger flow forecast data and vehicle resource constraints. The specific construction process is as follows: Urban public transport systems face the dual challenges of time-varying passenger flow (e.g., peak-hour congestion, off-peak idleness) and limited resources (e.g., vehicle capacity and dispatching capacity). Traditional scheduling relies on fixed timetables or manual experience, failing to dynamically balance service quality and cost control, resulting in excessively long passenger wait times during peak hours and high vehicle empty rates during off-peak hours. To address this, this model integrates time-segmented passenger flow forecasts (e.g., predicted passenger volume)... Vehicle resource parameters (passenger capacity) Total number of dispatchable vehicles Round trip time and operating cost parameters (cost per shift) Unit waiting time cost A dynamic scheduling framework is constructed to achieve multi-objective collaborative optimization.

[0027] To ensure the feasibility and rationality of the bus scheduling plan in actual operation, the model must simultaneously meet the following three aspects: 1) Passenger service quality: The departure schedule should cover all passenger demand, reduce passenger waiting time during peak hours, and avoid congestion and overcrowding caused by full vehicles; 2) Enterprise operating cost control: While ensuring service levels, reasonably control the number of departures and the number of vehicles used to reduce labor, fuel and operating costs; 3) Vehicle resources and operational constraints: Physical and scheduling constraints such as vehicle capacity limits, turnaround time, and total number of vehicles must be met to ensure that each round of departures is feasible within the scheduling capacity.

[0028] In this embodiment, the objective function of the model is defined as minimizing the total operating cost, which is a weighted average of departure cost and passenger waiting time cost, as shown in the following formula: (1) in, Operating cost per vehicle trip; For the first t Number of departures within a time period; Weighting coefficients for passenger waiting time costs; Cost per unit of waiting time; For the first t Predicted passenger flow for a given time period; The length of a single time period; This represents the total number of operating time periods. It's understandable that the first item... This represents the total departure cost, divided by the number of departures in each time period. Related to; the second item This represents the cost of passenger waiting time, in relation to departure frequency. Inversely proportional, weighting coefficient Used to balance the priorities of the two.

[0029] By integrating dynamic passenger flow forecasting with multi-objective optimization mechanisms, this approach breaks through the traditional model's reliance on the assumption of uniform passenger flow and directly quantifies the constraints of vehicle resources (such as load limits and departure intervals) and cost targets in actual operation.

[0030] Step S200: Set the constraints of the bus scheduling optimization model; To address the physical constraints and scheduling rules of bus queuing, the core constraints of the model are defined to ensure the feasibility of the generated queuing scheme in actual operation. The specific constraints are as follows: Passenger capacity constraint: The number of passengers on each trip must not exceed the vehicle's permitted passenger capacity to avoid passenger congestion and safety hazards caused by overloading. Mathematically, this constraint is expressed as: (2) in, This is the maximum number of passengers a single bus can carry; this constraint ensures that all passengers can board the bus on time and reduces the risk of congestion by limiting the average number of passengers per trip.

[0031] Minimum departure interval constraint: To ensure vehicle operation safety and dispatching efficiency, the departure interval time in any time period must not be less than the minimum departure interval. The minimum departure interval is determined by the round-trip travel time of a vehicle and the total number of dispatchable vehicles, as shown in the formula: (3) The corresponding departure intervals must meet the following requirements: (4) in, This is the minimum departure interval; Indicates the round-trip travel time of a vehicle. This represents the total number of available buses; this constraint ensures that vehicles can be promptly deployed to the next round of dispatch after completing their round-trip missions, avoiding insufficient vehicle turnover due to overly frequent departures.

[0032] Vehicle dispatching capacity limitations: Limited by the total number of vehicles that can actually be dispatched, the number of departures in each time period must meet the dispatching capacity limit, that is: (5) This constraint limits the maximum number of departures per unit time, thus avoiding exceeding the physical carrying capacity of vehicle resources and ensuring the operability of the scheduling scheme.

[0033] Integer Constraint: Since the number of departures in actual operation must be discrete integer values, the model requires the number of departures in each time period to satisfy: (6) in, The set of positive integers; this constraint reflects the discrete nature of the scheduling problem, ensuring that the physical meaning of the solution is consistent with the actual scheduling requirements.

[0034] Step S300: The number of departures in each time period is used as an integer decision variable. An initial population is generated using a discrete coding mechanism. Each individual in the initial population represents a scheduling scheme that satisfies all constraints. This step aims to generate an initial set of feasible solutions (initial population) that satisfies all constraints through discrete encoding. The specific implementation process is as follows: Each time period t Number of departures Defined as a positive integer decision variable, i.e. This is to reflect the discrete nature of the number of departures in actual scheduling. The number of departures in each time period needs to be determined independently, and the combination of the number of departures in all time periods constitutes a single scheduling scheme.

[0035] For each time period t According to vehicle dispatching capacity limitations ( ) and minimum departure interval constraint ( ), calculate the feasible range of departure times for that period, i.e., the lower limit and the upper limit.

[0036] For each time period, an integer number of departures is randomly generated within the range of the lower and upper limits to form a preliminary scheduling plan. Subsequently, the generated plan is validated against global constraints. Passenger load constraints: Check if they are met. ; Departure interval constraint: Verification: ; Integer constraints: ensure It is a strictly positive integer.

[0037] If the number of departures in a certain time period violates the constraint, then a nearest-nearest-feasible correction is performed: Passenger capacity exceeded ( ): Increase To satisfy The smallest integer, i.e. ; Insufficient departure intervals ( ): Decrease To satisfy The largest integer, i.e. .

[0038] Repeat the above generation and correction process until a predetermined number (e.g., 100) of feasible scheduling schemes are generated, forming the initial population. Each individual is a complete departure frequency matrix, representing a potential optimal solution that satisfies all constraints.

[0039] By employing a discrete encoding mechanism and constraint correction strategy, all individuals in the initial population are feasible solutions, avoiding redundant searches in the invalid solution space and improving the efficiency and convergence speed of subsequent iterative optimizations. Simultaneously, the combination of random generation and interval constraints ensures population diversity.

[0040] Step S400: Start the iterative optimization process based on the star-sparrow optimization algorithm, define the fitness function as the dual objective function, calculate the fitness value of individuals in the initial population, and record the current global optimal solution; The initial population (i.e., multiple feasible scheduling scheme individuals) generated in step S300 is imported into the Sparrow Optimization Algorithm (NOA) framework, and each individual is encoded as a vector of departure times for each time period. Algorithm parameters (such as population size, maximum number of iterations, and dynamic transition threshold) are preset according to the actual scheduling scenario.

[0041] Using the biobjective function (total operating cost) constructed in step S100 as the fitness evaluation criterion, its calculation formula is as follows: (7) in, Let be the objective function, representing the total operating cost. As a weighting factor for passenger waiting time costs, it's understandable that the first item directly quantifies departure costs, in relation to the number of departures. The first term is directly proportional to the second term, which is based on passenger waiting time costs and departure frequency. Inversely proportional, weighting coefficient Used to adjust the optimization priority of both.

[0042] For individuals that violate constraints (such as exceeding passenger capacity limits), additional penalty terms are added to force their fitness to deteriorate, ensuring that the algorithm prioritizes feasible solutions.

[0043] The algorithm iterates through each individual in the initial population, calculates its fitness value, and selects the individual with the best fitness (lowest total cost) as the current global optimum. This optimum will serve as a reference benchmark for subsequent population searches, guiding the population to evolve towards a better direction.

[0044] Step S500: In each iteration, a hybrid search strategy including global search, local search and jump operation is executed. The global search updates the departure count based on the current optimal solution, the local search adjusts the departure count in the neighborhood, and the jump operation randomly resets some departure counts to escape the local optimum. Based on NOA's swarm intelligence mechanism, individuals in the population are divided into three roles: Discoverer (Global Searcher): An individual with better fitness is responsible for moving closer to the current optimal solution and guiding the population to converge quickly; in the safe region (individuals with better fitness), it moves closer to the current global optimal solution; in the dangerous region (individuals with poor fitness), it performs random perturbations to explore new solutions.

[0045] Followers (local developers): They perform a fine-grained search of the neighborhood around the discoverer to uncover potential high-quality solutions; that is, they refer to the location of the discoverer and perform a fine-grained search within the neighborhood to optimize local solutions.

[0046] Watchdog (Jump Executor): An individual with poor fitness performs a jump operation when the algorithm gets stuck in a local optimum. It resets the number of departures by randomly perturbing the algorithm, thereby increasing the diversity of the population. That is, it selects the individual with the worst fitness and performs a jump operation (such as randomly resetting the number of departures) to help the population escape the local optimum.

[0047] Using the above strategy, step S500 optimizes the scheduling scheme in each iteration, gradually approaching the global optimal solution, while taking into account both solution efficiency and solution quality.

[0048] Step S600: Monitor the improvement of fitness value through a dynamic threshold control mechanism. If the improvement of fitness value is lower than the threshold in a preset number of consecutive iterations, trigger a jump operation and combine it with the number of departures to change the global mutation perturbation. This step dynamically monitors the algorithm optimization process and adaptively adjusts the search strategy to address the potential for the algorithm to get stuck in local optima or convergence stagnation in the later stages. The specific implementation is as follows: Set the fitness improvement threshold to a preset percentage of the total cost (e.g., 0.5%) to determine if the algorithm has stalled.

[0049] Define the number of consecutive monitoring iterations (e.g., 10 times) and track the improvement in fitness values ​​within this window.

[0050] After each iteration, the fitness value of the current global optimum is recorded and compared with the historical optimum. The relative improvement is calculated. If the relative improvement is less than the threshold, the improvement is considered insufficient.

[0051] The criterion for determining stagnation is: if the improvement rate within a continuous monitoring window (such as 10 iterations) is lower than the threshold, the algorithm is determined to be trapped in a local optimum or to have converged and stagnated.

[0052] The triggering principle for jump operations is: perform jump operations on a subset of individuals in the population (e.g., the 30% with the worst fitness), specifically including: Randomly reset departure count: For a selected individual's time period (e.g., randomly select 20% of the time period), regenerate an integer departure count within the feasible range, i.e., the upper and lower limits.

[0053] Global mutation perturbation: Apply a small perturbation to the number of departures throughout the entire time period with probability, and ensure the feasibility of the solution through constraint correction.

[0054] Step S700: Apply a penalty function to individuals that violate the constraints, and correct the number of departures to the feasible region through a discrete coding mechanism; To ensure the feasibility of the solution, a penalty function method and a repair strategy are adopted: a fitness penalty is imposed on individuals that do not meet the constraints of equations (2) to (4); for individuals that slightly violate the boundary conditions, the nearest neighbor correction mechanism is used to adjust them back into the feasible region.

[0055] Step S800: Update the global optimal solution. If the termination condition is met, stop the iteration and output the optimal scheduling plan.

[0056] After each iteration, the individual with the best fitness (lowest total cost) in the current population is compared with the historical global optimal solution. If the individual is better, the global optimal solution is updated. Then, the termination condition is checked (such as reaching the preset maximum number of iterations or the fitness value fluctuating below a set threshold for several consecutive iterations). If the condition is met, the optimization process terminates, and key indicators such as the departure frequency matrix for each time period, total operating cost, and passenger waiting time corresponding to the global optimal solution are output. If the termination condition is not met, the process returns to step S500 to continue iterative optimization. Through this step, the algorithm ensures that the final output scheduling plan is a near-optimal solution within the global search range, achieving a dual minimization of passenger waiting time and departure cost, while guaranteeing the feasibility of the plan and actual scheduling efficiency.

[0057] In this embodiment, as described in steps S300-S700 above, it should be noted that: The Nutcracker Optimization Algorithm (NOA) is a novel swarm intelligence optimization algorithm that simulates the cooperative and dynamic migration mechanisms of nutcracker birds during foraging in nature. This algorithm combines global search capabilities with local cooperative exploration capabilities, demonstrating superior performance in handling continuous optimization, nonlinear functions, and multimodal spaces.

[0058] NOA primarily simulates the following three core behaviors: 1) Aggregation: Individuals tend to move closer to high-quality solutions in their local neighborhood, forming multiple search subgroups and improving population convergence; 2) Alignment: Individuals refer to the movement trends of their surrounding peers when updating their orientation, enabling the population to maintain coordinated search. 3) Avoidance and Migration: When the local density is too high or it falls into convergence stagnation, some individuals will perform leapfrog migration to escape the local optimum trap.

[0059] NOA has advantages such as flexible structure, balanced search, and few parameters, making it particularly suitable for handling complex combinatorial optimization tasks with integer decision variables, strong constraints, and nonlinear objective functions, such as urban bus scheduling problems.

[0060] Considering the decision-making characteristics of bus scheduling problems, this embodiment has made the following three customized designs for NOA: 1) Discrete Integer Encoding Mechanism: The original NOA mainly targets continuous variable optimization problems. To adapt to the integer decision-making requirements of bus scheduling problems, this method uses an integer encoding mapping mechanism to map the particle position vector into discrete integer decision variables, while satisfying the constraints (formulas (2)-(5)) to ensure the feasibility of the solution after each round of updates.

[0061] 2) Dynamic threshold and hybrid search strategy: To prevent the algorithm from getting stuck in local optima in the mid-to-late stages, this method introduces a dynamic jump threshold control mechanism: when the overall fitness fluctuation is less than the preset threshold, some individuals perform jump operations; at the same time, it combines a hybrid search strategy of local perturbation and global mutation to improve search diversity and global exploration capability.

[0062] 3) Constraint handling mechanism: To ensure the feasibility of the solution, a penalty function method and a repair strategy are adopted.

[0063] NOA uses the objective function (see formula (1)) as the fitness evaluation criterion. Since the objective function is monotonically decreasing and then increasing, it has convexity, making it easy for NOA to obtain a global near-optimal solution during the search process.

[0064] Furthermore, the following experimental section will visualize and analyze the convergence curve of NOA to verify its stability and efficiency.

[0065] This embodiment uses actual operating data from a major urban bus route for simulation experiments. Operating hours are from 6:00 to 22:00, divided into 16 time slots, each lasting 60 minutes. The main parameter settings are shown in Table 1.

[0066] Table 1 Parameter Settings

[0067] To verify the effectiveness of the proposed bus scheduling optimization method based on the Nutcracker Optimization Algorithm (NOA), this embodiment selects the Sparrow Search Algorithm (SSA) as a comparison algorithm. SSA, a novel swarm intelligence optimization algorithm proposed in recent years, possesses strong global search capabilities and optimization performance, and has been widely applied in various complex optimization problems. By comparing NOA with SSA under the same experimental conditions, the solution effect, convergence characteristics, and robustness of NOA in the bus scheduling problem can be objectively evaluated.

[0068] Evaluation indicators include: Total Cost: This refers to the sum of operating costs and passenger waiting time costs over all time periods, expressed in yuan. Average Waiting Time: The arithmetic mean of the average waiting time for passengers across different time periods, expressed in minutes; Peak Waiting Time: The maximum passenger waiting time in any given time period, expressed in minutes. Running Time: The average computation time required to complete one full optimization solution, expressed in seconds.

[0069] Under the same initial conditions and the maximum number of iterations (set to 100), the SSA and NOA algorithms were run independently 10 times, and the average was taken as the final result.

[0070] Table 2 SSA Solution Results

[0071] Table 3. NOA Solution Results

[0072] Table 4 Performance Comparison of SSA and NOA Algorithms

[0073] As shown in Table 4, NOA outperforms the SSA algorithm in all three metrics: total cost, average passenger waiting time, and maximum waiting time. Compared to SSA, NOA reduces total cost by approximately 17.9%, average waiting time by approximately 5.8%, and maximum waiting time by nearly one minute. Furthermore, NOA demonstrates better real-time performance in terms of computation time, with an overall solution speed slightly faster than SSA.

[0074] Figure 3 and Figure 4 This is a comparison chart of the convergence trends of NOA and SSA. The convergence curves show that: Convergence speed: NOA quickly approaches the optimal solution within the first 30 iterations, while SSA requires about 500 iterations to achieve a similar result; Convergence accuracy: The final fitness value of NOA (approximately 10,000 yuan) is significantly lower than that of SSA (approximately 12,436 yuan), verifying its global search capability; Stability: NOA's fitness curve fluctuates less and tends to stabilize in the later stages of iteration, indicating that the algorithm is more robust.

[0075] This method addresses the challenges of dynamic passenger flow changes, resource constraints, and low scheduling efficiency in urban public transportation systems by constructing a bus scheduling optimization model that integrates passenger flow prediction, cost control, and operational constraints. To address the high-dimensional, strongly constrained integer optimization characteristics of the model, a customized solution framework based on the Nutcracker Optimization Algorithm (NOA) is proposed, incorporating a discrete encoding mechanism and a hybrid search strategy.

[0076] Simulation experiments on typical bus routes validated the proposed method and conducted a systematic comparison with the Sparrow Search Algorithm (SSA). Experimental results show that NOA outperforms the SSA algorithm in terms of total operating cost control, reduction of average passenger waiting time, and convergence speed, demonstrating good scheduling optimization effects and engineering application potential. The constructed scheduling model possesses strong dynamic adaptability, effectively improving the operational efficiency and service level of the public transportation system while meeting operational constraints.

[0077] According to another aspect of the embodiments of this application, an electronic device is also provided, including a processor and a memory, wherein the processor is configured to implement the steps of the method when executing a computer program stored in the memory.

[0078] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0079] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0080] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0081] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0082] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A bus scheduling method based on the star-sparrow optimization algorithm, characterized in that, Includes the following steps: A bus scheduling optimization model is constructed that integrates time-segmented passenger flow forecasting, vehicle resource constraints, and operating cost control. The bus scheduling optimization model takes minimizing the average passenger waiting time and departure operating cost as its dual objective functions. Define the constraints for the bus scheduling optimization model; The number of departures in each time period is used as an integer decision variable. An initial population is generated using a discrete coding mechanism. Each individual in the initial population represents a scheduling scheme that satisfies all constraints. The iterative optimization process is initiated based on the star-sparrow optimization algorithm. The fitness function is defined as the dual objective function. The fitness values ​​of individuals in the initial population are calculated, and the current global optimal solution is recorded. In each iteration, a hybrid search strategy including global search, local search and jump operation is executed. The global search updates the departure count based on the current optimal solution, the local search adjusts the departure count in the neighborhood, and the jump operation randomly resets some departure counts to escape the local optimum. The improvement of fitness value is monitored through a dynamic threshold control mechanism. If the improvement of fitness value is lower than the threshold in a preset number of consecutive iterations, a jump operation is triggered and the number of departures is adjusted in conjunction with the global mutation perturbation. A penalty function is applied to individuals that violate the constraints, and the number of departures is corrected to the feasible region through a discrete coding mechanism; Update the global optimal solution. If the termination condition is met, stop the iteration and output the optimal scheduling plan.

2. The bus scheduling method based on the larkspur optimization algorithm as described in claim 1, characterized in that, The formula for the dual objective function is: in, Operating cost per vehicle trip; For the first t Number of departures within a time period; Weighting coefficients for passenger waiting time costs; Cost per unit of waiting time; For the first t Predicted passenger flow for a given time period; The length of a single time period; This represents the total number of operating time periods.

3. The bus scheduling method based on the larkspur optimization algorithm as described in claim 2, characterized in that, The constraints include: Passenger capacity constraint: The number of passengers on each trip within each time period shall not exceed the vehicle's maximum passenger capacity, thus satisfying the requirement. ;in, The maximum number of passengers a single bus can carry; Minimum departure interval constraint: The departure interval within each time period shall not be less than the minimum departure interval, which is determined based on the round-trip travel time of a vehicle and the total number of dispatchable vehicles. And satisfy ,in, This is the minimum departure interval; Indicates the round-trip travel time of a vehicle. The total number of available buses; Vehicle dispatching capacity limit: The number of departures within each time period shall not exceed the maximum dispatchable capacity, i.e. ; Integer constraint: The number of departures in each time period is a positive integer, i.e. ,in, A set of positive integers.

4. The bus scheduling method based on the star-sparrow optimization algorithm as described in claim 1, characterized in that, Methods for generating the initial population using discrete coding mechanisms include: For each time period, based on vehicle scheduling capacity constraints and minimum departure interval constraints, calculate the lower and upper limits of the number of departures for that time period; For each time period, randomly generate an integer number of departures within the range of the lower and upper limits; Verify whether the generated integer number of departures satisfies the passenger capacity constraint, minimum departure interval constraint, vehicle scheduling capacity limit, and integer constraint; If there is a time period that violates the constraints, the number of integer departures in that time period will be adjusted to the nearest feasible integer value that satisfies all constraints. Repeat the above steps until a preset number of feasible individuals are generated, forming the initial population.

5. The bus scheduling method based on the larkspur optimization algorithm as described in claim 4, characterized in that, The adjustment method for adjusting the number of integer departures in this time period to the nearest feasible integer value that satisfies all constraints is as follows: If the passenger capacity exceeds the limit, increase the number of departures in integers until the limit is met. The smallest integer; If the departure interval is less than the minimum value, then reduce the number of integer departures until the minimum value is met. The largest integer.

6. The bus scheduling method based on the larkspur optimization algorithm as described in claim 1, characterized in that, Methods for monitoring the magnitude of fitness value improvement through dynamic threshold control mechanisms include: Set the fitness value improvement threshold to a preset percentage of the total cost, and set the number of continuous monitoring iterations; In each iteration, the fitness value of the current best solution is calculated and compared with the historical best value, and the improvement is recorded; If the improvement rate of the consecutive monitoring iterations is lower than the threshold, a jump operation is triggered. During the jump operation, a subset of individuals are randomly selected, and their departure frequency is globally mutated and perturbed.

7. The bus scheduling method based on the larkspur optimization algorithm as described in claim 1, characterized in that, The fitness function is calculated as follows: The weighted sum of total operating costs and passenger waiting time costs is calculated using the following formula: in, Let be the objective function, representing the total operating cost. The weighting coefficient for passenger waiting time costs.

8. The bus scheduling method based on the larkspur optimization algorithm as described in claim 1, characterized in that, The termination conditions include: The preset maximum number of iterations has been reached; The fitness value did not change significantly in several consecutive iterations.

9. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store programs that support the processor in executing the bus scheduling method based on the zigzag optimization algorithm according to any one of claims 1-8, and the processor is configured to execute the programs stored in the memory.

10. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is run by the processor, it executes the steps of the bus scheduling method based on the star-sparrow optimization algorithm as described in any one of claims 1-8.