Many-to-many shortest path searching method and device suitable for logistics road network
By classifying node importance and shrinking hierarchical processing of logistics road networks, combined with the bidirectional Dijkstra algorithm, the problem of long calculation time for many-to-many shortest paths in logistics road networks is solved, real-time and efficient of fast path query are achieved.
Patent Information
- Application Number
- CN202311690595.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-11
- Publication Date
- 2025-07-22
AI Technical Summary
When the prior art calculates many-to-many shortest paths in logistics road networks, the calculation time is too long to meet the real-time requirements, and the preprocessing process is complex and the map scale increases.
By performing importance classification and shrinking hierarchical processing of logistics road nodes, an optimized map preprocessing method is built, path search is used using the two-way Dijkstra algorithm, path weights are recorded, and two-dimensional array storage path cost is maintained.
It significantly shortens the many-to-many shortest path calculation time, meets the real-time needs of the logistics scheduling system, and optimizes the map preprocessing process.
Smart Images

Figure CN120355047A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of logistics scheduling, and in particular, to a method and device for searching for multi-to-multi shortest paths applicable to a logistics road network. Background Art
[0002] In many logistics transportation problems, it is necessary to obtain the shortest path weights between multiple pairs of nodes (s, t) ∈ S × T in a road network map G = (V, E), where S, T ∈ V. In practical applications, due to the extremely large scale of the road network, it often takes a long time to calculate the shortest path weights between these nodes.
[0003] The prior art can use the Dijkstra algorithm for each node in the starting node set S to find the paths from a single starting node to all end points, or perform |S| × |T| single-point-to-single-point path queries to obtain a multi-shortest path weight matrix. However, the time consumed by the above methods is still too long to meet the real-time requirements of practical applications. The multi-to-multi path planning method based on Highway Hierarchy significantly reduces the multi-to-multi path query time through preprocessing the original map. However, the cost is that the scale of the map after preprocessing increases significantly, and a long preprocessing time is required. Summary of the Invention
[0004] The purpose of the present invention is to propose a method and device for searching for multi-to-multi shortest paths applicable to a logistics road network in view of the deficiencies of the prior art.
[0005] The object of the present invention is achieved by the following technical solutions: A method for searching for multi-to-multi shortest paths applicable to a logistics road network, the method comprising the following steps:
[0006] Step 1: Put all logistics road nodes in the map into a priority queue and sort them from low to high according to importance;
[0007] Step 2: Take out the logistics road nodes from the priority queue in order from high to low according to importance for contraction to complete the preprocessing of the map;
[0008] Step 3: Judge the quantity relationship between the starting logistics road nodes and the ending logistics road nodes. If the number of starting logistics road nodes is greater than the number of ending logistics road nodes, then exchange the starting point and the ending point to construct an inverted map symmetric to the preprocessed map;
[0009] Step 4: In the preprocessed map or the inverted map, perform a reverse path search for each end logistics road node, and record the search space from each end logistics road node to the set of start nodes; for each node v in the search space, record an entry pair (t, d), where t represents the current end logistics road node being searched, and d represents the shortest path weight between node v and node t.
[0010] Step 5: Perform a forward path search for each start logistics road node in the set of start nodes, and record the search space from each start logistics road node to the set of end logistics road nodes; maintain a two-dimensional array during the forward path search to store the cost between each pair of start and end points. The two-dimensional array is the weight matrix of multiple shortest paths, and path selection is made based on the obtained weight matrix.
[0011] Furthermore, the importance of the logistics road node in Step 1 consists of three parts, including the edge difference degree, the number of contracted neighbors, and the node priority; the importance of the logistics road node depends on the linear combination of the three.
[0012] Furthermore, the logistics road nodes in the map are divided into three categories, including: storage area nodes, main road nodes, and access points; among them, the access points have the highest priority in the node importance ranking, followed by the main road nodes, and the storage area nodes have the lowest importance.
[0013] Furthermore, Step 2 preprocesses the map through the contraction of logistics road nodes; the process of logistics road node contraction is as follows:
[0014] When contracting the logistics road node v, regard the set of nodes where all edges enter v as U, and regard the set of logistics road nodes where all edges go from v as W; for node u in U and node w in W, only when the path <uvw>A shortcut edge uw is added only when it is the shortest path from u to w.
[0015] Further, in step 5, the cost values in the two-dimensional array are initialized to infinity or a sufficiently large value; for each logistics road node v on the forward search tree, each set of entry pairs on this node is traversed; for each entry pair (t, d) in the set, the cost value of the two-dimensional array D[s, t] is set to min{D[s, t], d(s, v)+d}.
[0016] In a second aspect, the present invention also provides a many-to-many shortest path search device applicable to a logistics road network, including a memory and one or more processors. An executable code is stored in the memory. When the processor executes the executable code, the described many-to-many shortest path search method applicable to a logistics road network is implemented.
[0017] In a third aspect, the present invention also provides a computer-readable storage medium, on which a program is stored. When the program is executed by a processor, the described many-to-many shortest path search method applicable to a logistics road network is implemented.
[0018] Advantages of the present invention: The present invention provides a many-to-many shortest path search method applicable to a logistics road network. Among them, a method of classifying the importance of logistics road nodes in the logistics road network map and shrinking levels is proposed to optimize the map preprocessing process. The improved preprocessed map accelerates the path query in the logistics road network, greatly reduces the calculation time in the weight calculation of multiple shortest paths, and meets the real-time requirements in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0020] Figure 1 It is a flowchart of an embodiment of the present invention.
[0021] Figure 2 It is a schematic diagram of a simplified logistics road network and its node classification in an embodiment of the present invention.
[0022] Figure 3 It is a schematic diagram of the contraction of logistics road nodes in a directed map in an embodiment of the present invention.
[0023] Figure 4 It is a schematic diagram of an example of the contraction of logistics road nodes in an undirected map in an embodiment of the present invention.
[0024] Figure 5 This is the structural diagram of a many-to-many shortest path search device for a logistics road network according to the present invention. Detailed implementation manners
[0025] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention.
[0026] Figure 1 This is the flowchart of the present invention, and the specific implementation process is as follows:
[0027] Step 1: Put all logistics road nodes in the map into a priority queue for importance sorting
[0028] Figure 2 Shown is a simplified logistics road network map. The nodes within the upper dotted box in the figure are storage area nodes, and the nodes within the lower dotted box are main road nodes. Among them, the black nodes are the nodes where the main road is connected to the storage area, and here they are defined as access points.
[0029] Calculate the priority of each logistics road node. The priority of a logistics road node consists of the edge difference degree, the number of contracted neighbors, and the priority of the logistics road node type. A good importance sorting of logistics road nodes is crucial for the preprocessing of the map. According to the characteristics of the logistics road network, the present invention uses a linear combination of three importances to sort the importance of logistics road nodes. First is the edge difference degree, which represents the net number of edges added to the map after contracting this node. In addition, the number of contracted neighbors of the logistics road node needs to be considered to achieve uniform contraction and a flat hierarchical structure. The number of contracted neighbors is completed by maintaining a counter for each logistics road node, and this counter is incremented each time an adjacent node is contracted. In this case, a logistics road node with a lower counter is superior to a node with a higher counter. Finally, the type of the logistics road node needs to be considered. Due to the structural characteristics of the logistics network map, the present invention divides the logistics road nodes on the map into three categories, namely storage area nodes and main road nodes. During the process of picking up and delivering goods in the logistics system, in most cases, the mobile robot transports goods from one storage area to another. During this period, a large number of shortest paths need to pass through the main road. Therefore, the nodes on the main road have a higher priority. Further, the nodes where the main road is connected to the storage area are defined as access points, and the access points have a higher priority than the ordinary nodes on the main road.
[0030] The calculation method of the edge difference degree is the number of new shortcut edges that need to be added after deleting this node from the map minus the number of original edges deleted. In the initial state, no nodes have been contracted, Figure 2 The edge difference degree of all nodes is -1, and the number of contracted neighbors of all logistics road nodes is 0. Set the priority of the logistics road node types according to the structure of the road network. Here, the priority value of the storage area node is set to 0, the priority value of the ordinary main road node is set to 5, and the priority value of the access point is set to 10.
[0031] Step 2: Take out nodes from the priority queue in turn according to the importance of the logistics road nodes for contraction processing. The contraction process is also the process of adding shortcuts to the original map. After all logistics road nodes are contracted, the preprocessing of the map is completed.
[0032] Figure 3 is the local structure connected to the logistics road node v in the directed map. When contracting the logistics road node v, regard the set of nodes where all edges enter v as U, and regard the set of nodes where all edges enter from v as W. For each u in U, do the following: For each node w in W, calculate Pw, that is, the cost of passing through v from u to w, which is the sum of the edge weights w(u, v)+w(v, w). Then P max is the maximum P of all w in W w value. Perform a standard Dijkstra shortest path search on the subgraph excluding v starting from u. Once the shortest path cost of a certain logistics road node is greater than P max stop the search. For each w, if dist(u, w) > P w , add a shortcut edge uw with a weight of P w . If this condition is not met, no shortcut is added.
[0033] Figure 4 is a schematic diagram of the contraction of the logistics road node c in the undirected map. It can be seen that node c is connected to three edges, namely edges ab, ae, and be. First, delete node c and the edges connected to it. To ensure the semantic invariance of the map, a shortcut needs to be added between nodes ab and ae. The value of the added shortcut edge ab is 5, indicating that this shortcut is composed of edges ac and cb. Similarly, shortcut ae is composed of edges ac and ca, and its value is 2. However, no shortcut needs to be added between nodes be because the shortcut composed of edges bc and ce is not the shortest path between nodes b and e. Path <bde>Ratio path <bce>The cost is lower, and shortcuts do not need to be added in this case.
[0034] Step 3: Evaluate the quantitative relationship between the starting logistics road nodes and the ending logistics road nodes to be calculated. If the number of starting logistics road nodes |S| is greater than the number of ending logistics road nodes |T|, an inverted map symmetrical to the preprocessed map will be constructed. Exchange the set of starting points and the set of ending points to be calculated, and then perform multi-path queries on the inverted map. The purpose of this operation is to ensure that the number of target nodes, i.e., the ending logistics road nodes, in the many-to-many path query is always not less than the number of starting logistics road nodes, which can improve the efficiency of multi-path search.
[0035] Step 4: Conduct a bidirectional Dijkstra search on the preprocessed map, perform a reverse path search for each target node in the target node set T, and record the search space from each target node t to the starting node set S. During a single reverse search, record an entry pair (t, d) for each node v, where t represents the current target node being searched, and d represents the shortest path weight between node v and node t.
[0036] Note that only the upward graph is searched during the reverse search. According to the importance ranking of logistics road nodes, if v is contracted after w, then v > w; if v is contracted before w, then v < w. Define the upward graph and the downward graph: The upward graph only contains edges where v > w. The downward graph only contains edges where v < w. Since each logistics road node has a unique position in the ranking, each edge is either in the upward graph or in the downward graph. Due to the symmetry of the bidirectional Dijkstra search, both the reverse search and the forward search can be completed on the upward graph.
[0037] Step 5: Conduct a forward path search for each starting logistics road node in the starting node set S, and record the search space from each starting node s to the target node set T. Maintain a two-dimensional array D during the forward search to store the cost between each pair of starting points and ending points. The cost values in the two-dimensional array are initially set to infinity or a sufficiently large value. After the forward search of the starting node s is completed, if there is a path between node s and node t, the forward search space starting from the starting node s and the reverse search space starting from the target node t will overlap. Denote the overlapping node set as L. For each node v in the set L, traverse each set of entry pairs on this node. For each entry pair (t, d) in the set, set the cost value of the two-dimensional array D[s, t] to min{D[s, t], d(s, v) + d}.
[0038] Step 6: After the bidirectional Dijkstra search is completed, the two-dimensional array D maintained in Step 5 is the weight matrix of multiple shortest paths, and path selection is performed based on the obtained weight matrix.
[0039] Corresponding to the foregoing embodiment of a method for searching for multiple pairs of shortest paths applicable to a logistics road network, the present invention further provides an embodiment of an apparatus for searching for multiple pairs of shortest paths applicable to a logistics road network.
[0040] See Figure 5 , an apparatus for searching for multiple pairs of shortest paths applicable to a logistics road network provided by an embodiment of the present invention includes a memory and one or more processors. Executable code is stored in the memory. When the processor executes the executable code, it is used to implement the method for searching for multiple pairs of shortest paths applicable to a logistics road network in the foregoing embodiment.
[0041] The embodiment of the apparatus for searching for multiple pairs of shortest paths applicable to a logistics road network provided by the present invention can be applied to any device with data processing capabilities. The any device with data processing capabilities can be a device or apparatus such as a computer. The apparatus embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a logically meaningful apparatus, it is formed by the processor of any device with data processing capabilities where it is located reading the corresponding computer program instructions in the non-volatile memory into the memory for operation. From the hardware level, as Figure 5 shown, it is a hardware structure diagram of any device with data processing capabilities where the apparatus for searching for multiple pairs of shortest paths applicable to a logistics road network provided by the present invention is located. In addition to Figure 5 the processor, memory, network interface, and non-volatile memory shown, any device with data processing capabilities where the apparatus in the embodiment is located usually further includes other hardware according to the actual functions of the any device with data processing capabilities, which will not be elaborated herein.
[0042] The implementation processes of the functions and roles of each unit in the foregoing apparatus are specifically detailed in the implementation processes of the corresponding steps in the foregoing method, and will not be elaborated herein.
[0043] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the descriptions in the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the present invention. A person of ordinary skill in the art can understand and implement it without creative work.
[0044] An embodiment of the present invention further provides a computer-readable storage medium, on which a program is stored. When the program is executed by a processor, it implements a multi-to-multi shortest path search method applicable to a logistics road network in the above embodiment.
[0045] The computer-readable storage medium may be an internal storage unit of any device with data processing capabilities described in any of the foregoing embodiments, such as a hard disk or a memory. The computer-readable storage medium may also be an external storage device of any device with data processing capabilities, such as a plug-in hard disk, a Smart Media Card (SMC), an SD card, a Flash Card, etc. equipped on the device. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of any device with data processing capabilities. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capabilities, and can also be used to temporarily store the data that has been output or will be output.
[0046] Obviously, the above embodiments of the present invention are only examples for clearly illustrating the present invention, rather than limiting the implementation manners of the present invention. For those of ordinary skill in the art, other different forms of changes or modifications can be made on the basis of the above description. It is not necessary and impossible to enumerate all the implementation manners here. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention shall be included in the protection scope of the claims of the present invention.< / bce> < / bde> < / uvw>
Claims
1. A many-to-many shortest path search method applicable to a logistics road network, characterized in that, The method includes the following steps: Step 1: Put all the logistics road nodes in the map into a priority queue and sort them from the lowest to the highest importance; Step 2: Take out the logistics road nodes from the priority queue in order of importance from the highest to the lowest and perform contraction to complete the preprocessing of the map; Step 3: Judge the quantity relationship between the starting logistics road nodes and the ending logistics road nodes. If the number of starting logistics road nodes is greater than the number of ending logistics road nodes, then exchange the starting point and the ending point, and construct a reverse map symmetric to the preprocessed map; Step 4: In the preprocessed map or the reverse map, perform a reverse path search for each ending logistics road node, and record the search space from each ending logistics road node to the set of starting nodes; record an entry pair (t, d) for each node v in the search space, where t represents the currently searched ending logistics road node, and d represents the shortest path weight between node v and node t; Step 5: Perform a forward path search for each starting logistics road node in the set of starting nodes, and record the search space from each starting logistics road node to the set of ending logistics road nodes; maintain a two-dimensional array during the forward path search to store the cost between each pair of starting and ending points. The two-dimensional array is the weight matrix of multiple shortest paths, and path selection is performed based on the obtained weight matrix.
2. A many-to-many shortest path search method applicable to a logistics road network according to claim 1, characterized in that In Step 1, the importance of the logistics road node consists of three parts, including the edge difference degree, the number of contracted neighbors, and the node priority; the importance of the logistics road node depends on the linear combination of the three.
3. A many-to-many shortest path search method applicable to a logistics road network according to claim 1, characterized in that, The logistics road nodes in the map are divided into three categories, including: storage area nodes, main road nodes, and access points; among them, the access points have the highest priority in the node importance sorting, followed by the main road nodes, and the storage area nodes have the lowest importance.
4. A many-to-many shortest path search method applicable to a logistics road network according to claim 1, characterized in that In Step 2, the map is preprocessed by contracting the logistics road nodes; the process of contracting the logistics road nodes is as follows: When contracting the logistics road node v, the set of nodes where all edges enter v is regarded as U, and the set of logistics road nodes where all edges enter from v is regarded as W; for the node u in U and the node w in W, only when the path <uvw>A shortcut edge uw will be added only when it is the shortest path from u to w.< / uvw> 5. A many-to-many shortest path search method applicable to a logistics road network according to claim 1, characterized in that, In Step 5, the cost values in the two-dimensional array are initialized to infinity or a sufficiently large value; for each logistics road node v on the forward search tree, traverse each set of entry pairs on this node; for each entry pair (t, d) in the set, set the cost value of the two-dimensional array D[s, t] to min{D[s, t], d(s, v)+d}.
6. A multi - to - multi shortest path search device applicable to a logistics road network, comprising a memory and one or more processors, wherein the memory stores executable code, characterized in that, When the processor executes the executable code, it implements a multi-to-many shortest path search method applicable to a logistics road network as described in any one of claims 1-5.
7. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed by the processor, it implements a multi-to-many shortest path search method applicable to a logistics road network as described in any one of claims 1-5.