The version of my Mathematica is 10. I generate a connected graph with 9 vertices, but find that it is not included in Mathematica.
adjm = {{0, 1, 0, 0, 1, 0, 0, 0, 1}, {1, 0, 1, 0, 0, 0, 0, 1, 0}, {0, 1, 0,
1, 0, 0, 0, 1, 0}, {0, 0, 1, 0, 1, 1, 0, 0, 0}, {1, 0, 0, 1, 0, 1,
0, 0, 0}, {0, 0, 0, 1, 1, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 1,
1}, {0, 1, 1, 0, 0, 0, 1, 0, 0}, {1, 0, 0, 0, 0, 0, 1, 0, 0}};
g1 = AdjacencyGraph[adjm];
(*generate the graph g1*)
ori2 = GraphData[9];
set2 = GraphData[#] & /@ ori2;
set3 = Select[set2, ConnectedGraphQ[#] == True &];
IsomorphicGraphQ[g1, #] & /@ (set3)
(*generate all the graphs with 9 vertices, select the connected ones and check if g1 is there*)
The output is a list of False
.
If I have missed something. Then the question is how to get the database of all connected graphs with 9 vertices?
GraphData[9]
will return all possible graphs on 9 vertices. I do not see why this should be so. It is just a non-exhaustive graph database, don't assume it contains everything. $\endgroup$IsomorphicGraphQ
to filter duplicates. Not to say it's impossible with smarter methods (it probably is), but how to do it seems hard enough that I'd say it's a math question first, and a Mathematica question only once you have a strategy in mind ... $\endgroup$