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 4⁢m⁢n−6⁢m−6⁢n+8 edges when m and n are both greater than 1, and zero edges otherwise.
with⁡GraphTheory:
with⁡SpecialGraphs:
R≔KnightsGraph⁡4,6
R≔Graph 1: an undirected graph with 24 vertices and 44 edge(s)
IsPlanar⁡R
false
ChromaticNumber⁡R
2
DrawGraph⁡R
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