I want a data structure where the keys are polyhedra (undirected 3-connected planar graphs; in my case they will probably mostly be <30 vertices), looked up such that equality is isomorphism. Is there an efficient way to implement this mapping?
I’ve researched and reflected a bit but have not come up with a solution. It seems like the solution is likely to be one of
-
A custom data structure that uses the graph itself to look up the data
-
A binary search tree (or other similar tree), which would require a well-defined ordering. (I have my doubts that such an ordering exists)
-
A hash table, which would require a good hash. I cannot immediately come up with one any better than “number of vertices” or similar.
How can I get efficient lookup?
Every polyhedral graph is planar. The isomorphism problem for planar graphs is polynomial time. It doesn’t have the unknown-but-thought-to-be-large complexity of the general graph isomorphism problem. Although efficient, the algorithms are not simple and rely on some fairly deep mathematics for their analysis.
The original paper (insofar as I know) is Hopcroft’s 1971 paper An N log N Algorithm for Isomorphism of Planar Triply Connected Graphs, available from Stanford as a scanned copy. There’s a fair amount of work on this problem. A more recent paper is Algorithm and Experiments in Testing Planar Graphs for Isomorphism which has the virtue of a number of references to existing algorithms and running time comparisons between them. This paper presents an algorithm that assigns a unique code to each graph, which incidentally also generates a well-defined ordering. Their best results in that paper for small graphs was the algorithm of Brendan McKay in Practical Graph Isomorphism.