Gray Configuration

Author

Eric W. Weisstein
May 22, 2026

This notebook downloaded from https://mathworld.wolfram.com/notebooks/Configurations/GrayConfiguration.nb.

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

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

Construction

27 points of a 3 × 3 × 3 grid and the 27 axis-parallel lines through these points

https://en.wikipedia.org/wiki/Gray_graph#Construction

The Gray graph can be constructed (Bouwer 1972) from the 27 points of a 3 × 3 × 3 grid and the 27 axis-parallel lines through these points

pts=GraphData[{"Grid",{3,3,3}},"VertexCoordinates3D"]

parallel=Pick[Subsets[pts,{3}],Total/@Boole/@Map[Equal@@@#&,Transpose/@Subsets[pts,{3}]],2]

lines=Sort[parallel/.Thread[pts->Range[Length[pts]]]]

GraphData["GrayGraph","Incidence"]

GraphData["GrayGraph","IncidenceLines"]

GraphData[{"Grid",{3,3,3}},"Graph",{"3D","Labeled"}]

g=LeviGraph[lines]

IsomorphicGraphQ[g,GraphData["GrayGraph"]]

RecognizeGraph@g

Configuration

GraphData["GrayConfigurationGraph","StandardName"]

Configuration

GraphData["GrayGraph","Incidence"]

lines=GraphData["GrayGraph","IncidenceLines"]

Subscript@@Reverse@Flatten@Tally[Length/@lines[[1]]]

RecognizeGraph[LeviGraph[#]]&/@lines

GraphData["GrayConfigurationGraph","#"]

configg=GraphData["GrayConfigurationGraph","Graph",{"3D","Configuration","Labeled"}][[1]]

lines2=Sort@ConfigurationLinesFromGraph[configg]

LeviGraph[lines2]//RecognizeGraph

points=GraphEmbedding[configg]

Includes diagonal lines:

eolines=ResourceFunction["FindExtraordinaryLines"][points]

Graphics3D[{AbsolutePointSize[5],Point[points],MapIndexed[Text[#2[[1]],#,{1,1}]&,points],LongestLine[points,#]&/@eolines},Boxed->False]

LeviGraph[eolines]

RecognizeGraph@%

ConfigurationGraph[points,lines2,VertexLabels->Automatic]

RecognizeGraph@%

ConfigurationDiagram[points,lines2,.5,Boxed->False,VertexLabels->None,Method->{"ShrinkWrap"->True}]