A carpooling order allocation method, system, terminal and storage medium
The network flow chart is constructed through the minimum cost maximum flow algorithm, combining the driver's order acceptance income and passenger waiting time to generate the best carpool order matching solution, solving the problem of existing carpooling methods ignoring the passenger experience and improving matching efficiency and driver benefits.
Patent Information
- Application Number
- CN202111476517.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-06
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2041-12-06
AI Technical Summary
The existing carpooling methods mainly start from the driver's perspective and ignore the passenger's carpooling experience, such as waiting time, which leads to poor matching efficiency and passenger experience.
The network flow chart is constructed using the minimum cost maximum flow algorithm, taking into account the driver's order acceptance income, the cost of running air and the waiting time of passengers, generating the best carpool order matching solution, and guiding idle drivers to areas with a large number of orders.
It improves the overall profit of drivers, increases the order matching rate, reduces the cost of taking orders and the waiting time for passengers, and improves the carpooling experience.
Smart Images

Figure CN114331026B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of smart city transportation technology, and in particular relates to a carpooling order allocation method, system, terminal and storage medium. Background Art
[0002] At present, online taxi-hailing has become an important research topic for experts and scholars at home and abroad. It can not only ease the tension of parking lots in cities, but also help control the total number of vehicles in cities, reduce the intensity of use of existing vehicles, and help alleviate traffic congestion. It is the best embodiment of building a green economy and a sharing economy. In order to utilize the empty seats in manned cars and reduce the monetary costs of passengers, major taxi service providers have been promoting their carpooling business in recent years. Carpooling services can reduce passengers' ride costs and make better use of limited vehicles to obtain more profits. When a driver can serve multiple orders at the same time, how to solve the problem of order-sharing and find the best match between the driver and multiple orders is also an important issue in online taxi-hailing.
[0003] At present, a commonly used carpooling method is to obtain the optimal balance between the revenue of receiving orders and the probability of acceptance by adjusting the radius of the vehicle's acceptable orders. If the initial dispatch radius is large, more drivers will receive the request information, increasing the possibility of the request being accepted and reducing the driver's acceptance probability. However, drivers who are relatively far away from the passenger may accept the request. It increases the distance between the passenger and the driver. Therefore, this method retrieves the optimal balance between the pick-up distance and the probability of acceptance through dynamic programming. However, this technology only considers the balance between the driver's revenue of receiving orders and the probability of acceptance from the driver's perspective, while ignoring the passenger's carpooling experience, such as the waiting time from the passenger's request for carpooling to the driver's acceptance and the driver's acceptance of the order. Summary of the invention
[0004] The present application provides a carpooling order allocation method, system, terminal and storage medium, which aims to solve at least one of the above-mentioned technical problems in the prior art to a certain extent.
[0005] In order to solve the above problems, this application provides the following technical solutions:
[0006] A method for allocating a carpooling order, comprising:
[0007] Obtain idle drivers, order requests and group order requests in the area at the current time, construct an initial network flow graph based on the idle drivers, order requests and group order requests, and obtain a feasible flow from the initial network flow graph; the initial network flow graph includes a source node, a driver node, an order node, a group order node and a sink node;
[0008] Constructing a cost network according to the initial network flow graph, wherein the weight of the directed edge between each node in the cost network is the revenue value of the driver accepting an order request;
[0009] Retrieving the minimum cost maximum flow of the initial network flow graph from the cost network by a minimum cost maximum flow algorithm, wherein the minimum cost maximum flow includes at least one augmenting path;
[0010] The initial network flow graph is modified according to the minimum cost maximum flow, and a carpooling order matching solution is generated according to the modified network flow graph.
[0011] The technical solution adopted by the embodiment of the present application also includes: the initial network flow graph constructed according to the idle drivers, order requests and order sharing requests is specifically:
[0012] Obtain a group order request that can be served simultaneously with each order request through the sending time, order starting point coordinates, and order ending point coordinates of each order request;
[0013] The driver node is set as the middle point of the first layer, the order node is set as the middle point of the second layer, and the group order node is set as the middle point of the third layer; there is a connected directed edge between the source point and each driver node, the capacity of the directed edge between the source point and the driver node is 1, the cost value is 0, and the corresponding reverse edge capacity is 0, and the cost value is 0; each driver node has a connected directed edge with each order node within its matching radius, the capacity of the directed edge between the driver node and the order node is 1, and the cost value is the opposite of the driver's revenue value for serving the order, and the corresponding reverse edge capacity is 0, and the cost value is the driver's revenue value for serving the order; if the order node has a group order node that can serve it at the same time, the order node There is a connected directed edge between a single node and all the group-order nodes that can be served simultaneously. The capacity of the directed edge between the order node and the group-order node is 1, and the cost value is the opposite of the driver's profit value for serving the order. The initial capacity of the reverse edge is 0, and the cost value is the driver's profit value for serving the order. All group-order nodes have a connected directed edge with the sink. The capacity of the directed edge between the group-order node and the sink is 1, and the cost value is 0. The corresponding reverse edge capacity is 0, and the cost value is 0. If there is no group-order node that can serve the order node simultaneously, the order node is directly connected to the sink. The capacity of the directed edge between the order node and the sink is 1, and the cost value is 0. The corresponding reverse edge capacity is 0, and the cost value is 0.
[0014] The technical solution adopted by the embodiment of the present application also includes: constructing a cost network according to the initial network flow graph also includes:
[0015] Based on the driver's location when accepting the order (x d ,yd )、Order starting position (x s ,y s ) and the order end position (x e ,y e ) respectively calculate the empty run cost, order cost, order amount and reward value obtained by the driver when accepting an order request whose waiting time exceeds a set threshold, and calculate the profit value of the driver accepting an order request based on the empty run cost, order cost, order amount and reward value, and use the profit value as the weight of the directed edge between each node in the cost network;
[0016] The cost of empty order acceptance is:
[0017]
[0018] The order costs are:
[0019]
[0020] The order amount is:
[0021]
[0022] The reward values are:
[0023]
[0024] The driver's profit value for accepting an order request is:
[0025] profit=amount-cost1-cost2+award
[0026] The technical solution adopted by the embodiment of the present application also includes: the minimum cost maximum flow of the initial network flow graph retrieved from the cost network by the minimum cost maximum flow algorithm includes:
[0027] Starting from the current feasible flow, the SPFA algorithm is used to retrieve a path with the minimum cost from the source point to the sink point from the cost network, and the path is used as the augmenting path. The maximum flow that can pass through the augmenting path and the total transmission cost of the current network flow are calculated through the capacity of each directed edge on the augmenting path;
[0028] Modify the cost value of the path in the cost network according to the maximum flow of the augmented path to generate a new cost network;
[0029] Starting from the current feasible flow, re-searching the augmented path from the new cost network;
[0030] Determine whether a new augmenting path can be retrieved from the new cost network. If a new augmenting path can be found, continue with the previous two steps; if no new augmenting path can be found,
[0031] Take the current augmenting path as the minimum-cost maximum flow of the current network flow.
[0032] The technical solution adopted in the embodiment of this application further includes: The specific method for retrieving a path with the minimum cost when transmitting from the source point to the sink point from the cost network by using the SPFA algorithm is:
[0033] Set an array dist[MAXN] for storing the shortest path length from the source point to each node at the current moment and an array visited[MAXN] for marking whether a node is in the queue, and initialize dist[MAXN] and visited[MAXN];
[0034] Set the dist value of the source point to 0 and the visited value to true;
[0035] Starting from the source point, update the shortest distance of the node i connected to the current node cur and on the edge with the current node as the tail point;
[0036] Judge whether dist[cur]+weight[cur][i]<dist[i] holds, where weight[cur][i] is the weight between the current node cur and the node i; if it holds, then dist[i] = dist[cur]+weight[cur][i]; if it does not hold, then judge whether the node i is in the queue. If the node i is not in the queue, add it to the queue, and record the enqueue times of each node. If the enqueue times are greater than the total number of nodes, it means there is a loop in the cost network, and then update the shortest distance of the node i connected to the current node cur and on the edge with the current node as the tail point again until the queue is empty.
[0037] The technical solution adopted in the embodiment of this application further includes: The specific method for modifying the cost value of this path in the cost network according to the maximum flow of the augmenting path is:
[0038] When the maximum flow of the augmenting path is less than the maximum capacity of this path, increase the reverse flow and modify the cost of this path to the negative of the initial cost; when there is no flow passing through the augmenting path, the flow direction remains unchanged and the cost of this path is the initial cost; when the maximum flow of the augmenting path is equal to the maximum capacity of this path, change the flow direction of this path to the reverse direction and modify the cost of this path to the negative of the initial cost.
[0039] The technical solution adopted by the embodiment of the present application also includes: modifying the initial network flow graph according to the minimum cost maximum flow, and generating a carpooling order matching solution according to the modified network flow graph is specifically:
[0040] Each augmenting path in the minimum cost maximum flow represents a carpooling order matching plan of a driver;
[0041] In each augmenting path, the directed edges connecting the driver node that accepts an order node and other order nodes disappear, and the capacity becomes 0; when there are directed edges between order nodes and group-order nodes in the augmenting path, the directed edges connecting the accepted order node and other group-order nodes disappear, and the capacity becomes 0.
[0042] Another technical solution adopted by the embodiment of the present application is: a carpooling order allocation system, comprising:
[0043] Network flow construction module: used to obtain idle drivers, order requests and group order requests in the area at the current time, construct an initial network flow graph based on the idle drivers, order requests and group order requests, and obtain a feasible flow from the initial network flow graph; the initial network flow graph includes source nodes, driver nodes, order nodes, group order nodes and sink nodes;
[0044] Cost network construction module: used to construct a cost network according to the initial network flow graph, wherein the weight of the directed edge between each node in the cost network is the revenue value of the driver accepting an order request;
[0045] A path calculation module: used for retrieving the minimum cost maximum flow of the initial network flow graph from the cost network by using the minimum cost maximum flow algorithm, wherein the minimum cost maximum flow includes at least one augmented path;
[0046] Order matching module: used to modify the initial network flow graph according to the minimum cost maximum flow, and generate a carpooling order matching solution according to the modified network flow graph.
[0047] Another technical solution adopted by the embodiment of the present application is: a terminal, the terminal includes a processor and a memory coupled to the processor, wherein:
[0048] The memory stores program instructions for implementing the carpooling order allocation method;
[0049] The processor is used to execute the program instructions stored in the memory to control the allocation of carpooling orders.
[0050] Another technical solution adopted by the embodiment of the present application is: a storage medium storing program instructions executable by a processor, wherein the program instructions are used to execute the carpooling order allocation method.
[0051] Compared with the prior art, the beneficial effects of the embodiments of the present application are as follows: the carpooling order allocation method, system, terminal and storage medium of the embodiments of the present application propose a carpooling order allocation algorithm based on minimum cost maximum flow, which constructs the real-time order dispatching process into a network flow, adds influencing factors such as the driver's order acceptance income, the driver's empty running cost, and the passenger waiting time in a dynamically changing environment, retrieves the minimum cost maximum flow in the network flow in real time and generates the best carpooling order matching plan, so as to maximize the driver's overall income, improve the order matching rate, reduce the empty running cost of accepting orders and the user's waiting time. At the same time, the present invention adds a driver guidance function to prompt idle drivers in real time the area with a large number of orders, guide drivers to move to this area, improve the driver's order acceptance rate, and reduce the waiting time of passengers. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 is a flow chart of a method for allocating carpooling orders according to an embodiment of the present application;
[0053] Figure 2 A schematic diagram of the structure of an initial network flow diagram of an embodiment of the present application;
[0054] Figure 3 A schematic diagram of the structure of the cost network and capacity-flow network of an embodiment of the present application;
[0055] Figure 4 A flowchart of the SPFA algorithm of an embodiment of the present application;
[0056] Figure 5 This is a schematic diagram of the structure of the modified cost network according to the embodiment of the present application;
[0057] Figure 6 A schematic diagram of an augmented path retrieved from a modified cost network in an embodiment of the present application;
[0058] Figure 7 This is a schematic diagram of the modified network flow graph structure in the embodiment of the present application;
[0059] Figure 8 This is a schematic diagram of the structure of a carpooling order allocation system according to an embodiment of the present application;
[0060] Fig. 9 This is a schematic diagram of the terminal structure of an embodiment of the present application;
[0061] Fig.10 A schematic diagram of the structure of a storage medium according to an embodiment of the present application. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0063] See also Figure 1 , is a flow chart of the method for allocating carpooling orders in an embodiment of the present application. The method for allocating carpooling orders in an embodiment of the present application comprises the following steps:
[0064] S10: Obtain idle drivers, order requests, and group order requests in the area at the current time, build an initial network flow graph based on the idle drivers, order requests, and group order requests, and obtain the simplest feasible flow from the initial network flow graph;
[0065] In this step, the network flow graph is a special directed graph consisting of several nodes and edges. Each of its edges has a specified capacity (i.e., the maximum amount that each directed edge can transmit), and the flow that each edge can transmit is less than or equal to its capacity value. Given a directed graph G = (ν, ε), the capacity function cap(l) is a non-negative function defined in ε. For a directed edge l = (ν i ,ν j ),cap(l)=cap ij is called the capacity of the directed edge l. Given a directed graph G = (ν, ε) and its capacity function cap(l), (ν, ε, cap(l)) is a capacity network. Given a capacity network, the flow f(l) is a function defined in ε. For a directed edge l = (ν i ,ν j ), f(l)=f ij It is called the flow value on l and is bounded by the capacity function cap(l).
[0066] In the capacity flow diagram, there are source points, intermediate points and sink points. The source point is represented by v s , whose in-degree is 0. The sink is represented by v t , whose out-degree is 0. All other nodes are called intermediate nodes. For a capacity network with a source and a sink, if the flow f satisfies both the conservation constraint and the capacity constraint, then from the source v s To the meeting point v t The flow f is called feasible flow. The conservation constraint is: for each intermediate point, the sum of the inflow flow must be equal to the sum of the outflow flow, that is:
[0067]
[0068] The capacity constraint is as follows: for each directed edge l in ε, its flow value f(l) cannot exceed its capacity function cap(l), that is:
[0069]
[0070] Specifically, Figure 2 As shown, it is a structural schematic diagram of the initial network flow graph of an embodiment of the present application. The initial network flow graph includes a source point, a driver node (3 idle drivers), an order node (5 order requests), a group order node (4 group order requests) and a sink. Assuming that the order requests at each time point are known, the group order request that can be served simultaneously with a certain order request can be obtained through the information such as the sending time of each request, the coordinates of the order starting point, and the coordinates of the order end point. Set the driver node as the middle point of the first layer, the order node as the middle point of the second layer, and the group order node as the middle point of the third layer. There is a connected directed edge between the source point and each driver node, the capacity of the edge is 1, the cost value is 0, and the corresponding reverse edge capacity is 0, and the cost value is 0, where the cost value represents the cost of transmitting a unit of traffic on the directed edge; each driver node has a connected directed edge with each order node within its matching radius, the capacity of the edge is 1, and the cost value is the opposite of the driver's service revenue value of the order, the corresponding reverse edge capacity is 0, and the cost value is the driver's service revenue value of the order; if there is a group order node that can be served simultaneously with an order node, then the order node is connected to the source node. There is a directed edge connecting a single node to all the order-sharing nodes that can be served simultaneously, with a capacity of 1 and a cost value that is the opposite of the driver's revenue value for serving the order. The initial capacity of the reverse edge is 0, and the cost value is the driver's revenue value for serving the order. All order-sharing nodes have a directed edge connecting them to the sink, with a capacity of 1 and a cost value of 0. The corresponding reverse edge capacity is 0 and the cost value is 0. For an order node that does not have an order-sharing node that can be served simultaneously, the order node is directly connected to the sink, with a capacity of 1 and a cost value of 0. The corresponding reverse edge capacity is 0 and the cost value is 0.
[0071] Assume that there are m driver nodes and n order nodes in the initial network flow graph, among which k order nodes have order-grouping nodes that can serve at the same time, the number of order types that can be grouped is c, and the total number of order-grouping nodes is t. Then the total number of nodes in the network flow graph is: m+n+k+2, and the total number of directed edges is:
[0072]
[0073] Assuming that the flow on all directed edges in the initial network flow graph does not exceed the capacity, the flow is called a feasible flow. The simplest feasible flow is the zero flow, that is, the flow with all flows being 0. The value of the feasible flow can be defined as:
[0074]
[0075] When |f| reaches the maximum (minimum) value, f is the maximum (minimum) flow. In addition, in a network flow graph, the source point vs To the meeting point v t The flow value of v t As the source point, v s The sum of the flow values at the sink is 9. Therefore, find the s To the meeting point v t The minimum flow rate is equal to the value from v t to v s The maximum flow rate.
[0076] S20: construct a cost network based on the initial network flow graph, where the weight of the directed edge between each node in the cost network is the revenue value of the driver accepting an order request;
[0077] In this step, the cost network constructed is as follows Figure 3 As shown above, the embodiment of the present application aims to maximize the overall profit, and the weight of the directed edge in the cost network is -profit (profit value). Assume that the position of the driver when accepting the order is (x d ,y d ), the order starting point is (x s ,y s ), the order end position is (x e ,y e ), the Euclidean distance between the starting point and the end point is used to calculate the vehicle's travel distance. The driver's cost of running in vain for an order is:
[0078]
[0079] The order cost is:
[0080]
[0081] The order amount is:
[0082]
[0083] In order to prevent passengers from waiting too long, a weight is assigned to order requests whose waiting time exceeds a set threshold. The weight is the driver's income per unit time when accepting the order, so that the driver can get additional reward value when accepting order requests with longer waiting time, so as to give priority to accepting order requests with longer waiting time. Specifically, the reward value that the driver can get when accepting an order request with a longer waiting time is:
[0084]
[0085] From the above formula, we can see that the overall profit a driver can get from accepting an order is:
[0086] profit=amount-cost1-cost2+award (9)
[0087] The purpose of the embodiments of the present application is to maximize the overall benefits, namely:
[0088] max∑profit=max∑(amount-cost1-cost2+award) (10)
[0089] S30: Retrieving the minimum cost maximum flow of the initial network flow graph from the cost network through the minimum cost maximum flow algorithm;
[0090] In this step, for a network flow, among the feasible flows with the same flow f, the feasible flow with the minimum total cost is called the minimum cost flow of the network with respect to flow f, or simply the minimum cost flow with flow f. The maximum flow refers to the maximum flow that does not exceed the capacity of each directed edge when transmitting from the source to the sink. The minimum cost maximum flow is to find the maximum flow f of a network and minimize the total transmission cost of the flow. The specific problem of solving the minimum cost maximum flow is: given a capacity network D = (V, A, C), each arc (v i ,v j ) In addition to the given capacity c ij In addition, the transmission cost b per unit flow is also given ij ≥0, denoted as D=(V,A,C,B), where b ij ∈B, retrieve the maximum flow f of the source point in the transmission cost and capacity network D = {f ij}, and the total transmission cost of the maximum flow b(f) = ∑b ij f ij Minimum.
[0091] In the embodiment of the present application, the method for solving the minimum cost maximum flow specifically includes:
[0092] S31: Starting from the current feasible flow, the SPFA (Shortest Path Faster Algorithm) algorithm is used to retrieve a path with the minimum cost from the source point to the sink point from the cost network, and the path is used as the augmenting path. The maximum flow that can pass the augmenting path and the total transmission cost are calculated through the capacity of each directed edge on the augmenting path;
[0093] Among them, starting from the current feasible flow, if there is a path that starts from the source and connects one node to another and can reach the sink, and each segment on the path satisfies flow ≤ capacity, then the minimum value delta of the capacity-flow value of each segment on the path can be found. Each segment flow on the path is added to the corresponding minimum value delta to obtain a new feasible flow, and this path is the augmenting path. Figure 3As shown in the figure, (a) is the cost network of the embodiment of the present application, and (b) is a known capacity - flow network. In the cost network, the retrieved augmenting path is 0 -> 2 -> 5 -> 6, and the minimum cost value of this path is 5 + 2 + 3 = 10. According to the capacity - flow network, the maximum flow that can be transmitted on this path is 2, so the total transmission cost of the current network flow is 10 * 2 = 20.
[0094] In the embodiment of the present application, the minimum - cost maximum - flow algorithm is specifically the SPFA (Shortest Path Faster Algorithm, an algorithm for finding the shortest path from a single source) algorithm. Please refer to Figure 4 Figure, which is the flowchart of the SPFA algorithm of the embodiment of the present application. It specifically includes the following steps: First, set an array dist[MAXN] for storing the shortest - path length from the source point to each node at the current moment and initialize it. Set an array visited[MAXN] for marking whether a node is in the queue, and initialize each element in the array to false. Secondly, set the dist value of the source point to 0 and the visited value to true. Then, starting from the source point, update the shortest distance (i.e., the value of the dist array) of the node i connected to the current node cur and on the edge with the current node as the tail, and judge whether dist[cur] + weight[cur][i] < dist[i] holds, where weight[cur][i] is the weight between the current node cur and the node i. If it holds, then dist[i] = dist[cur] + weight[cur][i]; if it does not hold, then judge whether the node i is in the queue. If the node i is not in the queue, add it to the queue and record the number of times each node enters the queue. If the number of times is greater than the total number of nodes, it means there is a loop in the network graph, and then update the shortest distance of the node i connected to the current node cur and on the edge with the current node as the tail until the queue is empty.
[0095] S32: Modify the cost value of this path in the cost network according to the maximum flow of the augmenting path to generate a new cost network;
[0096] Among them, the new cost network is as Figure 5 shown. The modification method of the cost network is specifically as follows: When the maximum flow x ij of the augmenting path is less than the maximum capacity c ij of this path, then increase the reverse flow and modify the cost of this path to the negative of the initial cost (i.e., the cost before modification). When there is no flow passing through the augmenting path, the flow direction (i.e., the arc direction) remains unchanged and the cost is the initial cost. When the maximum flow x ij of the augmenting path is equal to the maximum capacity c ij, the flow direction of the path is changed to the reverse direction, and the cost of the path is modified to the negative of the initial cost. That is:
[0097] When 0<x ij <c ij When , the arc direction remains unchanged and the cost value is positive; when the arc direction is reversed, the cost value is negative;
[0098] When x ij When =0, the arc direction remains unchanged and the cost value is positive.
[0099] When x ij =c ij When , the arc direction is reversed and the cost value is negative.
[0100] S33: Starting from the current feasible flow, perform augmented path retrieval again from the new cost network;
[0101] In this step, based on the current feasible flow, we continuously search for new augmenting paths from the source point, and augment the flow of the path each time until the source point and the sink point are no longer connected, that is, no new augmenting path can be found. The current augmenting path is the minimum cost path, and the current flow is the maximum flow of the network flow. Figure 6 As shown, assuming that a new augmented path is retrieved from the new cost network, the path is 0->2->4->6, the minimum cost of the path is 5+4+4=13, and the maximum flow is 2, then the total transmission cost of the current network flow is 13*2+20=46.
[0102] S34: Determine whether a new augmenting path can be found from the new cost network. If a new augmenting path can be found, continue to execute S32 and S33; if no new augmenting path can be found, execute S35;
[0103] S35: Using the current augmenting path as the minimum cost maximum flow of the initial network flow, where the minimum cost maximum flow includes at least one augmenting path.
[0104] S40: modifying the initial network flow graph according to the minimum cost maximum flow, and generating a carpooling order matching solution according to the modified network flow graph;
[0105] In this step, since a driver can only accept one order at each time point, when an augmenting path is retrieved, the directed edge connecting the driver and other order nodes in the path disappears, that is, the capacity becomes 0; similarly, since an order request can only be served with one group order request at the same time, when there is a directed edge between an order node and a group order node in the augmenting path, the directed edge connecting the order node with other group order nodes disappears, that is, the capacity becomes 0. The modified network flow graph is shown in the figure below. Figure 7As shown in the figure, the group of lines represents the maximum cost minimum flow of the network flow, and each augmenting path in the flow represents a carpooling order matching plan for a driver. Figure 7 The augmenting paths shown include:
[0106] (1) 0->1->8->12->13; this means that idle driver 1 is matched with order request 8, and at the same time, he accepts the carpooling request 12 while serving order request 8;
[0107] (2) 0->2->5->11->13; this means that idle driver 2 is matched with order request 5, and at the same time, he accepts the carpooling request 11 while serving order request 5;
[0108] (3) 0->3->7->13; this means that idle driver 3 is matched with order request 7, but there is no carpooling during the process of serving the order.
[0109] The embodiment of the present application can also count the number of order requests in each area in real time, and prompt idle drivers to move to areas with a larger number of order requests, so as to increase the driver's order acceptance rate and reduce passenger waiting time.
[0110] Based on the above, the method for allocating carpooling orders in the embodiment of the present application proposes a carpooling algorithm based on minimum cost maximum flow, which constructs the real-time dispatching process into a network flow. In a dynamically changing environment, factors such as the driver's order acceptance income, the driver's empty running cost, and the passenger waiting time are added to retrieve the minimum cost maximum flow in the network flow in real time, and generate the best carpooling order matching plan based on the minimum cost maximum flow, so as to maximize the driver's overall income, improve the order matching rate, and reduce the empty running cost of accepting orders and the waiting time of users. At the same time, the present invention adds a driver guidance function to prompt idle drivers in real time about areas with a large number of orders, guide drivers to move to this area, improve the driver's order acceptance rate, and reduce passenger waiting time.
[0111] See also Figure 8 , is a schematic diagram of the structure of the carpooling order allocation system of the embodiment of the present application. The carpooling order allocation system 40 of the embodiment of the present application includes:
[0112] Network flow construction module 41: used to obtain idle drivers, order requests and group order requests in the area at the current time, construct an initial network flow graph according to the idle drivers, order requests and group order requests, and obtain a feasible flow from the initial network flow graph; the initial network flow graph includes a source node, a driver node, an order node, a group order node and a sink node;
[0113] The cost network construction module 42 is used to construct a cost network according to the initial network flow graph, and the weight of the directed edge between each node in the cost network is the revenue value of the driver accepting an order request;
[0114] Path calculation module 43: used for retrieving the minimum cost maximum flow of the initial network flow graph from the cost network by using the minimum cost maximum flow algorithm, wherein the minimum cost maximum flow includes at least one augmenting path;
[0115] The order matching module 44 is used to modify the initial network flow graph according to the minimum cost maximum flow, and generate a carpooling order matching solution according to the modified network flow graph.
[0116] See also Fig. 9 , is a schematic diagram of the terminal structure of an embodiment of the present application. The terminal 50 includes a processor 51 and a memory 52 coupled to the processor 51.
[0117] The memory 52 stores program instructions for implementing the above-mentioned carpooling order allocation method.
[0118] The processor 51 is used to execute program instructions stored in the memory 52 to control the allocation of carpooling orders.
[0119] The processor 51 may also be referred to as a CPU (Central Processing Unit). The processor 51 may be an integrated circuit chip having the ability to process signals. The processor 51 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0120] See also Fig.10 , which is a schematic diagram of the structure of the storage medium of the embodiment of the present application. The storage medium of the embodiment of the present application stores a program file 61 that can implement all the above methods, wherein the program file 61 can be stored in the above storage medium in the form of a software product, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or terminal devices such as a computer, a server, a mobile phone, and a tablet.
[0121] The above description of the disclosed embodiments enables professionals and technicians in the field to implement or use the present application. Various modifications to these embodiments will be apparent to professionals and technicians in the field, and the general principles defined in this application can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown in the present application, but will conform to the widest range consistent with the principles and novel features disclosed in the present application.
Claims
1. A method for allocating carpooling orders, characterized in that: include: Obtain idle drivers, order requests and group order requests in the area at the current time, construct an initial network flow graph based on the idle drivers, order requests and group order requests, and obtain a feasible flow from the initial network flow graph; the initial network flow graph includes a source node, a driver node, an order node, a group order node and a sink node; Constructing a cost network according to the initial network flow graph, wherein the weight of the directed edge between each node in the cost network is the revenue value of the driver accepting an order request; Retrieving the minimum cost maximum flow of the initial network flow graph from the cost network by a minimum cost maximum flow algorithm, wherein the minimum cost maximum flow includes at least one augmenting path; Modifying the initial network flow graph according to the minimum cost maximum flow, and generating a carpooling order matching solution according to the modified network flow graph; The initial network flow graph constructed according to the idle drivers, order requests and order-sharing requests is specifically as follows: Obtain a group order request that can be served simultaneously with each order request through the sending time, order starting point coordinates, and order ending point coordinates of each order request; The driver node is set as the middle point of the first layer, the order node is set as the middle point of the second layer, and the order-sharing node is set as the middle point of the third layer; there is a connected directed edge between the source point and each driver node, the capacity of the directed edge between the source point and the driver node is 1, the cost value is 0, and the corresponding reverse edge capacity is 0, and the cost value is 0; each driver node has a connected directed edge with each order node within its matching radius, the capacity of the directed edge between the driver node and the order node is 1, and the cost value is the opposite of the driver's revenue value for serving the order, and the corresponding reverse edge capacity is 0, and the cost value is the driver's revenue value for serving the order; If the order node has a group order node that can serve simultaneously with it, then there is a connected directed edge between the order node and all the group order nodes that can serve simultaneously, the capacity of the directed edge between the order node and the group order node is 1, the cost value is the opposite of the driver's revenue value for serving the order, the initial capacity of the reverse edge is 0, and the cost value is the driver's revenue value for serving the order; all group order nodes have a connected directed edge with the sink, the capacity of the directed edge between the group order node and the sink is 1, the cost value is 0, the corresponding reverse edge capacity is 0, and the cost value is 0; if the order node does not have a group order node that can serve simultaneously with it, the order node is directly connected to the sink, the capacity of the directed edge between the order node and the sink is 1, the cost value is 0, the corresponding reverse edge capacity is 0, and the cost value is 0.
2. The method for allocating carpooling orders according to claim 1, characterized in that: The constructing a cost network according to the initial network flow graph further comprises: Based on the driver's location when accepting the order (x d ,y d )、Order starting position (x s ,y s ) and the order end position (x e ,y e ) respectively calculate the empty run cost, order cost, order amount and reward value obtained by the driver when accepting an order request whose waiting time exceeds a set threshold, and calculate the profit value of the driver accepting an order request based on the empty run cost, order cost, order amount and reward value, and use the profit value as the weight of the directed edge between each node in the cost network; The cost of empty order acceptance is: The order costs are: The order amount is: The reward values are: The driver's profit value for accepting an order request is: profit=amount-cost1-cost2+award.
3. The method for allocating carpooling orders according to claim 2, characterized in that: The step of retrieving the minimum cost maximum flow of the initial network flow graph from the cost network by using the minimum cost maximum flow algorithm comprises: Starting from the current feasible flow, use the SPFA algorithm to retrieve a path with the minimum cost from the source node to the sink node in the cost network, take this path as the augmenting path, and calculate the maximum flow that the augmenting path can pass through and the total transmission cost of the current network flow based on the capacity of each directed edge on the augmenting path; Modify the cost value of this path in the cost network according to the maximum flow of the augmenting path to generate a new cost network; Starting from the current feasible flow, retrieve the augmenting path again from the new cost network; Judge whether a new augmenting path can be retrieved from the new cost network. If a new augmenting path can be found, continue with the previous two steps; if no new augmenting path can be found, Take the current augmenting path as the minimum-cost maximum flow of the current network flow.
4. The method for allocating carpooling orders according to claim 3, characterized in that: The specific method of using the SPFA algorithm to retrieve a path with the minimum cost from the source node to the sink node in the cost network is as follows: Set an array dist[MAXN] for storing the shortest path length from the source node to each node at the current moment and an array visited[MAXN] for marking whether a node is in the queue, and initialize dist[MAXN] and visited[MAXN]; Set the dist value of the source node to 0 and the visited value to true; Starting from the source node, update the shortest distance of the node i connected to the current node cur and on the edge with the current node as the tail node; Judge whether dist[cur]+weight[cur][i]<dist[i] holds, where weight[cur][i] is the weight between the current node cur and the node i; if it holds, then dist[i]=dist[cur]+weight[cur][i]; if it does not hold, then judge whether the node i is in the queue. If the node i is not in the queue, add it to the queue and record the enqueue times of each node. If the enqueue times are greater than the total number of nodes, it means there is a loop in the cost network, then update the shortest distance of the node i connected to the current node cur and on the edge with the current node as the tail node again until the queue is empty.
5. The method for allocating carpooling orders according to claim 4, characterized in that: The specific method of modifying the cost value of this path in the cost network according to the maximum flow of the augmenting path is as follows: When the maximum flow of the augmenting path is less than the maximum capacity of this path, increase the reverse flow and modify the cost of this path to the negative of the initial cost; when there is no flow passing through the augmenting path, the flow direction remains unchanged and the cost of this path is the initial cost; When the maximum flow of the augmenting path is equal to the maximum capacity of this path, change the flow direction of this path to the reverse direction and modify the cost of this path to the negative of the initial cost.
6. The method for allocating carpooling orders according to claim 5, characterized in that: The specific method of modifying the initial network flow graph according to the minimum-cost maximum flow and generating a carpool order matching scheme based on the modified network flow graph is as follows: Each augmenting path in the minimum-cost maximum flow represents a carpool order matching scheme for a driver; In each augmenting path, the directed edges connecting the driver node that accepts an order node and other order nodes disappear, and the capacity becomes 0; when there are directed edges between order nodes and group-order nodes in the augmenting path, the directed edges connecting the accepted order node and other group-order nodes disappear, and the capacity becomes 0.
7. A carpooling order allocation system using the carpooling order allocation method according to claim 1, characterized in that: include: Network flow construction module: used to obtain idle drivers, order requests and group order requests in the area at the current time, construct an initial network flow graph based on the idle drivers, order requests and group order requests, and obtain a feasible flow from the initial network flow graph; the initial network flow graph includes source nodes, driver nodes, order nodes, group order nodes and sink nodes; Cost network construction module: used to construct a cost network according to the initial network flow graph, wherein the weight of the directed edge between each node in the cost network is the revenue value of the driver accepting an order request; A path calculation module: used for retrieving the minimum cost maximum flow of the initial network flow graph from the cost network by using the minimum cost maximum flow algorithm, wherein the minimum cost maximum flow includes at least one augmented path; Order matching module: used to modify the initial network flow graph according to the minimum cost maximum flow, and generate a carpooling order matching solution according to the modified network flow graph.
8. A terminal, characterized in that: The terminal includes a processor and a memory coupled to the processor, wherein: The memory stores program instructions for implementing the method for allocating carpooling orders according to any one of claims 1 to 6; The processor is used to execute the program instructions stored in the memory to control the allocation of carpooling orders.
9. A storage medium, characterized in that: The device stores program instructions executable by a processor, wherein the program instructions are used to execute the carpooling order allocation method described in any one of claims 1 to 6.
Citation Information
Patent Citations
Taxi matching method capable of reserving
CN109657820A
Guide route generation method and device
CN112508423A
Order distribution method and device thereof
CN112700049A
Task matching fair method for large-scale taxi taking platform
CN113240339A
Urban area flow prediction system and method for vehicle track big data
CN113724504A
