184 J. Gosliga et al. Fig. 17.4 A sample subgraph of Fig.17.3 D A B E C contains all edges fromEturbine that have both endpoints in V1, G1 is an induced subgraph of Gturbine. For determining similarity between engineering structures, induced subgraphs are the only subgraphs of interest, since to preserve topology it is necessary to include all connections that exist within the two parent graphs when examining any sub-structures. In addition, only connected subgraphs will be considered, since in a structure, every part must be physically connected to at least one other part of the structure. The dictionary data type in Python is also used to store the properties from the IE representation as node and edge attributes. This datatype allows the graph-matching algorithm to easily query the attributes of a given node, since the node label can be used as a dictionary key. The organisation of the information for elements consists of using the element ID as the dictionary key, and the element attributes are stored as a list, with nested lists containing the geometrical and material attributes. For example the node attributes for the elements in Table 17.1 appear as: turbine.elements = {‘A’ : [‘FRP’, [‘Beam’, ‘Aerofoil’]], ‘B’ : [‘FRP’, [‘Beam’, ‘Aerofoil’]], ‘C’ : [‘FRP’, [‘Beam’, ‘Aerofoil’]], ‘D’ : [‘FRP’, [‘Complex’, ‘Rotor hub’]], ‘E’ : [‘FRP’, [‘Shell’, ‘Cuboid’]], ‘F’ : [‘Metal’, [‘Beam’, ‘Cylindrical’]], ‘G’ : [‘Metal’, [‘Beam’, ‘Cylindrical’]], ‘H’ : [‘Metal’, [‘Beam’, ‘Cylindrical’]], ‘I’ : [‘Concrete’, [‘Plate’, ‘Cylindrical’]], ‘1’ : [‘Ground’]} For edges, the label is exchanged with the element set. This is because when looking up edges in resulting subgraphs, the easiest way to query if an edge exists between node v1 and node v2 is to check whether (v1,v2) ∈ Eand so naturally edges are best labelled by their node pair. The coordinates and joint information (for the turbine joints in Table 17.3) is then organised in a similar fashion to the node attributes, where the hierachical information is contained within a nested list: turbine.joints = { (‘A’, ‘D’) : [‘1’, [8, 15, 235.75], [‘Bearing’, [‘x’, ‘y’, ‘z’], [‘y’, ‘z’]]], (‘B’, ‘D’) : [‘2’, [8, 14, 254], [‘Bearing’, [‘x’, ‘y’, ‘z’], [‘y’, ‘z’]]], (‘C’, ‘D’) : [‘3’, [8, 16, 254], [‘Bearing’, [‘x’, ‘y’, ‘z’], [‘y’, ‘z’]]], (‘D’, ‘E’) : [‘4’, [10, 15, 253], [‘Bearing’, [‘x’, ‘y’, ‘z’], [‘x’, ‘y’]]], (‘E’, ‘F’) : [‘5’, [15, 15, 250], [‘Bearing’, [‘x’, ‘y’, ‘z’], [‘x’, ‘y’]]], (‘F’, ‘G’) : [‘6’, [15, 15, 183], [‘Bolted’]], (‘G’, ‘H’) : [‘7’, [15, 15, 105], [‘Bolted’]], (‘H’, ‘I’) : [‘8’, [15, 15, 5], [‘Bolted’]], (‘I’, ‘1’) : [‘9’, [15, 15, 0], [‘Soil’]]} where the regular parentheses represent a tuple in Python. While organising the information in this way reduces the readability from a human perspective, it makes it easier for a graph-matching algorithm to search for node or edge attributes. Furthermore, there are no empty rows or columns when presented with an incomplete set of attributes. Given the set of nodes V and edges Efor a structure, it is possible to plot the graph using Python. Plotting the graphs is not necessary for graph comparison, but can aid in assessing whether or not the code is producing valid subgraphs. An example of the graphs produced using the Python code is shown in Fig. 17.5. From these two graphs of the turbine and
RkJQdWJsaXNoZXIy MTMzNzEzMQ==