GraphTheory[SpecialGraphs]
KnightsGraph
construct knight's graph
Calling Sequence
Parameters
Description
Examples
Compatibility
KnightsGraph(m,n)
m, n
-
positive integers
The KnightsGraph(m,n) command creates the m by n knight's graph on m*n vertices. This is the bipartite graph which represents all legal moves of the knight chess piece on an m by n chessboard.
An m by n knight's graph has 4mn−6m−6n+8 edges when m and n are both greater than 1, and zero edges otherwise.
withGraphTheory:
withSpecialGraphs:
R≔KnightsGraph4,6
R≔Graph 1: an undirected graph with 24 vertices and 44 edge(s)
IsPlanarR
false
ChromaticNumberR
2
DrawGraphR
The GraphTheory[SpecialGraphs][KnightsGraph] command was introduced in Maple 2021.
For more information on Maple 2021 changes, see Updates in Maple 2021.
See Also
BishopsGraph
ChromaticNumber
IsPlanar
KingsGraph
QueensGraph
RooksGraph
SpecialGraphs
Download Help Document