Graph Deck

Author

Eric W. Weisstein
May 24, 2026

This notebook downloaded from https://mathworld.wolfram.com/notebooks/GraphTheory/GraphDeck.nb.

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

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

Figure

edges = {1 <-> 2, 2 <-> 3, 3 <-> 4, 4 <-> 5, 2 <-> 5};

g0 = Graph[
  edges,
  GraphLayout -> "SpringElectricalEmbedding"
];

coords = AssociationThread[VertexList[g0], GraphEmbedding[g0]];

fixedGraph[graph_, label_, size_: 170] := Module[
  {verts = VertexList[graph], localCoords, xs, ys, pad = .18},
  localCoords = KeyTake[coords, verts];
  xs = localCoords[[All, 1]];
  ys = localCoords[[All, 2]];
  Graph[
    verts,
    EdgeList[graph],
    VertexCoordinates -> Normal[localCoords],
    VertexLabels -> "Name",
    PlotRange -> {{Min[xs] - pad, Max[xs] + pad}, {Min[ys] - pad, Max[ys] + pad}},
    ImagePadding -> 12,
    ImageSize -> size,
    PlotLabel -> Style[label, 16]
  ]
];

g = fixedGraph[g0, Style["G",Italic], 180];

cards = Table[
  fixedGraph[VertexDelete[g0, v], Row[{Style["G", Italic], " – ", v}], 160],
  {v, VertexList[g0]}
]

GraphicsGrid[Partition[Prepend[cards,g],UpTo[3]],Dividers->All,Alignment->Top,BaseStyle->InsetBoxOptions->{BaseStyle->Directive[LightDarkSwitched@Black,14,FontFamily->"Times"]}]