Measuring line searching method based on graph algorithm
1. A method for searching a measurement line based on a graph algorithm is characterized by comprising the following steps:
(1) collating observation data into a set of waypoint pairsHLine point collectionNAnd a set of starting pointsC;
(2) Combining the observation data in the step (1) into a plurality of measurement networks based on an undirected graph breadth-first search method, wherein each measurement network comprises line point pairsH net Line pointN net And a starting pointC net ;
(3) Performing line search on each network under test in the step (2) based on an undirected graph depth-first search method;
(4) according to the line point pairs in each measuring network in the step (2)H net Line pointN net And a starting pointC net Setting up an error equation set, and resolving unknown parameters in each measurement network;
(5) and (4) calculating the closed level difference or the sum level difference of the line in the step (3), and evaluating the observation precision and quality according to the calculation result in the step (4).
2. The method of claim 1, wherein the step (1) comprises the steps of:
(1.1) arranging the observation data into a route point pair setHWherein each line point pair comprises line points at two ends of the line;
(1.2) removing the line point pair setsHIn-duplicate roll calling to obtain a set of route point setsN;
(1.3) sorting the sets of route pointsNKnowing the route points to obtain a set of starting pointsC。
3. The method for searching a measurement line based on a graph algorithm as claimed in claim 1, wherein the undirected graph breadth-first search method in the step (2) comprises the steps of:
(2.1) from the line point setNSelecting any line point as the starting point of network testing searchS;
(2.2) initializing queuesQStarting pointSEnqueue, starting pointSDyeing;
(2.3) queueQNot empty, queueQAt the head of the teamqOut-of-line, head of lineqThe line roll name is stored at the head of the queue, and the head of the queue is the front end for deleting operation; searching for a set of line point pairsHThe middle line point pair comprises a head of line pointqThe access of a plurality of line point pair information is marked to a plurality of line point pair information; for another of a plurality of said line point pairs not being a head of line pointqAnd undyed circuit points are dyed and queued, and so on until the queueQIs empty;
(2.4) all the dyed line points constitute one of saidMeasuring the net, integrating the information of the net, including all the dyed line pointsN net Marking accessed line point pairsH net And a starting pointC net ;
(2.5) removing the route point setNAll the dyed line points in the process, if the line points are collectedNIf the line point set is empty, the network measurement searching is finished, otherwise, the step (2.1) is executed to search the next network measurement until the line point setNIf the number is empty, all the measuring nets are obtained.
4. The method according to claim 1, wherein the step (3) of performing line search on each of the measurement networks according to an undirected graph depth-first search method comprises the following steps:
(3.1) obtaining a search starting point setS net Set of starting pointsS net For starting points in the measuring networkC net If no starting point exists in the measurement network, taking any line point in the measurement network; initializing a set of memory linesLine;
(3.2) judging the set of starting pointsS net If the number of the storage lines is null, the search is finished if the number of the storage lines is null, and the storage line set is searchedLineRemoving the duplicate and finishing the search; if not, it indicates that the search is not finished and the starting point set is selectedS net Take out any point
Background
Under the traditional measurement operation mode, observation data are less, and a simple measurement network and a circuit can be formed manually to carry out data calculation and observation quality evaluation. However, with the intelligent, digital and automatic walking into the measurement field, the observation becomes real-time and dynamic, the observation data becomes huge and disordered, and the measurement network and the line become complicated and huge from simple and small. If rely on manual work, not only work efficiency is low, the cost of labor is high, and operating quality is difficult to guarantee moreover. Therefore, it is necessary to provide a method capable of automatically searching for nets and lines for data calculation and observation quality evaluation.
In recent years, the graph algorithm has wide application in the aspect of searching for measuring lines, for example, Chinese patent with patent number CN104573396A searches for the minimum closed level ring, the minimum closed level ring and the level line in a leveling network; chinese patent No. CN105868538A performs a search for a closed level ring in a wire plane control network. The method is mainly used for researching the applicability improvement based on the graph algorithm and applied to the search of the closed level ring.
Disclosure of Invention
The invention aims to provide a measuring line searching method based on a graph algorithm according to the defects of the prior art, the measuring line searching method carries out autonomous networking and autonomous searching of lines in the network on observation data through the graph algorithm, and further carries out autonomous resolving of unknown parameters in the network and observation data quality inspection efficiently and conveniently.
The purpose of the invention is realized by the following technical scheme:
a method for searching a measurement line based on a graph algorithm is characterized by comprising the following steps:
(1)collating observation data into a set of waypoint pairsHLine point collectionNAnd a set of starting pointsC;
(2) Combining the observation data in the step (1) into a plurality of measurement networks based on an undirected graph breadth-first search method, wherein each measurement network comprises line point pairsH net Line pointN net And a starting pointC net ;
(3) Performing line search on each network under test in the step (2) based on an undirected graph depth-first search method;
(4) according to the line point pairs in each measuring network in the step (2)H net Line pointN net And a starting pointC net Setting up an error equation set, and resolving unknown parameters in each measurement network;
(5) and (4) calculating the closed level difference or the sum level difference of the line in the step (3), and evaluating the observation precision and quality according to the calculation result in the step (4).
The step (1) comprises the following steps:
(1.1) arranging the observation data into a route point pair setHWherein each line point pair comprises line points at two ends of the line;
(1.2) removing the line point pair setsHIn-duplicate roll calling to obtain a set of route point setsN;
(1.3) sorting the sets of route pointsNKnowing the route points to obtain a set of starting pointsC。
The undirected graph breadth-first search method in the step (2) comprises the following steps:
(2.1) from the line point setNSelecting any line point as the starting point of network testing searchS;
(2.2) initializing queuesQStarting pointSEnqueue, starting pointSDyeing;
(2.3) queueQNot empty, queueQAt the head of the teamqOut-of-line, head of lineqIs a line roll-call stored at the head of the line, said head of the line is advancedA front end of a row delete operation; searching for a set of line point pairsHThe middle line point pair comprises a head of line pointqThe access of a plurality of line point pair information is marked to a plurality of line point pair information; for another of a plurality of said line point pairs not being a head of line pointqAnd undyed circuit points are dyed and queued, and so on until the queueQIs empty;
(2.4) forming the measuring network by all the dyed line points, and integrating the information of the measuring network, including all the dyed line pointsN net Marking accessed line point pairsH net And a starting pointC net ;
(2.5) removing the route point setNAll the dyed line points in the process, if the line points are collectedNIf the line point set is empty, the network measurement searching is finished, otherwise, the step (2.1) is executed to search the next network measurement until the line point setNIf the number is empty, all the measuring nets are obtained.
The step (3) of performing line search on each network under test according to an undirected graph depth-first search method comprises the following steps:
(3.1) obtaining a search starting point setS net Set of starting pointsS net For starting points in the measuring networkC net If no starting point exists in the measurement network, taking any line point in the measurement network; initializing a set of memory linesLine;
(3.2) judging the set of starting pointsS net If the number of the storage lines is null, the search is finished if the number of the storage lines is null, and the storage line set is searchedLineRemoving the duplicate and finishing the search; if not, it indicates that the search is not finished and the starting point set is selectedS net Take out any point
Drawings
FIG. 1 is a flowchart of a method for searching a measurement line based on a graph algorithm according to the present invention;
fig. 2 is a flowchart of performing line search on a network based on an undirected graph depth-first search method in the present invention.
Detailed Description
The features of the present invention and other related features are described in further detail below by way of example in conjunction with the following drawings to facilitate understanding by those skilled in the art:
example (b): as shown in fig. 1 and 2, the present embodiment specifically relates to a method for searching a measurement line based on a graph algorithm, which includes the following steps:
【1】 Collating observation data into a set of waypoint pairsHLine point collectionNAnd a set of starting pointsC;
(1.1) arranging the observation data into a route point pair setHWherein each line point pair comprises line points at two ends of the line;
(1.2) sorting the line point pair setsHTo obtain a set of route point setsN;
(1.3) sorting the known route points to obtain a set of starting pointsC。
【2】 Combining the observation data in the step (1) into a plurality of measurement networks based on an undirected graph breadth-first search method, wherein each measurement network comprises line point pairsH net Line pointN net And a starting pointC net ;
(2.1) from the line point setNSelecting any line point as the starting point of network testing searchS;
(2.2) initializing FIFO queuesQFor storing the roll call and the starting point of the route point to be traversedSEnqueue, starting pointSDyeing; wherein, the queue is a special linear table, the queue only allows to insert at the back end, this operation is called enqueue, and delete operation at the front end, this operation is called dequeue; the dyeing is to add a mark to identify whether the route point is traversed or not;
(2.3) queueQNot empty, queueQAt the head of the teamqOut-of-line, head of lineqThe line roll name is stored at the head of the queue, and the head of the queue is the front end for deleting operation; searching for a set of line point pairsHThe middle line point pair comprises a head of line pointqThe access of a plurality of line point pair information is marked to a plurality of line point pair information; for another of a plurality of said line point pairs not being a head of line pointqAnd undyed circuit points are dyed and queued, and so on until the queueQIs empty;
(2.4) all the dyed line points form a measuring network, and the information of the measuring network is integrated and comprises all the dyed line pointsN net Marking accessed line point pairsH net And a starting pointC net ;
(2.5) removing the route point setNAll the dyed line points in the process, if the line points are collectedNIf the line point set is empty, the network measurement searching is finished, otherwise, the step (2.1) is executed to search the next network measurement until the line point setNIf the number is empty, all the measuring nets are obtained.
【3】 Performing line search on each network under test in the step (2) based on an undirected graph depth-first search method;
(3.1) obtaining a search starting point setS net Set of starting pointsS net For starting points in the measuring networkC net Set of compositions if said measureIf no starting point exists in the network, taking any line point in the measuring network; initializing a set of memory linesLine;
(3.2) judging the set of starting pointsS net If the number of the storage lines is null, the search is finished if the number of the storage lines is null, and the storage line set is searchedLineRemoving the duplicate and finishing the search; if not, it indicates that the search is not finished and the starting point set is selectedS net Take out any point