WO2023103320A1 - Building partitioning method, electronic device, and computer storage medium - Google Patents

Building partitioning method, electronic device, and computer storage medium Download PDF

Info

Publication number
WO2023103320A1
WO2023103320A1 PCT/CN2022/098768 CN2022098768W WO2023103320A1 WO 2023103320 A1 WO2023103320 A1 WO 2023103320A1 CN 2022098768 W CN2022098768 W CN 2022098768W WO 2023103320 A1 WO2023103320 A1 WO 2023103320A1
Authority
WO
WIPO (PCT)
Prior art keywords
loop
graph
adjacency matrix
path
maximum
Prior art date
Application number
PCT/CN2022/098768
Other languages
French (fr)
Chinese (zh)
Inventor
崔岩
常青玲
徐世廷
王昱涵
Original Assignee
五邑大学
广东四维看看智能设备有限公司
中德(珠海)人工智能研究院有限公司
珠海市四维时代网络科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 五邑大学, 广东四维看看智能设备有限公司, 中德(珠海)人工智能研究院有限公司, 珠海市四维时代网络科技有限公司 filed Critical 五邑大学
Publication of WO2023103320A1 publication Critical patent/WO2023103320A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • G06F30/13Architectural design, e.g. computer-aided architectural design [CAAD] related to design of buildings, bridges, landscapes, production plants or roads

Definitions

  • the invention relates to the field of house type data processing, in particular to a building partition method, electronic equipment and computer storage media.
  • the smart home improvement design platform is mainly used for building layout design, home decoration design, etc.
  • the division of rooms in a building is generally defined by the designer manually on the building floor plan.
  • Some smart home decoration design The platform can be divided according to the floor plan of the building, but it is difficult to deal with the floor plan of the building with a complex room layout, and the zoning process needs to consume a lot of time, and the zoning efficiency is low.
  • the present invention aims to solve at least one of the technical problems existing in the prior art. Therefore, the present invention provides a building subdivision method, electronic equipment and computer storage medium, which can obtain the subdivision result of the building according to the floor plan of the building, and the subdivision efficiency is high.
  • the embodiment of the first aspect of the present invention provides a building partition method, including the following steps:
  • the minimum circuit is obtained by searching
  • the undirected graph generated by the building floor plan can effectively simplify the complexity of the graph, thereby effectively improving the partition processing speed, and the maximum loop sum can be obtained according to the undirected graph search.
  • the smallest loop can be used to obtain the partition results of the building.
  • an adjacency matrix is set to record and analyze the data, which can not only avoid repeated searches of the obtained loops, but also ensure the reliability of the loop search, and effectively reduce the The complexity of data processing, and thus the rapid judgment of the search end conditions can be realized, which can effectively improve the speed of building subdivision processing.
  • obtaining an undirected graph corresponding to a building floor plan includes:
  • an undirected graph is generated, wherein the center line of the wall projection of the building floor plan is the edge of the undirected graph, and the endpoint of the wall projection center line of the building floor plan is the vertex of the undirected graph.
  • the maximum cycle is obtained by searching, including:
  • the vertex corresponding to the maximum or minimum value on the first coordinate axis is used as the first starting point, wherein the first coordinate axis is an axis parallel to the x-axis or the y-axis, and the first coordinate axis passes through the first starting point ;
  • the first adjacency matrix and the corresponding first degradation graph are generated according to the maximum loop, including:
  • the maximum loop input the value corresponding to each first path into the adjacency matrix to obtain the initial adjacency matrix, where the initial value of the adjacency matrix is 0, and each time the first path is traversed, the elements corresponding to the first path in the adjacency matrix plus 1;
  • elements with a value of 2 in the initial adjacency matrix are deleted to generate a first adjacency matrix and a corresponding first degenerate graph, wherein the first degenerate graph is obtained by deleting the first path traversed twice from the undirected graph.
  • searching for the minimum loop includes:
  • the vertex corresponding to the maximum or minimum value on the second coordinate axis is used as the second starting point, wherein the second coordinate axis is an axis parallel to the x-axis or the y-axis, and the second coordinate axis passes through the first two starting points;
  • generating a second adjacency matrix and a corresponding second degeneration graph including:
  • the numerical value corresponding to each second path is input into the first adjacency matrix to obtain an intermediate adjacency matrix, wherein, each time the second path is traversed, the element corresponding to the second path in the first adjacency matrix is increased by 1;
  • the intermediate adjacency matrix delete the element whose value is 2 in the intermediate adjacency matrix, and generate the second adjacency matrix and the corresponding second degraded graph, wherein, the second degraded graph is obtained by deleting the second path traversed twice from the first degraded graph .
  • the maximum loop and each minimum loop before obtaining the segmentation result of the building floor plan, it also includes:
  • the containment relationship between the largest loop and the smallest loop is obtained, wherein the inclusion relationship represents the association with the partition result.
  • the inclusion relationship between the largest loop and the smallest loop is obtained, including:
  • the largest loop is one, and every smallest loop is included in the largest loop
  • the largest loop with a smaller value range is the inner largest loop
  • the largest loop with a larger value range is the outer largest loop
  • the smallest loop that overlaps with the value range of the inner largest loop is selected as the outer surrounding smallest loop, and the inner largest loop is included in the outer surrounding smallest loop.
  • the embodiment of the second aspect of the present invention provides an electronic device, including:
  • a memory a processor, and a computer program stored on the memory and operable on the processor.
  • the processor executes the computer program, the building subdivision method of any one of the first aspect is realized.
  • computer-executable instructions are stored, and the computer-executable instructions are used to execute the building subdivision method of any one of the first aspect.
  • the computer storage medium in the embodiment of the third aspect can implement any one of the building subdivision methods in the first aspect, it has all the beneficial effects of the first aspect of the present invention.
  • Fig. 1 is the main step diagram of the building subdivision method of the embodiment of the present invention.
  • Fig. 2 is a step diagram of obtaining an undirected graph in a method for partitioning a building according to an embodiment of the present invention
  • Fig. 3 is a step diagram of searching for the largest loop in the building partition method of the embodiment of the present invention.
  • Fig. 4 is a step diagram of generating a first adjacency matrix and a first degradation graph in a building partition method according to an embodiment of the present invention
  • Fig. 5 is a step diagram of searching for the smallest loop in the building partition method according to the embodiment of the present invention.
  • Fig. 6 is a step diagram of generating a second adjacency matrix and a second degradation graph in the method for partitioning buildings according to an embodiment of the present invention
  • Fig. 7 is a connected undirected graph in the embodiment of the present invention.
  • Fig. 8 is the first degradation diagram after deleting bridges and overhangs in the embodiment of the present invention.
  • FIG. 9 is a schematic diagram of an initial adjacency matrix in an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of a first adjacency matrix in an embodiment of the present invention.
  • Fig. 11 is a disconnected undirected graph in the embodiment of the present invention.
  • Fig. 12 is a schematic diagram of partition results of another disconnected undirected graph in an embodiment of the present invention.
  • Subdivision refers to the division and discrimination of the rooms inside the building, which can reflect the internal layout of the building and specifically express the number and location of the rooms.
  • the partitioning method in the related art can only process simple floor plans of buildings, and the processing speed is slow, and its application is very limited.
  • a method for partitioning a building includes the following steps:
  • Step S100 obtaining the undirected graph corresponding to the floor plan of the building
  • Step S200 according to the undirected graph, search for the largest loop
  • Step S300 generating a first adjacency matrix and a corresponding first degradation graph according to the maximum loop;
  • Step S400 according to the first degradation map, search for the smallest loop
  • Step S500 generating a second adjacency matrix and a corresponding second degradation graph according to the minimum loop and the first adjacency matrix;
  • Step S600 updating the second degenerate graph to the first degenerate graph, re-searching to obtain the minimum loop, to generate the updated second adjacency matrix and the corresponding second degenerate graph, until the updated second adjacency matrix degenerates to empty, Among them, if the adjacency matrix is empty, the value of all elements inside it is 0;
  • Step S700 according to the maximum loop and each minimum loop, obtain the division result corresponding to the floor plan of the building.
  • Generating an undirected graph through the building floor plan can effectively simplify the complexity of the graph, thereby effectively improving the processing speed of partitioning.
  • the search of the undirected graph the largest loop and the smallest loop can be obtained, and then the result of the partitioning of the building can be obtained.
  • the adjacency matrix is set to record and analyze the data, which can not only avoid repeated search for the obtained loops, thus ensure the reliability of the loop search, but also effectively reduce the complexity of data processing, and then quickly realize the search end conditions. It is judged that the speed of building subdivision processing can be effectively improved.
  • step S100 obtaining the undirected graph corresponding to the building floor plan includes the following steps:
  • Step S110 obtaining the floor plan of the building.
  • Step S120 generate an undirected graph according to the building floor plan, wherein the center line of the wall projection of the building floor plan is the edge of the undirected graph, and the endpoint of the wall projection center line of the building floor plan is the edge of the undirected graph vertex.
  • the undirected graph is preprocessed through the following steps: develop software based on visual studio code, select node. dimensional data storage adjacency matrix M.
  • the data structure includes point, edge and loop.
  • the point contains three attributes, the abscissa x, the ordinate y, and the first number id 1 ;
  • the edge also has three attributes, the starting point start, the end point end, and the second number id 2 ,
  • the starting point start and the end point end are both types of points, and the corresponding value is the first number id 1 of the point, and the information of the point and the edge are stored in json, and the second number id 2 is the key;
  • the loop includes points, Edges, sub-circuits and parent circuits, and use arrays to store circuits, each element in the array corresponds to an object in the circuit, sub-circuits and parent circuits represent the inclusion relationship between circuits.
  • An undirected graph refers to a graph whose edges have no direction, generally represented by G(V, E), where V is a non-empty set, V is called a vertex set, and E is a set of unordered binary groups composed of elements in V. E is called an edge set.
  • the undirected graph generated according to the building floor plan only contains the wall information in the building floor plan, which can avoid the interference of other information other than the wall in the building floor plan to the room division, and can effectively simplify the processing process. Reduce the complexity of partition processing. If there is a path between any two vertices, the undirected graph G(V, E) is a connected graph; if there is no path between any two vertices, the undirected graph G(V, E) is a disconnected graph.
  • step S200 searches for the maximum loop, including the following steps:
  • the vertex corresponding to the maximum or minimum value on the first coordinate axis as the first starting point, wherein the first coordinate axis is an axis parallel to the x-axis or the y-axis, and the first coordinate axis passes through the first coordinate axis a starting point, and the end point of the first coordinate axis is the first starting point;
  • the edge is an arc edge, and its first direction factor is calculated through its tangent;
  • Step S200 will be described below.
  • first perform steps S210 to S240 set the first coordinate axis parallel to the x-axis, and the x-axis parallel to ⁇ V 1 , V 2 > to obtain the first coordinate axis
  • the vertex V 1 corresponding to the minimum value is the first starting point; with the first starting point V 1 as the first starting point, the first adjacent edges connected to V 1 are ⁇ V 1 , V 2 > and ⁇ V 1 , V 6 >;
  • Calculate the first rotation angles of the two first adjacent sides of vector V 1 V 2 and vector V 1 V 6 relative to the first reference line vector V 1 V 2 are ⁇ 11 and ⁇ 12 respectively, the first direction factor are K 11 and K 12 respectively; since ⁇ 11 ⁇ 12 , it can be seen that the relationship between the two first direction factors is K 11 ⁇ K 12 , and ⁇ V 1 , V 2 > corresponding to K 11 is the first path.
  • step S250 update the end point V 2 of the first path ⁇ V 1 , V 2 > as the first starting point, and update the first path ⁇ V 1 , V 2 > as the first reference line, and obtain the updated two
  • the two first adjacent edges are respectively ⁇ V 2 , V 3 > and ⁇ V 2 , V 7 >, and the updated two first adjacent edge vectors V 2 V 3 and vector V 2 V 7 are relative to the first baseline vector
  • the first rotation angles of V 1 V 2 are ⁇ 13 and ⁇ 14 respectively, and the first direction factors are K 13 and K 14 respectively.
  • step S260 is performed, according to multiple first paths, after connecting multiple first paths, the maximum circuit is Cb 1 (V 1 , V 2 , V 3 , V 4 , V 13 , V 14 , V 15 , V 16 , V 17 , V 18 , V 14 , V 13 , V 5 , V 19 , V 20 , V 19 , V 6 , V 1 ).
  • step 300 generates the first adjacency matrix and the corresponding first degradation map, including the following steps:
  • FIG. 7 is an undirected graph.
  • the largest circuit Cb 1 (V 1 , V 2 , V 3 , V 4 , V 13 , V 14 , V 15 , V 16 , V 17 , V 18 , V 14 , V 13 , V 5 , V 19 , V 20 , V 19 , V 6 , V 1 )
  • the corresponding element is incremented by 1 each time it is traversed
  • the first path corresponding to the element with a value of 2 in the initial adjacency matrix is a bridge and a branch
  • step S400 searches for the minimum loop, including:
  • Step S400 will be described below.
  • first perform steps S410 to S440 set the second coordinate axis parallel to the x-axis, and the x-axis is parallel to ⁇ V 1 , V 2 > to obtain the second coordinate axis
  • the vertex V 1 corresponding to the upper minimum value is the second starting point; with the second starting point V 1 as the second starting point, the second adjacent edges connected to V 1 are ⁇ V 1 , V 2 > and ⁇ V 1 , V 6 >; the calculated second rotation angles of the two second adjacent sides of vector V 1 V 2 and vector V 1 V 6 relative to the second reference line vector V 1 V 2 are ⁇ 21 and ⁇ 22 respectively, the first
  • the two direction factors are K 21 and K 22 respectively; since ⁇ 21 ⁇ 22 , it can be seen that the relationship between the two second direction factors is K 21 ⁇ K 22 , and ⁇ V 1 , V 2 > corresponding to K 21 is the second path .
  • step S460 update the end point of the third path ⁇ V 2 , V 7 > to the second starting point, and obtain the updated two second adjacent edges as ⁇ V 7 , V 8 > and ⁇ V 7 , V 12 >, the second rotation angles of the updated two second adjacent edge vectors V 7 V 8 and V 7 V 12 relative to the second reference line vector V 2 V 7 are ⁇ 25 and ⁇ 26 respectively, and the second direction factors are respectively K 25 and K 26 , it can be seen that the relationship between their corresponding second direction factors is K 25 >K 26 , and the second adjacent edge ⁇ V 7 , V 8 > corresponding to K 25 is the updated third path; repeat The above steps are performed until the end point corresponding to the updated third path coincides with the starting point V 1 of the second coordinate axis.
  • step S470 is performed, and the minimum circuit obtained after connecting the second path and multiple third paths is Cb 1S1 (V 1 , V 2 , V 7 , V 8 , V 9 , V 10 , V 11 , V 12 , V 7 ,V 2 ,V 3 ,V 4 ,V 5 ,V 6 ,V 1 ).
  • step S500 generates a second adjacency matrix and a corresponding second degeneration map according to the minimum loop and the first adjacency matrix, including:
  • the minimum circuit that can finally obtain the first degradation diagram is Cb 1S1 (V 1 , V 2 , V 7 , V 8 , V 9 , V 10 , V 11 , V 12 , V 7 , V 2 , V 3 , V 4 , V 5 , V 6 , V 1 ), when performing step S510, add 1 to the corresponding element each time it is traversed, and the searched minimum circuit Cb 1S1 is input into the first adjacency matrix to obtain an intermediate adjacency matrix, wherein the partial path of the smallest circuit Cb 1S1 is the same as the partial path of the largest circuit Cb 1 , and the value of the element in the corresponding intermediate adjacency matrix of these paths is 2; in step S520 When , delete the element whose value is 2 in the intermediate adjacency matrix, delete the path corresponding to the element whose value is 2 in the intermediate adjacency matrix in the first degenerate graph,
  • Cb 1S1 V 1 , V 2 , V 7 , V 8 , V 9 , V 10 , V 11 ,V 12 ,V 7 ,V 2 ,V 3 ,V 4 ,V 5 ,V 6 ,V 1
  • Cb 1S2 V 12 ,V 11 ,V 8 ,V 7 ,V 12
  • Cb 1S3 V 11 , V 10 , V 9 , V 8 , V 11
  • Cb 1S4 V 15 , V 16 , V 17 , V 18 , V 14 , V 15 ).
  • step S700 that is, before obtaining the division result of the building floor plan according to the maximum loop and each minimum loop, the following steps are also included:
  • the containment relationship between the largest loop and the smallest loop is obtained, wherein the inclusion relationship represents the association with the partition result.
  • obtaining the connectivity of an undirected graph includes the following steps:
  • obtaining the containment relationship between the largest loop and the smallest loop includes the following steps:
  • the largest loop is one, and every smallest loop is included in the largest loop
  • the largest loop with a smaller value range is the inner largest loop
  • the largest loop with a larger value range is the outer largest loop
  • the smallest loop that overlaps with the value range of the inner largest loop is selected as the outer surrounding smallest loop, and the inner largest loop is included in the outer surrounding smallest loop.
  • the second degenerate graph is updated to an undirected graph, and the maximum and minimum circuits are obtained by re-searching until the updated second adjacency matrix and the second
  • the degradation graph degenerates to empty at the same time, after obtaining each maximum loop and minimum loop, the following steps are also included:
  • an undirected graph is a connected graph, so all its smallest circuits are contained in its largest circuits.
  • the undirected graph is a disconnected graph, update the second degenerated graph to an undirected graph, and re-search to obtain the largest loop and the smallest loop in it, until the updated second adjacency matrix and the second degenerated graph simultaneously degenerate into Empty to get all the maximum and minimum loops.
  • Cb 1 (V 1 , V 2 , V 3 , V 4 , V 5 , V 6 , V 7 , V 8 , V 9 , V 20 , V 1 ),
  • Cb 2 (V 21, V 22 , V 23 , V 24 , V 25 , V 26 , V 21 ).
  • the inclusion relationship is that Cb 2 is included in Cb 1 s 6 . It can be seen that no matter whether the room is a convex polygon or a concave polygon, the building division method of the present invention can successfully complete the loop search, and can efficiently complete the online real-time division of the building.
  • the time complexity is twice the number of edges in the undirected graph, that is, the time complexity is O(E), where E is the number of edges in the undirected graph.
  • the containment relationship of the loop in the connected graph is clear, and no judgment processing is required. The judgment process of the containment relationship is only for the non-connected graph, not the connected graph. It only needs to compare the value ranges of the abscissa and ordinate of the loop vertices, so the time
  • the complexity is O(V), where V is the number of vertices. Therefore, the total time complexity is O(E)+O(V), which can effectively ensure the partitioning efficiency of the building partitioning method of the present invention.
  • the embodiment of the second aspect of the present invention also provides an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and operable on the processor.
  • the processor and memory can be connected by a bus or other means.
  • memory can be used to store non-transitory software programs and non-transitory computer-executable programs.
  • the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage devices.
  • the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the processor via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the non-transitory software programs and instructions required to realize the building subdivision method of the embodiment of the first aspect above are stored in the memory, and when executed by the processor, the building subdivision method in the above embodiment is executed, for example, executing Method steps S100 to S700 , method steps S110 to S120 , method steps S210 to S260 , method steps S310 to S320 , method steps S410 to S470 , and method steps S510 to S520 described above.
  • the device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • an embodiment of the present invention also provides a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by a processor or a controller, for example, by the above-mentioned Execution by a processor in the device embodiment can cause the above-mentioned processor to execute the building division method in the above-mentioned embodiment, for example, perform the above-described method steps S100 to S700, method steps S110 to S120, and method steps S210 to S260 , method steps S310 to S320, method steps S410 to S470, method steps S510 to S520.
  • Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, tape, magnetic disk storage or other magnetic storage devices, or can Any other medium used to store desired information and which can be accessed by a computer.
  • communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .
  • references to the terms “one embodiment,” “some embodiments,” “exemplary embodiments,” “example,” “specific examples,” or “some examples” are intended to mean that the implementation A specific feature, structure, material, or characteristic described by an embodiment or example is included in at least one embodiment or example of the present invention.
  • schematic representations of the above terms do not necessarily refer to the same embodiment or example.
  • the specific features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Geometry (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Civil Engineering (AREA)
  • Structural Engineering (AREA)
  • Computational Mathematics (AREA)
  • Architecture (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Disclosed are a building partitioning method, an electronic device, and a computer storage medium. The method comprises: obtaining an undirected graph corresponding to a building floor plan; searching according to the undirected graph to obtain the largest loop; generating a first adjacency matrix and a corresponding first degradation map according to the largest loop; searching according to the first degradation map to obtain the smallest loop; generating a second adjacency matrix and a corresponding second degradation map according to the smallest loop and the first adjacency matrix; updating the second degradation map to the first degradation map, and searching again to obtain the smallest loop so as to generate an updated second adjacency matrix and a corresponding second degradation map, until the updated second adjacency matrix is degraded to be empty; and obtaining, according to the largest loop and each smallest loop, a partitioning result corresponding to the building floor plan. The present invention can ensure the reliability of loop search, can effectively reduce the complexity of data processing, and thus can effectively increase the building partitioning speed.

Description

建筑物分间方法、电子设备及计算机存储介质Building partition method, electronic equipment and computer storage medium 技术领域technical field
本发明涉及户型数据处理领域,特别涉及一种建筑物分间方法、电子设备及计算机存储介质。The invention relates to the field of house type data processing, in particular to a building partition method, electronic equipment and computer storage media.
背景技术Background technique
随着人们生活水平的不断提高,房地产家装行业的配套产品也在逐步升级,智能家装设计平台应运而生。With the continuous improvement of people's living standards, the supporting products of the real estate home improvement industry are also gradually upgrading, and the smart home improvement design platform has emerged as the times require.
相关技术中,智能家装设计平台主要用于对建筑物进行户型设计、家装设计等,对于建筑物内房间的划分一般是设计师以人工的方式对建筑物户型图进行定义的,部分智能家装设计平台能够根据建筑物户型图进行分间,但难以处理房间格局复杂的建筑物户型图,且分间处理需要消耗大量的时间,分间效率低。In related technologies, the smart home improvement design platform is mainly used for building layout design, home decoration design, etc. The division of rooms in a building is generally defined by the designer manually on the building floor plan. Some smart home decoration design The platform can be divided according to the floor plan of the building, but it is difficult to deal with the floor plan of the building with a complex room layout, and the zoning process needs to consume a lot of time, and the zoning efficiency is low.
发明内容Contents of the invention
本发明旨在至少解决现有技术中存在的技术问题之一。为此,本发明提供了一种建筑物分间方法、电子设备及计算机存储介质,能够根据建筑物户型图得到建筑物的分间结果,分间效率高。The present invention aims to solve at least one of the technical problems existing in the prior art. Therefore, the present invention provides a building subdivision method, electronic equipment and computer storage medium, which can obtain the subdivision result of the building according to the floor plan of the building, and the subdivision efficiency is high.
本发明第一方面实施例提供一种建筑物分间方法,包括如下步骤:The embodiment of the first aspect of the present invention provides a building partition method, including the following steps:
获取建筑物户型图对应的无向图;Obtain the undirected graph corresponding to the floor plan of the building;
根据无向图,搜索得到最大回路;According to the undirected graph, search for the largest loop;
根据最大回路,生成第一邻接矩阵及对应的第一退化图;Generate a first adjacency matrix and a corresponding first degradation graph according to the maximum loop;
根据第一退化图,搜索得到最小回路;According to the first degeneracy graph, the minimum circuit is obtained by searching;
根据最小回路和第一邻接矩阵,生成第二邻接矩阵及对应的第二退化图;Generate a second adjacency matrix and a corresponding second degeneration graph according to the minimum loop and the first adjacency matrix;
将第二退化图更新为第一退化图,重新搜索得到最小回路,以生成更新后的第二邻接矩阵及对应的第二退化图,直至更新后的第二邻接矩阵退化为空;Updating the second degenerate graph to the first degenerate graph, re-searching to obtain the minimum loop, to generate the updated second adjacency matrix and the corresponding second degenerate graph, until the updated second adjacency matrix degenerates to empty;
根据最大回路和每一最小回路,得到建筑物户型图对应的分间结果。According to the maximum loop and each minimum loop, the division result corresponding to the floor plan of the building is obtained.
根据本发明的上述实施例,至少具有如下有益效果:通过建筑物户型图生成无向图,能够有效简化图形的复杂程度,从而有效提高分间处理速度,根据无向图搜索能够得到最大回路和最小回路,进而得到建筑物的分间结果,分间过程中设置邻接矩阵用于对数据进行记录分析,不仅能够避免重复搜索已得到的回路,从而能够确保回路搜索的可靠性,而且能够有效降低数据处理的复杂度,进而能够对搜索结束条件实现快速判断,能够有效提高建筑物分间处理的速度。According to the above-mentioned embodiment of the present invention, it has at least the following beneficial effects: the undirected graph generated by the building floor plan can effectively simplify the complexity of the graph, thereby effectively improving the partition processing speed, and the maximum loop sum can be obtained according to the undirected graph search. The smallest loop can be used to obtain the partition results of the building. During the partitioning process, an adjacency matrix is set to record and analyze the data, which can not only avoid repeated searches of the obtained loops, but also ensure the reliability of the loop search, and effectively reduce the The complexity of data processing, and thus the rapid judgment of the search end conditions can be realized, which can effectively improve the speed of building subdivision processing.
根据本发明第一方面的一些实施例,获取建筑物户型图对应的无向图,包括:According to some embodiments of the first aspect of the present invention, obtaining an undirected graph corresponding to a building floor plan includes:
获取建筑物户型图;Obtain the floor plan of the building;
根据建筑物户型图,生成无向图,其中,建筑物户型图的墙体投影中心线为无向图的边,建筑物户型图的墙体投影中心线的端点为无向图的顶点。According to the building floor plan, an undirected graph is generated, wherein the center line of the wall projection of the building floor plan is the edge of the undirected graph, and the endpoint of the wall projection center line of the building floor plan is the vertex of the undirected graph.
根据本发明第一方面的一些实施例,根据无向图,搜索得到最大回路,包括:According to some embodiments of the first aspect of the present invention, according to the undirected graph, the maximum cycle is obtained by searching, including:
根据无向图,将第一坐标轴上的最大值或最小值对应的顶点作为第一起始点,其中,第一 坐标轴为与x轴或y轴平行的轴线,第一坐标轴经过第一起始点;According to the undirected graph, the vertex corresponding to the maximum or minimum value on the first coordinate axis is used as the first starting point, wherein the first coordinate axis is an axis parallel to the x-axis or the y-axis, and the first coordinate axis passes through the first starting point ;
以第一起始点为第一出发点,获取每一与第一出发点连接的第一邻接边;Taking the first starting point as the first starting point, obtaining each first adjacent edge connected to the first starting point;
以第一坐标轴为第一基准线,计算每一第一邻接边对应的第一方向因子,其中,第一方向因子用于表示第一邻接边相对于第一基准线的第一旋转角关系;Taking the first coordinate axis as the first reference line, calculate the first direction factor corresponding to each first adjacent side, where the first direction factor is used to represent the first rotation angle relationship of the first adjacent side with respect to the first reference line ;
比较每一第一方向因子,得到最小的第一方向因子对应的第一邻接边为第一路径;Comparing each first direction factor, the first adjacent edge corresponding to the smallest first direction factor is obtained as the first path;
将第一路径的终点更新为第一出发点,并将第一路径更新为第一基准线,直至更新后的第一路径的终点与第一起始点重合;updating the end point of the first path to the first starting point, and updating the first path to the first baseline until the updated end point of the first path coincides with the first starting point;
根据多个第一路径,得到最大回路。According to the plurality of first paths, a maximum loop is obtained.
根据本发明第一方面的一些实施例,根据最大回路,生成第一邻接矩阵及对应的第一退化图,包括:According to some embodiments of the first aspect of the present invention, the first adjacency matrix and the corresponding first degradation graph are generated according to the maximum loop, including:
根据最大回路,将每一第一路径对应的数值输入到邻接矩阵,得到初始邻接矩阵,其中,邻接矩阵的初始值都为0,每遍历第一路径一次,邻接矩阵中对应第一路径的元素加1;According to the maximum loop, input the value corresponding to each first path into the adjacency matrix to obtain the initial adjacency matrix, where the initial value of the adjacency matrix is 0, and each time the first path is traversed, the elements corresponding to the first path in the adjacency matrix plus 1;
根据初始邻接矩阵,删除初始邻接矩阵中数值为2的元素,生成第一邻接矩阵及对应的第一退化图,其中,第一退化图由无向图删除遍历两次的第一路径后得到。According to the initial adjacency matrix, elements with a value of 2 in the initial adjacency matrix are deleted to generate a first adjacency matrix and a corresponding first degenerate graph, wherein the first degenerate graph is obtained by deleting the first path traversed twice from the undirected graph.
根据本发明第一方面的一些实施例,根据第一退化图,搜索得到最小回路,包括:According to some embodiments of the first aspect of the present invention, according to the first degradation map, searching for the minimum loop includes:
根据第一退化图,将第二坐标轴上的最大值或最小值对应的顶点作为第二起始点,其中,第二坐标轴为与x轴或y轴平行的轴线,第二坐标轴经过第二起始点;According to the first degradation diagram, the vertex corresponding to the maximum or minimum value on the second coordinate axis is used as the second starting point, wherein the second coordinate axis is an axis parallel to the x-axis or the y-axis, and the second coordinate axis passes through the first two starting points;
以第二起始点为第二出发点,获取每一与第二出发点连接的第二邻接边;Taking the second starting point as the second starting point, obtaining each second adjacent edge connected to the second starting point;
以第二坐标轴为第二基准线,计算每一第二邻接边对应的第二方向因子,其中,第二方向因子用于表示第二邻接边相对于第二基准线的第二旋转角关系;Taking the second coordinate axis as the second reference line, calculate the second direction factor corresponding to each second adjacent side, wherein the second direction factor is used to represent the second rotation angle relationship of the second adjacent side with respect to the second reference line ;
比较每一第二方向因子,得到最小的第二方向因子对应的第二邻接边为第二路径;Comparing each second direction factor, the second adjacent edge corresponding to the smallest second direction factor is obtained as the second path;
将第二路径的终点更新为第二出发点,并将第二路径更新为第二基准线,得到最大的第二方向因子对应的第二邻接边为第三路径;Update the end point of the second path to the second starting point, and update the second path to the second reference line, and obtain the second adjacent edge corresponding to the largest second direction factor as the third path;
将第三路径的终点更新为第二出发点,直至更新后的第三路径的终点与第二起始点重合;updating the end point of the third path to the second starting point until the updated end point of the third path coincides with the second starting point;
根据第二路径和多个第三路径,得到最小回路。According to the second path and the plurality of third paths, a minimum circuit is obtained.
根据本发明第一方面的一些实施例,根据最小回路和第一邻接矩阵,生成第二邻接矩阵及对应的第二退化图,包括:According to some embodiments of the first aspect of the present invention, according to the minimum loop and the first adjacency matrix, generating a second adjacency matrix and a corresponding second degeneration graph, including:
根据最小回路,将每一第二路径对应的数值输入到第一邻接矩阵,得到中间邻接矩阵,其中,每遍历第二路径一次,第一邻接矩阵中对应第二路径的元素加1;According to the minimum circuit, the numerical value corresponding to each second path is input into the first adjacency matrix to obtain an intermediate adjacency matrix, wherein, each time the second path is traversed, the element corresponding to the second path in the first adjacency matrix is increased by 1;
根据中间邻接矩阵,删除中间邻接矩阵中数值为2的元素,生成第二邻接矩阵及对应的第二退化图,其中,第二退化图由第一退化图删除遍历两次的第二路径后得到。According to the intermediate adjacency matrix, delete the element whose value is 2 in the intermediate adjacency matrix, and generate the second adjacency matrix and the corresponding second degraded graph, wherein, the second degraded graph is obtained by deleting the second path traversed twice from the first degraded graph .
根据本发明第一方面的一些实施例,根据最大回路和每一最小回路,得到建筑物户型图的分间结果之前,还包括:According to some embodiments of the first aspect of the present invention, according to the maximum loop and each minimum loop, before obtaining the segmentation result of the building floor plan, it also includes:
获取无向图的连通性;Get the connectivity of an undirected graph;
根据无向图的连通性,得到最大回路及最小回路之间的包含关系,其中,包含关系表征与分间结果的关联。According to the connectivity of the undirected graph, the containment relationship between the largest loop and the smallest loop is obtained, wherein the inclusion relationship represents the association with the partition result.
根据本发明第一方面的一些实施例,根据无向图的连通性,得到最大回路及最小回路之间的包含关系,包括:According to some embodiments of the first aspect of the present invention, according to the connectivity of the undirected graph, the inclusion relationship between the largest loop and the smallest loop is obtained, including:
将第二退化图更新为无向图,重新搜索得到最大回路及最小回路,直至更新后的第二邻接矩阵和第二退化图同时退化为空;Updating the second degenerate graph to an undirected graph, re-searching to obtain the maximum loop and the minimum loop, until the updated second adjacency matrix and the second degenerate graph degenerate to empty at the same time;
当无向图为连通图,最大回路为一个,得到每一最小回路均包含于最大回路中;When the undirected graph is a connected graph, the largest loop is one, and every smallest loop is included in the largest loop;
当无向图为非连通图,最大回路至少有两个,得到最大回路及最小回路之间的包含关系包括以下步骤:When the undirected graph is a disconnected graph, there are at least two maximum circuits, and obtaining the containment relationship between the maximum circuit and the minimum circuit includes the following steps:
获取取值范围存在重叠的两个最大回路;Obtain the two largest loops whose value ranges overlap;
根据取值范围存在重叠的两个最大回路,得到取值范围小的最大回路为内部最大回路、取值范围大的最大回路为外部最大回路;According to the two largest loops with overlapping value ranges, the largest loop with a smaller value range is the inner largest loop, and the largest loop with a larger value range is the outer largest loop;
根据外部最大回路中的每一最小回路以及内部最大回路,筛选出与内部最大回路取值范围有重叠的最小回路为外包围最小回路,得到内部最大回路包含于外包围最小回路中。According to each smallest loop in the outer largest loop and the inner largest loop, the smallest loop that overlaps with the value range of the inner largest loop is selected as the outer surrounding smallest loop, and the inner largest loop is included in the outer surrounding smallest loop.
本发明第二方面实施例提供一种电子设备,包括:The embodiment of the second aspect of the present invention provides an electronic device, including:
存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现第一方面任意一项的建筑物分间方法。A memory, a processor, and a computer program stored on the memory and operable on the processor. When the processor executes the computer program, the building subdivision method of any one of the first aspect is realized.
由于第二方面实施例的电子设备应用第一方面任意一项的建筑物分间方法,因此具有本发明第一方面的所有有益效果。Since the electronic equipment in the embodiment of the second aspect applies any one of the building subdivision methods in the first aspect, it has all the beneficial effects of the first aspect of the present invention.
根据本发明第三方面实施例提供的一种计算机存储介质,存储有计算机可执行指令,计算机可执行指令用于执行第一方面任意一项的建筑物分间方法。According to a computer storage medium provided by an embodiment of the third aspect of the present invention, computer-executable instructions are stored, and the computer-executable instructions are used to execute the building subdivision method of any one of the first aspect.
由于第三方面实施例的计算机存储介质可执行第一方面任意一项的建筑物分间方法,因此具有本发明第一方面的所有有益效果。Since the computer storage medium in the embodiment of the third aspect can implement any one of the building subdivision methods in the first aspect, it has all the beneficial effects of the first aspect of the present invention.
本发明的附加方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本发明的实践了解到。Additional aspects and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
附图说明Description of drawings
本发明的上述和/或附加的方面和优点从结合下面附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present invention will become apparent and understandable from the description of the embodiments in conjunction with the following drawings, wherein:
图1是本发明实施例的建筑物分间方法的主要步骤图;Fig. 1 is the main step diagram of the building subdivision method of the embodiment of the present invention;
图2是本发明实施例的建筑物分间方法中获取无向图的步骤图;Fig. 2 is a step diagram of obtaining an undirected graph in a method for partitioning a building according to an embodiment of the present invention;
图3是本发明实施例的建筑物分间方法中搜索最大回路的步骤图;Fig. 3 is a step diagram of searching for the largest loop in the building partition method of the embodiment of the present invention;
图4是本发明实施例的建筑物分间方法中生成第一邻接矩阵和第一退化图的步骤图;Fig. 4 is a step diagram of generating a first adjacency matrix and a first degradation graph in a building partition method according to an embodiment of the present invention;
图5是本发明实施例的建筑物分间方法中搜索最小回路的步骤图;Fig. 5 is a step diagram of searching for the smallest loop in the building partition method according to the embodiment of the present invention;
图6是本发明实施例的建筑物分间方法中生成第二邻接矩阵和第二退化图的步骤图;Fig. 6 is a step diagram of generating a second adjacency matrix and a second degradation graph in the method for partitioning buildings according to an embodiment of the present invention;
图7是本发明实施例中一个连通的无向图;Fig. 7 is a connected undirected graph in the embodiment of the present invention;
图8是本发明实施例中删除桥和悬枝后的第一退化图;Fig. 8 is the first degradation diagram after deleting bridges and overhangs in the embodiment of the present invention;
图9是本发明实施例中的初始邻接矩阵示意图;FIG. 9 is a schematic diagram of an initial adjacency matrix in an embodiment of the present invention;
图10是本发明实施例中的第一邻接矩阵示意图;FIG. 10 is a schematic diagram of a first adjacency matrix in an embodiment of the present invention;
图11是本发明实施例中的一个非连通的无向图;Fig. 11 is a disconnected undirected graph in the embodiment of the present invention;
图12是本发明实施例中另一个非连通的无向图的分间结果示意图。Fig. 12 is a schematic diagram of partition results of another disconnected undirected graph in an embodiment of the present invention.
具体实施方式Detailed ways
本发明的描述中,除非另有明确的限定,设置、安装、连接等词语应做广义理解,所属技术领域技术人员可以结合技术方案的具体内容合理确定上述词语在本发明中的具体含义。在本发明的描述中,若干的含义是一个或者多个,多个的含义是两个以上,大于、小于、超过等理解为不包括本数,以上、以下、以内等理解为包括本数。此外,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本发明的描述中,除非另有说明,“多个”的含义是两个或两个以上。In the description of the present invention, unless otherwise clearly defined, words such as setting, installation, and connection should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above words in the present invention in combination with the specific content of the technical solution. In the description of the present invention, several means one or more, and multiple means more than two. Greater than, less than, exceeding, etc. are understood as not including the original number, and above, below, within, etc. are understood as including the original number. In addition, the features defined as "first" and "second" may explicitly or implicitly include one or more of these features. In the description of the present invention, unless otherwise specified, "plurality" means two or more.
分间是指对建筑物内部的房间进行划分判别,能够反映出建筑物的内部格局,具体表示出房间的数量以及位置情况。相关技术中的分间方法只能对简单的建筑物户型图进行处理,且处理速度慢,应用的受限性大。Subdivision refers to the division and discrimination of the rooms inside the building, which can reflect the internal layout of the building and specifically express the number and location of the rooms. The partitioning method in the related art can only process simple floor plans of buildings, and the processing speed is slow, and its application is very limited.
下面参照图1至图12描述本发明的建筑物分间方法、电子设备及计算机存储介质。The building subdivision method, electronic equipment and computer storage medium of the present invention will be described below with reference to FIGS. 1 to 12 .
如图1所示,根据本发明第一方面实施例的一种建筑物分间方法,包括如下步骤:As shown in Figure 1, a method for partitioning a building according to an embodiment of the first aspect of the present invention includes the following steps:
步骤S100、获取建筑物户型图对应的无向图;Step S100, obtaining the undirected graph corresponding to the floor plan of the building;
步骤S200、根据无向图,搜索得到最大回路;Step S200, according to the undirected graph, search for the largest loop;
步骤S300、根据最大回路,生成第一邻接矩阵及对应的第一退化图;Step S300, generating a first adjacency matrix and a corresponding first degradation graph according to the maximum loop;
步骤S400、根据第一退化图,搜索得到最小回路;Step S400, according to the first degradation map, search for the smallest loop;
步骤S500、根据最小回路和第一邻接矩阵,生成第二邻接矩阵及对应的第二退化图;Step S500, generating a second adjacency matrix and a corresponding second degradation graph according to the minimum loop and the first adjacency matrix;
步骤S600、将第二退化图更新为第一退化图,重新搜索得到最小回路,以生成更新后的第二邻接矩阵及对应的第二退化图,直至更新后的第二邻接矩阵退化为空,其中,邻接矩阵为空则其内部所有元素的数值都为0;Step S600, updating the second degenerate graph to the first degenerate graph, re-searching to obtain the minimum loop, to generate the updated second adjacency matrix and the corresponding second degenerate graph, until the updated second adjacency matrix degenerates to empty, Among them, if the adjacency matrix is empty, the value of all elements inside it is 0;
步骤S700、根据最大回路和每一最小回路,得到建筑物户型图对应的分间结果。Step S700, according to the maximum loop and each minimum loop, obtain the division result corresponding to the floor plan of the building.
通过建筑物户型图生成无向图,能够有效简化图形的复杂程度,从而有效提高分间处理速度,根据无向图搜索能够得到最大回路和最小回路,进而得到建筑物的分间结果,分间过程中设置邻接矩阵用于对数据进行记录分析,不仅能够避免重复搜索已得到的回路,从而能够确保回路搜索的可靠性,而且能够有效降低数据处理的复杂度,进而能够对搜索结束条件实现快速判断,能够有效提高建筑物分间处理的速度。Generating an undirected graph through the building floor plan can effectively simplify the complexity of the graph, thereby effectively improving the processing speed of partitioning. According to the search of the undirected graph, the largest loop and the smallest loop can be obtained, and then the result of the partitioning of the building can be obtained. In the process, the adjacency matrix is set to record and analyze the data, which can not only avoid repeated search for the obtained loops, thus ensure the reliability of the loop search, but also effectively reduce the complexity of data processing, and then quickly realize the search end conditions. It is judged that the speed of building subdivision processing can be effectively improved.
可以理解的是,参考图2,步骤S100,获取建筑物户型图对应的无向图,包括以下步骤:It can be understood that, referring to FIG. 2, step S100, obtaining the undirected graph corresponding to the building floor plan includes the following steps:
步骤S110、获取建筑物户型图。Step S110, obtaining the floor plan of the building.
步骤S120、根据建筑物户型图,生成无向图,其中,建筑物户型图的墙体投影中心线为无向图的边,建筑物户型图的墙体投影中心线的端点为无向图的顶点。Step S120, generate an undirected graph according to the building floor plan, wherein the center line of the wall projection of the building floor plan is the edge of the undirected graph, and the endpoint of the wall projection center line of the building floor plan is the edge of the undirected graph vertex.
具体的,在进行步骤S100之后,通过以下步骤对无向图进行预处理:基于visual studio code开发软件,选用node.js为服务器、js作为开发语言,先对数据结构进行定义,再开辟动态二维数据存储邻接矩阵M。其中,数据结构包括点、边以及回路,点包含有三个属性,横坐标x、纵坐标y以及第一编号id 1;边也有三个属性,起始点start、终点end以及第二编号id 2,其中起始点start和终点end都是点的类型,对应的数值为点的第一编号id 1,并将点和边的信息都存储到json中,第二编号id 2为key;回路包含点、边、子回路和父回路,并用数组存储回路,数组中每个元素对应回路中的一个对象,子回路和父回路表示了回路间的包含关系。 Specifically, after performing step S100, the undirected graph is preprocessed through the following steps: develop software based on visual studio code, select node. dimensional data storage adjacency matrix M. Among them, the data structure includes point, edge and loop. The point contains three attributes, the abscissa x, the ordinate y, and the first number id 1 ; the edge also has three attributes, the starting point start, the end point end, and the second number id 2 , The starting point start and the end point end are both types of points, and the corresponding value is the first number id 1 of the point, and the information of the point and the edge are stored in json, and the second number id 2 is the key; the loop includes points, Edges, sub-circuits and parent circuits, and use arrays to store circuits, each element in the array corresponds to an object in the circuit, sub-circuits and parent circuits represent the inclusion relationship between circuits.
无向图是指边为没有方向的图,一般以G(V,E)表示,其中V为非空集合,V称为顶点集,E为V中元素构成的无序二元组的集合,E称为边集。根据建筑物户型图生成的无向图,只包含了建筑物户型图中的墙体信息,能够避免建筑物户型图中墙体以外的其他信息对房间分间造成干扰,能够有效简化处理过程,降低分间处理的复杂度。若任意两个顶点都形成有通路,则该无向图G(V,E)为连通图;若存在两个顶点之间没有通路,则无向图G(V,E)为非连通图。An undirected graph refers to a graph whose edges have no direction, generally represented by G(V, E), where V is a non-empty set, V is called a vertex set, and E is a set of unordered binary groups composed of elements in V. E is called an edge set. The undirected graph generated according to the building floor plan only contains the wall information in the building floor plan, which can avoid the interference of other information other than the wall in the building floor plan to the room division, and can effectively simplify the processing process. Reduce the complexity of partition processing. If there is a path between any two vertices, the undirected graph G(V, E) is a connected graph; if there is no path between any two vertices, the undirected graph G(V, E) is a disconnected graph.
最大回路是指包容连通图中全部顶点和边的回路,通常记为Cb i;参考图7,为连通的无向图,该无向图带有桥<V 13,V 14>和悬枝<V 19,V 20>,其中,最大回路为Cb 1=(V 1,V 2,V 3,V 4,V 13,V 14,V 15,V 16,V 17,V 18,V 14,V 13,V 5,V 19,V 20,V 19,V 6,V 1),该最大回路包含桥<V 13,V 14>和悬枝<V 19,V 20>。 The largest circuit refers to the circuit containing all the vertices and edges in the connected graph, usually denoted as Cb i ; referring to Figure 7, it is a connected undirected graph with bridges <V 13 , V 14 > and hanging branches< V 19 ,V 20 >, where the maximum loop is Cb 1 =(V 1 ,V 2 ,V 3 ,V 4 ,V 13 ,V 14 ,V 15 ,V 16 ,V 17 ,V 18 , V 14 ,V 13 , V 5 , V 19 , V 20 , V 19 , V 6 , V 1 ), the largest circuit includes bridge <V 13 , V 14 > and suspension branch <V 19 , V 20 >.
可以理解的是,参考图3,步骤S200,根据无向图,搜索得到最大回路,包括以下步骤:It can be understood that, referring to FIG. 3, step S200, according to the undirected graph, searches for the maximum loop, including the following steps:
S210、根据无向图,将第一坐标轴上的最大值或最小值对应的顶点作为第一起始点,其中,第一坐标轴为与x轴或y轴平行的轴线,第一坐标轴经过第一起始点,且第一坐标轴的终点为第一起始点;S210. According to the undirected graph, use the vertex corresponding to the maximum or minimum value on the first coordinate axis as the first starting point, wherein the first coordinate axis is an axis parallel to the x-axis or the y-axis, and the first coordinate axis passes through the first coordinate axis a starting point, and the end point of the first coordinate axis is the first starting point;
S220、以第一起始点为第一出发点,获取每一与第一出发点连接的第一邻接边;S220. Taking the first starting point as the first starting point, acquiring each first adjacent edge connected to the first starting point;
S230、以第一坐标轴为第一基准线,计算每一第一邻接边对应的第一方向因子,其中,第一方向因子用于表示第一邻接边相对于第一基准线在矢量状态下的第一旋转角关系,第一邻接边相对于第一基准线在矢量状态下的为第一旋转角α 1,第一方向因子设为K 1=α 1/2π,α 1∈(-π,π),当第一邻接边相对于第一基准线顺时针旋转,α 1为负值,当第一邻接边相对于第一基准线逆时针旋转时α 1为正值,当第一邻接边为弧形边,通过其切线计算其第一方向因子; S230. Taking the first coordinate axis as the first reference line, calculate the first direction factor corresponding to each first adjacent side, wherein the first direction factor is used to indicate that the first adjacent side is in a vector state relative to the first reference line The first rotation angle relationship of the first adjacent side relative to the first reference line in the vector state is the first rotation angle α 1 , the first direction factor is set to K 11 /2π, α 1 ∈(-π , π), when the first adjacent side rotates clockwise relative to the first reference line, α 1 is a negative value, when the first adjacent side rotates counterclockwise relative to the first reference line, α 1 is positive, when the first adjacent The edge is an arc edge, and its first direction factor is calculated through its tangent;
S240、比较每一第一方向因子,得到最小的第一方向因子对应的第一邻接边为第一路径;S240. Compare each first direction factor, and obtain the first adjacent edge corresponding to the smallest first direction factor as the first path;
S250、将第一路径的终点更新为第一出发点,并将第一路径更新为第一基准线,直至更新后的第一路径的终点与第一起始点重合,其中,第一路径的终点为远离更新前第一出发点的一端点;S250. Update the end point of the first path to the first starting point, and update the first path to the first reference line until the updated end point of the first path coincides with the first starting point, wherein the end point of the first path is far from An endpoint of the first starting point before updating;
S260、根据多个第一路径,得到最大回路。S260. Obtain a maximum loop according to the multiple first paths.
以下对步骤S200进行说明,参考图7为无向图,先进行步骤S210至S240,设第一坐标轴与x轴平行,x轴与<V 1,V 2>平行,获取第一坐标轴上最小值对应的顶点V 1点为第一起始点;以第一起始点V 1点为第一出发点,获取与V 1点连接的第一邻接边有<V 1,V 2>和<V 1,V 6>;计算得到向量V 1V 2和向量V 1V 6两条第一邻接边相对于第一基准线向量V 1V 2的第一旋转角分别为α 11和α 12,第一方向因子分别为K 11和K 12;由于α 1112,可知两个第一方向因子的关系为K 11<K 12,得到K 11对应的<V 1,V 2>为第一路径。再进行步骤S250,将第一路径<V 1,V 2>的终点V 2更新为第一出发点,并将第一路径<V 1,V 2>更新为第一基准线,得到更新后的两个第一邻接边分别为<V 2,V 3>和<V 2,V 7>,更新后的两个第一邻接边向量V 2V 3和向量V 2V 7相对于第一基准线向量V 1V 2的第一旋转角分别为α 13和α 14,第一方向因子分别为K 13和K 14,可知它们对应的第一方向因子的关系为K 13<K 14,得到K 13对应的第一邻接边<V 2,V 3>为更新后的第一路径;重复进行上述步骤,直至更新后的第一路径对应的终点与第一起始点V 1点重合。最后进行步骤S260,根据多个第一路径,连接多个第一路径后得到最大回路为Cb 1(V 1,V 2,V 3,V 4,V 13,V 14,V 15,V 16,V 17,V 18,V 14,V 13,V 5,V 19,V 20,V 19,V 6,V 1)。 Step S200 will be described below. Referring to FIG. 7 which is an undirected graph, first perform steps S210 to S240, set the first coordinate axis parallel to the x-axis, and the x-axis parallel to <V 1 , V 2 > to obtain the first coordinate axis The vertex V 1 corresponding to the minimum value is the first starting point; with the first starting point V 1 as the first starting point, the first adjacent edges connected to V 1 are <V 1 , V 2 > and <V 1 , V 6 >; Calculate the first rotation angles of the two first adjacent sides of vector V 1 V 2 and vector V 1 V 6 relative to the first reference line vector V 1 V 2 are α 11 and α 12 respectively, the first direction factor are K 11 and K 12 respectively; since α 1112 , it can be seen that the relationship between the two first direction factors is K 11 <K 12 , and <V 1 , V 2 > corresponding to K 11 is the first path. Then go to step S250, update the end point V 2 of the first path <V 1 , V 2 > as the first starting point, and update the first path <V 1 , V 2 > as the first reference line, and obtain the updated two The two first adjacent edges are respectively <V 2 , V 3 > and <V 2 , V 7 >, and the updated two first adjacent edge vectors V 2 V 3 and vector V 2 V 7 are relative to the first baseline vector The first rotation angles of V 1 V 2 are α 13 and α 14 respectively, and the first direction factors are K 13 and K 14 respectively. It can be seen that the relationship between their corresponding first direction factors is K 13 <K 14 , and K 13 corresponds to The first adjacent edge <V 2 , V 3 > of is the updated first path; repeat the above steps until the end point corresponding to the updated first path coincides with the first starting point V 1 . Finally, step S260 is performed, according to multiple first paths, after connecting multiple first paths, the maximum circuit is Cb 1 (V 1 , V 2 , V 3 , V 4 , V 13 , V 14 , V 15 , V 16 , V 17 , V 18 , V 14 , V 13 , V 5 , V 19 , V 20 , V 19 , V 6 , V 1 ).
可以理解的是,参考图4,步骤300,根据最大回路,生成第一邻接矩阵及对应的第一退化图,包括以下步骤:It can be understood that, referring to FIG. 4, step 300, according to the maximum loop, generates the first adjacency matrix and the corresponding first degradation map, including the following steps:
S310、根据最大回路,将每一第一路径对应的数值输入到邻接矩阵,得到初始邻接矩阵,其中,邻接矩阵的初始值都为0,每遍历第一路径一次,邻接矩阵对应第一路径的元素加1;S310. According to the maximum loop, input the value corresponding to each first path into the adjacency matrix to obtain the initial adjacency matrix, wherein, the initial value of the adjacency matrix is 0, and each time the first path is traversed, the adjacency matrix corresponds to the first path add 1 to the element;
S320、根据初始邻接矩阵,删除初始邻接矩阵中数值为2的元素,生成第一邻接矩阵及对应的第一退化图,其中,第一退化图由无向图删除遍历两次的第一路径后得到。S320. According to the initial adjacency matrix, delete elements with a value of 2 in the initial adjacency matrix to generate the first adjacency matrix and the corresponding first degenerate graph, wherein the first degenerate graph is deleted from the undirected graph after traversing the first path twice get.
参考图7为无向图,在进行步骤S200后,最终能够得到无向图中的最大回路Cb 1(V 1,V 2,V 3,V 4,V 13,V 14,V 15,V 16,V 17,V 18,V 14,V 13,V 5,V 19,V 20,V 19,V 6,V 1),在进行步骤S310时,以每遍历一次则对应元素加1的方式,将搜索得到的最大回路的Cb 1遍历的第一路径输入到初始值都为0的邻接矩阵中,得到如9图所示的初始邻接矩阵,其中桥<V 13,V 14>和悬枝<V 19,V 20>都遍历了两次,因此初始邻接矩阵中对应元素的值为2;在进行步骤S320时,初始邻接矩阵中数值 为2的元素对应的第一路径为桥和悬枝,删除无向图中的桥和悬枝后生成第一退化图如图8所示,其中孤立点V20也被删除,同时删除初始邻接矩阵中数值为2的元素,生成如图10所示的第一邻接矩阵,其中,数值为0的省略不写。 Referring to FIG. 7 is an undirected graph. After performing step S200, the largest circuit Cb 1 (V 1 , V 2 , V 3 , V 4 , V 13 , V 14 , V 15 , V 16 , V 17 , V 18 , V 14 , V 13 , V 5 , V 19 , V 20 , V 19 , V 6 , V 1 ), when performing step S310, the corresponding element is incremented by 1 each time it is traversed, Input the first path of Cb 1 traversal of the largest loop obtained from the search into the adjacency matrix whose initial value is 0, and obtain the initial adjacency matrix as shown in Figure 9, in which the bridge <V 13 , V 14 > and the overhang < V 19 , V 20 > have been traversed twice, so the value of the corresponding element in the initial adjacency matrix is 2; when performing step S320, the first path corresponding to the element with a value of 2 in the initial adjacency matrix is a bridge and a branch, After deleting the bridges and hanging branches in the undirected graph, the first degenerated graph is generated as shown in Figure 8, in which the isolated point V20 is also deleted, and the element with a value of 2 in the initial adjacency matrix is deleted at the same time, and the first degenerated graph as shown in Figure 10 is generated. An adjacency matrix, where the value 0 is omitted.
可以理解的是,参考图5,步骤S400,根据第一退化图,搜索得到最小回路,包括:It can be understood that, referring to FIG. 5, step S400, according to the first degradation map, searches for the minimum loop, including:
S410、根据第一退化图,将第二坐标轴上的最大值或最小值对应的顶点作为第二起始点,其中,第二坐标轴为与x轴或y轴平行的轴线,第二坐标轴经过第二起始点,且第二坐标轴的终点为第二起始点;S410. According to the first degradation diagram, use the vertex corresponding to the maximum or minimum value on the second coordinate axis as the second starting point, wherein the second coordinate axis is an axis parallel to the x-axis or the y-axis, and the second coordinate axis passing through the second starting point, and the end point of the second coordinate axis is the second starting point;
S420、以第二起始点为第二出发点,获取每一与第二出发点连接的第二邻接边;S420. Using the second starting point as the second starting point, obtain each second adjacent edge connected to the second starting point;
S430、以第二坐标轴为第二基准线,计算每一第二邻接边对应的第二方向因子,其中,第二方向因子用于表示第二邻接边相对于第二基准线在矢量状态下的第二旋转角关系,第二邻接边相对于第二基准线在矢量状态下的第二旋转角为α 2,第二方向因子设为K 2=α 2/2π,α 2∈(-π,π),当第二邻接边相对于第二基准线顺时针旋转,α 2为负值,当第二邻接边相对于第二基准线逆时针旋转时α 2为正值,当第二邻接边为弧形边,通过其切线计算其第二方向因子; S430. Taking the second coordinate axis as the second reference line, calculate the second direction factor corresponding to each second adjacent side, wherein the second direction factor is used to indicate that the second adjacent side is in a vector state relative to the second reference line The second rotation angle relation of , the second rotation angle of the second adjacent side relative to the second reference line in the vector state is α 2 , the second direction factor is set to K 22 /2π, α 2 ∈(-π , π), when the second adjacent side rotates clockwise relative to the second reference line, α 2 is a negative value, when the second adjacent side rotates counterclockwise relative to the second reference line, α 2 is positive, when the second adjacent The edge is an arc edge, and its second direction factor is calculated through its tangent;
S440、比较每一第二方向因子,得到最小的第二方向因子对应的第二邻接边为第二路径;S440. Compare each second direction factor, and obtain the second adjacent edge corresponding to the smallest second direction factor as the second path;
S450、将第二路径的终点更新为第二出发点,并将第二路径更新为第二基准线,得到最大的第二方向因子对应的第二邻接边为第三路径,其中,第二路径的终点为远离更新前第二出发点的一端点;S450. Update the end point of the second path to the second starting point, and update the second path to the second reference line, and obtain the second adjacent edge corresponding to the largest second direction factor as the third path, wherein the second path's The end point is an end point away from the second starting point before the update;
S460、将第三路径的终点更新为第二出发点,直至更新后的第三路径的终点与第二起始点重合,其中,第三路径的终点为远离更新前第二出发点的一端点;S460. Update the end point of the third path to the second starting point until the updated end point of the third path coincides with the second starting point, wherein the end point of the third path is an end point away from the second starting point before updating;
S470、根据第二路径和多个第三路径,得到最小回路。S470. Obtain a minimum circuit according to the second path and multiple third paths.
以下对步骤S400进行说明,参考图8为第一退化图,先进行步骤S410至S440,设第二坐标轴与x轴平行,x轴与<V 1,V 2>平行,获取第二坐标轴上最小值对应的顶点V 1点为第二起始点;以第二起始点V 1点为第二出发点,获取与V 1点连接的第二邻接边有<V 1,V 2>和<V 1,V 6>;计算得到向量V 1V 2和向量V 1V 6两条第二邻接边相对于第二基准线向量V 1V 2的第二旋转角分别为α 21和α 22,第二方向因子分别为K 21和K 22;由于α 2122,可知两个第二方向因子的关系为K 21<K 22,得到K 21对应的<V 1,V 2>为第二路径。再进行步骤S450,将第二路径<V 1,V 2>的终点V 2更新为第二出发点,并将第二路径<V 1,V 2>更新为第二基准线,得到更新后的两个第二邻接边分别为<V 2,V 3>和<V 2,V 7>,更新后的两个第二邻接边向量V 2V 3和V 2V 7相对于第二基准线向量V 1V 2的第二旋转角分别为α 23和α 24,第二方向因子分别为K 23和K 24,可知它们对应的第二方向因子分别为K 23<K 24,得到K 24对应的第二邻接边<V 2,V 7>为第三路径。接着进行步骤S460,将第三路径<V 2,V 7>的终点更新为第二出发点,得到更新后的两个第二邻接边分别为<V 7,V 8>和<V 7,V 12>,更新后的两个第二邻接边向量V 7V 8和V 7V 12相对于第二基准线向量V 2V 7的第二旋转角分别为α 25和α 26,第二方向因子分别为K 25和K 26,可知它们对应的第二方向因子的关系为K 25>K 26,得到K 25对应的第二邻接边<V 7,V 8>为更新后的第三路径;重复进行上述步骤,直至更新后的第三路径对应的终点与第二坐标轴的起始点V 1点重合。最后进行步骤S470,根据第二路径和多个第三路径连接后得到最小回路为Cb 1S1(V 1,V 2,V 7,V 8,V 9,V 10,V 11,V 12,V 7,V 2,V 3,V 4,V 5,V 6,V 1)。 Step S400 will be described below. Referring to FIG. 8 for the first degradation map, first perform steps S410 to S440, set the second coordinate axis parallel to the x-axis, and the x-axis is parallel to <V 1 , V 2 > to obtain the second coordinate axis The vertex V 1 corresponding to the upper minimum value is the second starting point; with the second starting point V 1 as the second starting point, the second adjacent edges connected to V 1 are <V 1 , V 2 > and <V 1 , V 6 >; the calculated second rotation angles of the two second adjacent sides of vector V 1 V 2 and vector V 1 V 6 relative to the second reference line vector V 1 V 2 are α 21 and α 22 respectively, the first The two direction factors are K 21 and K 22 respectively; since α 2122 , it can be seen that the relationship between the two second direction factors is K 21 <K 22 , and <V 1 , V 2 > corresponding to K 21 is the second path . Go to step S450 again, update the end point V 2 of the second path <V 1 , V 2 > as the second starting point, and update the second path <V 1 , V 2 > as the second baseline, and obtain the updated two The two second adjacent edges are respectively <V 2 , V 3 > and <V 2 , V 7 >, and the updated two second adjacent edge vectors V 2 V 3 and V 2 V 7 are relative to the second baseline vector V 1 The second rotation angles of V 2 are α 23 and α 24 respectively, and the second direction factors are K 23 and K 24 respectively. It can be seen that their corresponding second direction factors are K 23 <K 24 , and the corresponding second direction factors of K 24 are obtained. The two adjacent edges <V 2 , V 7 > are the third path. Then proceed to step S460, update the end point of the third path <V 2 , V 7 > to the second starting point, and obtain the updated two second adjacent edges as <V 7 , V 8 > and <V 7 , V 12 >, the second rotation angles of the updated two second adjacent edge vectors V 7 V 8 and V 7 V 12 relative to the second reference line vector V 2 V 7 are α 25 and α 26 respectively, and the second direction factors are respectively K 25 and K 26 , it can be seen that the relationship between their corresponding second direction factors is K 25 >K 26 , and the second adjacent edge <V 7 , V 8 > corresponding to K 25 is the updated third path; repeat The above steps are performed until the end point corresponding to the updated third path coincides with the starting point V 1 of the second coordinate axis. Finally, step S470 is performed, and the minimum circuit obtained after connecting the second path and multiple third paths is Cb 1S1 (V 1 , V 2 , V 7 , V 8 , V 9 , V 10 , V 11 , V 12 , V 7 ,V 2 ,V 3 ,V 4 ,V 5 ,V 6 ,V 1 ).
可以理解的是,参考图6,步骤S500,根据最小回路和第一邻接矩阵,生成第二邻接矩阵及对应的第二退化图,包括:It can be understood that, referring to FIG. 6, step S500 generates a second adjacency matrix and a corresponding second degeneration map according to the minimum loop and the first adjacency matrix, including:
S510、根据最小回路,将每一第二路径对应的数值输入到第一邻接矩阵,得到中间邻接矩阵,其中,每遍历第二路径一次,第一邻接矩阵中对应第二路径的元素加1;S510. According to the minimum loop, input the value corresponding to each second path into the first adjacency matrix to obtain an intermediate adjacency matrix, wherein, each time the second path is traversed, the element corresponding to the second path in the first adjacency matrix is incremented by 1;
S520、根据中间邻接矩阵,删除中间邻接矩阵中数值为2的元素,生成第二邻接矩阵及对应的第二退化图,其中,第二退化图由第一退化图删除遍历两次的第二路径后得到。S520. According to the intermediate adjacency matrix, delete the element whose value is 2 in the intermediate adjacency matrix, and generate the second adjacency matrix and the corresponding second degenerate graph, wherein, the second degenerate graph deletes the second path traversed twice from the first degenerate graph after getting.
参考图8为第一退化图,在进行步骤S400后,最终能够得到第一退化图的最小回路为Cb 1S1(V 1,V 2,V 7,V 8,V 9,V 10,V 11,V 12,V 7,V 2,V 3,V 4,V 5,V 6,V 1),在进行不步骤S510时,以每遍历一次则对应元素加1的方式,将搜索得到的最小回路Cb 1S1输入到第一邻接矩阵中,得到中间邻接矩阵,其中最小回路Cb 1S1的部分路径与最大回路Cb 1的部分路径相同,这些路径对应中间邻接矩阵中元素的数值为2;在进行步骤S520时,删除中间邻接矩阵中数值为2的元素,删除第一退化图中对应中间邻接矩阵中数值为2的元素对应的路径,生成第二退化图,同时删除中间邻接矩阵中数值为2的元素,生成第二邻接矩阵。 Referring to FIG . 8 is the first degradation diagram. After performing step S400, the minimum circuit that can finally obtain the first degradation diagram is Cb 1S1 (V 1 , V 2 , V 7 , V 8 , V 9 , V 10 , V 11 , V 12 , V 7 , V 2 , V 3 , V 4 , V 5 , V 6 , V 1 ), when performing step S510, add 1 to the corresponding element each time it is traversed, and the searched minimum circuit Cb 1S1 is input into the first adjacency matrix to obtain an intermediate adjacency matrix, wherein the partial path of the smallest circuit Cb 1S1 is the same as the partial path of the largest circuit Cb 1 , and the value of the element in the corresponding intermediate adjacency matrix of these paths is 2; in step S520 When , delete the element whose value is 2 in the intermediate adjacency matrix, delete the path corresponding to the element whose value is 2 in the intermediate adjacency matrix in the first degenerate graph, generate the second degenerate graph, and delete the element whose value is 2 in the intermediate adjacency matrix , generating the second adjacency matrix.
将第二退化图更新为第一退化图,重新搜索得到最小回路,以生成更新后的第二邻接矩阵及对应的第二退化图,直至更新后的第二邻接矩阵退化为空,即第二邻接矩阵中的元素都为0,此时,可判断搜索得到最大回路Cb 1中的所有最小回路分别为Cb 1S1(V 1,V 2,V 7,V 8,V 9,V 10,V 11,V 12,V 7,V 2,V 3,V 4,V 5,V 6,V 1)、Cb 1S2(V 12,V 11,V 8,V 7,V 12)、Cb 1S3(V 11,V 10,V 9,V 8,V 11)和Cb 1S4(V 15,V 16,V 17,V 18,V 14,V 15)。 Update the second degenerate graph to the first degenerate graph, and re-search to obtain the minimum cycle to generate the updated second adjacency matrix and the corresponding second degenerate graph until the updated second adjacency matrix degenerates to empty, that is, the second The elements in the adjacency matrix are all 0. At this time, it can be judged that all the minimum circuits in the maximum circuit Cb 1 obtained by searching are Cb 1S1 (V 1 , V 2 , V 7 , V 8 , V 9 , V 10 , V 11 ,V 12 ,V 7 ,V 2 ,V 3 ,V 4 ,V 5 ,V 6 ,V 1 ), Cb 1S2 (V 12 ,V 11 ,V 8 ,V 7 ,V 12 ), Cb 1S3 (V 11 , V 10 , V 9 , V 8 , V 11 ) and Cb 1S4 (V 15 , V 16 , V 17 , V 18 , V 14 , V 15 ).
非连通图中只可能某个最大回路包含在大范围的最大回路中的某个最小回路中本文中,由于以下性质:一个最大会包含其内的所有最小回路,一个最大回路内的所有最小回路之间无包含关系,一个非连通图中的两个连通子图形成的回路可能存在包含关系。可知只有非连通图才存在回路间的包含关系,若某个非连通图中存在两个大小不同的连通子图即两个最大回路G(大)和H(小),若G和H存在包含关系,则
Figure PCTCN2022098768-appb-000001
假设H包含于G的两个或两个以上的最小回路中,则
Figure PCTCN2022098768-appb-000002
与G和H是非连通图中的两个连通子图矛盾;假设只有H的某个最小回路包含在G或G的最小回路中,则
Figure PCTCN2022098768-appb-000003
同上矛盾。故只有在非连通图中存在回路间的包含关系,且只有某个最大回路包含在某个最小回路中。
In a disconnected graph, it is only possible that a maximum circuit is contained in a minimum circuit in a large range of maximum circuits. In this paper, due to the following properties: a maximum will contain all the minimum circuits in it, and all the minimum circuits in a maximum circuit There is no inclusion relationship between them, and the circuit formed by two connected subgraphs in a disconnected graph may have an inclusion relationship. It can be seen that only non-connected graphs have containment relations between circuits. If there are two connected subgraphs of different sizes in a certain non-connected graph, that is, the two largest circuits G (large) and H (small), if G and H contain relationship, then
Figure PCTCN2022098768-appb-000001
Assuming that H is contained in two or more minimum circuits of G, then
Figure PCTCN2022098768-appb-000002
Contradicts that G and H are two connected subgraphs in a disconnected graph; assuming only a certain minimum circuit of H is contained in G or the minimum circuit of G, then
Figure PCTCN2022098768-appb-000003
Ditto contradictory. Therefore, there is an inclusion relationship between circuits only in a disconnected graph, and only a certain maximum circuit is contained in a certain minimum circuit.
可以理解的是,步骤S700之前,即根据最大回路和每一最小回路,得到建筑物户型图的分间结果之前,还包括以下步骤:It can be understood that, before step S700, that is, before obtaining the division result of the building floor plan according to the maximum loop and each minimum loop, the following steps are also included:
获取无向图的连通性;Get the connectivity of an undirected graph;
根据无向图的连通性,得到最大回路及最小回路之间的包含关系,其中,包含关系表征与分间结果的关联。According to the connectivity of the undirected graph, the containment relationship between the largest loop and the smallest loop is obtained, wherein the inclusion relationship represents the association with the partition result.
具体的,获取无向图的连通性包括以下步骤:Specifically, obtaining the connectivity of an undirected graph includes the following steps:
当第二邻接矩阵退化为空,获取对应的第二退化图;When the second adjacency matrix degenerates to be empty, obtain the corresponding second degenerate graph;
根据第二退化图,判断无向图的连通性,其中,当第二退化图为空图,无向图为连通图,当第二退化图为非空图,无向图为非连通图。Judging the connectivity of the undirected graph according to the second degenerated graph, wherein, when the second degenerated graph is an empty graph, the undirected graph is a connected graph, and when the second degenerated graph is a non-empty graph, the undirected graph is a disconnected graph.
可以理解的是,根据无向图的连通性,得到最大回路及最小回路之间的包含关系,包括以下步骤:It can be understood that, according to the connectivity of the undirected graph, obtaining the containment relationship between the largest loop and the smallest loop includes the following steps:
当无向图为连通图,最大回路为一个,得到每一最小回路均包含于最大回路中;When the undirected graph is a connected graph, the largest loop is one, and every smallest loop is included in the largest loop;
当无向图为非连通图,最大回路至少有两个,得到最大回路及最小回路之间的包含关系包括以下步骤:When the undirected graph is a disconnected graph, there are at least two maximum circuits, and obtaining the containment relationship between the maximum circuit and the minimum circuit includes the following steps:
将第二退化图更新为无向图,重新搜索得到最大回路及最小回路,直至更新后的第二邻接矩阵退化为空且第二退化图退化为空图;Updating the second degenerate graph to an undirected graph, and re-searching to obtain the maximum loop and the minimum loop, until the updated second adjacency matrix degenerates to empty and the second degenerate graph degenerates to an empty graph;
获取取值范围存在重叠的两个最大回路;Obtain the two largest loops whose value ranges overlap;
根据取值范围存在重叠的两个最大回路,得到取值范围小的最大回路为内部最大回路、取值范围大的最大回路为外部最大回路;According to the two largest loops with overlapping value ranges, the largest loop with a smaller value range is the inner largest loop, and the largest loop with a larger value range is the outer largest loop;
根据外部最大回路中的每一最小回路以及内部最大回路,筛选出与内部最大回路取值范围有重叠的最小回路为外包围最小回路,得到内部最大回路包含于外包围最小回路中。According to each smallest loop in the outer largest loop and the inner largest loop, the smallest loop that overlaps with the value range of the inner largest loop is selected as the outer surrounding smallest loop, and the inner largest loop is included in the outer surrounding smallest loop.
具体的,当无向图为非连通图,最大回路至少有两个,将第二退化图更新为无向图,重新 搜索得到最大回路及最小回路,直至更新后的第二邻接矩阵和第二退化图同时退化为空,得到每一最大回路及最小回路之后,还包括以下步骤:Specifically, when the undirected graph is a disconnected graph and there are at least two maximum circuits, the second degenerate graph is updated to an undirected graph, and the maximum and minimum circuits are obtained by re-searching until the updated second adjacency matrix and the second The degradation graph degenerates to empty at the same time, after obtaining each maximum loop and minimum loop, the following steps are also included:
1、计算某个最大回路的横坐标x和纵坐标y的取值范围(X min,X max)和(Y min,Y max),若
Figure PCTCN2022098768-appb-000004
Figure PCTCN2022098768-appb-000005
取{X min≤xCb i≤X max}和{X min≤xCb j≤X max}中取值范围小者进入下一步。
1. Calculate the value range (X min , X max ) and (Y min , Y max ) of the abscissa x and y coordinate y of a certain maximum loop, if
Figure PCTCN2022098768-appb-000004
and
Figure PCTCN2022098768-appb-000005
Choose the smaller value range among {X min ≤ xCb i ≤ X max } and {X min ≤ xCb j ≤ X max } to enter the next step.
2、假设{X min≤xCb j≤X max}取值范围较小,则计算最大回路Cb i的所有最小回路的x坐标和y坐标的取值范围,取
Figure PCTCN2022098768-appb-000006
Figure PCTCN2022098768-appb-000007
时的k值,即得到某个最大回路Cb j包含于最大回路Cb i的最小回路Cb is k,如图11中,最大回路Cb 2=(V 13,V 14,V 15,V 16,V 13)包含在Cb 1的最小回路Cb 1s 1=(V 1,V 2,V 10,V 9,V 12,V 6,V 7,V 8,V 1)中。
2. Assuming that the value range of {X min ≤ xCb j ≤ X max } is small, then calculate the value ranges of the x coordinates and y coordinates of all the minimum circuits of the largest circuit Cb i , taking
Figure PCTCN2022098768-appb-000006
and
Figure PCTCN2022098768-appb-000007
k value at the same time, that is, to obtain the minimum circuit Cb i s k of a certain maximum circuit Cb j included in the maximum circuit Cb i , as shown in Figure 11, the maximum circuit Cb 2 = (V 13 , V 14 , V 15 , V 16 , V 13 ) is included in the smallest circuit Cb 1 s 1 =(V 1 , V 2 , V 10 , V 9 , V 12 , V 6 , V 7 , V 8 , V 1 ) of Cb 1 .
3、重复步骤1和2,找到所有的回路间的包含关系。3. Repeat steps 1 and 2 to find the containment relationship between all circuits.
参考图7,无向图为连通图,因此其所有最小回路都包含于最大回路中。Referring to Figure 7, an undirected graph is a connected graph, so all its smallest circuits are contained in its largest circuits.
参考图12,无向图为非连通图,将第二退化图更新为无向图,重新搜索得到最大回路及其中的最小回路,直至更新后的第二邻接矩阵和第二退化图同时退化为空,得到所有的最大回路和最小回路。Referring to Figure 12, the undirected graph is a disconnected graph, update the second degenerated graph to an undirected graph, and re-search to obtain the largest loop and the smallest loop in it, until the updated second adjacency matrix and the second degenerated graph simultaneously degenerate into Empty to get all the maximum and minimum loops.
最大回路为:Cb 1=(V 1,V 2,V 3,V 4,V 5,V 6,V 7,V 8,V 9,V 20,V 1),Cb 2=(V 21,V 22,V 23,V 24,V 25,V 26,V 21)。 The maximum circuit is: Cb 1 = (V 1 , V 2 , V 3 , V 4 , V 5 , V 6 , V 7 , V 8 , V 9 , V 20 , V 1 ), Cb 2 = (V 21, V 22 , V 23 , V 24 , V 25 , V 26 , V 21 ).
全部最小回路分别为:房间1:Cb 1s 1=(V 1,V 2,V 12,V 11,V 10,V 16,V 9,V 20,V 1),房间2:Cb 1s 2=(V 11,V 12,V 17,V 16,V 10,V 11),房间5:Cb 1s 3=(V 2,V 3,V 13,V 12,V 2),房间4:Cb 1s 4=(V 12,V 13,V 14,V 17,V 12),房间3:Cb 1s 5=(V 17,V 14,V 15,V 16,V 17),房间8:Cb 1s 6=(V 16,V 15,V 14,V 18,V 6,V 7,V 8,V 19,V 8,V 9,V 16),房间6:Cb 1s 7=(V 3,V 4,V 18,V 14,V 13,V 3),房间7:Cb 1s 8=(V 4,V 5,V 6,V 18,V 4),房间9:Cb 2s 1=(V 21,V 22,V 25,V 26,V 21),房间10:Cb 2s 2=(V 22,V 23,V 24,V 25,V 22)。 All the minimum circuits are: room 1: Cb 1 s 1 = (V 1 , V 2 , V 12 , V 11 , V 10 , V 16 , V 9 , V 20 , V 1 ), room 2: Cb 1 s 2 =(V 11 ,V 12 ,V 17 ,V 16 ,V 10 ,V 11 ), room 5: Cb 1 s 3 =(V 2 ,V 3 ,V 13 ,V 12 , V 2 ), room 4: Cb 1 s 4 = (V 12 , V 13 , V 14 , V 17 , V 12 ), room 3: Cb 1 s 5 = (V 17 , V 14 , V 15 , V 16 , V 17 ), room 8: Cb 1 s 6 =(V 16 ,V 15 ,V 14 ,V 18 ,V 6 ,V 7 ,V 8 ,V 19 ,V 8 ,V 9 ,V 16 ), room 6: Cb 1 s 7 =(V 3 ,V 4 ,V 18 ,V 14 ,V 13 ,V 3 ), room 7: Cb 1 s 8 =(V 4 ,V 5 ,V 6 ,V 18 ,V 4 ), room 9: Cb 2 s 1 = (V 21 , V 22 , V 25 , V 26 , V 21 ), room 10: Cb 2 s 2 = (V 22 , V 23 , V 24 , V 25 , V 22 ).
包含关系为Cb 2包含于Cb 1s 6。可以看出,无论房间是凸多边形或凹多边形,本发明的建筑物分间方法都能顺利的完成回路搜索,能够高效的完成建筑物在线实时分间。 The inclusion relationship is that Cb 2 is included in Cb 1 s 6 . It can be seen that no matter whether the room is a convex polygon or a concave polygon, the building division method of the present invention can successfully complete the loop search, and can efficiently complete the online real-time division of the building.
使用本发明的建筑物分间方法进行分间处理,无向图中的边一旦遍历两次则会被删除,由此可知,时间复杂度是无向图边数的两倍,即时间复杂度为O(E),其中E是无向图的边数。连通图内回路的包含关系明确,无需进行判断处理,包含关系的判断处理只针对非连通图,而非连通图中,只需比较回路顶点的横坐标和纵坐标的取值范围,故其时间复杂度为O(V),其中V是顶点个数。因此,总的时间复杂度是O(E)+O(V),能够有效确保本发明建筑物分间方法的分间效率。Using the building partition method of the present invention to carry out partition processing, once the edges in the undirected graph are traversed twice, they will be deleted. It can be seen from this that the time complexity is twice the number of edges in the undirected graph, that is, the time complexity is O(E), where E is the number of edges in the undirected graph. The containment relationship of the loop in the connected graph is clear, and no judgment processing is required. The judgment process of the containment relationship is only for the non-connected graph, not the connected graph. It only needs to compare the value ranges of the abscissa and ordinate of the loop vertices, so the time The complexity is O(V), where V is the number of vertices. Therefore, the total time complexity is O(E)+O(V), which can effectively ensure the partitioning efficiency of the building partitioning method of the present invention.
另外,本发明第二方面实施例还提供了一种电子设备,该电子设备包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序。In addition, the embodiment of the second aspect of the present invention also provides an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and operable on the processor.
处理器和存储器可以通过总线或者其他方式连接。The processor and memory can be connected by a bus or other means.
存储器作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序以及非暂态性计算机可执行程序。此外,存储器可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施方式中,存储器可选包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至该处理器。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。As a non-transitory computer-readable storage medium, memory can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the processor via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
实现上述第一方面实施例的建筑物分间方法所需的非暂态软件程序以及指令存储在存储器中,当被处理器执行时,执行上述实施例中的建筑物分间方法,例如,执行以上描述的方法步骤S100至S700、方法步骤S110至S120、方法步骤S210至S260、方法步骤S310至S320、方法步骤S410至S470、方法步骤S510至S520。The non-transitory software programs and instructions required to realize the building subdivision method of the embodiment of the first aspect above are stored in the memory, and when executed by the processor, the building subdivision method in the above embodiment is executed, for example, executing Method steps S100 to S700 , method steps S110 to S120 , method steps S210 to S260 , method steps S310 to S320 , method steps S410 to S470 , and method steps S510 to S520 described above.
以上所描述的设备实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可 以不是物理上分开的,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
此外,本发明的一个实施例还提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机可执行指令,该计算机可执行指令被一个处理器或控制器执行,例如,被上述设备实施例中的一个处理器执行,可使得上述处理器执行上述实施例中的建筑物分间方法,例如,执行以上描述的方法步骤S100至S700、方法步骤S110至S120、方法步骤S210至S260、方法步骤S310至S320、方法步骤S410至S470、方法步骤S510至S520。In addition, an embodiment of the present invention also provides a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by a processor or a controller, for example, by the above-mentioned Execution by a processor in the device embodiment can cause the above-mentioned processor to execute the building division method in the above-mentioned embodiment, for example, perform the above-described method steps S100 to S700, method steps S110 to S120, and method steps S210 to S260 , method steps S310 to S320, method steps S410 to S470, method steps S510 to S520.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统可以被实施为软件、固件、硬件及其适当的组合。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。Those skilled in the art can understand that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware and an appropriate combination thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit . Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). As known to those of ordinary skill in the art, the term computer storage media includes both volatile and nonvolatile media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules, or other data. permanent, removable and non-removable media. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, tape, magnetic disk storage or other magnetic storage devices, or can Any other medium used to store desired information and which can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示意性实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。In the description of this specification, references to the terms "one embodiment," "some embodiments," "exemplary embodiments," "example," "specific examples," or "some examples" are intended to mean that the implementation A specific feature, structure, material, or characteristic described by an embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
尽管已经示出和描述了本发明的实施例,本领域的普通技术人员可以理解:在不脱离本发明的原理和宗旨的情况下可以对这些实施例进行多种变化、修改、替换和变型,本发明的范围由权利要求及其等同物限定。Although the embodiments of the present invention have been shown and described, those skilled in the art can understand that various changes, modifications, substitutions and modifications can be made to these embodiments without departing from the principle and spirit of the present invention. The scope of the invention is defined by the claims and their equivalents.

Claims (10)

  1. 建筑物分间方法,其特征在于,包括如下步骤:The building partition method is characterized in that it comprises the steps of:
    获取建筑物户型图对应的无向图;Obtain the undirected graph corresponding to the floor plan of the building;
    根据所述无向图,搜索得到最大回路;According to the undirected graph, searching for the maximum loop;
    根据所述最大回路,生成第一邻接矩阵及对应的第一退化图;Generate a first adjacency matrix and a corresponding first degradation graph according to the maximum loop;
    根据所述第一退化图,搜索得到最小回路;According to the first degradation graph, searching for a minimum loop;
    根据所述最小回路和所述第一邻接矩阵,生成第二邻接矩阵及对应的第二退化图;generating a second adjacency matrix and a corresponding second degradation graph according to the minimum loop and the first adjacency matrix;
    将所述第二退化图更新为所述第一退化图,重新搜索得到所述最小回路,以生成更新后的所述第二邻接矩阵及对应的所述第二退化图,直至更新后的所述第二邻接矩阵退化为空;updating the second degenerate graph to the first degenerate graph, re-searching to obtain the minimum loop, to generate the updated second adjacency matrix and the corresponding second degenerate graph, until the updated all The second adjacency matrix degenerates into empty;
    根据所述最大回路和每一所述最小回路,得到所述建筑物户型图对应的分间结果。According to the largest loop and each of the smallest loops, the division result corresponding to the floor plan of the building is obtained.
  2. 根据权利要求1所述的建筑物分间方法,其特征在于,获取建筑物户型图对应的无向图,包括:The method for partitioning buildings according to claim 1, wherein obtaining the undirected graph corresponding to the floor plan of the building comprises:
    获取所述建筑物户型图;Obtain the floor plan of the building;
    根据所述建筑物户型图,生成所述无向图,其中,所述建筑物户型图的墙体投影中心线为所述无向图的边,所述建筑物户型图的墙体投影中心线的端点为所述无向图的顶点。Generate the undirected graph according to the building floor plan, wherein the wall projection centerline of the building floor plan is an edge of the undirected graph, and the wall projection centerline of the building floor plan The endpoints of are the vertices of the undirected graph.
  3. 根据权利要求1所述的建筑物分间方法,其特征在于,所述根据所述无向图,搜索得到最大回路,包括:The method for partitioning buildings according to claim 1, wherein said searching for the maximum loop according to said undirected graph includes:
    根据所述无向图,将第一坐标轴上的最大值或最小值对应的顶点作为第一起始点,其中,所述第一坐标轴为与x轴或y轴平行的轴线,所述第一坐标轴经过所述第一起始点;According to the undirected graph, the vertex corresponding to the maximum or minimum value on the first coordinate axis is used as the first starting point, wherein the first coordinate axis is an axis parallel to the x-axis or the y-axis, and the first The coordinate axis passes through the first starting point;
    以所述第一起始点为第一出发点,获取每一与所述第一出发点连接的第一邻接边;Taking the first starting point as a first starting point, acquiring each first adjacent edge connected to the first starting point;
    以所述第一坐标轴为第一基准线,计算每一所述第一邻接边对应的第一方向因子,其中,所述第一方向因子用于表示所述第一邻接边相对于所述第一基准线的第一旋转角关系;Using the first coordinate axis as a first reference line, calculate a first direction factor corresponding to each of the first adjacent sides, wherein the first direction factor is used to indicate that the first adjacent side is relative to the The first rotation angle relationship of the first reference line;
    比较每一所述第一方向因子,得到最小的所述第一方向因子对应的所述第一邻接边为第一路径;Comparing each of the first direction factors to obtain the first adjacent edge corresponding to the smallest first direction factor as the first path;
    将所述第一路径的终点更新为所述第一出发点,并将所述第一路径更新为所述第一基准线,直至更新后的所述第一路径的终点与所述第一起始点重合;updating the end point of the first path to the first starting point, and updating the first path to the first baseline until the updated end point of the first path coincides with the first starting point ;
    根据多个所述第一路径,得到所述最大回路。According to a plurality of the first paths, the maximum loop is obtained.
  4. 根据权利要求3所述的建筑物分间方法,其特征在于,所述根据所述最大回路,生成第一邻接矩阵及对应的第一退化图,包括:The method for partitioning buildings according to claim 3, wherein said generating a first adjacency matrix and a corresponding first degradation graph according to said maximum loop comprises:
    根据所述最大回路,将每一所述第一路径对应的数值输入到邻接矩阵,得到初始邻接矩阵,其中,所述邻接矩阵的初始值都为0,每遍历所述第一路径一次,所述邻接矩阵中对应所述第一路径的元素加1;According to the maximum loop, input the value corresponding to each of the first paths into the adjacency matrix to obtain an initial adjacency matrix, wherein, the initial values of the adjacency matrix are all 0, and each time the first path is traversed, the Adding 1 to the element corresponding to the first path in the adjacency matrix;
    根据所述初始邻接矩阵,删除所述初始邻接矩阵中数值为2的元素,生成所述第一邻接矩阵及对应的所述第一退化图,其中,所述第一退化图由所述无向图删除遍历两次的所述第一路径后得到。According to the initial adjacency matrix, delete the element whose value is 2 in the initial adjacency matrix, generate the first adjacency matrix and the corresponding first degraded graph, wherein the first degraded graph is formed by the undirected The graph is obtained after deleting the first path traversed twice.
  5. 根据权利要求1所述的建筑物分间方法,其特征在于,所述根据所述第一退化图,搜索得到最小回路,包括:The method for partitioning buildings according to claim 1, wherein the searching for the smallest loop according to the first degradation map includes:
    根据所述第一退化图,将第二坐标轴上的最大值或最小值对应的顶点作为第二起始点,其中,所述第二坐标轴为与x轴或y轴平行的轴线,所述第二坐标轴经过所述第二起始点;According to the first degradation diagram, the vertex corresponding to the maximum or minimum value on the second coordinate axis is used as the second starting point, wherein the second coordinate axis is an axis parallel to the x-axis or the y-axis, and the the second coordinate axis passes through the second starting point;
    以所述第二起始点为第二出发点,获取每一与所述第二出发点连接的第二邻接边;Taking the second starting point as a second starting point, acquiring each second adjacent edge connected to the second starting point;
    以所述第二坐标轴为第二基准线,计算每一所述第二邻接边对应的第二方向因子,其中, 所述第二方向因子用于表示所述第二邻接边相对于所述第二基准线的第二旋转角关系;Using the second coordinate axis as a second reference line, calculate a second direction factor corresponding to each of the second adjacent sides, wherein the second direction factor is used to indicate that the second adjacent side is relative to the The second rotation angle relationship of the second reference line;
    比较每一所述第二方向因子,得到最小的所述第二方向因子对应的所述第二邻接边为第二路径;Comparing each of the second direction factors to obtain the second adjacent edge corresponding to the smallest second direction factor as the second path;
    将所述第二路径的终点更新为所述第二出发点,并将所述第二路径更新为所述第二基准线,得到最大的所述第二方向因子对应的所述第二邻接边为第三路径;updating the end point of the second path to the second starting point, and updating the second path to the second reference line, and obtaining the second adjacent edge corresponding to the largest second direction factor is third path;
    将所述第三路径的终点更新为所述第二出发点,直至更新后的所述第三路径的终点与所述第二起始点重合;updating the end point of the third path to the second starting point until the updated end point of the third path coincides with the second starting point;
    根据所述第二路径和多个所述第三路径,得到所述最小回路。The minimum loop is obtained according to the second path and the plurality of third paths.
  6. 根据权利要求5所述的建筑物分间方法,其特征在于,根据所述最小回路和所述第一邻接矩阵,生成第二邻接矩阵及对应的第二退化图,包括:The method for partitioning buildings according to claim 5, wherein, according to the minimum loop and the first adjacency matrix, a second adjacency matrix and a corresponding second degradation map are generated, including:
    根据所述最小回路,将每一所述第二路径对应的数值输入到所述第一邻接矩阵,得到中间邻接矩阵,其中,每遍历所述第二路径一次,所述第一邻接矩阵中对应所述第二路径的元素加1;According to the minimum loop, the value corresponding to each second path is input into the first adjacency matrix to obtain an intermediate adjacency matrix, wherein, each time the second path is traversed, the corresponding value in the first adjacency matrix adding 1 to the elements of the second path;
    根据所述中间邻接矩阵,删除所述中间邻接矩阵中数值为2的元素,生成所述第二邻接矩阵及对应的所述第二退化图,其中,所述第二退化图由所述第一退化图删除遍历两次的所述第二路径后得到。According to the intermediate adjacency matrix, delete the elements whose value is 2 in the intermediate adjacency matrix to generate the second adjacency matrix and the corresponding second degraded graph, wherein the second degraded graph is formed by the first The degradation graph is obtained after deleting the second path traversed twice.
  7. 根据权利要求6所述的建筑物分间方法,其特征在于,所述根据所述最大回路和每一所述最小回路,得到所述建筑物户型图的分间结果之前,还包括:The building division method according to claim 6, wherein, before obtaining the division result of the building floor plan according to the maximum loop and each minimum loop, it also includes:
    获取所述无向图的连通性;Obtain the connectivity of the undirected graph;
    根据所述无向图的连通性,得到所述最大回路及所述最小回路之间的包含关系,其中,所述包含关系表征与所述分间结果的关联。According to the connectivity of the undirected graph, an inclusion relationship between the largest loop and the smallest loop is obtained, wherein the inclusion relationship represents an association with the segmentation result.
  8. 根据权利要求7所述的建筑物分间方法,其特征在于,所述根据所述无向图的连通性,得到所述最大回路及所述最小回路之间的包含关系,包括:The method for partitioning a building according to claim 7, wherein the inclusion relationship between the largest loop and the smallest loop is obtained according to the connectivity of the undirected graph, including:
    当所述无向图为连通图,所述最大回路为一个,得到每一所述最小回路均包含于所述最大回路中;When the undirected graph is a connected graph, the maximum loop is one, and each of the minimum loops is included in the maximum loop;
    当所述无向图为非连通图,所述最大回路至少有两个,所述得到所述最大回路及所述最小回路之间的包含关系包括以下步骤:When the undirected graph is a disconnected graph, and there are at least two maximum circuits, the obtaining the inclusion relationship between the maximum circuit and the minimum circuit includes the following steps:
    将所述第二退化图更新为所述无向图,重新搜索得到所述最大回路及所述最小回路,直至更新后的所述第二邻接矩阵和所述第二退化图同时退化为空;updating the second degenerate graph to the undirected graph, re-searching to obtain the maximum loop and the minimum loop, until the updated second adjacency matrix and the second degradation graph degenerate to empty at the same time;
    获取取值范围存在重叠的两个所述最大回路;Obtaining the two largest loops whose value ranges overlap;
    根据所述取值范围存在重叠的两个所述最大回路,得到取值范围小的所述最大回路为内部最大回路、取值范围大的所述最大回路为外部最大回路;According to the two maximum loops with overlapping value ranges, it is obtained that the maximum loop with a small value range is an internal maximum loop, and the maximum loop with a large value range is an external maximum loop;
    根据所述外部最大回路中的每一所述最小回路以及所述内部最大回路,筛选出与所述内部最大回路取值范围有重叠的所述最小回路为外包围最小回路,得到所述内部最大回路包含于所述外包围最小回路中。According to each of the minimum circuits in the external maximum circuit and the internal maximum circuit, the minimum circuit that overlaps with the value range of the internal maximum circuit is selected as the outer enclosing minimum circuit, and the internal maximum circuit is obtained. A loop is included in the outer enclosing minimum loop.
  9. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如权利要求1至8中任意一项所述的建筑物分间方法。A memory, a processor, and a computer program stored on the memory and operable on the processor, when the processor executes the computer program, the building according to any one of claims 1 to 8 is realized Partition method.
  10. 一种计算机存储介质,其特征在于,存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1至8中任意一项所述的建筑物分间方法。A computer storage medium, which is characterized in that it stores computer executable instructions, and the computer executable instructions are used to execute the building subdivision method according to any one of claims 1 to 8.
PCT/CN2022/098768 2021-12-09 2022-06-14 Building partitioning method, electronic device, and computer storage medium WO2023103320A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111500409.6 2021-12-09
CN202111500409.6A CN114386138B (en) 2021-12-09 2021-12-09 Building division method, electronic device and computer storage medium

Publications (1)

Publication Number Publication Date
WO2023103320A1 true WO2023103320A1 (en) 2023-06-15

Family

ID=81196530

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/098768 WO2023103320A1 (en) 2021-12-09 2022-06-14 Building partitioning method, electronic device, and computer storage medium

Country Status (2)

Country Link
CN (1) CN114386138B (en)
WO (1) WO2023103320A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114386138B (en) * 2021-12-09 2023-03-28 五邑大学 Building division method, electronic device and computer storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008091958A2 (en) * 2007-01-23 2008-07-31 Mental Images, Gmbh Terminating spatial partition hierarchies by a priori bounding memory
CN102663499A (en) * 2012-03-11 2012-09-12 西安电子科技大学 Network community division method based on simulated annealing genetic algorithm
CN111382805A (en) * 2020-04-02 2020-07-07 贝壳技术有限公司 Method, electronic device, and medium for processing house type vector data of house
CN114386138A (en) * 2021-12-09 2022-04-22 五邑大学 Building division method, electronic device and computer storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10191998B1 (en) * 2016-09-13 2019-01-29 The United States of America, as represented by the Director, National Security Agency Methods of data reduction for parallel breadth-first search over graphs of connected data elements
CN110319845B (en) * 2018-03-30 2024-01-09 日本电气株式会社 Method, device and system for determining reachable path between two points
CN111832844A (en) * 2020-07-31 2020-10-27 上海同普电力技术有限公司 AGV shortest path planning method and device and computer readable storage medium
CN113256029A (en) * 2021-06-23 2021-08-13 合肥量圳建筑科技有限公司 In-building path finding method, device, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008091958A2 (en) * 2007-01-23 2008-07-31 Mental Images, Gmbh Terminating spatial partition hierarchies by a priori bounding memory
CN102663499A (en) * 2012-03-11 2012-09-12 西安电子科技大学 Network community division method based on simulated annealing genetic algorithm
CN111382805A (en) * 2020-04-02 2020-07-07 贝壳技术有限公司 Method, electronic device, and medium for processing house type vector data of house
CN114386138A (en) * 2021-12-09 2022-04-22 五邑大学 Building division method, electronic device and computer storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
FU ZHI HONG, YU JI HUI ,SU XIANG FENG: "The Algorithm of Searching out the Least and Most Loops by Making Use of Direction Factor", JOURNAL OF CHONGQING UNIVERSITY(NATURAL SCIENCE EDITION), vol. 25, no. 3, 30 March 2002 (2002-03-30), pages 64 - 67, 71, XP093069741 *

Also Published As

Publication number Publication date
CN114386138B (en) 2023-03-28
CN114386138A (en) 2022-04-22

Similar Documents

Publication Publication Date Title
US20200210821A1 (en) Data processing method, device, electronic device and readable storage medium
Salinas et al. Structure‐aware mesh decimation
TW201939366A (en) Recommendation system construction method and device
WO2023103320A1 (en) Building partitioning method, electronic device, and computer storage medium
CN112902970B (en) Routing inspection path planning method and routing inspection robot
WO2020107326A1 (en) Lane line detection method, device and computer readale storage medium
CN111814235A (en) Parking space arrangement optimization and polygon simplification method, device, equipment and storage medium
WO2017107865A1 (en) Image retrieval system, server, database, and related method
CN111460234A (en) Graph query method and device, electronic equipment and computer readable storage medium
WO2018184305A1 (en) Group search method based on social network, device, server and storage medium
CN111102980B (en) Path generation method and device and electronic equipment
WO2022056955A1 (en) Uncertain graph-based community discovery method
CN105678844B (en) One kind is based on atural object scattered points increased profile construction method point by point
CN111159577A (en) Community division method and device, storage medium and electronic device
CN111161289A (en) Method, device and computer program product for improving contour precision of object in image
CN105677843A (en) Method for automatically obtaining attribute of four boundaries of parcel
US8762898B1 (en) Double patterning aware routing without stitching
CN111680376B (en) Method, device and system for constructing polygon by line elements
CN111643906A (en) Information processing method and device and computer readable storage medium
CN114648618B (en) Indoor space three-dimensional topological relation construction method and system
US20230385337A1 (en) Systems and methods for metadata based path finding
CN116091365B (en) Triangular surface-based three-dimensional model notch repairing method, triangular surface-based three-dimensional model notch repairing device, triangular surface-based three-dimensional model notch repairing equipment and medium
CN115512065B (en) Real-time map construction method and device based on blocking large-scale scene
WO2023198088A1 (en) Method and apparatus for determining pose of robot, and robot and storage medium
CN115457394A (en) Road network center line generation method and device based on road topology adaptive search

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22902758

Country of ref document: EP

Kind code of ref document: A1