Regional demand response type bus design optimization method based on improved genetic algorithm
By improving the genetic algorithm to design a regional demand-responsive bus optimization method, the problem of low efficiency and high cost of campus buses in meeting students' tidal and periodic needs is solved, and more efficient bus services are realized to meet students' real-time travel needs. .
Patent Information
- Application Number
- CN202410662548.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-08-27
AI Technical Summary
Campus buses have the problems of low efficiency, high cost and poor satisfaction in meeting students' tidal and cyclical riding needs. Existing technology is difficult to effectively respond to students' real-time travel needs.
An improved genetic algorithm is used to design a regional demand-responsive bus optimization method. By obtaining student travel demand data and bus operation data, a bus line optimization model is constructed, genetic algorithm parameters are set, crossover, mutation and selection operations are performed, and a flexible bus service plan is output. To meet the travel needs of students.
It improves the operating efficiency of campus buses, reduces students’ travel time costs, provides more flexible and efficient travel services, and meets students’ real-time transportation needs.
Smart Images

Figure CN118551906A
Abstract
Description
Technical Field
[0001] The invention relates to a regional demand responsive public transportation design optimization method based on an improved genetic algorithm, and belongs to the technical field of intelligent transportation. Background Art
[0002] In recent years, campus buses have gradually been promoted by schools and loved by students due to their convenience and comfort. With the increase in the number of university admissions in my country, the pressure on campus transportation has continued to increase, causing a series of problems such as traffic congestion, traffic safety and school delays. At present, the main modes of travel in universities in my country are walking, bicycles and electric bicycles. Campus buses are only a backup option for students to travel, but under conditions such as long travel distances and bad weather, campus buses are an ideal choice for students to travel.
[0003] The routes of campus buses usually connect the main activity areas on campus, such as dormitories, teaching buildings, and canteens. They are tidal and cyclical in nature with the arrangement of activities such as classes. Therefore, the route optimization of campus buses is more complicated than that of traditional buses. On the one hand, due to the influence of courses, students' travel on campus has obvious time window preferences and tidal characteristics. Campus buses cannot meet the students' travel needs during the get out of class time period by running on fixed routes; on the other hand, due to the cyclical changes in courses, students on campus have cyclical travel needs. Campus buses cannot meet the students' cyclical travel needs by running on fixed routes. At present, campus buses have problems such as low operating efficiency, high cost, and poor satisfaction of teachers and students. Demand-responsive buses can adjust the routes and itineraries of buses according to students' real-time needs and itinerary requests to provide more flexible and efficient campus travel services, which is in line with the operation mode of campus buses. Summary of the invention
[0004] The purpose of the present invention is to optimize the design of campus demand-responsive public transportation to solve the problem of campus traffic pressure and the inability to meet the transportation needs of teachers and students proposed in the above background technology, and to improve the operating efficiency of campus public transportation and provide flexible, efficient and satisfactory travel services. To achieve the above purpose, the present invention proposes a regional demand-responsive public transportation design optimization method based on an improved genetic algorithm, which includes the following steps:
[0005] S1: Obtain the target population's public transportation demand data and regional public transportation operation data to conduct passenger flow analysis;
[0006] S2: Construct a regional demand-responsive bus route optimization model;
[0007] S3: Set the parameters of the improved genetic algorithm, initialize the population and evaluate the individual fitness;
[0008] S4: Use improved genetic algorithm to perform crossover, mutation and selection operations on individuals;
[0009] S5: Output the regional demand-responsive bus service plan and compare and evaluate it with the original plan;
[0010] In step S1, the acquisition of the target population's public transportation travel demand data and the regional public transportation operation data and the passenger flow analysis includes the following steps:
[0011] S11 Obtaining the public transportation travel demand data of the target population. The specific process includes:
[0012] Obtain the target population's public transportation travel demand data, including the travel demand at each station and the target population's preferred time window time_window;
[0013] The operation data of the S12 area bus is obtained. The specific process includes:
[0014] Obtain regional bus operation data, including regional bus routes, capacity Q, vehicle speed v, and maximum operating time T max And the origin and transit station information, including station ID, longitude lat, latitude lon;
[0015] S13 passenger flow analysis, the specific process includes:
[0016] Based on the target population's public transportation demand data and regional public transportation operation data, passenger flow analysis is conducted to obtain the target population's public transportation peak hours, high-frequency departure stations, and concentrated destinations.
[0017] In step S2, the construction of a regional demand-responsive bus route optimization model includes the following steps:
[0018] The regional demand-responsive bus route optimization model mathematically abstracts the input, output, objective function and constraints of demand-responsive bus services. The specific process includes:
[0019] S21 builds the input model of regional demand-responsive public transportation; based on the collected public transportation travel demand data of the target population and the regional public transportation operation data, inputs the bus speed v, bus capacity Q, station ID, longitude lat, latitude lon, demand demand and preferred time window time_window;
[0020] S22 Design the objective function of the regional demand-responsive bus network optimization model; Under the condition of focusing on minimizing the travel time cost of the target population, the objective function formula of the regional demand-responsive bus line optimization model is as follows:
[0021] Z=min{T1+T2+T3+T4}
[0022]
[0023] Define the travel time of the bus on the road T1, which is in seconds, the stop time T2, which is in seconds, the deviation time between the target population preference time window and the bus service time window T3, which is in seconds, and the penalty for arriving at a fixed station beyond the specified time T4, which is in seconds. Add the above time costs to get the total time cost Z; where i, j represent individual candidate stations, I is a set of candidate stations, O is a set of starting stations, D is a set of terminal stations, k represents a single bus line, and K is a set of bus lines; Indicates that on line k, if stations i and j are adjacent and i is before j, the value is 1, otherwise it is 0; d ij is the distance from station i to station j, v is the bus speed; represents the time when the bus departs from station i on route k, N represents the time when the bus arrives at station i on route k; i is the demand of site i, A negative deviation variable indicating that the bus service time window is lower than the upper limit of the target population's preferred time window, A positive deviation variable indicating that the bus service time window is higher than the upper limit of the target population's preferred time window, A negative deviation variable indicating that the bus service time window is lower than the lower limit of the target population's preferred time window, A positive deviation variable indicating that the bus service time window is higher than the lower limit of the target population's preferred time window; It takes 1 when candidate bus stop i is selected as a stop, otherwise it takes 0; G is the cost of exceeding the specified time, and M represents the set of stops that the regional bus must visit;
[0024] S23 Design constraints for the regional demand-responsive bus route optimization model; Considering bus capacity constraints and designated station constraints, the constraints for the regional demand-responsive bus route optimization model are as follows:
[0025] Determine the vehicle capacity constraints in regional bus operations to limit bus overloading:
[0026]
[0027] in, represents the number of target people assigned to route k at site i;
[0028] The maximum operating time of each bus route in the restricted area is as follows:
[0029]
[0030] Ensure that each bus departs from the starting point and arrives at the terminal point:
[0031]
[0032] Make sure that when two candidate stations are selected, there is a possible line connection between them:
[0033]
[0034] The relationship between the target population's preferred time window, deviation variables, and planned arrival and departure times is calculated as follows:
[0035]
[0036] Among them, l i Indicates the lower limit of the target population’s preferred time window at site u, u i represents the upper limit of the target population’s preferred time window at site i;
[0037] make sure Only assigned if a site is selected:
[0038]
[0039] Where H is a constant approaching infinity;
[0040] Ensure that each route schedule meets demand:
[0041]
[0042] The additional items Used to ensure that site i is before site j;
[0043] Ensure that the bus arrives at the designated stop within the specified time:
[0044]
[0045] Among them, R k is the set of stations that route k passes through, T0 is the time that the bus cannot exceed to reach the designated station;
[0046] S24 outputs a regional responsive bus service plan: including bus route bus_road, bus running time bus_time, bus service time window bus_window, bus travel distance bus_distance, and bus time window deviation bus_deviation.
[0047] In step S3, the steps of setting parameters of the improved genetic algorithm, initializing the population and evaluating individual fitness include the following steps:
[0048] S31 improves the genetic algorithm parameter setting, and the specific process includes:
[0049] Set the number of iterations generation, population size popsize, crossover probability p1, mutation probability p2, and tournament selection box size C_size;
[0050] S32 initializes the population. The specific process includes:
[0051] Randomly generate individuals, the genetic encoding format is
[0052] X=(x0,x1,x2…x n )
[0053] Where n is the number of required stations, x0 represents the originating station, and x i represents site i;
[0054] S33 evaluates individual fitness, and the specific process includes:
[0055] In the decoding module, according to the designed objective function and constraints, the time cost Z of the route represented by each individual is obtained through genetic encoding and decoding.
[0056] In step S4, the use of the improved genetic algorithm to perform crossover, mutation and selection operations on individuals includes the following steps:
[0057] S41 crossover operation, the specific process includes:
[0058] Use the POX crossover strategy to cross individuals. Randomly take the fragments that need the crossover process on the gene, copy the fragment taken by the parent P1 to the offspring C1, and copy the fragment taken by the parent P2 to the offspring C2; take out the fragment copied to C1 in P1, and copy these fragments to C2 in sequence; take out the fragment copied to C2 in P2, and copy these fragments to C1 in sequence.
[0059] S42 mutation operation, the specific process includes:
[0060] The individuals were mutated using a reverse mutation strategy, where two positions in the gene were randomly selected and the gene sequence between the two positions was reversed.
[0061] S43 selects an operation, and the specific process includes:
[0062] Use the tournament selection strategy to select individuals, with a tournament selection box size of C_size; randomly select C_size individuals from the population for competitive selection, and select individuals with lower time cost as parents. Repeat the selection until enough parents are selected.
[0063] In step S5, the output of the regional demand-responsive bus service plan includes the following steps:
[0064] S51 outputs a regional demand-responsive bus service plan. The specific process includes:
[0065] Determine whether the number of iterations reaches the maximum number of iterations: if the number of iterations reaches the maximum number of iterations, stop the iteration and output the regional demand-responsive bus service plan, including the bus route bus_road, bus running time bus_time, bus service time window bus_window, bus travel distance bus_distance, and bus time window deviation bus_deviation; if the number of iterations does not reach the maximum number of iterations, repeat step S4;
[0066] Determine whether the cost of the output regional demand-responsive bus service plan has converged: if the cost of the regional demand-responsive bus service plan has converged, output the plan as the optimal regional demand-responsive bus service plan; if the cost of the regional demand-responsive bus service plan has not converged, return to step S3.
[0067] S52 optimization effect comparison, the specific process includes:
[0068] After outputting the regional demand-responsive bus service plan, the output service plan is evaluated by comparing it with the original bus plan using bus travel time as the evaluation index.
[0069] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the regional demand-responsive bus design optimization method based on an improved genetic algorithm as described in any one of the above items is implemented.
[0070] The present invention also provides a computer electronic device, comprising a memory and a processor;
[0071] The memory is used to store computer programs;
[0072] The processor is used to implement the regional demand-responsive public transportation design optimization method based on the improved genetic algorithm as described in any of the above items when executing the computer program.
[0073] Beneficial effects of the present invention:
[0074] The present invention optimizes the regional responsive bus routes such as on-campus by improving the genetic algorithm, takes the travel time cost of the target population such as students as the objective function, takes the students' class time and the bus capacity as the main constraints, establishes a campus demand-responsive bus route optimization model, obtains the campus demand-responsive bus operation route, compares and evaluates it with the original route, improves the operation efficiency of on-campus buses, and reduces the time cost of student travel. This method can be applied to other types of semi-enclosed areas such as campuses and parks, and can effectively improve the operation efficiency of regional buses. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 This is a schematic diagram of the campus bus operation area of Zijingang Campus in the example of the present invention
[0076] Figure 2 This is the layout diagram of the bus stop on the Zijingang campus in the present invention.
[0077] Figure 3 Framework diagram of campus responsive bus system
[0078] Figure 4 Optimizing the flow chart for campus responsive bus routes
[0079] Figure 5 To improve the genetic algorithm flow chart
[0080] Figure 6 Cross flow chart for POX
[0081] Figure 7 Reverse mutation flow chart
[0082] Figure 8 Selecting a flowchart for a tournament
[0083] Fig. 9 Passenger flow analysis diagram for departure stations at different time periods
[0084] Fig.10 Passenger flow analysis diagram for destinations at different time periods
[0085] Fig.11 Cost change chart DETAILED DESCRIPTION
[0086] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0087] This paper proposes a regional demand-responsive bus design optimization method based on an improved genetic algorithm. Figure 1 and Figure 2 As an example, the campus bus operation area diagram and campus bus station layout diagram are shown in Figure 3 The regional responsive bus system framework shown in Figure 4 The regional responsive bus route optimization process shown in the figure is Figure 5 The improved genetic algorithm shown in the figure implements the design optimization method of campus demand-responsive bus, which includes the following steps:
[0088] 1. Obtain student bus travel demand data and campus bus operation data to conduct passenger flow analysis
[0089] The campus bus of Zhejiang University Zijingang Campus was selected as the case of this research method. Through field surveys, the demand data of student bus travel from April 3 to April 7, 2023 was obtained. The demand for departure stations at different time periods is as follows: Fig. 9 As shown in Figure 2, the number of passengers at different destinations during different periods is as follows: Fig.10 As shown. According to the information in the diagram, the East Teaching District and the West Teaching District are the concentrated destinations for students to travel, and the East of the cafeteria is a high-frequency departure station for students to travel. The peak travel hours are 9:15-10:15 and 12:45-13:45. According to the course schedule on the school's official website, the three main nodes for students to attend classes are 8:00, 10:00, and 13:25. Select the East Teaching District and the West Teaching District as designated stations, select 13:25 as the time that cannot be exceeded to arrive at the designated station, and select the student bus travel demand data from 13:00 to 13:30 to optimize the design of campus demand-responsive buses.
[0090] The operation data of campus buses were obtained through the official website of the school. The operation areas of campus buses are as follows: Figure 1 At present, there are 5 bus routes in the school, and the specific route information and departure time are shown in Table 1.
[0091] Table 1 Campus bus routes
[0092]
[0093]
[0094] There are currently 14 stops on campus. Since the demand for the West Canteen Stop is 0, this stop is abandoned. During the operation of campus buses, depots are set up to serve the functions of turnover, parking and charging. The stops and stops are mapped to the road network according to longitude and latitude. The stop numbers and names are as follows: Figure 2Combining the selected student bus travel demand data and campus bus operation data, the demand and preferred time windows of each station are shown in Table 2.
[0095] Table 2 Site demand and preferred time window
[0096]
[0097] Taking 13:00 as the zero reference, the time unit of the preferred time window is converted into seconds for programming processing. The longitude and latitude coordinates are converted into XY plane coordinates for the convenience of internal analysis of the region, and the XY coordinates of the station are shown in Table 3.
[0098] Table 3 XY plane coordinates of the sites
[0099]
[0100] According to the obtained XY plane coordinates, the site distance matrix was constructed using Python's Scipy toolkit as shown in Table 4.
[0101] Table 4 Site distance matrix
[0102]
[0103] The campus bus has 23 seats, excluding the driver's seat, and the bus capacity Q is 22 people; the campus bus travel speed v is 7m / s; the maximum running time of each route is T max The service time of campus bus at the station is related to the demand of the station. When the demand is less than 6 people, each person needs 10s of service time. When the demand is greater than or equal to 6 people, the total service time is fixed at 60s.
[0104] 2. Construct a campus demand-responsive bus route optimization model
[0105] Based on the above analysis, the parameter values in the campus demand-responsive bus route optimization model are determined. Among them, the candidate site set I includes the 13 sites except the bus station shown in Table 1; the bus origin site set O and the bus terminal site set D include the bus station depot; i is the lower limit of the preferred time window shown in Table 1, u i is the upper limit of the preferred time window shown in Table 1; the bus capacity Q is 22 people; the campus bus speed v is 7m / s; the maximum running time of each route is T maxThe set of stations M that the campus bus must pass through includes the East Teaching District Station and the West Teaching District Station; the cost G for exceeding the specified time is set to 10000s; the time T0 that the bus cannot exceed to arrive at the designated station is 13:25, and the unit is converted into seconds with 13:00 as the zero base, which is 1500s.
[0106] 3. Set the parameters of the improved genetic algorithm, initialize the population and evaluate the individual fitness
[0107] Through Python, based on Figure 5 The improved genetic algorithm process shown builds the framework of the improved genetic algorithm. Set the number of iterations of the improved genetic algorithm to 50; the population size popsize to 10000; the crossover probability p1 to 0.8; the mutation probability p2 to 0.5; and the tournament selection box size G_size to 5.
[0108] First, construct the path code X = (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14) in the order of the required site IDs. Then use Python's random module to randomly shuffle the order of the path codes to generate a new path code X = (12, 14, 5, 7, 10, 3, 11, 4, 6, 13, 2, 9, 8). Finally, add the origin site depot as the final individual X = (1, 12, 14, 5, 7, 10, 3, 11, 4, 6, 13, 2, 9, 8). Initialize the population to randomly generate 10,000 individuals, and the length of each individual code is 14.
[0109] Set up the decoding module, input the objective function and constraints; first, initialize the parameters of the decoding module, including the bus capacity Q of 22 people and the bus speed v of 7m / s; obtain data information from Table 2, Table 3 and Table 4, including XY plane coordinates location_x, location_y, demand demand, preferred time window time_window and distance distance; initialize variables, create an empty list to store path code, stay time, time window deviation, vehicle travel distance and vehicle running time; second, traverse each station in the path. For each station, calculate the arrival time of the current station according to the vehicle running speed, the distance between stations and the departure time of the previous station, calculate the service time of the current station and the departure time of the current station according to the demand; calculate the time window deviation according to the arrival and departure time of the current station and the preferred time window; determine whether the demand of the current station is less than the remaining capacity of the vehicle. If the remaining capacity of the vehicle is less than the demand, store the path code of the current vehicle and add a new vehicle; otherwise, update the remaining capacity of the vehicle and add the station to the path of the vehicle. Determine whether station 11 and station 13 are in the current path; if station 11 and station 13 are not in the path, compare the distance between the last station in the path code and station 11 and station 13, give priority to passing through the closer station and then the farther station, and finally return to the initial station depot; otherwise, return directly to the initial station depot; determine whether the latest time to pass through station 11 and station 13 exceeds 1500s; if the latest time to pass through station 11 and station 13 exceeds 1500s, add a penalty value to the time cost Z. Finally, update the relevant information and return the path code, stay time, time window deviation, vehicle travel distance, vehicle operation time and total time cost Z.
[0110] 4. Use improved genetic algorithms to select, crossover and mutate individuals
[0111] Use as Figure 6 The POX crossover strategy shown in the figure crosses individuals; Python is used to randomly generate two position indexes, and the gene code between the two position indexes is taken on the gene as the fragment that needs to be crossed, and the fragment taken by the parent P1 is copied to the child C1, and the fragment taken by the parent P2 is copied to the child C2; the fragment copied to C1 is taken out from P1, and these fragments are copied to C2 in sequence; the fragment copied to C2 is taken out from P2, and these fragments are copied to C1 in sequence to complete the crossover operation.
[0112] Use as Figure 7 The reverse mutation strategy shown is used to mutate individuals; two position indexes are randomly generated using Python, and the gene sequence between these two positions is reversed.
[0113] Use as Figure 8 The tournament selection strategy shown is used to select individuals; the tournament selection box size is 5; Python is used to randomly select 5 individuals from the population of 10,000 individuals for competitive selection, compare the fitness values Z, and select the individual with the smaller fitness value Z as the parent.
[0114] 5. Output the campus demand-responsive bus service plan and compare and evaluate it with the original plan
[0115] When the number of iterations reaches 50, the campus demand-responsive bus service plan is output, such as Fig.11 As shown in the figure, the cost of the campus demand-responsive bus service plan has converged. Larger population size, mutation rate, and crossover rate can prevent the optimization from falling into the local optimal solution. With almost the same parameters, the global optimal solution was obtained after less than 20 iterations. The output campus demand-responsive bus service plan is shown in Tables 5 and 6.
[0116] Table 5. Example path allocation results
[0117]
[0118]
[0119] Table 6 Service routes and service time windows
[0120]
[0121] The time when the three routes pass through station 11 (West Teaching Area) and station 13 (East Teaching Area) is less than the class time 1500 (13:25), which meets the rigid constraint of students attending classes and the capacity constraint.
[0122] Before the optimization, the total time that the campus buses on Line 1, Line 2 and Line 3 traveled on the road was 56 minutes. After the optimization, the total time that the three campus buses traveled on the road and stayed at the station was 49 minutes. The optimized campus demand-responsive bus has greater advantages in student travel.
[0123] It should be noted that the regional demand-responsive bus design optimization method based on the improved genetic algorithm provided in the above embodiment can essentially exist in the form of a program processing flow. Therefore, similarly, based on the same inventive concept, another preferred embodiment of the present invention also provides a computer electronic device corresponding to the regional demand-responsive bus design optimization method based on the improved genetic algorithm provided in the above embodiment, which includes a memory and a processor;
[0124] The memory is used to store computer programs;
[0125] The processor is used to implement the regional demand-responsive public transportation design optimization method based on the improved genetic algorithm as described above when executing the computer program.
[0126] Similarly, based on the same inventive concept, another preferred embodiment of the present invention also provides a computer-readable storage medium corresponding to the regional demand-responsive bus design optimization method based on the improved genetic algorithm provided in the above embodiment, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the regional demand-responsive bus design optimization method based on the improved genetic algorithm as mentioned above is implemented.
[0127] The above-described embodiments are only some of the preferred solutions of the present invention, but they are not intended to limit the present invention. A person skilled in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.
Claims
1. A regional demand-responsive public transportation design optimization method based on an improved genetic algorithm, characterized by: The following steps are involved: S1: Obtain the target population's public transportation demand data and regional public transportation operation data to conduct passenger flow analysis; S2: Construct a regional demand-responsive bus route optimization model; S3: Set the parameters of the improved genetic algorithm, initialize the population and evaluate the individual fitness; S4: Use improved genetic algorithm to perform crossover, mutation and selection operations on individuals; S5: Output regional demand-responsive bus service plan.
2. According to claim 1, a regional demand-responsive public transportation design optimization method based on an improved genetic algorithm is characterized by: In step S1, the specific steps are as follows: The target population's public transportation travel demand data includes the travel demand at each station and the preferred time window time_window; The operation data of regional buses include the routes, capacity Q, vehicle speed v, and maximum operation time T of regional buses. max And the origin and transit station information, including station ID, longitude lat, latitude lon; Passenger flow analysis is based on the target population's public transportation demand data and regional public transportation operation data to obtain the target population's public transportation peak hours, high-frequency departure stations and concentrated destinations.
3. The regional demand-responsive public transportation design optimization method based on improved genetic algorithm according to claim 1 is characterized by: In step S2, the construction of the regional demand-responsive bus route optimization model includes the following specific steps: Build the input model of regional responsive public transportation: based on the collected target population public transportation demand data and regional public transportation operation data, take the bus speed v, bus capacity Q, station ID, longitude lat, latitude lon, demand demand and preferred time window time_window as input; take the regional demand responsive public transportation service plan: including bus operation route bus_road, bus operation time bus_time, bus service time window bus_window, bus travel distance bus_distance, bus time window deviation bus_deviation as output; Design the objective function of the regional demand-responsive bus route optimization model; Under the condition of focusing on minimizing the travel time cost of the target population, the objective function formula of the regional demand-responsive bus route optimization model is as follows: Z=min{T1+T2+T3+T4} Define the travel time of the bus on the road T1, which is in seconds, the stop time T2, which is in seconds, the deviation time T3 between the target population preference time window and the bus service time window, which is in seconds, and the penalty T4 for arriving at the fixed station beyond the specified time, which is in seconds. Add the above time costs to get the total time cost Z; where i, j represent single candidate stations, i is the candidate station set, O is the starting station set, D is the terminal station set, k represents a single bus line, and K is the bus line set; Indicates that on line k, if stations i and j are adjacent and i is before j, the value is 1, otherwise it is 0; d ij is the distance from station i to station j, v is the bus speed; represents the time when the bus departs from station i on route k, N represents the time when the bus arrives at station i on route k; i is the demand of site i, A negative deviation variable indicating that the bus service time window is lower than the upper limit of the target population's preferred time window, A positive deviation variable indicating that the bus service time window is higher than the upper limit of the target population's preferred time window, A negative deviation variable indicating that the bus service time window is lower than the lower limit of the target population's preferred time window, A positive deviation variable indicating that the bus service time window is higher than the lower limit of the target population's preferred time window; It takes 1 when candidate bus stop i is selected as a stop, otherwise it takes 0; G is the cost of exceeding the specified time, and M represents the set of stops that the regional bus must pass through.
4. The regional demand-responsive public transportation design optimization method based on improved genetic algorithm according to claim 3 is characterized by: The constraints of the regional demand-responsive bus route optimization model are as follows: Determine the vehicle capacity constraints in regional bus operations to limit bus overloading: in, represents the number of target people assigned to route k at site i; The maximum operating time of each bus route in the restricted area is as follows: Ensure that each bus departs from the starting point and arrives at the terminal point: Make sure that when two candidate stations are selected, there is a possible line connection between them: The relationship between the target population's preferred time window, deviation variables, and planned arrival and departure times is calculated as follows: Among them, l i represents the lower limit of the target population’s preferred time window at site i, u i represents the upper limit of the target population’s preferred time window at site i; make sure Only assigned if a site is selected: Where H is a constant approaching infinity; Ensure that each line schedule meets design requirements: The additional items Used to ensure that site i is before site j; Ensure that the bus arrives at the designated stop within the specified time: Among them, R k is the set of stations that route k passes through, and T0 is the time that the bus cannot exceed to reach the designated station.
5. The regional demand-responsive public transportation design optimization method based on improved genetic algorithm according to claim 1 is characterized by: In step S3, the specific steps of parameter setting and initialization are as follows: Improve genetic algorithm parameter settings: set the number of iterations generation, population size popsize, crossover probability p1, mutation probability p2, and tournament selection box size C_size; Initialize the population: randomly generate individuals, the gene encoding format is X = (x0, x1, x2…x n ), where n is the number of required sites, x0 represents the originating site, and x i represents site i; Evaluate fitness: In the decoding module, according to the designed objective function and constraints, the time cost Z of the route represented by each individual is obtained through genetic encoding and decoding.
6. The regional demand-responsive public transportation design optimization method based on improved genetic algorithm according to claim 1 is characterized by: In step S4, the specific steps of crossover, mutation and selection are as follows: Use the POX crossover strategy to cross individuals: take any fragment that needs a crossover process on the gene, copy the fragment taken by the parent P1 to the offspring C1, and copy the fragment taken by the parent P2 to the offspring C2; take out the fragment copied to C1 in P1, and copy these fragments to C2 in sequence; take out the fragment copied to C2 in P2, and copy these fragments to C1 in sequence; Use the reverse mutation strategy to mutate individuals: randomly select two positions in the gene and reverse the gene sequence between the two positions; Use the tournament selection strategy to select individuals: the size of the tournament selection box is C_size; C_size individuals are randomly selected from the population for competitive selection, and individuals with lower time costs are selected as parents. The selection is repeated until enough parents are selected.
7. The regional demand-responsive public transportation design optimization method based on improved genetic algorithm according to claim 1 is characterized by: In step S5, the specific steps of outputting the result are as follows: Determine whether the number of iterations reaches the maximum number of iterations: if the number of iterations reaches the maximum number of iterations, stop the iteration and output the regional demand-responsive bus service plan, including the bus route bus_road, bus running time bus_time, bus service time window bus_window, bus travel distance bus_distance, and bus time window deviation bus_deviation; if the number of iterations does not reach the maximum number of iterations, repeat step S4; Determine whether the cost of the output regional demand-responsive bus service plan has converged: if the cost of the regional demand-responsive bus service plan has converged, output the plan as the optimal regional demand-responsive bus service plan; if the cost of the regional demand-responsive bus service plan has not converged, return to step S3.
8. The regional demand-responsive public transportation design optimization method based on improved genetic algorithm according to claim 1 is characterized by: After outputting the regional demand-responsive bus service plan, the output service plan is evaluated by comparing it with the original bus plan using bus travel time as the evaluation index.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the regional demand-responsive public transportation design optimization method based on the improved genetic algorithm as described in any one of claims 1 to 8 is implemented.
10. A computer electronic device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is used to implement the regional demand-responsive public transportation design optimization method based on an improved genetic algorithm as described in any one of claims 1 to 8 when executing the computer program.
