Method and device for generating sparse graph containing traffic itinerant path by adopting frequency graph and node degree, electronic equipment and storage medium
The method of generating sparse maps through the frequency graph and node degree has solved the problem of long calculation time and difficulty in adapting to changing traffic conditions by the existing traffic patrol path planning method, and achieved faster and more efficient optimal patrol path planning.
Patent Information
- Application Number
- CN202510153525.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-05-30
AI Technical Summary
The existing traffic circuit path planning methods are difficult to find the optimal circuit path in a short time, especially when passing through multiple transportation stations, resulting in long calculation time and difficult to adapt to changing traffic conditions.
The method of generating a sparse graph containing traffic tour paths is adopted for frequency graphs and node degrees. By establishing a weight graph, the optimal i node paths and frequency graphs are calculated, edges with frequency smaller than the threshold value are deleted, and edges are sorted and deleted according to the average frequency and node degrees of the node until the sparse graph is generated.
It effectively reduces the difficulty and calculation time of traffic patrol path planning, reduces the number of irrelevant paths, and greatly reduces the search space of the optimal patrol path.
Smart Images

Figure CN120069017A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic path planning, and particularly to a method, apparatus, electronic device and storage medium for generating a sparse graph of traffic tour paths by using a frequency graph and node degrees. Background Art
[0002] With the progress of society and the development of urbanization, the transportation and logistics industries have become increasingly important. There are more and more transportation service stations on traffic maps, and the routes between stations are gradually increasing. The path planning of large-scale transportation services has become increasingly complex. In particular, it is difficult to solve the traffic tour path planning passing through multiple transportation stations in a short time, and it is difficult to meet the needs of modern industrial logistics and transportation services. Given a set of transportation stations distributed at different positions on a traffic map, a means of transportation is specified to start from an initial station, pass through all the given transportation stations along a certain path to perform tasks, and then return to the initial departure station after the tasks are completed. To save transportation costs, it is required that the means of transportation does not pass through each transportation station repeatedly, that is, the means of transportation starts from the initial station, passes through each given transportation station once, and then returns to the departure station. The path of the means of transportation forms a tour path passing through all the given transportation stations. To achieve the goal of energy saving and time saving, traffic tour path planning needs to find the optimal tour path passing through all the given transportation stations in advance, so as to arrange a suitable means of transportation to complete the transportation tasks on time.
[0003] There are a large number of service objects at different locations in many traffic application scenarios, and it is required that the means of transportation arrive at the corresponding locations at fixed times to complete the services. For large-scale transportation problems, traffic tour path planning is indeed very important, but it is very difficult to solve completely. First of all, the traffic tour path planning passing through multiple transportation stations essentially belongs to a combinatorial optimization problem. As the number of transportation stations passed through increases, the number of tour paths increases exponentially. For complex traffic tour path planning, the processing time of the analysis means and methods for obtaining the optimal tour route is very long, and it is difficult to obtain a satisfactory tour route within an acceptable time. In addition, the transportation environment is constantly changing, and traffic tour path planning needs to consider the changing traffic conditions and adjust the transportation routes at any time to obtain a satisfactory tour route. In view of this, as Figure 1 shown in the schematic diagram of the existing traffic tour path planning method.
[0004] The main reason why the difficulty of traffic tour path planning cannot be reduced is that the search space for the optimal traffic tour path on the traffic map is huge, which causes many solving methods unable to search for the optimal traffic tour path in a short time. Investigating the reason, the number of paths between transportation stations is the main factor forming the huge search space. If the number of paths in the original traffic map can be reduced to a certain extent, the search space for the optimal traffic tour path will be greatly reduced, and thus the difficulty of traffic tour path planning will also be greatly reduced. In fact, many paths between transportation stations do not belong to the optimal traffic tour path. Given n transportation nodes, the optimal tour path is only n paths connecting these n nodes, and the remaining irrelevant paths can be ignored. In view of this, in order to enable the subsequent algorithm to quickly search for the optimal traffic tour path in the traffic map, some methods or technologies are needed to delete many irrelevant paths from the traffic map and only leave a small number of paths in the traffic map. In this way, the simplified traffic map will reduce the solving difficulty of the optimal tour path and shorten the calculation time. However, it is very difficult to distinguish the paths in the optimal tour traffic path from the general paths only based on the length of the paths on the traffic map.
[0005] Although the Chinese patent "201810579353.X A Method for Planning Traffic Tour Paths to Reduce Path Branches" also deletes a large number of path branches not in the optimal path to generate a sparse graph, reduces the search space for the optimal tour path, and reduces the calculation time for the algorithm to solve the optimal tour path. However, it only uses the optimal four-node path to calculate the frequency of each path and cannot delete more edges not in the optimal tour path; in addition, it needs to calculate the frequency of edges in multiple rounds, with a large amount of calculation. When a frequency graph is calculated and the edges with smaller frequencies are deleted according to the frequency threshold, if the number of edges included in the remaining graph is large, it is necessary to select a certain number of quadrilaterals for each edge again, recalculate the frequency of each edge in the remaining graph, and then perform the edge deletion operation, repeating this process until a sparse graph is generated.
[0006] Therefore, a method for generating a sparse graph containing traffic tour paths using a frequency graph and node degree is needed to delete more edges not in the optimal tour path and reduce the amount of calculation. Summary of the Invention
[0007] The purpose of the present invention is to propose a method, device, electronic device and storage medium for generating a sparse graph containing traffic tour paths using a frequency graph and node degree.
[0008] The method for generating a sparse graph containing traffic tour paths using a frequency graph and node degree includes the following steps:
[0009] Input n traffic nodes on the traffic map and the paths between the traffic nodes, and establish a weight graph containing n traffic nodes and paths;
[0010] According to the weighted graph containing n traffic nodes, select N i-node weighted graphs for each edge, calculate the optimal i-node path and frequency graph, and at the same time establish the distance matrix DM and the initial connection relationship matrix AM between traffic nodes; delete the edges with frequencies less than the frequency threshold in the frequency graph to generate a frequency sparse graph and the corresponding weighted sparse graph;
[0011] Calculate the average frequency and node degree of the nodes in the frequency sparse graph, and at the same time calculate the product of the average frequency and node degree of each node. Sort the nodes according to the size of the product, delete the edge with the minimum frequency associated with the node with the largest product, and update the frequency sparse graph, the corresponding weighted sparse graph, and the initial connection relationship matrix AM until the number of edges in the frequency sparse graph meets the requirements;
[0012] Using the frequency of the edge as heuristic information, solve the shortest tour traffic path by the branch and bound method, and output the sparse graph containing the traffic tour path.
[0013] Furthermore, i is greater than or equal to 4, and n is greater than or equal to i.
[0014] Furthermore, the frequency threshold is 0.25 * i * (i - 1) * N. When (n - 2)! / (i - 2)! / (n - i)! <= 30, take N = (n - 2)! / (i - 2)! / (n - i)!; when (n - 2)! / (i - 2)! / (n - i)! > 30, N takes an integer greater than 30.
[0015] A device for generating a sparse graph containing a traffic tour path using a frequency graph and node degree, including:
[0016] A weighted graph establishment module, used to input n traffic nodes on the traffic graph and the paths between traffic nodes, and establish a weighted graph containing n traffic nodes and paths;
[0017] A sparse graph generation module, used to select N i-node weighted graphs for each edge according to the weighted graph containing n traffic nodes, calculate the optimal i-node path and frequency graph, and at the same time establish the distance matrix DM and the initial connection relationship matrix AM between traffic nodes; delete the edges with frequencies less than the frequency threshold in the frequency graph to generate a frequency sparse graph and the corresponding weighted sparse graph;
[0018] A sparse graph update module, used to calculate the average frequency and node degree of the nodes in the frequency sparse graph, and at the same time calculate the product of the average frequency and node degree of each node. Sort the nodes according to the size of the product, delete the edge with the minimum frequency associated with the node with the largest product, and update the frequency sparse graph, the corresponding weighted sparse graph, and the initial connection relationship matrix AM until the number of edges in the frequency sparse graph meets the requirements;
[0019] A sparse graph output module, which uses the frequency of edges as heuristic information and adopts the branch and bound method to solve the shortest tour traffic path, and outputs a sparse graph containing the traffic tour path.
[0020] Further, in the sparse graph generation module, i is greater than or equal to 4, and n is greater than or equal to i.
[0021] Further, the frequency threshold in the sparse graph generation module is 0.25 * i * (i - 1) * N. When (n - 2)! / (i - 2)! / (n - i)! <= 30, N = (n - 2)! / (i - 2)! / (n - i)!; when (n - 2)! / (i - 2)! / (n - i)! > 30, N takes an integer greater than 30.
[0022] An electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements each step in the method of generating a sparse graph containing a traffic tour path using a frequency graph and node degrees.
[0023] A storage medium stores a computer program. When the computer program is executed by a processor, it implements each step in the method of generating a sparse graph containing a traffic tour path using a frequency graph and node degrees.
[0024] The beneficial effects of the present invention are as follows:
[0025] 1. After the frequency graph is calculated in the present invention, the edges with smaller frequencies are deleted once according to the frequency threshold. Then, by updating the average frequency of each node and the degree of the node, appropriate nodes and edges with smaller frequencies are selected for deletion until a sparse graph is generated, without the need to recalculate the frequency for each remaining edge again, and the computational amount is small.
[0026] 2. The present invention calculates the frequency of each edge using the optimal path containing more nodes. The frequency difference between the edges in the optimal tour path and the edges in the non - optimal tour path will be greater, which is more conducive to deleting more edges not in the optimal tour path and reduces the difficulty of traffic tour path planning. Description of the Drawings
[0027] Figure 1 It is a schematic diagram of an existing traffic tour path planning method.
[0028] Figure 2 It is a weight graph of an exemplary traffic map.
[0029] Figure 3 It is a frequency graph of an exemplary traffic map.
[0030] Figure 4 It is a schematic flowchart of generating a sparse graph of a traffic tour path in an embodiment of the present invention.
[0031] Figure 5 It is a schematic diagram of a device that generates a sparse graph containing traffic tour paths using a frequency graph and node degrees.
[0032] Figure 6(a) is the weight graph of an embodiment of the present invention.
[0033] Figure 6(b) is the frequency graph of an embodiment of the present invention.
[0034] Figure 6(c) is the frequency graph simplified by using a frequency threshold in an embodiment of the present invention.
[0035] Figure 6(d) is the frequency graph after edge deletion by multiplying the average frequency of points and node degrees in the present invention.
[0036] Figure 7 It is a schematic diagram of the structure of an electronic device of the present invention. Specific embodiments
[0037] The present invention proposes a method, device, electronic device, and storage medium for generating a sparse graph containing traffic tour paths using a frequency graph and node degrees. The following further describes the present invention with reference to the accompanying drawings and specific embodiments.
[0038] As Figure 4 shown, the method of the present invention for generating a sparse graph containing traffic tour paths using a frequency graph and node degrees includes the following steps:
[0039] A. Represent the transportation stations and possible paths between stations as a weight graph. The nodes on the weight graph represent transportation stations, the connections between nodes in the graph are edges, representing traffic paths, and the weights on the edges represent path distances, travel times of transportation tools, or transportation costs. The meaning of the weights on the edges in one weight graph is consistent to ensure that the weights of the optimal traffic tour paths are not contradictory; in addition, establish an adjacency relationship matrix and a distance matrix between nodes. The elements of the adjacency relationship matrix represent whether there is a path or an edge between nodes, and the elements of the distance matrix represent the length of the path between nodes.
[0040] B. Take a weight graph with n (n is greater than or equal to 4) nodes as an object. For each edge containing two nodes, randomly generate i - 2 (i is greater than or equal to 4, n is greater than or equal to i) other nodes, and form an i-node weight graph with the two nodes of an edge. A total of N such i-node weight graphs are generated. Calculate the optimal path of the given endpoints in each i-node weight graph, calculate the frequency of each edge using the optimal path of the given endpoints, and convert the weight graph into a frequency graph. The frequency of each edge in the frequency graph represents the number of times the edge appears in the optimal path of the given endpoints.
[0041] C. Given a frequency threshold, delete the edges in the frequency graph whose frequencies are less than the frequency threshold to generate a new frequency graph with a smaller number of edges, that is, a frequency sparse graph and the corresponding weight sparse graph;
[0042] D. Based on the frequency sparse graph, calculate the average frequency of all the edges connected to each node as the average frequency of each node, and at the same time calculate the degree of each node, that is, the number of edges associated with each node;
[0043] E. Calculate the product of the average frequency and the node degree of each node, sort the nodes according to the size of the product, select the node with the largest product and find the edge with the smallest associated frequency, delete this edge, and at the same time update the remaining frequency sparse graph, the corresponding weight graph, and the initial connection relationship matrix AM;
[0044] F. Sparse graph judgment, if the remaining weight sparse graph meets the sparse graph condition, go to step G; otherwise, go to step D to start the deletion operation of the next round of path branches;
[0045] G. Output the sparse graph containing the traffic tour path.
[0046] As can be seen from the above steps, before calculating the optimal traffic tour path, the initial complex traffic map is simplified according to the calculated frequency graph and node degree, and many irrelevant path branches connecting each transportation station are deleted. Since the number of tour paths contained in the simplified traffic map is greatly reduced, the difficulty of traffic tour path planning is thus greatly reduced.
[0047] The above method steps are further explained below. The weight graph is a mathematical form of the traffic map. Transportation stations are represented as nodes in the weight graph, traffic paths are represented as edges in the weight graph, and the traffic path length, the travel time of the transportation vehicle, or the transportation cost is represented as the weight of the edge in the weight graph. Since the weight of the edge can represent physical quantities with specific meanings such as traffic time, cost, and distance, the weight graph has a wide range of applications. For the convenience of calculation, the weight information between nodes is represented as a distance matrix DM, and the elements of the distance matrix are the weights of the edges between the corresponding two nodes; to clearly represent whether there is a path between transportation nodes, an adjacency relationship matrix AM of the weight graph is established. If there is a path between two transportation stations, there is an edge connecting the corresponding nodes in the weight graph, and the corresponding element in the adjacency matrix is 1, otherwise it is 0. In the dynamic traffic planning scenario, due to traffic control or traffic congestion, the corresponding elements between some nodes with traffic paths in the adjacency matrix can also be assigned 0 to meet the needs of dynamic traffic planning. Given a traffic map containing n transportation nodes, if there is a path between any two nodes, then there will be n(n - 1) / 2 edges in the weight graph, and both the distance matrix DM and the adjacency matrix AM are n×n matrices.
[0048] The optimal paths with given endpoints are calculated based on the weighted graph. Given a complete weighted graph with i nodes, there are a total of i*(i - 1) / 2 optimal paths with given endpoints. To calculate each optimal path of i nodes, the lengths of (i - 2)! paths need to be compared. For example, given a weighted graph with four nodes, as Figure 2 shown, once the weights on the edges are determined, six optimal four-node paths with given endpoints can be calculated based on the weights on the edges. Taking Figure 2 the endpoints 1 and 2 in Figure 2 as an example, the calculation process of the optimal path with given endpoints is as follows. Given two endpoints 1 and 2, there are two paths passing through the four nodes 1, 2, 3, and 4, which are represented as 1-3-4-2 and 1-4-3-2 respectively. According to 12 the weights d 13 = 6, d 14 = 3, d 23 = 4, d 24 = 1, and d 34 = 2 of the six edges in Figure 2 , the lengths of these two paths are calculated to be 12 and 9 respectively. Obviously, the four-node path 1-4-3-2 is shorter than the four-node path 1-3-4-2. Therefore, the four-node path 1-4-3-2 is regarded as the optimal four-node path with given endpoints 1 and 2, and this optimal path contains three edges: 1-4, 4-3, and 3-2. Since there are six pairs of endpoints for the four nodes 1, 2, 3, and 4, there are a total of six optimal four-node paths with given endpoints in the weighted graph containing four nodes. Still taking Figure 2 the weighted graph as an example, the six optimal four-node paths with given endpoints are: 1-4-3-2, 1-4-2-3, 1-2-3-4, 2-1-4-3, 2-3-1-4, and 3-2-1-4.
[0049] The frequency graph is calculated using the optimal paths with given endpoints. The frequency of an edge in the frequency graph is the number of times that edge appears in the optimal paths with given endpoints. Taking Figure 2 the weighted graph as an example to calculate a frequency graph. Since the six optimal four-node paths are 1-4-3-2, 1-4-2-3, 1-2-3-4, 2-1-4-3, 2-3-1-4, and 3-2-1-4 respectively, the frequencies of the six edges are calculated to be f 12 = 3, f 13 = 1, f 14 = 5, f 23 = 5, f 24 = 1, and f 34 = 3. The corresponding frequency graph is as Figure 3As shown. It can be seen that the frequencies of the edges in the frequency graph are quite different from the weights of the edges in the weight graph; moreover, the magnitudes of the frequencies of the edges in the frequency graph do not change similarly with the magnitudes of the weights of the edges in the weight graph. For example, in the weight graph, the weight d 24 of edge 2-4 is the smallest, being 1, and the frequency f 24 of edge 2-4 in the frequency graph is also the smallest, being 1. However, in the weight graph, the weight d 13 of edge 1-3 is the largest, being 9, while the frequency f 13 of edge 1-3 in the frequency graph is instead the smallest, being 1. More importantly, some edges that are not in the optimal tour path can be deleted by means of the frequencies of the edges in the frequency graph, simplifying the complex weight graph, reducing the search space for the optimal tour path, and thus lowering the difficulty of solving the optimal tour path. Figure 2 In the weight graph, assuming that node 1 is the initial node, the optimal traffic tour path passing through nodes 1, 2, 3, and 4 is 1-2-3-4-1. It is very difficult to determine the optimal traffic tour path merely based on the path length. For example, starting from node 2 and using the weights of the edges as heuristic information, usually the nearer node 4 will be chosen as the next node. Searching in this way, the two paths found, 2-4-1-3-2 and 2-4-3-1-2, are not the optimal tour paths. If the number of nodes in the weight graph is large, a "combinatorial explosion"-type computational amount will occur when searching in this way, which is not conducive to solving the problem. Figure 3 In the frequency graph, given a frequency threshold of 3, after deleting the edges 1-3 and 2-4 whose frequencies are less than 3, the remaining four edges, 1-2, 2-3, 3-4, and 4-1, form a cycle 1-2-3-4-1, which is actually Figure 2 the optimal tour path in the weight graph. It can be seen that in the simplified weight graph, the search space for the optimal tour path will be greatly reduced, and thus the computational amount for the optimal tour path will also be greatly reduced.
[0050] Since the weight graph contains more than four nodes, the frequency graph is calculated using the optimal paths for many given endpoints. A complete weight graph with n nodes contains n! / i! / (n - i)! i-node weight graphs, and on average (n - 2)! / (i - 2)! / (n - i)! i-node weight graphs contain each edge. For a traffic graph with n nodes, when calculating the frequency graph, N i-node weight graphs containing each edge are randomly selected, then the optimal paths in each i-node weight graph are calculated, and then the frequencies of each edge in the optimal paths are enumerated. Operations are performed using the edge frequencies and node degrees, and the results are used as a key heuristic information to delete irrelevant path branches. First, a part of the edges are deleted according to the given frequency threshold, and then within the remaining frequency graph, the average frequency and node degree of each node are calculated. A node is selected based on the product of the average frequency and node degree of the node, and then the edge with the minimum frequency connected to the node is deleted. After deleting an edge, the remaining frequency graph and weight graph are updated. This process is iterated until a sparse graph is obtained.
[0051] The frequency threshold is determined as follows. When calculating the frequency graph by selecting N i-node weight graphs containing each edge, the frequency threshold is taken as 0.25 * i(i - 1)N. When (n - 2)! / (i - 2)! / (n - i)! <= 30, N = (n - 2)! / (i - 2)! / (n - i)!; when (n - 2)! / (i - 2)! / (n - i)! > 30, N takes an integer greater than 30. In the frequency graph, if the frequency of an edge is less than 0.25 * i(i - 1)N, the edge is regarded as an irrelevant path branch and is deleted from the frequency graph, and at the same time, the edge is deleted from the weight graph; otherwise, the edge is retained. After deleting these irrelevant edges in the frequency graph, a frequency sparse graph with fewer edges and the corresponding weight sparse graph are obtained.
[0052] Generally, especially when the number of nodes n in the initial traffic graph is large, after deleting edges through the frequency threshold 0.25 * i(i - 1)N, the number of edges in the remaining graph is still large, and the search space for the optimal traffic tour path is still large, and further edge deletion is required to obtain a sparse graph with fewer edges. In addition, after deleting edges using the frequency threshold 0.25 * i(i - 1)N, the number of edges connected to each node is not equal, and some nodes are connected to many edges (that is, the degrees of these nodes are still large), resulting in a large local search space and requiring a large number of edges connected to nodes with large degrees to be deleted.
[0053] The average frequency of a node and the node degree are calculated as follows. After deleting a part of the edges according to the frequency threshold 0.25*i(i - 1)N, the number of edges connecting each node in the remaining frequency sparse graph is different; the average frequency of these edges is calculated according to the frequencies of all the edges connecting a node in the remaining frequency graph, and this average frequency is taken as the average frequency of the node. Generally, the average frequencies of each node are not equal. In the remaining frequency sparse graph, the number of edges connecting each node is taken as the degree of the corresponding node.
[0054] The edge deletion by cycling according to the product of the average frequency of a node and the node degree is operated as follows. According to a remaining frequency sparse graph, calculate the product of the average frequency and the node degree of each node, sort the nodes according to the product, select the node corresponding to the maximum product. Usually, this node connects more edges. Delete the edge with the minimum frequency connected to this node from the frequency graph, and at the same time delete this edge from the weight graph, and update the remaining frequency graph and the weight graph. This kind of edge deletion operation can be iterated. Before the next round of edge deletion, it is necessary to recalculate the average frequency and the node degree of each node, and then perform edge deletion according to the product of the two on each node until the traffic graph is simplified to a certain extent, and the search space of the optimal traffic tour path on the simplified traffic graph is greatly reduced.
[0055] The number of paths in the simplified traffic graph is determined as follows. If the traffic graph contains n transportation stations and the number of paths is less than nlog 2 n, this traffic graph is regarded as a simplified traffic graph, otherwise it is regarded as a complex traffic graph. When a part of the path branches are deleted by using the frequency threshold 0.25*i(i - 1)N and the iterative method and the traffic graph is still complex, taking the current frequency sparse graph as the initial graph, it is only necessary to recalculate the product of the average frequency and the node degree of the nodes in the frequency sparse graph, sort the nodes and then delete the irrelevant paths until the number of paths in the sparse graph is less than nlog 2 n.
[0056] After obtaining the weight graph of the traffic graph, the adjacency matrix AM and the distance matrix DM between nodes, step B can be executed: for each edge representing a path, select N i-node weight graphs containing this edge to calculate the frequency of the optimal path and the edge it contains, and calculate the frequency graph corresponding to the weight graph. Next, execute steps C, D, E, and F to ensure that a sparse graph is generated, and finally execute step G to output the sparse graph containing the optimal tour path.
[0057] The above describes the method of generating a sparse graph containing a tour path by using a frequency graph and a node degree. To implement this method, the embodiments of the present invention also include a device for generating a sparse graph containing a traffic tour path by using a frequency graph and a node degree, as Figure 5 shown, including:
[0058] A weight graph building module, which is used to input n traffic nodes on a traffic map and the paths between the traffic nodes, and build a weight graph containing the n traffic nodes and the paths;
[0059] A sparse graph generation module, which is used to select N i-node weight graphs for each edge according to the weight graph containing n traffic nodes, calculate the optimal i-node path and frequency graph, and simultaneously establish a distance matrix DM and an initial connection relationship matrix AM between traffic nodes; delete the edges with frequencies less than the frequency threshold in the frequency graph to generate a frequency sparse graph and a corresponding weight sparse graph;
[0060] A sparse graph update module, which is used to calculate the average frequency and node degree of the nodes in the frequency sparse graph, and simultaneously calculate the product of the average frequency and node degree of each node, sort the nodes according to the size of the product, delete the edges with the minimum frequency associated with the node with the largest product, and update the frequency sparse graph and the corresponding weight sparse graph until the number of edges in the frequency sparse graph meets the requirements;
[0061] A sparse graph output module, which is used to use the frequency of the edges as heuristic information, solve the shortest tour traffic path by the branch and bound method, and output a sparse graph containing the traffic tour path.
[0062] Next, a more specific example will be used to illustrate the method for generating a sparse graph containing the optimal traffic tour path of the present invention.
[0063] In this embodiment, an offshore wind farm operation and maintenance company conducts regular maintenance and repair tasks for five offshore wind turbines. The operation and maintenance company's ships and personnel start from a dock, sequentially perform maintenance on each wind turbine, and return to the departure dock after completing the tasks. Due to the complex offshore environment, for safety and to save ship operation costs, the operation and maintenance company needs to plan the shortest tour route in advance according to the specific positions of the five wind turbines. The positions of the dock and the five wind turbines are fixed, and there is a sea route between the dock and the wind turbines, as well as between the wind turbines. For the convenience of description and calculation, the dock and the five wind turbines are respectively labeled as No. 1, 2, 3, 4, 5, and 6. According to the label information of the dock and the wind turbines and their relative position relationships, the established traffic weight graph is shown in Figure 6(a). The numbers in the circles respectively represent the labels of the dock and the wind turbines, the connections between them represent paths, and the weights on the paths represent the path lengths, with the unit being km. Taking the dock 1 as the starting node, the optimal tour path of this example is 1-3-6-2-5-4-1.
[0064] (1) According to the relative positions between the dock and the wind turbines, use the weight graph generation unit of the traffic graph to generate the traffic weight graph shown in Figure 6(a). The adjacency relationship matrix between the nodes on the weight graph is The node distance matrix is At the same time, update the adjacency relationship matrix between the nodes in the weight graph to and
[0065] (2) Select a 4-node weighted graph and calculate the frequency of each edge using the optimal path it contains. Since this example is relatively simple, calculate the optimal paths contained in all 4-node weighted graphs in the weighted graph. At this time, there are six 4-node weighted graphs containing each edge, that is, N = 6.
[0066] (3) The frequency graph calculated using the optimal path of four nodes is shown in Fig. 6(b). The frequency on the edge represents the frequency of an edge in the optimal four-node path.
[0067] (4) Given a frequency threshold of 18, the edges in the frequency graph with a frequency greater than or equal to 18 are shown as thick solid lines in Fig. 6(b). Delete the edges in the frequency graph with a frequency less than 18 to obtain a frequency sparse graph, which is shown in Fig. 6(c). Update the weight sparse graph and the adjacency relationship matrix.
[0068] (5) Calculate the average frequency of the wharf and wind turbine nodes in the frequency sparse graph. The average frequencies of the six nodes 1, 2, 3, 4, 5, and 6 are 27, 25, 20.67, 27, 20.67, and 25 respectively. Calculate the node degrees in the frequency sparse graph. The degrees of the six nodes 1, 2, 3, 4, 5, and 6 are: 2, 2, 3, 2, 3, 2. The node degrees of the wind turbine nodes 3 and 5 are greater than those of other nodes, and the redundant edges connected to the nodes with large node degrees need to be deleted. Calculate the product of the average frequency and the node degree of each node. The products corresponding to the six nodes are: 54, 50, 62.01, 54, 62.01, 50. The products of the wind turbine nodes 3 and 5 are the largest. Since the products of these two wind turbine nodes are equal, select one of the nodes, such as the wind turbine node 3, and delete the edge 3-5 with the minimum frequency connected to it. The generated sparse graph is shown in Fig. 6(d). Update the weight sparse graph and the adjacency relationship matrix.
[0069] (6) Since the number of edges 6 in the frequency sparse graph is less than 6log 2 6, specify the wharf node 1 as the initial starting point and use the branch and bound method or other search methods to search for the optimal traffic tour path passing through six nodes.
[0070] (7) Since many edges are deleted, the search difficulty of the optimal traffic tour path in the sparse graph is greatly reduced, and it is easy to obtain the optimal tour path 1-3-6-2-5-4-1. Output the optimal traffic tour path.
[0071] The above several steps have completed the establishment of the weight graph, the selection of the weight graph of the i node, the calculation of the optimal path, the calculation of the frequency graph, the deletion of the irrelevant paths based on the frequency threshold, and the deletion of the irrelevant paths using the product of the node average frequency and the node degree. It can be seen that compared with the initial traffic graph, the number of paths contained in the sparse graph is greatly reduced, the search space of the optimal traffic tour path is greatly reduced, and the difficulty of the tour path planning is correspondingly reduced.
[0072] This embodiment also includes an electronic device and a storage medium. Figure 7 The structural schematic diagram of the electronic device of the present invention. An electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements each step in the method of generating a sparse graph containing a traffic tour path using a frequency graph and a node degree. A storage medium stores a computer program, and when the computer program is executed by a processor, it implements each step in the method of generating a sparse graph containing a traffic tour path using a frequency graph and a node degree.
[0073] By deleting a large number of irrelevant paths, the initial complex traffic graph is simplified, the number of paths in the sparse graph is greatly reduced, and only a small number of paths need to be considered during path planning, greatly reducing the difficulty of traffic tour path planning.
[0074] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present application can be implemented in various computer languages. For example, object-oriented programming languages such as Java and interpreted scripting languages such as JavaScript.
[0075] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0076] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to work in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction device, the instruction device implementing the function specified in one or more processes and / or blocks Figure 1 in one process or a plurality of processes and / or blocks Figure 1 in one block or a plurality of blocks.
[0077] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, such that a series of operation steps are executed on the computer or other programmable apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable apparatus provide steps for implementing the function specified in one or more processes and / or blocks Figure 1 in one process or a plurality of processes and / or blocks Figure 1 in one block or a plurality of blocks.
[0078] Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications falling within the scope of the present application.
[0079] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims
1. A method for generating a sparse graph containing traffic circuit paths using a frequency graph and node degrees, characterized in that: The following steps are involved: Input n traffic nodes and paths between traffic nodes on the traffic map, and establish a weighted graph containing n traffic nodes and paths; According to the weight graph containing n traffic nodes, N i-node weight graphs are selected for each edge, the optimal i-node path and frequency graph are calculated, and the distance matrix DM and the initial connection relationship matrix AM between the traffic nodes are established at the same time; Delete the edges whose frequency is less than the frequency threshold in the frequency graph to generate a frequency sparse graph and a corresponding weight sparse graph; Calculate the average frequency and node degree of the nodes in the frequency sparse graph, and calculate the product of the average frequency and node degree of each node, sort the nodes according to the size of the product, delete the edge with the smallest frequency associated with the node with the largest product, update the frequency sparse graph and the corresponding weight sparse graph and the initial connection relationship matrix AM until the number of edges in the frequency sparse graph meets the requirements; Taking the frequency of edges as heuristic information, the branch and bound method is used to solve the shortest circuit traffic path, and a sparse graph containing the traffic circuit path is output.
2. The method for generating a sparse graph containing traffic circuit paths using a frequency graph and node degrees according to claim 1, characterized in that: i is greater than or equal to 4, and n is greater than or equal to i.
3. The method for generating a sparse graph containing traffic circuit paths using a frequency graph and node degrees according to claim 1 or 2, characterized in that: The frequency threshold is 0.25*i(i-1)N. When (n-2)! / (i-2)! / (ni)!<=30, N=(n-2)! / (i-2)! / (ni)!; when (n-2)! / (i-2)! / (ni)!>30, N is an integer greater than 30.
4. A device for generating a sparse graph containing traffic circuit paths using a frequency graph and node degrees, characterized in that: include: A weighted graph building module is used to input n traffic nodes and paths between traffic nodes on a traffic map, and to build a weighted graph including n traffic nodes and paths; The sparse graph generation module is used to select N i-node weight graphs for each edge according to the weight graph containing n traffic nodes, calculate the optimal i-node path and frequency graph, and establish the distance matrix DM and the initial connection relationship matrix AM between traffic nodes; Delete the edges whose frequency is less than the frequency threshold in the frequency graph to generate a frequency sparse graph and a corresponding weight sparse graph; The sparse graph update module is used to calculate the average frequency and node degree of the nodes in the frequency sparse graph, and calculate the product of the average frequency and node degree of each node, sort the nodes according to the size of the product, delete the edge with the smallest frequency associated with the node with the largest product, and update the frequency sparse graph and the corresponding weight sparse graph as well as the initial connection relationship matrix AM until the number of edges in the frequency sparse graph meets the requirements; The sparse graph output module is used to solve the shortest circuit traffic path by using the branch and bound method with the frequency of edges as heuristic information, and output a sparse graph containing the traffic circuit path.
5. The device for generating a sparse graph containing traffic circuit paths using a frequency graph and node degrees according to claim 4, characterized in that: In the sparse graph generation module, i is greater than or equal to 4, and n is greater than or equal to i.
6. The device for generating a sparse graph containing traffic circuit paths by using a frequency graph and node degrees according to claim 4 or 5, characterized in that: The frequency threshold in the sparse graph generation module is 0.25*i(i-1)N. When (n-2)! / (i-2)! / (ni)!<=30, N=(n-2)! / (i-2)! / (ni)!; when (n-2)! / (i-2)! / (ni)!>30, N is an integer greater than 30.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, each step of the method for generating a sparse graph containing a traffic circuit path by using a frequency graph and node degrees as described in any one of claims 1 to 3 is implemented.
8. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the method for generating a sparse graph containing a traffic circuit path by using a frequency graph and node degrees as described in any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Traffic itinerating path planning method reducing path branches
CN108413980A