Database of labelled simple graphs on $n$-vertices?

123 Views Asked by At

Recently for fun, I have been doing some computational experiments in maple with graphs and have suddenly desired a collection of labelled simple graphs on $n$-vertices. I am aware of Brenden Mckay's collection of unlabelled simple graphs and his program geng but have not found something similar for labelled graphs. I imagine it would only be tractable for smaller numbers of vertices but I am still interested.

In theory, it should be a much simpler problem to generate labelled graphs on $n$ vertices but for some reason, I can't think of how to effectively program it in maple. (Any hints in this direction would also be much appreciated.)

1

There are 1 best solutions below

7
On

For completeness, @MishaLavrov has a solution (below), which with slight modification gives the labeled graphs:

Graph[Range[n], #, VertexLabels->Automatic] & /@ Subsets[UndirectedEdge @@@ Subsets[Range[n], {2}]]

So if n=3 we get

enter image description here

Moreover, Mathematica has a curated database of graphs (GraphData[]), with excellent tools for creating and classifying them:

enter image description here

Here's just a list of the graph classes:

{"Acyclic", "AlmostHamiltonian", "AlternatingGroup", "Andrasfai", "Antelope", "Antiprism", "Apex", "Apollonian", "Archimedean", "ArchimedeanDual", "ArcTransitive", "Arrangement", "Asymmetric", "BananaTree", "Barbell", "Beineke", "Bicolorable", "Biconnected", "Bicubic", "Bipartite", "BipartiteKneser", "Bishop", "BlackBishop", "Book", "Bouwer", "Bridged", "Bridgeless", "Cactus", "Cage", "Caterpillar", "Caveman", "Cayley", "Centipede", "Chang", "Chordal", "Chordless", "ChromaticallyNonunique", "ChromaticallyUnique", "Circulant", "Class1", "Class2", "ClawFree", "CocktailParty", "Complete", "CompleteBipartite", "CompletelyRegular", "CompleteTree", "CompleteTripartite", "Cone", "Conference", "Connected", "CriticalNonplanar", "CrossedPrism", "Crown", "CubeConnectedCycle", "Cubic", "Cycle", "Cyclic", "Cyclotomic", "DeterminedByResistance", "DeterminedBySpectrum", "Disconnected", "DistanceRegular", "DistanceTransitive", "Doob", "DutchWindmill", "EdgeTransitive", "Empty", "Eulerian", "Fan", "FibonacciCube", "Firecracker", "Fiveleaper", "FoldedCube", "Forest", "Fullerene", "Fusene", "Gear", "GeneralizedPetersen", "GeneralizedPolygon", "Grid", "Haar", "Hadamard", "Halin", "HalvedCube", "HamiltonConnected", "HamiltonDecomposable", "Hamiltonian", "HamiltonLaceable", "Hamming", "Hanoi", "Harary", "Helm", "HoneycombToroidal", "HStarConnected", "Hypercube", "Hypohamiltonian", "Hypotraceable", "Identity", "IGraph", "Imperfect", "Incidence", "Integral", "Johnson", "Keller", "KempeCounterexample", "King", "Kneser", "Knight", "Kuratowski", "Ladder", "LadderRung", "LCF", "Line", "Lobster", "Local", "LocallyPetersen", "Lollipop", "Matchstick", "MaximallyNonhamiltonian", "Median", "MengerSponge", "Metelsky", "MoebiusLadder", "MongolianTent", "Moore", "Mycielski", "Noncayley", "Nonempty", "Noneulerian", "Nonhamiltonian", "Nonplanar", "Nonsimple", "NoPerfectMatching", "NotDeterminedByResistance", "NotDeterminedBySpectrum", "Nuciferous", "Octic", "Odd", "Ore", "Paley", "Pan", "Pancyclic", "Path", "Paulus", "Perfect", "PerfectMatching", "PermutationStar", "Planar", "Platonic", "Polyhedral", "Polyiamond", "Polyomino", "Prism", "Pseudoforest", "Pseudotree", "Quartic", "Queen", "Quintic", "Regular", "RegularPolychoron", "Rook", "RookComplement", "SelfComplementary", "SelfDual", "Semisymmetric", "Septic", "Sextic", "SierpinskiCarpet", "SierpinskiSieve", "SierpinskiTetrahedron", "Simple", "Snark", "Spider", "SquareFree", "StackedBook", "StackedPrism", "Star", "StronglyPerfect", "StronglyRegular", "Sun", "Sunlet", "Symmetric", "Tadpole", "Taylor", "Tetrahedral", "Toroidal", "TorusGrid", "Traceable", "Transposition", "Tree", "TriangleFree", "Triangular", "TriangularGrid", "TriangularHoneycombAcuteKnight", "TriangularHoneycombBishop", "TriangularHoneycombKing", "TriangularHoneycombObtuseKnight", "TriangularHoneycombQueen", "TriangularHoneycombRook", "Triangulated", "Tripod", "Turan", "TwoRegular", "Unicyclic", "UnitDistance", "Untraceable", "VertexTransitive", "WeaklyPerfect", "WeaklyRegular", "Web", "WellCovered", "Wheel", "WhiteBishop", "Windmill", "Wreath", "ZeroSymmetric", "ZeroTwo"}

And here's the labelling TriangularHoneycombAcuteKnight graph with 10 vertices (to take one of millions of examples).

enter image description here

And on and on and on and on....