A lightweight carpooling scheduling method for mileage optimization under multiple time constraints
By introducing a multi-time-constrained mileage optimization method into the carpooling service system, using directed acyclic graphs and improved Boolean optimization variables, and designing a heuristic algorithm for the fallback strategy, the passenger time constraints and computational complexity problems are solved, and efficient vehicle scheduling and passenger allocation are achieved.
Patent Information
- Application Number
- CN202211463382.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-22
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-11-22
AI Technical Summary
Existing carpooling service systems fail to effectively consider the time constraints of passenger boarding and alighting points under resource-constrained conditions, and the computational complexity is too high in large-scale passenger-car assignment problems, making it difficult to ensure real-time and accuracy.
A lightweight carpooling scheduling method with mileage optimization under multiple time constraints is adopted. A task model is established through a directed acyclic graph. An improved three-dimensional Boolean optimization variable is introduced, and a heuristic algorithm based on a fallback strategy is designed to reduce the computational complexity and improve applicability.
The problem-solving time is significantly reduced, and the applicability and accuracy of the carpooling scheduling method are improved. In particular, the calculation time is significantly reduced and the applicability is improved in large-scale problems.
Smart Images

Figure CN115729106B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of vehicle path planning and task optimization scheduling, and mainly relates to a lightweight carpooling scheduling method for optimizing mileage under multiple time constraints. Background Art
[0002] With the deepening implementation of energy conservation and emission reduction strategies and the increasing energy consumption issues of private cars, vehicle sharing and carpooling services have become a travel option for many people. However, the allocation and scheduling algorithms for carpooling services remain relatively simple. Major software applications typically prioritize closest-distance allocation, which results in significant resource waste and can cause some passengers to wait excessively long. Meanwhile, with the rapid development of vehicle-infrastructure collaboration, driverless taxis have been deployed by many companies. While the on-demand model remains viable given the current low demand and availability of available vehicles, a significant expansion in the future will complicate the allocation, scheduling, and turnover of driverless taxis and passengers. Therefore, a globally conscious, computationally efficient, and applicable scheduling and allocation algorithm is urgently needed. Therefore, under resource-constrained conditions, it is of great practical significance to study a lightweight vehicle-sharing scheduling algorithm based on total mileage optimization under multiple time constraints.
[0003] For ride-sharing systems, existing methods generally use heuristic algorithms with low computational complexity to improve scalability. While significant research has been conducted on ride-sharing systems and vehicle dispatching, the following issues remain: 1) These approaches fail to account for the time constraints that may exist for each passenger at their boarding and alighting points; 2) In the more common scenario of vehicle dispatching, vehicles can choose any destination, rather than the traditional MTSP problem where the starting and ending points are set to the same point. Existing work has insufficiently addressed the situation where the destination can be chosen arbitrarily; and 3) For large-scale, high-volume vehicle-to-vehicle dispatching problems, existing solutions suffer from excessive computational complexity while maintaining accuracy, making it difficult to guarantee real-time performance. Summary of the Invention
[0004] The present invention addresses the problems existing in the prior art and provides a lightweight carpooling scheduling method with mileage optimization under multiple time constraints. First, the arrival of a vehicle at a certain pick-up / drop-off point to pick up or drop off passengers and the arrival of the vehicle at the terminal are considered tasks. Tasks are represented by vertices, and the execution costs between tasks are represented by edges. A task model is established in the form of a directed acyclic graph. Then, based on the multi-traveling salesman problem model and the vehicle routing problem model, improved three-dimensional Boolean optimization variables are set based on the two-dimensional Boolean optimization variables in the multi-traveling salesman problem model. In this new model, constraints that do not exist in the multi-traveling salesman problem model and the vehicle routing problem model are proposed to construct a vehicle-passenger allocation and scheduling problem model based on total mileage optimization. The optimal solution is obtained using a hybrid nonlinear integer programming solver, and a heuristic algorithm based on a back-off strategy is designed. This algorithm can significantly reduce the problem-solving time while only losing about 20% of the accuracy compared to the optimal solution. This algorithm improves the applicability of the scheduling method and its scalability for large-scale problems. To achieve the above objectives, the present invention adopts a technical solution: a lightweight carpooling scheduling method for optimizing mileage under multiple time constraints, comprising the following steps:
[0005] S1. Establish a task model: consider the arrival of a vehicle at a certain pick-up / drop-off point to pick up passengers and the arrival of the vehicle at the terminal as tasks. Tasks are represented by vertices, and the execution costs between tasks are represented by edges. The task model is established in the form of a directed acyclic graph (DAG).
[0006] S2, based on the multiple traveling salesman problem model and the vehicle routing problem model, setting an improved three-dimensional Boolean optimization variable based on the two-dimensional Boolean optimization variable in the multiple traveling salesman problem model, and proposing an objective function that minimizes total mileage; the multiple traveling salesman problem model includes at least a flow constraint and a traversal uniqueness constraint;
[0007] S3, additional constraints: The new model proposes constraints that do not exist in the multi-traveling salesman problem model and the vehicle routing problem model, and constructs a vehicle-passenger allocation and scheduling problem model based on total mileage optimization. The constraints include the starting station constraint, the terminal station constraint, the passenger pick-up and drop-off sequence constraint, the capacity limit constraint, the vehicle route rule constraint, and the multi-point time constraint;
[0008] S4, model solution: For the vehicle-passenger allocation and scheduling problem based on total mileage optimization proposed in step S3, the optimal solution is obtained using a hybrid nonlinear integer programming solver. A heuristic algorithm based on a backoff strategy is designed. This algorithm can significantly reduce the problem-solving time while only losing about 20% of the accuracy compared to the optimal solution. The solution specifically includes:
[0009] S41: Determine the shortest possible local distance from the current task execution location to the task execution location;
[0010] S42: Update the information of prohibited and executable tasks according to the global information;
[0011] S43: Determine whether the vehicle violates the time constraint of a certain executable task when selecting it at the current task execution location, judge the feasibility of the method, and if not, determine the optimal carpooling scheduling method; if the current task violates the time constraint, test other tasks in the executable task set until the next selectable task is found; if all executable tasks violate the time constraint, use the state rollback strategy to roll back the vehicle state and update the executable task set.
[0012] As an improvement of the present invention, in step S1, it is assumed that there are M vehicles and N passengers, and each of the M vehicles has its own M starting stations and M preset destinations, and each of the N passengers has its own N boarding points and N getting off points, then the 2(N+M) tasks P: {P1,…,P 2N+2M} represents the set of all tasks in the carpooling service. For task P i With P j , any edge E i,j Representative task P i With P j The execution cost between them, the edge weight W i,j Represents the task P i Execution location to task P j The distance between the coordinates of the execution locations is recorded as:
[0013] 2(N+M) tasks can be divided into four parts: M starting point sets S: {S1,…,S M}、M endpoint sets D:{D1,…,D M}、N passenger boarding point set N p :{N p 1,…,N p N}、N passenger drop-off point set N d :{N d 1,…,N d N}, M vehicles start from their respective starting points and eventually return to their own preset destinations after picking up or dropping off at least one person. All passengers can set the right time window at their respective pick-up and drop-off points, indicating that the passenger wants to be picked up or dropped off before a certain time. The right time window of each pick-up point is set as: a:{a1,…,a 2N}.
[0014] As an improvement of the present invention, in step S2, X i,j,m Indicates that vehicle number m performs task P i With P j , and passes through the corresponding path to represent the matching relationship between the pick-up task and the vehicle:
[0015]
[0016] Among them, X i,j,m is a three-dimensional Boolean optimization variable, C is the set of all vehicles;
[0017] Due to d i,j Represents task P i and Task P j The execution cost between i,j,m *d i,j Can be used as m car to perform mission P i With P j The execution cost of , with minimizing the total mileage as the objective function, can be obtained:
[0018]
[0019] As another improvement of the present invention, in step S3,
[0020] Origin station constraint: ensure that each vehicle starts from its own origin station, and the vehicle leaving the origin station must go to perform N of the passenger pickup tasks. ) One of the tasks is:
[0021]
[0022] Terminal constraint: The vehicle must return to the terminal after completing the pick-up and drop-off mission:
[0023]
[0024] Passenger pickup order constraint: After picking up a passenger, the bus must drop the passenger off before returning to the destination. The n boarding tasks set by n passengers are set as P1, P3, P1, ..., P 2n-1 The corresponding n get-off tasks are set as P2, P4, P6, ..., P 2n If the vehicle completes task P1, it must select task P2 in the subsequent task selection:
[0025]
[0026] Point set traversal uniqueness constraint: Each passenger boarding / disembarking location is only allowed to be passed by a certain vehicle once, and after passing through, it cannot be passed by other vehicles or the vehicle itself again. The constraints are:
[0027]
[0028] Capacity constraint: Considering the capacity constraint of a vehicle, its capacity q at a certain moment can be any positive integer less than or equal to 4. When passing a certain station, there will be more than one person getting on or off the vehicle, that is:
[0029]
[0030] Among them, G i Indicates the execution of task P i For the change in the number of people in a vehicle: G:{G1,…,G 2N};
[0031] Traffic constraints: For the intermediate point, i.e. the pick-up point, a car must leave when it enters, i.e. there is a task P to execute. i to P j If the path is selected, there must be a path to execute task P j to P k The path is selected. To achieve this, the constraints that need to be added are:
[0032]
[0033]
[0034] Multi-point time constraints: Introducing the right time window of the user's preset pick-up point and drop-off point, indicating that the user hopes to be picked up / dropped off before a certain time.
[0035]
[0036]
[0037] Among them, t i,j Indicates that from task P i Execution location to task P j The estimated time at the execution location is estimated based on the difference between the average speed and the distance.
[0038] As another improvement of the present invention, in step S3, the vehicle driving route rule constraint includes:
[0039] If the vehicle is not allowed to choose the route from the origin to the origin, the constraint condition is:
[0040]
[0041] If the vehicle is not allowed to choose a route that goes directly from the starting point to the destination, the constraints are:
[0042]
[0043] If the vehicle is not allowed to choose a route from a pick-up point back to the starting point, the constraints are:
[0044]
[0045] If the vehicle is not allowed to choose to walk from the current point to the current point, the constraint condition is:
[0046]
[0047] If the vehicle is not allowed to choose the path it has traveled, the constraint condition is:
[0048]
[0049] If the constraint condition that does not allow the vehicle to choose the same path twice in both directions is:
[0050]
[0051] As another improvement of the present invention, in step S41, all executable tasks are traversed based on the vehicle attributes and the basic fallback strategy to determine the task execution location with the shortest feasible local distance from the current task execution location; the vehicle attributes include at least the current coordinates of the vehicle, the current travel time of the vehicle, the current capacity of the vehicle, the current total distance traveled by the vehicle, the tasks that can be executed in the current state of the vehicle, and the tasks that cannot be executed in the current state of the vehicle;
[0052] The basic fallback strategy is: when the vehicle is at the starting point, the content of the "previous state attributes" of the vehicle is empty. After selecting the next station, the vehicle attributes are updated synchronously: if the optimal point is selected, the attributes of the vehicle in the previous state are added to the "previous state attributes" in the current state. When simulating the time constraint test, if all optional points do not meet the time constraint, the data in the "previous state attributes" must be placed in the current vehicle attributes, and the original optimal point must be placed in the non-selectable point set before the next optimal point is selected.
[0053] As a further improvement of the present invention, after the time constraint of step S43 is completed, if the task P k The condition is met, but it does not mean that task P will be executed next from the current task. k In the final route allocation plan, there may still be a selection task P kAfter that, if it is found that all subsequent tasks do not meet the time constraint, then the state rollback strategy needs to roll back to the state where the previous task is completed and cancel the task P. k As a task in the optional task set, the local optimal task is searched according to the greedy strategy.
[0054] Compared with the prior art, the present invention has the following beneficial effects:
[0055] 1) This invention provides a model for passenger-vehicle allocation and route selection planning in ride-sharing services that is closer to real-life scenarios. The task mapping method based on total mileage optimization can improve the model's applicability to tasks in real-life scenarios.
[0056] 2) This paper proposes a lightweight scheduling algorithm for vehicle sharing based on total mileage optimization under multiple time constraints. This algorithm is a heuristic algorithm based on a fallback strategy with low computational complexity, which significantly reduces the time required to solve the problem and improves the applicability of this scheduling and allocation method. In particular, for large-scale human-vehicle route planning and allocation problems, the computational time of the heuristic scheduling algorithm is significantly reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 This is a flow chart of a lightweight carpooling scheduling method for optimizing mileage under multiple time constraints according to the present invention;
[0058] Figure 2 The task directed acyclic graph formed after step S1 of embodiment 2 of the method of the present invention;
[0059] Figure 3 Invoke a commercial solver to obtain an accurate solution for the visual route and the person-vehicle allocation diagram for Example 2 of the present invention;
[0060] Figure 4 Schematic diagram showing the changing trend of the sum of total distances calculated by the present method and the conventional method in Example 2 of the present invention, while keeping the total number of passengers unchanged, and the proportional difference between the total distances calculated as the number of participating vehicles increases;
[0061] Figure 5 Schematic diagram showing the changing trend of the sum of total distances calculated by the present method and the conventional method in Example 2 of the present invention, while keeping the total number of vehicles unchanged, and the proportional difference between the total distances calculated as the number of participating vehicles increases;
[0062] Figure 6 This is a time-consuming trend diagram of a common method for finding an optimal solution using a solver in Example 2 of the present invention;
[0063] Figure 7This is a time consumption trend diagram of the heuristic search algorithm based on the fallback strategy in Example 2 of the present invention;
[0064] Figure 8 This is a comparison chart of the average number of seats used when all vehicles in Example 2 of the present invention are selected together in one round using the method of the present invention and when the vehicles are operated without using the method of this case. DETAILED DESCRIPTION
[0065] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention.
[0066] Example 1
[0067] A lightweight carpooling scheduling method for mileage optimization under multiple time constraints, such as Figure 1 As shown, the following steps are included:
[0068] Step S1: The arrival of a vehicle at a certain boarding / drop-off point to pick up or drop off passengers and the arrival of the vehicle at the terminal are regarded as tasks. Some tasks have characteristics such as correlation and time constraints. Tasks are represented by vertices, and the execution costs between tasks are represented by edges. The task model is established in the form of a directed acyclic graph (DAG).
[0069] Assume that there are M vehicles and N passengers, and each of the M vehicles has its own M starting stations and M preset destinations, and each of the N passengers has its own N boarding points and N getting off points. 2(N+M) tasks P are available: {P1,…,P 2N+2M} to describe all the task sets in the carpooling service, use vertices to represent the tasks, use edges to represent the execution costs between tasks, and construct a directed acyclic graph G(V,E) to represent all tasks and the relationships between tasks. For task P i , which means that the vehicle arrives at location i to perform the task of picking up or dropping off passengers or enter the terminal. Assume that the two tasks are P i With P j , any edge E i,j Representative task P i With P j The execution cost between them, in this invention, the weight of the edge W i,j Represents the task P i Execution location to task P j The distance between the coordinates of the execution locations is recorded as: According to the characteristics of the tasks, 2(N+M) tasks can be divided into four parts: M starting point sets S: {S1,…,S M}、M endpoint sets D:{D1,…,DM}、N passenger boarding point set N p :{N p 1,…,N p N}、N passenger drop-off point set N d :{N d 1,…,N d N}, M vehicles start from their respective starting points, and after picking up at least one person, they eventually return to their own preset destinations at the time of departure.
[0070] In this process, in order to meet the needs of passengers, the present invention considers such a situation: all passengers can set the right time window at their respective pick-up and drop-off points, indicating that the passengers want to be picked up or dropped off before a certain time. The right time window of each pick-up point is set as: a:{a1,…,a 2N After determining the attributes of all task representative point sets, a task network is formed, in which some tasks have correlation or time constraint attributes.
[0071] Step S2: Based on the Multiple Traveling Salesmen Problem (MTSP) model and the Vehicle Routing Problem (VRP) model, the classic traffic flow balance, point-finding rule constraints and other constraints are adopted, and with reference to the schemes of setting Boolean optimization variables and setting the objective function of minimizing the total distance in the MTSP model, new optimization variables are set, and the objective function of minimizing the total mileage is proposed.
[0072] The traditional multiple traveling salesman problem can be used to describe a scenario similar to this problem, that is, multiple traveling salesmen start from their common starting point, traverse all points on the map once without overlapping paths, and finally return to the starting point. In the multiple traveling salesman problem and vehicle routing problem, there are references to this problem, such as: flow balance constraints on the concentration of traversed points, constraints that ensure that all points are traversed only once, and the setting scheme of optimization variables. Based on the traditional multiple traveling salesman problem and vehicle routing problem, this paper introduces a three-dimensional Boolean optimization variable X i,j,m , through X i,j,m Indicates that vehicle number m performs task P i With P j , and passes through the corresponding path to represent the matching relationship between the pick-up and drop-off tasks and the vehicles;
[0073]
[0074] in, C is the set of all vehicles.i,j Represents task P i and Task P j The execution cost between i,j,m *d i,j Can be used as m car to perform mission P i With P j The execution cost of , with minimizing the total mileage as the objective function, can be obtained:
[0075]
[0076] Step S3: By introducing constraints such as the order of pick-up and drop-off points, multi-point time window restrictions, and separation of departure and destination points, which do not exist in the MTSP model and the VRP model but are relevant to the actual problem described in the present invention, a vehicle-passenger allocation and scheduling problem based on total mileage optimization with a strict mathematical description is constructed.
[0077] In this step, a continuous optimization variable W is introduced i,m , which means that when car m arrives at task P i Time of execution place, where Using the continuous variable W i,m To describe the time constraints, and according to the time and correlation requirements of the vehicle scheduling problem, the following constraints are added:
[0078] (1) Origin station constraint: ensure that each vehicle starts from its own origin station, and the vehicle leaving the origin station must go to perform N of the passenger pickup tasks. p Therefore, we add the following constraints:
[0079]
[0080] (2) Destination Constraint: This invention considers the scenario where the vehicle needs to return to the destination after completing the pick-up and drop-off mission. Therefore, the following constraints should be added:
[0081]
[0082] (3) Passenger pick-up and drop-off sequence constraint: After picking up a person, the passenger must be dropped off before returning to the destination. Specifically, suppose there are n passengers, and they are numbered sequentially as 1, 2, 3, ..., n passengers. The n boarding tasks set by n passengers are set as P1, P3, P5, ..., P 2n-1 The corresponding n get-off tasks are set as P2, P4, P6, ..., P 2n If the vehicle completes task P1, it must choose to perform task P2 in the subsequent task selection. To meet this requirement, the following constraints should be added:
[0083]
[0084] (4) Point set traversal uniqueness constraint: The present invention considers the situation that each passenger boarding / disembarking location is only allowed to be passed by a certain vehicle once. After passing through, it cannot be passed by other vehicles or the vehicle again. The constraint conditions are:
[0085]
[0086] (5) Capacity Constraint: The present invention considers the capacity constraint of the vehicle. Taking an ordinary family car as an example, its capacity q at a certain moment can be any positive integer less than or equal to 4. However, when passing a certain station, there may be more than one person boarding or getting off the vehicle. This situation is reflected in the task constraint as follows:
[0087]
[0088] Among them, G i Indicates the execution of task P i For the change in the number of people in a vehicle: G:{G1,…,G 2N}.
[0089] (6) Vehicle driving route rule constraints: In order to achieve basic path selection requirements, the following road driving rule constraints need to be added:
[0090]
[0091] Formula (7) is the constraint condition that does not allow the vehicle to choose a route from the origin to the origin;
[0092]
[0093] Formula (8) is the constraint condition that does not allow vehicles to choose a route that goes directly from the starting point to the destination;
[0094]
[0095] Formula (9) is the constraint condition that does not allow the vehicle to choose a route from a certain pick-up point back to the starting point;
[0096]
[0097] Formula (10) is the constraint condition that does not allow the vehicle to choose to go from the current point to the current point;
[0098]
[0099] Formula (11) is the constraint condition that does not allow the vehicle to choose the path it has traveled;
[0100]
[0101] Formula (12) is a constraint that does not allow a vehicle to choose the same path twice in both directions.
[0102] (7) Flow Constraint: For the intermediate point, i.e., the pick-up point, a car must leave when it enters, i.e., there is a task P to be executed. i to P j If the path is selected, there must be a path to execute task P j to P k The path is selected. To achieve this, the constraints that need to be added are:
[0103]
[0104]
[0105] (8) Multi-point time constraints: The present invention considers the user's perspective and introduces a right time window at the user's preset pick-up point and drop-off point, which means that the user hopes to be picked up / dropped off before a certain time, which is more in line with the actual application scenario of vehicle sharing services.
[0106]
[0107]
[0108] Among them, t i,j It represents the estimated time from the execution location of task i to the execution location of task j, which is estimated based on the difference between the average speed and the distance.
[0109] The allocation and scheduling problem takes the minimization of total mileage as the objective function. According to the problem model, a person-vehicle allocation and scheduling optimization problem based on total mileage optimization can be established:
[0110]
[0111]
[0112] Step S4: For the problem raised in step S3, the optimal solution is obtained through a hybrid nonlinear integer programming solver, and the original problem is divided into three sub-problems using the problem decomposition method. A heuristic algorithm based on a backoff strategy with low computational complexity is designed, which significantly reduces the problem-solving time and improves the applicability of this vehicle scheduling problem.
[0113] First, the accuracy of the problem model must be determined and the optimal solution must be obtained. The optimal solution's execution time and the calculated total mileage are used as a control group, and the performance is analyzed. A commercial mixed-integer nonlinear programming solver (Gurobi) was used to obtain the optimal solution. Analysis revealed that the computation time for the optimal solution increases exponentially with increasing problem size. Therefore, based on the optimized problem structure in step S3 and utilizing problem decomposition, a low-computational-complexity heuristic algorithm was designed to improve the applicability of the problem model. The original problem in step S3 can be decomposed into three subproblems during the point set iteration process: 1) driving from the current task execution location to the feasible task execution location with the shortest local distance; 2) updating information about prohibited and executable tasks based on global information; and 3) simulating whether the vehicle's selection of an executable task at the current task execution location violates the task's time constraints to further determine feasibility. Solving these three subproblems sequentially updates the current location point in successive iterations. Ultimately, after the set of available points is cleared, the vehicle travels to the preset destination to complete a passenger pickup and drop-off matching task. The specific steps are as follows:
[0114] a) Determine the attributes of a vehicle at a particular pick-up point and update the strategy for selecting the point;
[0115] According to the problem structure, set the attribute {CO m ,T m ,CA m ,D m ,S m ,B m ,L m},in CO m represents the current coordinates of car m, T m Indicates the current travel time of vehicle m, CA m represents the current capacity of car m, D m Indicates the total distance traveled by car m, S m Indicates that the current state of car m can execute tasks, B m Indicates that the current state of vehicle m cannot execute the task, L m Represents all the attributes of the previous state of vehicle m. The above attributes will be updated when the vehicle completes the next task. The present invention sets up a data structure for storing the above attributes and performs a basic point-finding scheme for state rollback based on the attributes of the previous point set. For example, when vehicle m is at the starting point of the vehicle, the current coordinate CO of the vehicle is m is the starting point coordinate, the current timer T m Zero, current capacity CA m For four passengers, the distance traveled is D m Zero, selectable point set S mN is the set of N passenger boarding points p :{N p 1,…,N p N}、Unselectable point set B m N is the set of N passenger drop-off points d :{N d 1,…,N d N}、"Previous state attribute"L m The content is empty. After selecting the next point according to a certain strategy, several attributes of the car need to be updated synchronously: If the optimal point selected is N p 1 point, all attributes need to be updated, and the current coordinate is set to N p 1, the current timer is set to the estimated time calculated based on the distance between the two points and the speed, the current capacity is set to three passengers, the distance traveled is increased by the distance between the two points, and the corresponding N can be added to the selected point set d 1. Delete point N p 1. Add point N to the non-selectable point set p 1. At the same time, the attributes of the vehicle in the previous state, that is, the coordinates, time, driving distance and other information when vehicle m is at the starting point, are added to the "previous state attributes" in the current state. When simulating the time constraint test, if all optional points do not meet the time constraint, the data in the "previous state attributes" must be placed in the current vehicle attributes, and the original optimal point must be placed in the set of unselectable points before the next optimal point is selected.
[0116] After determining the vehicle attributes and the basic fallback strategy, it is necessary to select a strategy for moving from one task to another. According to the structure of formula (17), the present invention plans to use a greedy algorithm to solve this problem. After completing a task, all the tasks that may be executed next are traversed (tasks that cannot be executed do not need to be considered), and the task with the shortest distance to the current position is selected as the local optimal task. After determining the local optimal task, a time constraint simulation is performed on the execution of the task. The time constraint simulation scheme will be explained in detail below. The time constraint simulation scheme proposed by the present invention is also based on the simulation of the current two tasks and the small-scale subsequent situation. It is also a process of seeking local feasibility, so it has the characteristics of a heuristic algorithm. After repeatedly executing the greedy algorithm to find the local optimal task, time constraint simulation and state fallback strategy, when the optional task sets of all vehicles are empty sets, it is determined that a global person-vehicle allocation and route planning have been completed. The state of each vehicle at the starting point is taken as the first state. The above algorithm is iterated in the task set, and finally the solution to problem (17) can be obtained.
[0117] b) time-constrained simulation scheme;
[0118] After each vehicle arrives at a new boarding point, it needs to perform a time constraint simulation. This simulation involves simulating several situations: directly dropping off the newly picked-up passenger, or inserting any task (a task in the optional task set) in the middle of dropping off the newly picked-up passenger. A total of n situations need to be simulated, where n is the total number of tasks in the current vehicle's optional task set. Observe whether the time constraints of each task are met. If multiple situations are met, the one with the smallest total distance is selected.
[0119] This invention considers the situation where there is at least one pair of pick-up points that can be effectively traversed by the vehicle immediately from the starting point. This means that the vehicle will not violate the two time window constraints for these pick-up points in this scenario. This serves as the foundation for the fallback strategy and time-constrained simulation scheme, ensuring that the time-constrained simulation scheme does not fall back after all simulation scenarios are no longer allowed.
[0120] The points that can be selected after the time constraint simulation are not necessarily selected, because the heuristic algorithm involved in the present invention only considers local optimality and feasibility in each step of searching for the optimal task. Therefore, when searching for the optimal task, if the task P k The condition is met, but it does not mean that task P will be executed next from the current task. k In the final route allocation plan, there may still be a selection task P k After that, if it is found that all subsequent tasks do not meet the time constraint, then the state rollback strategy needs to roll back to the state where the previous task is completed and cancel the task P. k As a task in the optional task set, the local optimal task is searched according to the greedy strategy.
[0121] Taking a simple example, suppose there are two vehicles waiting at their starting point, and three passengers need to participate in the carpooling service. For ease of description, all tasks in the current task set are numbered. The three passengers' boarding points are P1, P3, and P5, and the corresponding disembarkation points are P2, P4, and P6. The starting points of the two vehicles are P7 and P8. The execution process of the algorithm is as follows:
[0122] Step 1: Assume that the task closest to the execution location P7 is P1, and the task closest to the execution location P8 is P5. Initially, the optional point sets of both vehicles are [P1, P3, P5]. Due to the existence of basic conditions, the vehicle at the execution location P7 can definitely satisfy the task of executing P1 (picking up passenger 1) and then immediately executing P2 (dropping off passenger 1). Similarly, the vehicle at the execution location P8 can definitely satisfy the task of executing P5 (picking up passenger 3) and then immediately executing P6 (dropping off passenger 3). Therefore, the two vehicles selected P1 and P5 as the optimal tasks in the first round.
[0123] Step 2: After a vehicle selects a boarding task, a time constraint simulation calculation is performed. For a vehicle starting at the P7 execution location, its set of selectable points becomes [P3, P2]. This is because after executing P1, P2 is added to the set of selectable tasks. Therefore, two time constraint simulations are required: P1-P2 and P1-P3-P2. These two simulations verify whether the time constraints of task P2 or task P3 and task P2 are satisfied, respectively. Because the underlying conditions exist, the P1-P2 scenario is guaranteed to be satisfied, meaning that the time constraint of task P2 must also be satisfied. Therefore, only the P1-P3-P2 scenario needs to be calculated. Note that the time constraints of both tasks P3 and P2 must be satisfied.
[0124] Step 3: Each time a task is selected as the local optimal task, the vehicle's attributes are updated and a storage information is added to the "previous state attribute" data structure. The "previous state attribute" data structure can store multiple pieces of information and is labeled by a label. For example, in this case, after the vehicle starting at the P7 execution location completes task P1, the information stored in the data structure is labeled "attributes of vehicle 1 at P7", and so on. If the time simulation fails after passing the boarding point, the first information in reverse order is extracted from the "previous state attribute" data structure and overwritten with the current vehicle attributes. This indicates that the vehicle has returned to the state after the previous task was completed. Repeat steps 2 and 3 for multiple rounds of selection until the optional task sets of all vehicles are empty and all tasks are completed.
[0125] Example 2
[0126] A lightweight carpooling scheduling method with mileage optimization under multiple time constraints is proposed. First, the arrival of a vehicle at a certain pick-up / drop-off point to pick up passengers and the arrival of the vehicle at the terminal are regarded as tasks. Tasks are represented by vertices, and the execution costs between tasks are represented by edges. The task model is established in the form of a directed acyclic graph (DAG), such as Figure 2 As shown, Figure 2Taking the scenario of two cars and three passengers as an example, points 1, 3, and 5 represent the three passengers' boarding points, points 2, 4, and 6 represent the three passengers' alighting points, points A and B represent the starting points of the two cars, and points C and D represent the end points of the two cars. In the figure, solid edges represent selectable edges, dense dashed edges represent two points with corresponding relationships, and sparse dashed edges represent two points with sequence constraints. Based on the multi-traveling salesman problem model and the vehicle routing problem model, new Boolean optimization variables are set, and an objective function of minimizing the total mileage is proposed. Then, constraints that do not exist in the multi-traveling salesman problem model and the vehicle routing problem model are added, and a vehicle-passenger allocation and scheduling problem model based on total mileage optimization is constructed. The optimal solution is obtained through a hybrid nonlinear integer programming solver to achieve the optimal carpooling scheduling method. Figure 3 This is a simulation experiment in which the present invention uses a commercial solver to find an accurate solution to a route and a person-vehicle distribution diagram. Figure 2 The situation of two cars with three passengers is simulated. The starting points of the two cars in the figure are points A and B, and the corresponding end points are points C and D. The boarding points along the way are numbered, where points with odd numbers are boarding points and points with even numbers are alighting points. The numbers in brackets after the corresponding points in the figure represent the capacity change value of the vehicle arriving at this point, such as the capacity of the boarding point is increased by one, and the capacity of the alighting point is reduced by one. Figure 3 The optimal route selection and passenger-vehicle allocation relationship obtained through the method in this case are demonstrated.
[0127] Figure 4 In this embodiment, when the configuration scenario is multiple vehicles and multiple passengers, while keeping the total number of passengers unchanged, the number of vehicles participating in a single allocation process is gradually increased. The changing trend of the sum of the total distances calculated by the two methods is also shown, as is the proportional difference between the total distances calculated by the two methods as the number of participating vehicles increases. As can be seen from the figure, the calculation result of this method is approximately 20% to 25% higher than the optimal solution in terms of total mileage.
[0128] Figure 5 This example shows the changing trend of the total distance calculated by the two methods when the number of passengers participating in a single assignment is increased gradually, while the total number of vehicles remains unchanged, in a scenario with multiple vehicles and multiple passengers. The figure also shows the proportional difference between the total distances calculated by the two methods as the number of participating vehicles increases. As can be seen from the figure, the calculation result of this method is approximately 20% to 30% higher than the optimal solution in terms of total mileage.
[0129] Figure 6In this embodiment, when the number of vehicles participating in a single assignment is fixed at 5, the number of passengers participating in the assignment is adjusted from 7 to 15. The corresponding nine randomly generated coordinate point sets are used to generate a trend graph of the algorithm time consumption for finding the optimal solution using the solver. As can be seen from the graph, as the problem scale continues to expand, the running time of the exact solution increases exponentially, making it unsuitable for large-scale vehicle-passenger assignment and route planning problems.
[0130] Figure 7 In the example configuration of the present invention, when the number of vehicles participating in one allocation is fixed at 5, the number of passengers participating in the allocation is adjusted from 7 to 15, corresponding to the randomly generated 9 coordinate point sets, and the time consumption trend diagram of the heuristic search algorithm based on the back-off strategy of the present invention is adopted. It can be seen from the figure that as the scale of the problem continues to expand, the running time of the method proposed by the present invention is greatly shortened, and the growth trend is close to linear growth at small and medium scales, and the calculation time is extremely short.
[0131] Figure 8 In the example configuration of the present invention, when the number of vehicles participating in one allocation is fixed at 5, the number of passengers participating in the allocation is adjusted from 7 to 15, corresponding to the randomly generated 9 coordinate point sets. A comparison chart of the average number of seats used when the vehicles are running is made between the scheme in which all vehicles are selected together in a round in the method proposed by the present invention and the scheme in which the selection of one vehicle is completely completed before the next vehicle is selected. It can be seen from the figure that the point-finding method in the method proposed by the present invention can significantly increase the average number of seats used in the vehicle, which is conducive to energy conservation and emission reduction and improves resource utilization.
[0132] In summary, the present invention establishes a task model for related tasks, such as vehicle departure from a starting point, vehicle arrival at a destination, and vehicle picking up and dropping off passengers along the way, in the form of a directed acyclic graph. Based on the classic mathematical model of the Multiple Traveling Salesmen Problem (MTSP) and the Vehicle Routing Problem (VRP), the problem structure is designed, and optimization variables and objective functions are proposed. By introducing constraints such as the sequence of pick-up and drop-off points, multi-point time window restrictions, and separation of starting points and destinations, a vehicle-passenger allocation and scheduling problem based on total mileage optimization with a strict mathematical description is constructed. The optimal solution is obtained through a hybrid nonlinear integer programming solver, and an optimal carpooling scheduling method is implemented. This method significantly reduces the problem-solving time and improves the scalability of the allocation and scheduling method for large-scale problems.
[0133] It should be noted that the above content merely illustrates the technical idea of the present invention and cannot be used to limit the scope of protection of the present invention. For ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications all fall within the scope of protection of the claims of the present invention.
Claims
1. A lightweight carpooling scheduling method for optimizing mileage under multiple time constraints, characterized by: The following steps are involved: S1. Establish a task model: Consider the arrival of a vehicle at a certain pick-up / drop-off point to pick up passengers and the arrival of the vehicle at the terminal as tasks. Tasks are represented by vertices, and the execution costs between tasks are represented by edges. The task model is established in the form of a directed acyclic graph (DAG). S2, determining an objective function for minimizing total mileage: Based on a multiple traveling salesman problem model and a vehicle routing problem model, setting an improved three-dimensional Boolean optimization variable based on the two-dimensional Boolean optimization variable in the multiple traveling salesman problem model to propose an objective function for minimizing total mileage; the multiple traveling salesman problem model includes at least a flow constraint and a traversal uniqueness constraint; S3, additional constraints: The new model proposes constraints that do not exist in the multi-traveling salesman problem model and the vehicle routing problem model, and constructs a vehicle-passenger allocation and scheduling problem model based on total mileage optimization. The constraints include the starting station constraint, the terminal station constraint, the passenger pick-up and drop-off sequence constraint, the capacity limit constraint, the vehicle route rule constraint, and the multi-point time constraint; S4, model solution: For the vehicle-passenger allocation and scheduling problem based on total mileage optimization proposed in step S3, the optimal solution is obtained using a hybrid nonlinear integer programming solver, and a heuristic algorithm based on a fallback strategy is designed. The solution process of the heuristic algorithm specifically includes: S41: Determine the shortest possible local distance from the current task execution location to the task execution location; S42: Update the information of prohibited and executable tasks according to the global information; S43: Determine whether the vehicle violates the time constraint of a certain executable task when selecting it at the current task execution location, and judge the feasibility of the method. If not, determine the local optimal task that should be executed next; if the current task violates the time constraint, test other tasks in the executable task set until the next selectable task is found; if all executable tasks violate the time constraint, use the state rollback strategy to roll back the vehicle state and update the executable task set.
2. The lightweight carpooling scheduling method for optimizing mileage under multiple time constraints according to claim 1, characterized in that: In step S1, assume that there are M vehicles and N passengers, and each of the M vehicles has its own M starting stations and M preset destinations, and each of the N passengers has its own N boarding points and N getting-off points, then there are 2(N+M) tasks P: {P1, ..., P 2N+2M } represents the set of all tasks in the carpooling service. For task P i With P j , any edge E i,j Representative task P i With P j The execution cost between them, the edge weight W i,j Represents the task P i Execution location to task P j The distance between the coordinates of the execution locations is recorded as: di,j, 2(N+M) tasks can be divided into four parts: M starting point sets S: {S1, ..., S M }、M endpoint sets D: {D1,...,D M }、N passenger boarding point set N p :{N p 1, ..., N p N }、N passenger drop-off point set N d :{N d 1, ..., N d N }, M vehicles start from their respective starting points and eventually return to their own preset destinations after picking up or dropping off at least one person. All passengers can set the right time window at their respective pick-up and drop-off points, indicating that the passenger wants to be picked up or dropped off before a certain time. The right time window of each pick-up point is set as: a: {a1, ..., a 2N }.
3. The lightweight carpooling scheduling method for optimizing mileage under multiple time constraints as claimed in claim 2, characterized in that: In step S2, X i,j,m Indicates that vehicle number m performs task P i With P j , and passes through the corresponding path to represent the matching relationship between the pick-up task and the vehicle: Among them, X i,j,m is a three-dimensional Boolean optimization variable, C is the set of all vehicles; Due to d i,j Represents task P i and Task P j The execution cost between i,j,m *d i,j Can be used as m car to perform mission P i With P j The execution cost of , with minimizing the total mileage as the objective function, can be obtained: 。 4. The lightweight carpooling scheduling method for optimizing mileage under multiple time constraints as claimed in claim 3, characterized in that: In the step S2, Point set traversal uniqueness constraint: Each passenger boarding / disembarking location is only allowed to be passed by a certain vehicle once, and after passing through, it cannot be passed by other vehicles or the vehicle itself again. The constraints are: Traffic constraints: For the intermediate point, i.e. the pick-up point, a car must leave when it enters, i.e. there is a task P to execute. i to P j If the path is selected, there must be a path to execute task P j to P k The path is selected. To achieve this, the constraints that need to be added are: 。 5. The lightweight carpooling scheduling method for optimizing mileage under multiple time constraints as claimed in claim 3, characterized in that: In the step S3, Origin station constraint: ensure that each vehicle starts from its own origin station, and the vehicle leaving the origin station must go to perform N of the passenger pickup tasks. p One of the tasks is: Terminal constraint: The vehicle must return to the terminal after completing the pick-up and drop-off mission: Passenger pickup order constraint: After picking up a passenger, the bus must drop off the passenger before returning to the destination. The n boarding tasks set by n passengers are set as P1, P3, P5, ..., P 2n-1 The corresponding n get-off tasks are set as P2, P4, P6, ..., P 2n If the vehicle completes task P1, it must select task P2 in the subsequent task selection: Capacity constraint: Considering the capacity constraint of a vehicle, its capacity q at a certain moment can be any positive integer less than or equal to 4. When passing a certain station, there will be more than one person getting on or off the vehicle, that is: Among them, G i Indicates the execution of task P i For the change in the number of people in a vehicle: G: {G1, ..., G 2N }; Multi-point time constraints: Introducing the right time window of the user's preset pick-up point and drop-off point, indicating that the user hopes to be picked up / dropped off before a certain time. Among them, t i,j Indicates that from task P i Execution location to task P j The estimated time at the execution location is estimated based on the difference between the average speed and the distance.
6. The lightweight carpooling scheduling method for optimizing mileage under multiple time constraints as claimed in claim 3, characterized in that: In step S3, the vehicle driving route rule constraints include: If the vehicle is not allowed to choose the route from the origin to the origin, the constraint condition is: If the vehicle is not allowed to choose a route that goes directly from the starting point to the destination, the constraints are: If the vehicle is not allowed to choose a route from a pick-up point back to the starting point, the constraints are: If the vehicle is not allowed to choose to walk from the current point to the current point, the constraint condition is: If the vehicle is not allowed to choose the path it has traveled, the constraint condition is: If the constraint condition that does not allow the vehicle to choose the same path twice in both directions is: 。 7. A lightweight carpooling scheduling method for optimizing mileage under multiple time constraints as claimed in claim 5 or 6, characterized in that: In step S41, all executable tasks are traversed based on the vehicle attributes and the basic fallback strategy to determine the task execution location with the shortest feasible local distance from the current task execution location; the vehicle attributes include at least the current coordinates of the vehicle, the current driving time of the vehicle, the current capacity of the vehicle, the current total distance traveled by the vehicle, the tasks that can be executed in the current state of the vehicle, and the tasks that cannot be executed in the current state of the vehicle; The basic fallback strategy is as follows: when the vehicle is at the starting point, the "previous state attributes" of the vehicle are empty. After selecting the next station, the vehicle attributes are updated synchronously: if the optimal point is selected, the attributes of the vehicle in the previous state are added to the "previous state attributes" of the current state. When simulating the time constraint test, if all optional points do not meet the time constraint, the data in the "previous state attributes" must be placed in the current vehicle attributes, and the original optimal point must be placed in the set of unselectable points before the next optimal point is selected.
8. The lightweight carpooling scheduling method for optimizing mileage under multiple time constraints as claimed in claim 7, characterized in that: After the time constraint of step S43 is completed, if task P k The condition is met, but it does not mean that task P will be executed next from the current task. k In the final route allocation plan, there may still be a selection task P k After that, if it is found that all subsequent tasks do not meet the time constraint, then the state rollback strategy needs to roll back to the state where the previous task is completed and cancel the task P. k As a task in the optional task set, the local optimal task is searched according to the greedy strategy.
Citation Information
Patent Citations
Carpooling scheduling method based on evolutionary algorithm
CN111178724A
Multi-mode customized bus dynamic scheduling method and system and readable storage medium
CN113919684A