Method for recommending residential building function relationship graph based on graph similarity and graph edit distance

By establishing a residential functional relationship diagram database based on graph similarity and graph edit distance, the problems of time-consuming and laborious drawing and inaccurate recommendations are solved, and diversified functional relationship diagram recommendations are realized, thereby improving the work efficiency of architects.

CN117633267BActive Publication Date: 2026-07-07CHONGQING UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHONGQING UNIV
Filing Date
2023-11-21
Publication Date
2026-07-07

Smart Images

  • Figure CN117633267B_ABST
    Figure CN117633267B_ABST
Patent Text Reader

Abstract

The application discloses a residential building function relationship graph recommendation method based on graph similarity and graph edit distance, and comprises the following steps: 1) establishing a residential function relationship graph database; 2) obtaining a function relationship graph input by a user; 4) obtaining a function relationship graph to be matched; 5) searching for residential function relationship graphs with the same number of vertices as the function relationship graph to be matched, and respectively calculating the similarity between the function relationship graph to be matched and the residential function relationship graphs; 6) based on the similarity, arranging the searched residential function relationship graphs in descending order, and then calculating the graph edit distance between the function relationship graph to be matched and the residential function relationship graphs; 7) based on the graph edit distance, arranging the searched residential function relationship graphs in ascending order, and selecting K residential function relationship graphs as recommended residential function relationship graphs. The application realizes the recommendation of the residential building function relationship graph, the recommended scheme is accurate and diverse, can be used in various building auxiliary design software, and has high portability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of functional relationship diagram recommendation technology, specifically a method for recommending residential building functional relationship diagrams based on graph similarity and graph edit distance. Background Technology

[0002] Architectural function diagrams are abstract descriptions of a building's functional attributes and their spatial relationships. They are commonly used in architectural concept design and guide subsequent layout design, making them an indispensable tool for architects. Currently, the construction industry is moving towards intelligent and automated systems, and many intelligent building layout generation methods use architectural function diagrams as input. These methods, supplemented by architect-drawn function diagrams, can quickly generate a large number of architectural schemes, significantly improving architects' productivity. However, drawing architectural function diagrams typically requires architects to have extensive experience and knowledge. Furthermore, drawing multiple function diagrams that meet specific needs is time-consuming and laborious. Currently, there is no systematic solution for efficiently matching desired function diagrams from a large dataset and recommending them to architects.

[0003] Therefore, it is necessary to develop a functional relationship graph recommendation algorithm that provides accurate recommendations and diverse options. Summary of the Invention

[0004] The purpose of this invention is to provide a method for recommending residential building function relationship diagrams based on graph similarity and graph edit distance, comprising the following steps:

[0005] 1) Establish a database of residential functional relationship diagrams;

[0006] 2) Obtain the functional relationship diagram of user input, and perform input detection and missing completion;

[0007] 3) Select the matching method for the functional relationship diagram, and process the functional relationship diagram after missing parts are filled in step 3) according to the matching method to obtain the functional relationship diagram to be matched;

[0008] 4) Retrieve residential function relationship graphs with the same number of vertices as the functional relationship graph to be matched in the residential function relationship graph database, and calculate the similarity between the functional relationship graph to be matched and these residential function relationship graphs respectively;

[0009] 5) Based on similarity, the retrieved residential function relationship diagrams are sorted in descending order, and then the graph edit distance between the function relationship diagram to be matched and the residential function relationship diagram is calculated;

[0010] 6) Based on the graph edit distance, sort the retrieved residential function relationship diagrams in ascending order, and select K residential function relationship diagrams as recommended residential function relationship diagrams.

[0011] Furthermore, the residential function relationship diagram database includes multiple coded residential function relationship diagrams; in the residential function relationship diagrams, the vertices of functional areas are encoded with integers, and spatial relationships are encoded with 0-1.

[0012] The residential functional relationship diagram is an undirected graph, in which functional areas are represented as vertices, the spatial relationships between functional areas are represented as edges, and the number of vertices in the functional relationship diagram is called the order.

[0013] The functional area vertices include the master bedroom vertices, secondary bedroom vertices, living room vertices, kitchen vertices, master bathroom vertices, secondary bathroom vertices, balcony vertices, study vertices, and storage room vertices.

[0014] The edges in the residential function relationship diagram include door edges that are connected and wall edges that are adjacent.

[0015] Furthermore, the input detection includes vertex detection; if the user-input functional relationship graph is missing a core functional point, then the missing core functional point is filled in; the core functional point type is pre-stored in the residential functional relationship graph database.

[0016] Furthermore, the input detection also includes edge detection; taking the living room vertex as the central vertex, if there is a core functional area vertex that is not connected to the living room vertex by a door, then the missing door connection is automatically filled; the core functional area type is pre-stored in the residential function relationship graph database.

[0017] Furthermore, the matching methods include equal-order matching, decreasing-order matching, and increasing-order matching;

[0018] When the matching method is equal-order matching, processing the missing and filled functional relationship diagram in step 3) means: using the missing and filled functional relationship diagram as the functional relationship diagram to be matched.

[0019] When the matching method is reduced-order matching, the processing of the missing and filled functional relationship graph in step 3) means: randomly reducing d1 vertices of non-core functional partitions in the missing and filled functional relationship graph, and using the reduced functional relationship graph as the functional relationship graph to be matched.

[0020] When the matching method is incremental matching, processing the missing and filled functional relationship graph in step 3) means: randomly adding d2 vertices of non-core functional partitions to the missing and filled functional relationship graph, and using the added functional relationship graph as the functional relationship graph to be matched.

[0021] Furthermore, the similarity between the functional relationship diagram to be matched and the residential functional relationship diagram is shown below:

[0022] S(A I A d ) = Swall (A Iw A dw )+S door (A Id A wd (1)

[0023]

[0024]

[0025] Among them, A Iw A represents the wall-edge adjacency matrix of the functional relationship graph to be matched. Id A represents the gate-edge adjacency matrix of the functional relationship graph to be matched; dw A represents the wall-edge adjacency matrix of the functional relationship graph in the database. dd S(A) represents the gate-edge adjacency matrix of the functional relationship graph in the database, ⊙ represents the element-wise product of the matrices, n represents the dimension of the matrix, and S(A) represents the gate-edge adjacency matrix of the functional relationship graph in the database. I A d S represents the overall similarity. wall (A Iw A dw S represents the similarity between the walls. door (A Id A dd The ) indicates the similarity of the door edges.

[0026] Furthermore, the graph edit distance is shown below:

[0027]

[0028] Among them, G I G represents a functional relationship diagram representing user input. S This represents the functional relationship graph after similarity ranking, c(e i ) indicates the editing action e i The cost function, Indicates G I Transform to G S The set of all edit paths, D(G) I G S ) represents the path with the minimum total cost among all fully edited paths; editing operations include door-edge insertion, door-edge deletion, door-edge replacement, wall-edge insertion, wall-edge deletion, wall-edge replacement, vertex insertion, vertex deletion, and vertex replacement.

[0029] A residential building function relationship graph recommendation system based on graph similarity and graph edit distance includes a database module, a user input module, a graph detection module, a user selection module, a multi-level matching module, a graph similarity calculation module, a graph edit distance calculation module, and a ranking recommendation module;

[0030] The database module encodes and stores functional relationship diagram data;

[0031] The user input module is used to convert and encode the functional relationship diagram of user input.

[0032] The graph detection module is used to detect and process the functional relationship graph input by the user; the user selection module is used for the user to select the matching method.

[0033] The multi-level matching module processes the functional relationship diagram according to the matching method selected by the user;

[0034] The graph similarity calculation module is used to calculate the similarity between the user-input functional relationship graph and the functional relationship graph processed by matching method.

[0035] The graph edit distance calculation module is used to calculate the graph edit distance between the user-input functional relationship graph and the functional relationship graph after graph similarity ranking;

[0036] The sorting and recommendation module is used to sort the matching results and recommend them to the user.

[0037] A computer-readable storage medium storing a program for generating a residential building function relationship graph recommendation method based on graph similarity and graph edit distance;

[0038] When the processor executes the generation program for the residential building function relationship graph recommendation method based on graph similarity and graph edit distance, the method for recommending residential building function relationship graphs based on graph similarity and graph edit distance is implemented.

[0039] A computer device includes a computer-readable storage medium, a processor, and a program stored in the computer-readable storage medium for generating a residential building function relationship graph recommendation method based on graph similarity and graph edit distance;

[0040] When the processor executes the program for generating the residential building function relationship graph recommendation method based on graph similarity and graph edit distance, it implements the residential building function relationship graph recommendation method based on graph similarity and graph edit distance.

[0041] The technical effectiveness of this invention is undeniable. This invention decomposes the functional relationship graph into vertices and edges, and implements recommendations based on graph similarity and graph edit distance for functional relationship graphs composed of vertices of the master bedroom, secondary bedroom, living room, kitchen, master bathroom, secondary bathroom, balcony, study, storage room, walls, and doors. This solves the problems of difficult functional relationship graph retrieval, inaccurate recommendations, and time-consuming and laborious drawing. It achieves accurate and diverse functional relationship graph recommendations, improving the architect's work efficiency and enhancing the user experience. Attached Figure Description

[0042] Figure 1 This is a flowchart illustrating a method for recommending residential building functional relationship graphs based on graph similarity and graph edit distance, according to an embodiment of the present invention.

[0043] Figure 2 This is a structural composition diagram of a residential building function relationship graph recommendation system based on graph similarity and graph edit distance, as described in an embodiment of the present invention. Detailed Implementation

[0044] The present invention will be further described below with reference to embodiments, but it should not be construed that the scope of the present invention is limited to the following embodiments. Various substitutions and modifications made based on ordinary technical knowledge and common practices in the art without departing from the above-described technical concept of the present invention should be included within the scope of protection of the present invention.

[0045] Example 1:

[0046] See Figures 1 to 2 A method for recommending residential building function relationship graphs based on graph similarity and graph edit distance includes the following steps:

[0047] 1) Establish a database of residential functional relationship diagrams;

[0048] Based on the number of vertices in the residential function relationship diagram, the residential function relationship diagrams in the database are classified, thereby constructing multiple sets of function relationship diagrams of different orders;

[0049] 2) Obtain the functional relationship diagram of user input, and perform input detection and missing completion;

[0050] 3) Select the matching method for the functional relationship diagram, and process the functional relationship diagram after missing parts are filled in step 3) according to the matching method to obtain the functional relationship diagram to be matched;

[0051] 4) Based on the set of functional relationship graphs, retrieve residential functional relationship graphs with the same number of vertices as the functional relationship graph to be matched in the residential functional relationship graph database, and calculate the similarity between the functional relationship graph to be matched and these residential functional relationship graphs respectively.

[0052] 5) Based on similarity, the retrieved residential function relationship diagrams are sorted in descending order, and then the graph edit distance between the function relationship diagram to be matched and the residential function relationship diagram is calculated;

[0053] 6) Based on the graph edit distance, sort the retrieved residential function relationship diagrams in ascending order, and select K residential function relationship diagrams as recommended residential function relationship diagrams.

[0054] Example 2:

[0055] The method for recommending residential building functional relationship diagrams based on graph similarity and graph edit distance is the same as in Embodiment 1. Furthermore, the residential functional relationship diagram database includes multiple encoded residential functional relationship diagrams; in the residential functional relationship diagrams, the vertices of functional areas are encoded with integers, and spatial relationships are encoded with 0-1.

[0056] Example 3:

[0057] The method for recommending residential building functional relationship diagrams based on graph similarity and graph edit distance is the same as any one of embodiments 1-2. Further, the residential functional relationship diagram is an undirected graph, wherein functional areas are represented as vertices, the spatial relationship between functional areas is represented as edges, and the number of vertices in the functional relationship diagram is called the order.

[0058] The functional area vertices include the master bedroom vertices, secondary bedroom vertices, living room vertices, kitchen vertices, master bathroom vertices, secondary bathroom vertices, balcony vertices, study vertices, and storage room vertices.

[0059] The edges in the residential function relationship diagram include door edges that are connected and wall edges that are adjacent.

[0060] Example 4:

[0061] The method for recommending residential building functional relationship diagrams based on graph similarity and graph edit distance is the same as any one of embodiments 1-3. Further, the input detection includes vertex detection; if the user-input functional relationship diagram is missing core functional points, then the missing core functional points are filled in; the types of the core functional points are pre-stored in the residential functional relationship diagram database.

[0062] Example 5:

[0063] The method for recommending residential building functional relationship graphs based on graph similarity and graph edit distance is the same as any one of embodiments 1-4. Furthermore, the input detection also includes edge detection; taking the living room vertex as the center vertex, if there is a core functional area vertex that is not connected to the living room vertex by a door, the missing door connection is automatically filled; the core functional area type is pre-stored in the residential functional relationship graph database.

[0064] Example 6:

[0065] The method for recommending residential building functional relationship diagrams based on graph similarity and graph edit distance is the same as any one of embodiments 1-5. Furthermore, the matching method includes equal-order matching, reduced-order matching, and increased-order matching.

[0066] When the matching method is equal-order matching, processing the missing and filled functional relationship diagram in step 3) means: using the missing and filled functional relationship diagram as the functional relationship diagram to be matched.

[0067] When the matching method is reduced-order matching, the processing of the missing and filled functional relationship graph in step 3) means: randomly reducing d1 vertices of non-core functional partitions in the missing and filled functional relationship graph, and using the reduced functional relationship graph as the functional relationship graph to be matched.

[0068] When the matching method is incremental matching, processing the missing and filled functional relationship graph in step 3) means: randomly adding d2 vertices of non-core functional partitions to the missing and filled functional relationship graph, and using the added functional relationship graph as the functional relationship graph to be matched.

[0069] Example 7:

[0070] The method for recommending residential building function relationship diagrams based on graph similarity and graph edit distance is the same as any one of embodiments 1-6. Further, the similarity between the function relationship diagram to be matched and the residential function relationship diagram is as follows:

[0071] S(A I A d ) = S wall (A Iw A dw )+S door (A Id A dd (1)

[0072]

[0073]

[0074] Among them, A Iw A represents the wall-edge adjacency matrix of the functional relationship graph to be matched. Id A represents the gate-edge adjacency matrix of the functional relationship graph to be matched; dw A represents the wall-edge adjacency matrix of the functional relationship graph in the database. dd S(A) represents the gate-edge adjacency matrix of the functional relationship graph in the database, ⊙ represents the element-wise product of the matrices, n represents the dimension of the matrix, and S(A) represents the gate-edge adjacency matrix of the functional relationship graph in the database. I A d S represents the overall similarity. wall (A Iw A dw S represents the similarity between the walls. door (A Id A dd The ) indicates the similarity of the door edges.

[0075] Example 8:

[0076] The method for recommending residential building function relationship diagrams based on graph similarity and graph edit distance is the same as any one of embodiments 1-7. Further, the graph edit distance is as follows:

[0077]

[0078] Among them, G I G represents a functional relationship diagram representing user input. S This represents the functional relationship graph after similarity ranking, c(e i ) indicates the editing action e i The cost function, Indicates G I Transform to G S The set of all edit paths, D(G) I G S ) represents the path with the minimum total cost among all fully edited paths; editing operations include door-edge insertion, door-edge deletion, door-edge replacement, wall-edge insertion, wall-edge deletion, wall-edge replacement, vertex insertion, vertex deletion, and vertex replacement.

[0079] Example 9:

[0080] A residential building function relationship graph recommendation system based on graph similarity and graph edit distance includes a database module, a user input module, a graph detection module, a user selection module, a multi-level matching module, a graph similarity calculation module, a graph edit distance calculation module, and a ranking recommendation module;

[0081] The database module encodes and stores functional relationship diagram data;

[0082] The user input module is used to convert and encode the functional relationship diagram of user input.

[0083] The graph detection module is used to detect and process the functional relationship graph input by the user; the user selection module is used for the user to select the matching method.

[0084] The multi-level matching module processes the functional relationship diagram according to the matching method selected by the user;

[0085] The graph similarity calculation module is used to calculate the similarity between the user-input functional relationship graph and the functional relationship graph processed by matching method.

[0086] The graph edit distance calculation module is used to calculate the graph edit distance between the user-input functional relationship graph and the functional relationship graph after graph similarity ranking;

[0087] The sorting and recommendation module is used to sort the matching results and recommend them to the user.

[0088] When the residential building function relationship graph recommendation system based on graph similarity and graph edit distance is working, it performs the steps of the method described in any one of Examples 1-8.

[0089] Example 10:

[0090] A computer-readable storage medium storing a program for generating a residential building function relationship graph recommendation method based on graph similarity and graph edit distance;

[0091] When the generator program for the residential building function relationship graph recommendation method based on graph similarity and graph edit distance is executed by the processor, it implements the residential building function relationship graph recommendation method based on graph similarity and graph edit distance of any one of embodiments 1-8.

[0092] Example 11:

[0093] A computer device includes a computer-readable storage medium, a processor, and a program stored in the computer-readable storage medium for generating a residential building function relationship graph recommendation method based on graph similarity and graph edit distance;

[0094] When the generator program for the residential building function relationship graph recommendation method based on graph similarity and graph edit distance is executed by the processor, it implements the residential building function relationship graph recommendation method based on graph similarity and graph edit distance of any one of embodiments 1-8.

[0095] Example 12:

[0096] A method for recommending residential building function relationship diagrams based on graph similarity and graph edit distance includes the following steps:

[0097] 1) Establish a residential functional relationship diagram database. The residential functional relationship diagram is described using basic graph theory concepts. The functional relationship diagram is an undirected graph, with functional areas represented as vertices and spatial relationships between functional areas represented as edges. The number of vertices in the functional relationship diagram is called its order. The functional area vertices of a residential building include the master bedroom vertex, secondary bedroom vertex, living room vertex, kitchen vertex, master bathroom vertex, secondary bathroom vertex, balcony vertex, study vertex, and storage room vertex. Spatial relationships between functional areas in a residential building include door edges (connected relationships) and wall edges (adjacent relationships).

[0098] Integer encoding is used to encode the vertices of functional areas. 0-1 encoding is used to encode spatial relationships; a value of 1 represents two vertices if there is an edge between them, and 0 represents two vertices if there is no edge. Vertex sets, door edge sets, and wall edge sets are constructed for the building function relationship diagram. A large number of residential function relationship diagrams are collected, encoded using the above method, and stored in a database.

[0099] 2) Divide the residential functional relationship diagram database. Process the residential functional relationship diagram database by classifying the functional relationship diagrams in the database according to the number of vertices, forming multiple sets of functional relationship diagrams of different orders.

[0100] 3) Perform input detection on the user-input data. User input data falls into three categories: first, a graph where every vertex has a connected vertex; second, a disconnected graph with one or more pairs of disconnected vertices and at least one edge; and third, a zero graph with only vertices and no edges. Input detection is divided into vertex detection and edge detection.

[0101] 4) First, vertex detection is performed on the user-input functional relationship diagram. The building functional relationship diagram must contain some main functional vertices. Different types of buildings can have different main functional vertices. Taking a residential functional relationship diagram as an example, it must contain one kitchen vertex, one bedroom vertex, one toilet vertex, and one living room vertex; these vertices are the main functional vertices. If any of the above main functional vertices are missing, the missing vertices will be automatically filled in, and the algorithm will then proceed to the next step based on the filled-in functional relationship diagram.

[0102] 5) Subsequently, edge detection is performed on the user-input functional relationship graph. Residential functional relationship graphs typically use the living room vertex as the central vertex, and all major functional areas are connected to the living room vertex via doors. Therefore, the connection set is checked; if any major functional area vertex has no door connection to the living room vertex, the missing door connection will be automatically filled in. Vertices of non-major functional areas will not have their connections automatically filled in.

[0103] 6) Users select the matching method for the functional relationship diagram. Three matching methods are available: equal-order matching, decreasing-order matching, and increasing-order matching. Multiple matching methods can be selected simultaneously to provide more diverse functional relationship diagram solutions.

[0104] Level matching is used to match functional relationship graphs with the same number of vertices as the input.

[0105] When the number of input vertices is large, reduced-order matching can be selected. Reduced-order matching matches functional relational graphs with fewer vertices than the input. The reduction order can be set; for example, setting the reduction order to one will match functional relational graphs with one fewer vertex than the input. When set to reduced-order matching, vertices of non-primary functional partitions of the set order are automatically and randomly reduced from the input functional relational graph.

[0106] When the number of input vertices is small, incremental matching can be selected. Incremental matching matches functional relationship graphs with more vertices than the input. The increment can be set; for example, setting the increment to one will match functional relationship graphs with one more vertex than the input. When set to incremental matching, non-primary functional partition vertices of the set increment will be automatically and randomly added to the input functional relationship graph.

[0107] 7) After the user selects a matching method, the input functional relationship graph is processed according to that method. If multiple matching methods are selected, each method is saved and calculated separately. A graph of equal order to the processed functional relationship graph is retrieved from the database for similarity calculation. The similarity is calculated using the adjacency matrix of the input data and the database data, using the following formula:

[0108] S(A I A d ) = S wall (A Iw A dw )+S door (A Id A dd )

[0109]

[0110]

[0111] Where A Iw A represents the adjacency matrix of the walls in the user input function relationship graph. Id A represents the adjacency matrix of the gate edges in the user input function relationship graph. dw A represents the adjacency matrix of the walls in the database functional relationship graph. dd Let S represent the adjacency matrix of the gate edges in the database functional relationship graph, ⊙ represent the element-wise product of the matrices, n represent the dimension of the matrix, and S represent the total similarity. wall S represents the similarity between the walls. door This indicates the similarity of the door edges.

[0112] 8) Sort the results according to the similarity calculation, with those having higher similarity first and those having lower similarity last.

[0113] 9) Calculate the graph edit distance based on the similarity-sorted functional relationship graph. If multiple matching methods are selected, save each method separately and calculate the distance accordingly. The graph edit distance is calculated using the input data and the similarity ranking results, using the following formula:

[0114]

[0115] Among them G I G represents a functional relationship diagram representing user input. S This represents a functional relationship graph after similarity ranking, where 'c' represents the editing action 'e'. i The cost function, Indicates G I Transform to G s The set of all edit paths, D(G) I G SThe path with the minimum total cost among all fully edited paths is represented by (). Editing actions include door-edge insertion, door-edge deletion, door-edge replacement, wall-edge insertion, wall-edge deletion, wall-edge replacement, vertex insertion, vertex deletion, and vertex replacement. The cost of each editing operation is 1 by default. If the number of edits exceeds a threshold, the graph will not be sorted.

[0116] 10) Sort the results based on the distance calculation of the graph, with the fewest edits first and the highest edits last.

[0117] 11) Based on the set K value, group the data according to the set matching method to form a TOP-K list, and recommend the functional relationship diagram to the user.

Claims

1. A method for recommending residential building function relationship diagrams based on graph similarity and graph edit distance, characterized in that, Includes the following steps: Step 1) Establish a residential function relationship diagram database; Step 2) Obtain the functional relationship diagram of user input, and perform input detection and missing completion; Step 3) Select the matching method for the functional relationship diagram, and process the functional relationship diagram after missing parts are filled in in Step 2) according to the matching method to obtain the functional relationship diagram to be matched; Step 4) Based on retrieving residential function relationship graphs from the residential function relationship graph database that have the same number of vertices as the functional relationship graph to be matched, calculate the similarity between the functional relationship graph to be matched and these residential function relationship graphs respectively; Step 5) Based on similarity, sort the retrieved residential function relationship diagrams in descending order, and then calculate the graph edit distance between the function relationship diagram to be matched and the residential function relationship diagram; Step 6) Based on the graph edit distance, sort the retrieved residential function relationship diagrams in ascending order, and select K residential function relationship diagrams as recommended residential function relationship diagrams; The similarity between the functional relationship diagram to be matched and the residential functional relationship diagram is shown below: (1) (2) (3) in, This represents the wall-edge adjacency matrix of the functional relationship graph to be matched. This represents the door-edge adjacency matrix of the functional relationship graph to be matched; This represents the wall-edge adjacency matrix of the functional relationship graph in the database. This represents the door-edge adjacency matrix of the functional relationship graph in the database. Represents the element-wise product of matrices. Represents the dimension of the matrix. Indicates the overall similarity. Indicates the similarity between the walls. Indicates the similarity of the door edges; The image editing distance is shown below: (4) in, A diagram representing the functional relationships of user input. A graph showing the functional relationships after similarity ranking. Indicates editing action The cost function, Indicates will Transform to The collection of all edit paths, This represents the path with the minimum total cost among all fully edited paths; editing operations include door-edge insertion, door-edge deletion, door-edge replacement, wall-edge insertion, wall-edge deletion, wall-edge replacement, vertex insertion, vertex deletion, and vertex replacement.

2. The residential building function relationship diagram recommendation method based on graph similarity and graph edit distance according to claim 1, characterized in that, The residential function relationship diagram database includes multiple coded residential function relationship diagrams; in the residential function relationship diagrams, the vertices of functional areas are encoded with integers, and spatial relationships are encoded with 0-1; The residential functional relationship diagram is an undirected graph, in which functional areas are represented as vertices, the spatial relationships between functional areas are represented as edges, and the number of vertices in the functional relationship diagram is called the order. The functional area vertices include the master bedroom vertices, secondary bedroom vertices, living room vertices, kitchen vertices, master bathroom vertices, secondary bathroom vertices, balcony vertices, study vertices, and storage room vertices. The edges in the residential function relationship diagram include door edges that are connected and wall edges that are adjacent.

3. The residential building function relationship diagram recommendation method based on graph similarity and graph edit distance according to claim 1, characterized in that, The input detection includes vertex detection; if the user-input functional relationship diagram is missing a core functional point, then the missing core functional point is filled in; the core functional point type is pre-stored in the residential functional relationship diagram database.

4. The residential building function relationship diagram recommendation method based on graph similarity and graph edit distance according to claim 3, characterized in that, The input detection also includes edge detection; taking the living room vertex as the central vertex, if there is a core functional area vertex that is not connected to the living room vertex by a door, the missing door connection is automatically filled; the core functional area type is pre-stored in the residential function relationship graph database.

5. The residential building function relationship diagram recommendation method based on graph similarity and graph edit distance according to claim 1, characterized in that, The matching methods include equal-order matching, decreasing-order matching, and increasing-order matching. When the matching method is equal-order matching, processing the missing and filled functional relationship diagram in step 3) means: using the missing and filled functional relationship diagram as the functional relationship diagram to be matched. When the matching method is reduced-order matching, the processing of the missing and filled functional relationship graph in step 3) means: randomly reducing d1 vertices of non-core functional partitions in the missing and filled functional relationship graph, and using the reduced functional relationship graph as the functional relationship graph to be matched. When the matching method is incremental matching, processing the missing and filled functional relationship graph in step 3) means: randomly adding d2 vertices of non-core functional partitions to the missing and filled functional relationship graph, and using the added functional relationship graph as the functional relationship graph to be matched.

6. A residential building function relationship graph recommendation system based on graph similarity and graph edit distance, characterized in that: It includes a database module, a user input module, a graph detection module, a user selection module, a multi-level matching module, a graph similarity calculation module, a graph edit distance calculation module, and a ranking and recommendation module; The database module encodes and stores functional relationship diagram data; The user input module is used to convert and encode the functional relationship diagram of user input. The graph detection module is used to detect and process the functional relationship graph to be matched input by the user; the user selection module is used for the user to select the matching method; The multi-level matching module processes the functional relationship graph to be matched according to the matching method selected by the user; The graph similarity calculation module is used to calculate the similarity between the user-inputted functional relationship graph to be matched and the residential functional relationship graph processed according to the matching method. The graph edit distance calculation module is used to calculate the graph edit distance between the user-input function relationship graph to be matched and the residential function relationship graph after graph similarity ranking; The sorting and recommendation module is used to sort the matching results and recommend them to the user. The similarity between the functional relationship diagram to be matched and the residential functional relationship diagram is shown below: (1) (2) (3) in, This represents the wall-edge adjacency matrix of the functional relationship graph to be matched. This represents the door-edge adjacency matrix of the functional relationship graph to be matched; This represents the wall-edge adjacency matrix of the functional relationship graph in the database. This represents the door-edge adjacency matrix of the functional relationship graph in the database. Represents the element-wise product of matrices. Represents the dimension of the matrix. Indicates the overall similarity. Indicates the similarity between the walls. Indicates the similarity of the door edges; The image editing distance is shown below: (4) in, A diagram representing the functional relationships of user input. A graph showing the functional relationships after similarity ranking. Indicates editing action The cost function, Indicates will Transform to The collection of all edit paths, This represents the path with the minimum total cost among all fully edited paths; editing operations include door-edge insertion, door-edge deletion, door-edge replacement, wall-edge insertion, wall-edge deletion, wall-edge replacement, vertex insertion, vertex deletion, and vertex replacement.

7. A computer-readable storage medium, characterized in that: It stores a program for generating a method for recommending residential building function relationship graphs based on graph similarity and graph edit distance; When the generator program for the residential building function relationship graph recommendation method based on graph similarity and graph edit distance is executed by the processor, it implements the residential building function relationship graph recommendation method based on graph similarity and graph edit distance as described in any one of claims 1-5.

8. A computer device, characterized in that: The invention includes a computer-readable storage medium, a processor, and a program stored in the computer-readable storage medium for generating a residential building function relationship graph recommendation method based on graph similarity and graph edit distance; When the generator program for the residential building function relationship graph recommendation method based on graph similarity and graph edit distance is executed by the processor, it implements the residential building function relationship graph recommendation method based on graph similarity and graph edit distance as described in any one of claims 1-5.