Pancyclic

Author

Eric W. Weisstein
April 10, 2022

This notebook downloaded from http://mathworld.wolfram.com/notebooks/GraphTheory/PancyclicGraph.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/PancyclicGraph.html.

©2022 Wolfram Research, Inc. except for portions noted otherwise

Counts

All

A286684

Total[Boole[Get[#]]]&/@FileNames["*.m",FileNameJoin[{$GraphDataDirectory,"Nodes","Pancyclic"}]]

Length/@(pan=Table[Pick[ConnectedGraphs[n],PancyclicGraphQ/@ConnectedGraphs[n]],{n,10}])

%-Length/@Table[GraphData["Pancyclic",n],{n,10}]

Classes

GraphClassesThatAreClass["Pancyclic"]

Graphic

pan=Table[GraphData["Pancyclic",n],{n,5}];

Map[GraphData[#,"Notation"]&,pan,{2}]

GraphData["DiamondGraph","Notation"]//InputForm

GraphicsGrid[Flatten[Partition[#,UpTo[4]]&/@Map[Show[GraphData[#]/.g_System`Graph:>SetProperty[g,{VertexSize->If[VertexCount[g]==1,.03,{"Scaled",.09}],System`VertexStyle->Red,System`EdgeStyle->Black}],PlotLabel->TextCell[GraphData[#,"Name"],PageWidth->70,TextAlignment->Center],BaseStyle->{Italic,FontFamily->"Times"}]&,pan/.g_System`Graph:>ToEntity[g],{2}],1],ImageSize->400,Dividers->{{Thick,True,True,True,Thick},{Thick,Thick,Thick,True,Thick}}]

Hamiltonian but not Pancyclic

Complement@@GraphData/@{"Hamiltonian","Pancyclic"}

GraphData["Balaban10Cage",{"Hamiltonian","Pancyclic"}]

GraphData["Balaban10Cage","CyclePolynomial"]

Checks

Starting with 3-cycle

Monitor[DeleteCases[{g=#,GraphData[#,"Pancyclic"],PancyclicGraphQ[GraphData[#]]}&/@GraphData["Hamiltonian",;;10],{_,x_,x_}],g]//Timing

Monitor[DeleteCases[{g=#,GraphData[#,"Pancyclic"],PancyclicGraphQ[GraphData[#]]}&/@GraphData["Hamiltonian",;;15],{_,x_,x_}],g]//Timing

Total[Boole[PancyclicGraphQ/@Graphs[8]]]//Timing

Check Connected first

Total[Boole[PancyclicGraphQ/@Graphs[8]]]//Timing

Check Hamiltonian first

Monitor[DeleteCases[{g=#,GraphData[#,"Pancyclic"],PancyclicGraphQ[GraphData[#]]}&/@GraphData["Hamiltonian",;;10],{_,x_,x_}],g]//Timing

Monitor[DeleteCases[{g=#,GraphData[#,"Pancyclic"],PancyclicGraphQ[GraphData[#]]}&/@GraphData["Hamiltonian",;;15],{_,x_,x_}],g]//Timing

Total[Boole[PancyclicGraphQ/@Graphs[8]]]//Timing