Graph isomorphism is a well studied problem in computer science but there are no polynomial time algorithms known(there are some claims but none of them have been proven yet).
I have to test isomorphism of two graph but for my case the problem is slightly different. The size of the graph is less than, say 10 or 11, that is less number of vertices. There is no bound on the number of edges that is graph can be dense or sparse. The number of such pairwise testing(isomorphism checks) will be around 10^8.
If someone could suggest a few algorithms which are best suited for such a case. Also it would be great if algorithm can be parallelized.
Any help appreciated.
This answer relies on the fact that one of the two graphs will be the same for all of your isomorphism checks. There is a large variety of numbers you could compute for every node which are invariant under relabeling:
You can take your reference graph and compute several of these numbers for every node. With a bit of luck, you’ll find a set of functions which is not too costly to compute, and for which the resulting numbers will uniquely identify each node. You might even be able to hash these numbers down to a single number. In that case, you can process each input graph as follows: by computing these numbers and their hash for every node, you can quickly determine which node from the reference graph corresponds to each node of the input graph, if any. Once you have a one-to-one correspondence between nodes, checking whether all the edges fit is trivial.
If you don’t find a cheap enough set of functions that uniquely describe every node, I would expect that in most real world graphs (i.e. not specifically constructed for high symmetry), you would still obtain rather small equivalence classes, so checking for all possible permutations in each class might still be cheap enough for your application.
Just as an idea: if performance is a real issue here, you might even try to turn the result of your analysis into customized program code. So for every reference graph, you’d have your application compile a small piece of code which it can then load dynamically to perform these checks with all the power that compiler-optimized machine code can give you. Not sure whether that’s worth the effort, but I think it might be an interesting approach.
Highly symmetric graphs may require more work. You could try to identify isomorphisms of your graph up front. If, for example, you can interchange the labels of v1 and v2 without affecting the graph structure, then for every input graph you process, if you are unsure whether to map a given vertex to v1 or v2, you know that it doesn’t matter, so you don’t have to try both alternatives but can simply choose v1 arbitrarily. This greatly reducs the number of permutations you’ll have to check.