Reputation: 51
I have two graphs G, H labeled and I want to extract all common subgraph of two graphs, I got to a part that is:
1 - extract all the nodes that are in common, but I'm stuck on the part that includes:
2 - Step 1: Take the First vertex and store it in a set P = {first element} (which will be the set of all common subgraph), and go to 2nd if it is adjacent to the first of the two P graph G and H, we add it, and so on, but I do not know how to do it when i have more than 2
Upvotes: 1
Views: 879
Reputation: 22690
That is a NP-complete problem. See http://en.wikipedia.org/wiki/Subgraph_isomorphism_problem
Upvotes: 2