Reputation: 157
I have two graphs G1 and G2, which are not isomorphic. I need to make a new graph G1' such that, with the minimum changes in G1, it will have the nodes of both G1 as well as G2. For example, let's say there is a node n1 in G1 with three connecting nodes n11, n12, n13. If now a 'corresponding' node n2 in G2 has 5 nodes n21, n22, n23, n24, n25, then n1' in G1' also needs to have five nodes n11', n12', n13', n14', n15'. The first three copied from G1 and the two extra nodes which will have value of the last of the three. The tree emanating from the extra nodes will be either entirely newly created or will comprise some extra nodes from G1 that haven't got equivalent nodes in G2 (are not 'exhausted' in some sense).
The problems are 1) finding the most suitable seed as the starting point so that the starting views are as much similar as possible 2) Building the tree from the extra nodes keeping the added node count to the minimum
Edit:
I will try to explain this further with the help of an illustration. My knowledge of graph theory is very superficial, so please excuse me if something sounds silly.
I broadly want to obtain a graph which, with the minimum number of node manipulations, can take the form of one of the two non-isomorphic source graphs.
In the example above graph G' can take two forms G or H with some amount pf node shuffling.
1) To make it G, we keep all the orange nodes at their position. The dotted nodes will 'merge' to their neighboring nodes. So B21' will have the value of A21 and will be at the same position (dissolving the corresponding edges). Likewise will happen with the pairs B31'-A31, B14'-A15 B25'-B23, A32'-A22 and A23'-A32. With this configuration the graph would resembles G completely, without any edges 'sticking out'
2) To make it isomorphic with H, A11 and A12, will take the values of A13, A32 and A32' that of A23, A23' that of A22. The dotted nodes will 'come out' of their merged positions.
The problem is to find G'. Maybe there is no ready graph operation or the solution is impossible, but any pointer to achieve this with any degree of approximation and efficiency is most welcome.
NB: The starting nodes A1 and B1 are arbitrary. First half of the problem is identifying these nodes so that the views are as much similar as possible.
Upvotes: 0
Views: 352
Reputation: 1785
This is at least as hard as the graph isomorphism problem which is currently not known to be solvable in polynomial time. As such, you should not expect to be able to find an efficient algorithm for your problem.
The correspondence is straightforward to see because if G1
and G2
were in fact isomorphic, you would have G1' = G1
, so an algorithm which solves this problem could be used to solve the graph isomorphism problem.
Upvotes: 2