Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a BFS algorithm-based geological profile closed region searching and filling method, which is used for searching a closed region by utilizing a multi-time path searching method on the basis of the traditional BFS algorithm, effectively avoiding the problem of missing of the closed region, automatically filling textures according to expanded adjacency list information, and being more convenient, quicker and more accurate in drawing a geological profile.
The present invention achieves the above-described object by the following technical means.
A BFS algorithm-based geological profile closed region searching and filling method comprises the following steps:
inputting the drawn geological section line into a survey data management system, searching a closed region formed by the geological section line by using an improved BFS algorithm, recording information of the closed region, outputting the closed region according to the recorded information of the closed region, filling geological material textures into the closed region, and finally outputting a geological section map by the survey data management system.
Further, the process of searching for the closed region by using the improved BFS algorithm is as follows: the method comprises the steps of obtaining intersection points formed by geological section lines by using a Bentley-Ottmann algorithm, judging geological material attributes corresponding to the intersection points, constructing an undirected graph by using all the obtained intersection points, expanding an adjacency list data structure of all the intersection points of the undirected graph, searching and outputting a closed region by using a multi-time path searching method, and recording closed region information in the searching process in an adjacency list.
Further, the intersection adjacency list has 5 data structures, which are: GEO, COLOR, P, D, M, where GEO represents the geological material of the intersection, COLOR represents the COLOR of the intersection, P represents the parent of the intersection, D represents the distance of the intersection to the source intersection, and M represents the linked list structure.
Further, the multiple path searching method comprises the following steps: selecting source intersection points in an undirected graph and coloring the source intersection points grey, conducting first search outwards from the source intersection points, coloring all the intersection points searched for the first time grey, conducting second search outwards by taking the intersection points searched for the first time as new source intersection points, coloring all the intersection points searched for the second time grey, wherein the intersection points searched repeatedly are colored black, the intersection points not searched are white, and repeating the above process until all the intersection points are searched, so that a first round of closed area is obtained; sequentially taking the meeting points in a point set consisting of all meeting points in the searching process as new source intersection points for searching to obtain a second round of closed areas; when a new meeting point in the second round of closed region and a meeting point serving as a source intersection point have appeared in the first round of closed region at the same time, the closed region is not output, otherwise, the closed region is output.
Further, the closed region information recording process is as follows: when the adjacent intersection points searched by the source intersection points are gray, increasing records about the source intersection points in an M data structure of the adjacent intersection points; and simultaneously recording other 4 kinds of data structure information of the adjacent intersection points, wherein the GEO data structure information is consistent with the attribute of the geological material.
Furthermore, the closed area is composed of a group of intersection point sets which are sequentially ordered, the intersection points in the sets find source intersection points through a backtracking path from a parent intersection point to form a main path, other intersection points in the intersection point chain table structure form other main paths, a plurality of main paths have one same source intersection point, and the source intersection point and the main paths jointly form the closed area.
Further, the closed region output process includes two cases: when the number of the intersection points of the closed area is odd, the D data structure information of the meeting points in the closed area is the same as the D data structure information of the intersection points in the linked list structure, the meeting points are traced back along respective main paths at the same time, the same source intersection points are found, and the closed area is constructed and output; when the number of the intersection points of the closed area is an even number, the D data structure information value of the meeting point in the closed area is larger than that of the intersection point in the chain table structure, the meeting point returns to the first level after backtracking along the main path, the path is backtracked simultaneously with the intersection point in the chain table structure again, the same source intersection point is found, and the closed area is constructed and output.
Further, in the geological material texture filling process, the number of intersection points of each drilling central line and the closed area is obtained according to intersection points which are not empty in GEO data structure information; when the number of the intersection points is 1, taking the intersection point as R, and then respectively taking the farthest intersection point on the central line of the drill hole as T and the farthest intersection point on the lower central line of the drill hole as B; t = R if there is no intersection point above, and B = R if there is no intersection point below; when the T point is located in the closed area, taking the R point as a geological material marking point; when the point B is positioned in the closed area, taking the point B as a geological material marking point; when the number of the intersection points is more than 1, taking the intersection point of the central line of the drilling hole and the lowest part of the closed area as a geological material marking point; r, T, B each indicate an intersection number.
Further, the geological material mark point is GqWherein q represents the number of the q-th drilling hole, and q is a positive integer; all geological material mark points in the closed region form a point set Gq};
{GqWhen the GEO attributes in the sealing area are not the same geological material, the sealing area is not filled with the geological material;
{ Gqwhen the GEO attributes in the closed area are the same geological material and the GEO attributes of the drilling boundary points in the closed area are not all the geological material, the closed area is not filled with the geological material; and when the GEO attributes of the drilling boundary points in the closed area are all the geological materials, filling corresponding geological material textures into the closed area.
Further, the borehole boundary points represent formation demarcation points on the borehole centerline.
The invention has the following beneficial effects:
(1) the BFS algorithm is applied to the field of geological profile drawing, and on the basis of the traditional BFS algorithm, aiming at the actual situation of the geological profile, namely the existence of a nested closed region, the closed region is searched by adopting a multi-path searching method, so that the problem of missing of the closed region caused by the existing one-time searching method can be effectively avoided, and the searching result is more accurate.
(2) The traditional BFS algorithm simply searches all points in the undirected graph, but the invention expands the data structure of the intersection point adjacency list in the undirected graph on the basis, adds 5 data structures for representing intersection point geological materials, intersection point colors, parent intersection points and the distance from the intersection point to the source intersection point in the adjacency list, and records the closed area information into the adjacency list in the process of searching the closed area, thereby being convenient for backtracking a path according to the recorded information, searching the closed area and simultaneously being convenient for automatically filling the corresponding geological material textures.
(3) According to the geological material texture filling method, the geological material marking point set is obtained based on the number of intersection points of the drilling central line and the closed area, the geological material texture filling judgment is carried out by comprehensively considering the GEO attribute conditions of the set and the drilling boundary points, and the filling can be ensured to be more accurate.
(4) By adopting the method provided by the invention, the efficiency of an engineer in drawing the geological profile can be greatly improved, and the real cloud geological profile delivery based on data can be realized.
Detailed Description
The invention will be further described with reference to the following figures and specific examples, but the scope of the invention is not limited thereto.
The english letters "a", "B", "c", "d", "e", "f", "g", "h", "i", "x", "y", "n", "s", "j", "k", "T", "u", "v", "p", "R", "T", "B" mentioned in the present embodiment all represent the numbers of the intersection points, and "Q" represents the set of meeting points, and is only for the convenience of describing the present invention, and thus cannot be construed as limiting the present invention; the "gray" and "black" mentioned in the present embodiment are only for convenience of describing the present invention and thus should not be construed as limiting the present invention; the specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
The specific process of the geological profile closed area searching and filling method based on the Breadth-First-Search (BFS) algorithm is shown in FIG. 8:
step 1: inputting geological section line data drawn by a computer or a person into a survey data management system;
step 2: searching a closed region for the geological section line by using an improved BFS algorithm, and outputting the closed region;
step 2.1: acquiring intersections of a plurality of line segments in the geological section line generated in the step 1 by utilizing a Bentley-Ottmann algorithm; when obtaining the nodical, judge the geological material attribute that the nodical corresponds, the later stage of being convenient for is to the judgement of closed area geological material, and concrete process is: according to the center line of the drill hole, the geological material attribute of each layer of bottom points in the drill hole is taken as the geological material of the current layer, and the geological material attribute of the top point of the drill hole is taken as the material of the first layer of geological body; taking the geological material attribute of a point on the first drilling center line which is vertically encountered downwards as the geological material attribute of the intersection point obtained by intersecting all other line segments and the drilling center line; for intersections that are not intersected by the borehole centerline, the geologic material property for that intersection is null.
Step 2.2: constructing an undirected graph G = (V, E) as shown in FIG. 1 by using all the obtained intersection points, so as to facilitate the search of a closed region, wherein V represents an intersection point, namely a circle in FIG. 1; e denotes a line connecting the two intersections.
Step 2.3: expanding an adjacency list data structure aiming at the intersection points in the undirected graph; the adjacency list with 5 data structures as shown in fig. 2 is expanded for each intersection in the undirected graph, and the 5 data structures are specifically: GEO, COLOR, P, D, M, wherein GEO represents the geological material of the intersection point, consistent with the geological material properties of each intersection point in step 2.1; COLOR indicates the COLOR of the intersection point for marking the search track; p represents a parent intersection of the intersection; d represents the distance from the intersection point to the source intersection point; m denotes a linked list structure for recording the found closed region information.
Step 2.4: searching a closed region by using an improved BFS algorithm;
taking the undirected graph of fig. 3 as an example, searching for a closed region is performed: all the intersections in FIG. 3 are denoted by a, b, c, d, e, f, g, h, i in this order; determining a source intersection point a, coloring the point a grey, searching outwards from the intersection point, searching all the intersection points which can be reached from the point a, and coloring all the intersection points (b and c) searched for the first time grey, namely coloring the points b and c grey; respectively starting second search by taking the point b and the point c as new source intersection points, searching all intersection points which can be reached from the new source intersection points, and coloring all the intersection points (a, e and d) searched for the second time gray, wherein the intersection points searched for repeatedly are colored black, namely the point a is black, and the point e and the point d are gray; and starting a third search by taking the point e and the point d as new source intersection points respectively, and coloring all the intersection points (c, h, f, b and g) searched for the third time in grey, wherein the intersection points searched for repeatedly are colored in black, namely the point c and the point b are colored in black, and the point h, the point f and the point g are colored in grey. And continuously circulating the process until all the intersection points are searched, finding two meeting points of the point i and the point f after the search is finished, and searching a closed area I (i, h, e, c, a, b, d, g) and a closed area II (f, e, c, a, b, d) by using the two meeting points to trace back a path, but omitting a closed area III (f, e, h, i, g, d).
In the practical application process, the phenomenon of closed region nesting as shown in fig. 3 often occurs, and the problem of missing a closed region is easily caused only by adopting the search method, so that the invention carries out a multi-path search method based on the BFS algorithm to solve the problem:
after the point a is used as the initial intersection point, all the meeting points form a point set Q, the point set Q in the graph 3 comprises the point i and the point f, the meeting points in the point set Q are sequentially taken as new source intersection points to be searched, if the new meeting points and the meeting points which are taken as the source intersection points are found to be simultaneously appeared in the existing closed region during searching, the closed region is not output, otherwise, the closed region is output. In fig. 4, when the point f is used as the source intersection point for searching, two meeting points, namely, the point a and the point i, can be obtained, and a closed region ii (f, e, c, a, b, d) and a closed region iii (f, e, h, i, g, d) can be obtained at the same time; the point a and the point f are already simultaneously appeared in the existing closed area II, so that the closed area II is not output any more, and the point i and the point f are never simultaneously appeared in any existing closed area, so that the closed area III is output; for point i, the search is also performed in the same manner; by the multi-path searching method, all closed areas in the graph can be searched out, and omission is avoided.
Step 2.5: recording the closed region information into an adjacency list of the intersection point;
after traversing all the intersection points by adopting the improved BFS algorithm in the step 2.4, finding the position of the closed region according to traversal information and outputting the closed region, wherein the meeting point formed by the meeting of two gray intersection points is a typical characteristic of forming the closed region, and in the searching process, when the gray intersection points are searched, namely when the gray intersection points meet, the closed region information needs to be recorded in the gray intersection point adjacency list; in the actual search, there are two cases where gray intersections meet: the first is the case that the number of intersection points of the closed area is odd; the second is the case where the number of intersections of the closed region is even.
For the case that the number of the intersection points of the closed region is odd, taking fig. 4 as an example for explanation, the intersection points in fig. 4 are respectively represented by s, m, n, x and y, the s point is a source intersection point, the m point is found by the first search, and the s point, the n point, the x point and the y point are found by the second search; during the third search, the search is sent from the point n, if the adjacent intersection point x is found to be gray, a record about the point n is added in the data structure of the adjacency list M of the point x, and the COLOR data structure information, the P data structure information and the D data structure information of the point x are recorded at the same time, so that a closed area IV (x, n, M) is constructed; and then searching outwards from the point x, meanwhile, not searching for the blackened point n, continuously finding the grey point y, adding a record related to the point x in the data structure of the adjacency list M of the point y, and simultaneously recording the COLOR data structure information, the P data structure information and the D data structure information of the point y for constructing the closed region V (x, y, M). The adjacency list of x dots after information recording is shown in fig. 5 (a), and the adjacency list of y dots is shown in fig. 5 (b).
For the case that the number of the intersection points of the closed region is even, the case is described by taking fig. 6 as an example, the j point is a source intersection point, the k point is found by the first search, and the j point, the t point, the u point and the v point are found by the second search; and in the third search, starting the search from the point t, finding a white intersection point r, changing the COLOR of the point r into gray, then respectively sending the points u and v for searching, and searching the gray intersection point r, adding two records about the points u and v in the data structure of the adjacency list M of the point r, simultaneously recording COLOR data structure information, P data structure information and D data structure information of the point r, and respectively constructing a closed region VII (r, u, k, t) and a closed region VI (r, v, k, t). Fig. 7 shows an adjacency list of r dots after information recording.
Step 2.6: outputting the closed area;
the closed area is formed by a group of intersection point sets which are sequentially ordered, for any intersection point, a source intersection point can be gradually found through a father intersection point of the intersection point, so that a main path is formed, each intersection point in the intersection point linked list structure can also form other main paths, the main paths have one same source intersection point, and the source intersection point and the main path form the closed area together; for the case that the number of the intersection points of the closed region is odd number and even number, different closed region output methods need to be adopted.
When the number of the intersection points of the closed region is odd, the D data structure information of the intersection point in the encounter point adjacency table in the closed region is the same as the D data structure information of the intersection point in the M data structure, which is described by taking fig. 4 as an example: in the figure, D [ y ] = D [ x ] =2, where D [ y ] represents the distance from the y point to the source intersection point, and D [ x ] represents the distance from the x point to the source intersection point; the main path of y point is y → P [ y ] → P [ P [ y ] ], i.e. y → m → s, and the main path of x point is x → P [ x ] → P [ P [ x ] ], i.e. x → m → s, wherein P [ y ] denotes the parent intersection of y points and P [ x ] denotes the parent intersection of x points; the point y and the point x are traced back along the main path at the same time, a first same source intersection point m is found, and a closed region V (x, y, m) can be constructed and output; by the method, other closed regions with odd intersection numbers can be constructed and output.
When the number of the intersection points of the closed region is even, the D data structure information value in the encounter point adjacency table in the closed region is greater than the D data structure information value of the intersection point in the M data structure information, which is described with fig. 6 as an example: in the figure, D [ r ] =3, D [ u ] =2, D [ r ] > D [ u ], where D [ r ] denotes a distance from an r point to a source intersection point, and D [ u ] denotes a distance from a u point to the source intersection point; the main path at point r is r → P [ r ] → P [ P [ r ] ] → P [ P [ P [ r ] ] ], i.e. r → t → k → j, and the main path at point u is u → P [ u ] → P [ P [ u ] ] →, i.e. u → k → j; the point r is traced back along the main path first, then returns to the first stage, is traced back along the path t → k → j, and is traced back simultaneously with the main path of the point u, the same first source intersection point k is found, and the closed region VII (r, u, k, t) can be constructed and output; by the method, other closed regions with even number of intersections can be constructed and output.
And step 3: filling geological materials in the searched closed area;
after all the closed areas are output through the step 2.5, the closed areas need to be filled with corresponding geological material textures, the selection of the geological material textures depends on geological material (GEO) information forming intersection points of the closed areas, and the geological material (GEO) information is obtained through geological material attributes of the intersection points in the step 2.1; obtaining the number of intersection points of each drilling center line and a certain closed area according to the intersection points of which all GEO data structure information is not empty;
for the condition that the number of the intersection points is only 1, taking the intersection point as R, then respectively taking the farthest upper intersection point on the central line of the drill hole as T, the farthest lower intersection point as B, if the upper intersection point does not exist, T = R, and if the lower intersection point does not exist, B = R; if the T point is located in the closed area, taking the R point as a geological material marking point; and if the point B is located in the closed area, taking the point B as a geological material marking point. For the number of intersectionsAnd if the number of the drilling holes is more than 1, taking the intersection point of the central line of the drilling hole and the lowest part of the closed area as a geological material marking point. Marking the mark point of geological material as GqWherein the subscript q denotes the number of the qth borehole, q being a positive integer.
All geological material mark points in the closed area form a point set GqThere are two cases for this set of points:
(1){Gqwhen the GEO attributes in the geological data are not the same geological material, the geological material of the closed area is not unique, and the closed area is not filled with the geological material;
(2){ Gqfinding out all the drilling boundary points positioned in the closed area when the GEO attributes in the geological formations are the same; when the GEO attribute of the drilling boundary point is not completely the geological material, the geological material of the closed area is not unique, and the geological material filling is not carried out on the closed area; when the GEO attributes of the drilling boundary points are all the geological materials, the geological materials of the closed area are unique, and corresponding geological material textures are filled in the closed area; wherein the borehole boundary points represent formation demarcation points on the borehole centerline.
And 4, step 4: the survey data management system outputs a geological profile map that is populated with geological material textures via step 3.
The present invention is not limited to the above-described embodiments, and any obvious improvements, substitutions or modifications can be made by those skilled in the art without departing from the spirit of the present invention.