HammingGraph - Maple Help

GraphTheory[SpecialGraphs]

 HammingGraph
 construct Hamming graph

 Calling Sequence HammingGraph(d,q) HammingGraph(d,s)

Parameters

 d - positive integer q - positive integer s - string of distinct characters

Description

 • HammingGraph(d,q) returns the Hamming graph, an undirected graph whose vertices correspond to sequences of symbols of length d chosen from some alphabet of size q.
 • The graph has ${q}^{d}$ vertices, each of which corresponds to a sequence of the $q$ symbols of length $d$. Two vertices are connected if the corresponding sequences differ pairwise by a single symbol, that is, if their Hamming distance is 1.
 • HammingGraph(d,s) returns a Hamming graph equivalent to HammingGraph(d,length(s)) but whose vertices are strings of length q composed from the characters in s.
 • The graph is named for Richard Hamming.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $\mathrm{with}\left(\mathrm{SpecialGraphs}\right):$
 > $\mathrm{H32}≔\mathrm{HammingGraph}\left(3,2\right)$
 ${\mathrm{H32}}{≔}{\mathrm{Graph 1: an undirected graph with 8 vertices and 12 edge\left(s\right)}}$ (1)
 > $\mathrm{DrawGraph}\left(\mathrm{H32}\right)$
 > $\mathrm{H53}≔\mathrm{HammingGraph}\left(5,3\right)$
 ${\mathrm{H53}}{≔}{\mathrm{Graph 2: an undirected graph with 243 vertices and 1215 edge\left(s\right)}}$ (2)
 > $\mathrm{NumberOfEdges}\left(\mathrm{H53}\right)$
 ${1215}$ (3)

Compatibility

 • The GraphTheory[SpecialGraphs][HammingGraph] command was introduced in Maple 2023.