Level network minimum independent closed loop searching method, device and equipment and medium
Through the edge rotation search algorithm, the relative position information of the edges is used to solve the problem of low search efficiency of the minimum independent closed loop in the prior art, and efficient and accurate acquisition of independent closed loops of the level network is achieved, which simplifies the algorithm design and implementation process.
Patent Information
- Application Number
- CN202411158105.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-11-15
Smart Images

Figure CN118960675A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of leveling measurement, and in particular to a method, device, equipment and medium for searching a minimum independent closed loop of a leveling network. Background Art
[0002] The leveling network is an elevation control network with nodes composed of multiple leveling routes composed of a series of leveling points. According to the national first- and second-class leveling measurement specifications, it is necessary to calculate the closing error of the smallest independent closed loop in the leveling network. According to the calculation results, the quality of leveling observation can be preliminarily judged, so as to timely discover systematic errors or gross errors. It is also an important basis for rigorous adjustment in the internal industry. Therefore, it is necessary to first determine the smallest independent closed loop in the leveling network.
[0003] The traditional determination of the minimum independent closed loop is done manually. Although manual calculation is more flexible, the traditional method is too inefficient and prone to errors for complex observation networks. With the development and application of computers, the use of computers to realize closed loop search and closure difference calculation has also emerged. The core problem lies in the design of closed loop search algorithm.
[0004] As a basic algorithm, the minimum independent closed loop search algorithm can realize the automatic retrieval of the minimum number of independent closures and their composition in the leveling network. It is also widely used in many fields such as measurement results adjustment, InSAR phase unwrapping, intelligent navigation route retrieval and ventilation network construction. At present, there are three basic methods for the minimum independent closed loop search algorithm: matrix transformation search, spanning tree and remainder transformation search, and depth-first search:
[0005] (1) Matrix transformation search: a. Establish a mesh matrix, where the corresponding element between two connected points is "1", and vice versa is "0"; b. Matrix transformation, multiple row and column swaps, so that the matrix sub-diagonal elements are "1"; c. Independent closed loop judgment, the all-"1" diagonal elements parallel to the main diagonal elements and the other remaining "1" elements form a closed loop.
[0006] (2) Spanning tree and remainder transformation search: a. Simplify the graph network information into a spanning tree and a corresponding remainder tree; b. Add the remainder branches to the spanning tree and obtain closed loops by deleting non-circuit edges; c. Construct a set of closed loops with the shortest paths between the remainder branches and their two end points in the spanning tree, and then use the shortest path to find the minimum independent closed loop.
[0007] (3) Depth-first search: a. Convert the network graph into an adjacency list; b. Traverse each edge and disconnect it in turn, searching for the shortest path between the two endpoints of the disconnected edge; c. The shortest path found and the disconnected edge form the minimum independent closed loop.
[0008] Many scholars have also continuously improved and optimized these three basic methods, and the current minimum independent closed loop search method is relatively mature.
[0009] However, the existing minimum independent closed loop search algorithms all use the relevant information between points to search, and the implementation process is relatively complicated, the operating efficiency is low, and the time complexity and space complexity are high, which makes the acquisition of independent closed loops of the leveling network very time-consuming and inefficient. Summary of the invention
[0010] The present invention provides a method, device, equipment and medium for searching the minimum independent closed loop of a leveling network, which solves the problem that the existing minimum independent closed loop search algorithms all use the relevant information between points to search, the implementation process is relatively complicated, the operating efficiency is low, the time complexity and space complexity are high, and the acquisition of independent closed loops of the leveling network is very time-consuming and inefficient.
[0011] In a first aspect, the present invention provides a method for searching a minimum independent closed loop of a leveling network, comprising the following steps:
[0012] Obtain multiple leveling routes of the leveling network to be measured, each leveling route includes a starting point and an end point;
[0013] Take each leveling route as an edge and obtain the direction value of the edge according to the corresponding starting point and end point;
[0014] Performing independent closed loop search on all edges to obtain multiple minimum independent closed loops; the independent closed loop search includes a clockwise rotation search and a counterclockwise rotation search performed in sequence, the steps of the clockwise rotation search and the counterclockwise rotation search are the same but the search directions are opposite;
[0015] Search for independent closed loops on all edges and obtain multiple minimum independent closed loops, including:
[0016] Traverse all edges based on clockwise search, starting the search with any edge as the starting edge S1;
[0017] Determine whether the direction value of S1 is within the range of 0° to 180°; if so, perform a clockwise search to determine the adjacent edge S j , let j = 2;
[0018] Adjacent edge S j As the new starting edge, search clockwise again to determine the next adjacent edge S j+1 ;
[0019] Judge S j+1 Is the end point of S1 the same as the starting point of S1? If so, then S1-S j+1 A minimum independent closed loop is formed;
[0020] Determine whether the minimum independent closed loop is an outer loop and whether it is repeated with the searched minimum independent closed loop; if the minimum independent closed loop is not an outer loop and is not repeated with the searched closed loop, output the minimum independent closed loop;
[0021] Based on the counterclockwise rotation search, all edges are traversed and the above clockwise rotation search process is repeated to obtain multiple minimum independent closed loops.
[0022] Preferably, if the direction value of the starting edge S1 is not within the range of 0° to 180°, another edge is selected as the starting edge S1 to start the search.
[0023] Preferably, if S j+1 The end point of S1 is different from the starting point of S1. j+1 As the new starting edge, search clockwise again to determine the next adjacent edge S j+2 , judge S j+2 Whether the end point of is the same as the starting point of S1.
[0024] Preferably, if the minimum independent closed loop is not an external loop, another edge is selected as the starting edge to start the search.
[0025] Preferably, if the minimum independent closed loop overlaps with the closed loop that has been searched, another edge is selected as the starting edge to start the search.
[0026] In a second aspect, the present invention further provides a leveling network minimum independent closed loop search device, comprising:
[0027] An acquisition module is used to acquire multiple leveling routes of the leveling network to be measured, each leveling route includes a starting point and an end point;
[0028] A module is constructed to treat each leveling route as an edge and obtain the direction value of the edge according to the corresponding start and end points;
[0029] A search module is used to perform independent closed loop search on all edges to obtain multiple minimum independent closed loops; the independent closed loop search includes a clockwise rotation search and a counterclockwise rotation search performed in sequence, the steps of the clockwise rotation search and the counterclockwise rotation search are the same but the search directions are opposite;
[0030] The search module includes:
[0031] The start module is used to traverse all edges based on a clockwise rotation search and start the search with any edge as the starting edge S1;
[0032] The judgment module is used to judge whether the direction value of S1 is within the range of 0° to 180°; if so, a clockwise rotation search is performed to determine the adjacent edge S j , let j = 2;
[0033] Determine the module for adjacent edge S j As the new starting edge, search clockwise again to determine the next adjacent edge S j+1 ;
[0034] Form a module to judge S j+1 Is the end point of S1 the same as the starting point of S1? If so, then S1-S j+1 A minimum independent closed loop is formed;
[0035] An output module is used to determine whether the minimum independent closed loop is an outer loop and whether it is repeated with the searched minimum independent closed loop; if the minimum independent closed loop is not an outer loop and is not repeated with the searched closed loop, the minimum independent closed loop is output;
[0036] The repetition module is used to traverse all edges based on the counterclockwise rotation search, and repeat the above clockwise rotation search process to obtain multiple minimum independent closed loops.
[0037] In a third aspect, the present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for searching for the minimum independent closed loop of the leveling network when executing the program.
[0038] In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the method for searching for the minimum independent closed loop of the leveling network is implemented.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] The present invention first obtains multiple leveling routes of the leveling network to be measured, takes each leveling route as an edge, and obtains the direction value of the edge according to the corresponding starting point and end point. An independent closed loop search is performed on all edges through clockwise rotation search and counterclockwise rotation search performed in sequence through the direction value of the edge, and multiple minimum independent closed loops are obtained. The present invention makes full use of the relative position information of the edges in the network graph, and performs the minimum independent closed loop search through the rotation of the edges. Compared with the existing matrix transformation-based search, spanning tree and remainder transformation-based search, and depth-first search, it has lower time complexity and space complexity. During the design, only the edges with directions within 0° to 180° are searched, so that the algorithm has higher operating efficiency and improves the efficiency of obtaining independent closed loops of the leveling network. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 is a graph of an instance of the ring search method;
[0043] Figure 2 A flow chart of a method for searching a minimum independent closed loop of a leveling network according to the present invention;
[0044] Figure 3 Schematic diagram of search results according to an embodiment of the present invention. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] Basic Principles of Minimum Independent Closed Loop Search
[0047] For any polygon, the edges that make up the polygon are connected end to end in sequence to form a closed figure, and no other edges pass between any two adjacent edges. The minimum independent closed loop can be simplified to independent polygons in the control network, which are connected end to end. If the edge is used as the basic unit, the adjacent edge is searched clockwise or counterclockwise, and the search is repeated in the same direction of the searched adjacent edge until the figure is closed, the search for the minimum independent closed loop can be realized.
[0048] like Figure 1 As shown, (1) take edge AB as the starting edge of the closed loop, that is, A is the starting point of the closed loop, rotate clockwise around the end point B of edge AB to obtain the adjacent edge BC. (2) Take edge BC as the starting edge, rotate clockwise around the end point C of edge BC to obtain the adjacent edge CD. (3) Determine whether the end point of the searched adjacent edge CD is the same as the starting point of the closed loop. If they are the same, the closed loop is searched. If they are different, repeat (2) and (3) until the closed loop is found. (4) Traverse each edge as the starting edge to search for the smallest independent closed loop in the network.
[0049] When using a computer to search for the minimum independent closed loop, the computer can remove the repeated minimum independent closed loop and the outermost loop through simple judgment, but if there is an omission, it cannot be solved. Therefore, when searching for closed loops, the principle of "repeated but not missed, more but not less" must be followed.
[0050] When searching directly according to the basic idea of the edge rotation search algorithm, there may be problems such as treating the outer loop as an independent closed loop and missing or repeating the search. Therefore, the following issues should be paid attention to when designing the algorithm:
[0051] (1) Detection and elimination of outer rings: Figure 1 As shown in the figure, if AD is the starting edge, the DC edge is obtained by rotating clockwise around D, and then the CH edge is obtained by rotating the DC edge clockwise around C, and so on. The final closed loop ADCHGEA is the outermost loop. Based on the theory that the outermost loop contains all the extreme points, that is, the top, bottom, leftmost and rightmost points, and the loop containing four extreme points must be an outer loop, the outermost loop is judged and eliminated. Therefore, when inputting data, the four extreme points can be extracted according to the coordinate information, and then it is judged whether the closed loop contains the four extreme points. If it does, it means that it is an outer loop that needs to be eliminated.
[0052] (2) Avoiding search omissions: If the closed loop is searched only in a clockwise or counterclockwise direction, there may be search omissions. Figure 1 For example, the clockwise search of AB is used as the starting edge to obtain the ABCDA ring, BF is used as the starting edge to obtain the BFGHCB ring, FE is used as the starting edge to obtain the FEGF ring, and EA is used as the starting edge to obtain the outermost ring EADCHGE, while the ABFE ring is not searched. The reason for the search omission is that the directions of all routes in a closed ring are the same as the search direction. Therefore, performing a counterclockwise search after a clockwise search can avoid the search omission phenomenon.
[0053] (3) Comparison and elimination of duplicate loops: The search for the smallest independent closed loop not only has omission problems, but also duplication problems, such as Figure 1As shown, if AB is used as the starting edge, an ABCDA ring is searched, and if BC is used as the starting edge, an ABCDA ring is also searched. In order to ensure the uniqueness of the independent closed rings searched independently, after searching for a closed ring, it is necessary to compare it with the closed ring searched previously to determine whether it is repeated with the closed ring searched previously. If the constituent edges of the closed rings searched twice are the same, the two closed rings are considered to be repeated rings, and one of the two repeated rings needs to be removed. In addition, for a polygon, there is at least one edge whose general direction is within the range of 0° to 180°. Therefore, before searching with the starting edge, it can be determined whether it is within the range of 0° to 180°. If so, no search is required, and the closed ring can be searched out using other edges in the polygon according to the above algorithm.
[0054] Based on the above analysis, the present invention provides a method for searching the minimum independent closed loop of a leveling network. Figure 2 , including the following steps:
[0055] Step 1: Obtain multiple leveling routes of the leveling network to be measured, each leveling route includes a starting point and an end point.
[0056] Step 2: Take each leveling route as an edge and obtain the direction value of the edge based on the corresponding starting point and end point.
[0057] Step 3: Search for independent closed loops on all edges to obtain multiple minimum independent closed loops and the leveling route numbers that constitute the minimum independent closed loops. Including:
[0058] (1) Input information (starting point, end point) in units of edges, calculate the direction value of the edge based on the starting point and end point, and extract the maximum point at the same time; assign an initial value i = 1.
[0059] (2) Traverse all edges and start the search with the i-th edge as the starting edge S1.
[0060] (3) First determine whether the direction of the i-th edge is within the range of 0° to 180°. If so, proceed to step (4); if not, i++ returns to step (2).
[0061] (4) Rotate clockwise to determine the adjacent edge S2 (traverse all other edges and determine the adjacent edge S2 based on the starting point, end point and direction values); assign an initial value j = 2.
[0062] (5) With edge S j is the starting edge, and the next adjacent edge S is determined by rotating clockwise. j+1 .
[0063] (6) Determine edge S j+1 Whether the end point of is the same as the starting point of starting edge S1.
[0064] (7) If not, continue steps (5) and (6) until the loop is closed.
[0065] (8) If they are the same, determine whether it is an outer loop (i.e., whether it contains all the extreme points) and whether it is repeated with the searched closed loop.
[0066] (9) If it is not an external loop and there is no duplication with the ones already searched, then output it; otherwise i++, take the next edge as the starting edge, and repeat steps (2) to (9) until all edges have been traversed.
[0067] (10) Repeat steps (2) to (9) in a counterclockwise direction to complete the search for all minimum independent closed loops.
[0068] The principle of the present invention is simple and easy to implement. The algorithm makes full use of the relative position relationship between edges in the network graph. The edge rotation method is simple in principle and does not require high mathematical background knowledge. The idea of the method can be intuitively understood, so the algorithm is easier to implement.
[0069] The algorithm is rigorously designed, and the search results are accurate and stable. The algorithm is based on the basic idea of edge rotation search, and is designed with the basic principle of "can be repeated without missing, can be more than enough", taking into account possible special situations such as searching the outermost ring, missing in one direction, and repeated search, and making corresponding processing in the algorithm design, making the algorithm more rigorous in design and ensuring the accuracy and stability of the search results.
[0070] Low time and space complexity, high operation efficiency. The original data storage of the algorithm during the implementation process is different from the matrix storage and linked list storage of the existing algorithm. Instead, it adopts array storage with edges as the object, so the space complexity is low during operation and search. At the same time, when searching for the minimum independent closed loop, the existing algorithm will search for a non-minimum closed loop, which needs to be further determined by methods such as the shortest path, while the closed loop searched by the present invention must be the minimum independent closed loop except for the outermost loop, and no further determination is required, so the time complexity is also low. In addition, the algorithm is designed to only search for edges with directions within 0° to 180°, so that the algorithm has higher operation efficiency.
[0071] Based on the same concept, the present invention also provides a leveling network minimum independent closed loop search device, including an acquisition module, a construction module and a search module.
[0072] The acquisition module is used to acquire multiple leveling routes of the leveling network to be measured, and each leveling route includes a starting point and an end point.
[0073] The building module is used to take each leveling route as an edge and obtain the direction value of the edge according to the corresponding start point and end point.
[0074] The search module is used to perform independent closed loop search on all edges to obtain multiple minimum independent closed loops; the independent closed loop search includes clockwise rotation search and counterclockwise rotation search performed in sequence, and the steps of the clockwise rotation search and the counterclockwise rotation search are the same but the search directions are opposite.
[0075] The search module includes a start module, a judgment module, a determination module, a formation module, an output module and a repeat module.
[0076] The start module is used to traverse all edges based on a clockwise rotation search, starting the search with any edge as the starting edge S1.
[0077] The judgment module is used to judge whether the direction value of S1 is within the range of 0° to 180°; if so, a clockwise rotation search is performed to determine the adjacent edge S j , let j=2.
[0078] Determine the module used to take the adjacent edge S j As the new starting edge, search clockwise again to determine the next adjacent edge S j+1 .
[0079] The formation module is used to judge S j+1 Is the end point of S1 the same as the starting point of S1? If so, then S1-S j+1 A minimum independent closed loop is formed.
[0080] The output module is used to determine whether the minimum independent closed loop is an outer loop and whether it is repeated with the searched minimum independent closed loop; if the minimum independent closed loop is not an outer loop and does not repeat with the searched closed loop, the minimum independent closed loop is output.
[0081] The repetition module is used to traverse all edges based on the counterclockwise rotation search, and repeat the above clockwise rotation search process to obtain multiple minimum independent closed loops.
[0082] The present invention also provides a computer device, including a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the above-mentioned minimum independent closed loop search method for the leveling network when executing the program.
[0083] The present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned method for searching the minimum independent closed loop of the leveling network is implemented.
[0084] Example
[0085] According to the above method, the search for the minimum independent closed loop is realized with the help of C language programming. Figure 3As shown, a test is conducted using a precision leveling observation network in a certain region as an example. The network consists of 32 leveling routes and 23 nodes, totaling more than 3,000 kilometers, with letters used to represent the point names.
[0086] The search results are shown in Table 1. A total of 10 minimum independent closed loops and the leveling route numbers that constitute the minimum independent closed loops were searched, which is consistent with the manual statistical results, thus verifying the accuracy and stability of the algorithm.
[0087] Table 1 Search results
[0088]
[0089]
[0090] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0091] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for searching the minimum independent closed loop of a leveling network, characterized in that: The following steps are involved: Obtain multiple leveling routes of the leveling network to be measured, each leveling route includes a starting point and an end point; Take each leveling route as an edge and obtain the direction value of the edge according to the corresponding starting point and end point; Performing independent closed loop search on all edges to obtain multiple minimum independent closed loops; the independent closed loop search includes a clockwise rotation search and a counterclockwise rotation search performed in sequence, the steps of the clockwise rotation search and the counterclockwise rotation search are the same but the search directions are opposite; Search for independent closed loops on all edges and obtain multiple minimum independent closed loops, including: Traverse all edges based on clockwise search, starting the search with any edge as the starting edge S1; Determine whether the direction value of S1 is within the range of 0° to 180°; if so, perform a clockwise search to determine the adjacent edge S j , let j = 2; Adjacent edge S j As the new starting edge, search clockwise again to determine the next adjacent edge S j+1 ; Judge S j+1 Is the end point of S1 the same as the starting point of S1? If so, then S1-S j+1 A minimum independent closed loop is formed; Determine whether the minimum independent closed loop is an outer loop and whether it is repeated with the searched minimum independent closed loop; if the minimum independent closed loop is not an outer loop and is not repeated with the searched closed loop, output the minimum independent closed loop; Based on the counterclockwise rotation search, all edges are traversed and the above clockwise rotation search process is repeated to obtain multiple minimum independent closed loops.
2. A method for searching the minimum independent closed loop of a leveling network as claimed in claim 1, characterized in that: If the direction value of the starting edge S1 is not within the range of 0° to 180°, another edge is selected as the starting edge S1 to start the search.
3. A method for searching the minimum independent closed loop of a leveling network as claimed in claim 1, characterized in that: If S j+1 The end point of S1 is different from the starting point of S1. j+1 As the new starting edge, search clockwise again to determine the next adjacent edge S j+2 , judge S j+2 Whether the end point of is the same as the starting point of S1.
4. A method for searching the minimum independent closed loop of a leveling network as claimed in claim 1, characterized in that: If the minimum independent closed loop is not an external loop, another edge is selected as the starting edge to begin the search.
5. A method for searching the minimum independent closed loop of a leveling network as claimed in claim 1, characterized in that: If the minimum independent closed loop overlaps with the closed loop that has been searched, another edge is selected as the starting edge to start the search.
6. A leveling network minimum independent closed loop search device, characterized in that: include: An acquisition module is used to acquire multiple leveling routes of the leveling network to be measured, each leveling route includes a starting point and an end point; A module is constructed to treat each leveling route as an edge and obtain the direction value of the edge according to the corresponding start and end points; A search module is used to perform independent closed loop search on all edges to obtain multiple minimum independent closed loops; the independent closed loop search includes a clockwise rotation search and a counterclockwise rotation search performed in sequence, the steps of the clockwise rotation search and the counterclockwise rotation search are the same but the search directions are opposite; The search module includes: The start module is used to traverse all edges based on a clockwise rotation search, starting the search with any edge as the starting edge S1; The judgment module is used to judge whether the direction value of S1 is within the range of 0° to 180°; if so, a clockwise rotation search is performed to determine the adjacent edge S j , let j = 2; Determine the module for adjacent edge S j As the new starting edge, search clockwise again to determine the next adjacent edge S j+1 ; Form a module to judge S j+1 Is the end point of S1 the same as the starting point of S1? If so, then S1-S j+1 A minimum independent closed loop is formed; An output module is used to determine whether the minimum independent closed loop is an outer loop and whether it is repeated with the searched minimum independent closed loop; if the minimum independent closed loop is not an outer loop and is not repeated with the searched closed loop, the minimum independent closed loop is output; The repetition module is used to traverse all edges based on the counterclockwise rotation search, and repeat the above clockwise rotation search process to obtain multiple minimum independent closed loops.
7. A computer device, characterized in that: It includes a memory, a processor and a computer program stored in the memory and executable on the processor, and when the processor executes the program, it implements the minimum independent closed loop search method of the leveling network as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method for searching the minimum independent closed loop of the leveling network described in any one of claims 1 to 5 is implemented.
Citation Information
Cited By
Leveling network minimum closed loop rapid search method based on survey station grouping and degree priority
CN121365714A
Method for searching minimum closed loop of leveling network based on station grouping and degree priority
CN121365714B
