# King's graph

King's graph
${\displaystyle 8\times 8}$ king's graph
Vertices${\displaystyle nm}$
Edges${\displaystyle 4nm-3(n+m)+2}$
Girth${\displaystyle 3}$ when ${\displaystyle \min(m,n)>1}$
Chromatic number${\displaystyle 4}$ when ${\displaystyle \min(m,n)>1}$
Chromatic index${\displaystyle 8}$ when ${\displaystyle \min(m,n)>2}$
Table of graphs and parameters

In graph theory, a king's graph is a graph that represents all legal moves of the king chess piece on a chessboard where each vertex represents a square on a chessboard and each edge is a legal move. More specifically, an ${\displaystyle n\times m}$ king's graph is a king's graph of an ${\displaystyle n\times m}$ chessboard.[1] It is the map graph formed from the squares of a chessboard by making a vertex for each square and an edge for each two squares that share an edge or a corner. It can also be constructed as the strong product of two path graphs.[2]

For an ${\displaystyle n\times m}$ king's graph the total number of vertices is ${\displaystyle nm}$ and the number of edges is ${\displaystyle 4nm-3(n+m)+2}$. For a square ${\displaystyle n\times n}$ king's graph, the total number of vertices is ${\displaystyle n^{2}}$ and the total number of edges is ${\displaystyle (2n-2)(2n-1)}$.[3]

The neighbourhood of a vertex in the king's graph corresponds to the Moore neighborhood for cellular automata.[4] A generalization of the king's graph, called a kinggraph, is formed from a squaregraph (a planar graph in which each bounded face is a quadrilateral and each interior vertex has at least four neighbors) by adding the two diagonals of every quadrilateral face of the squaregraph.[5]