Grid Graph

DOWNLOAD Mathematica Notebook GridGraph

A two-dimensional grid graph, also known as a square grid graph, is an m×n lattice graph G_(m,n) that is the graph Cartesian product P_m square P_n of path graphs on m and n vertices.

Brouwer et al. (1989, p. 440) use the term "m×n grid" to refer to the line graph L(K_(m,n)) of the complete bipartite graph K_(m,n), known in this work as the rook graph K_m square K_n.

The grid graph G_(m,n) is implemented in the Wolfram Language as GridGraph[m, n, ...]. Precomputed properties for a number of grid graphs are available using GraphData[{"Grid", {m, ..., r, ...}}].

A grid graph P_m square P_n has mn vertices and (m-1)n+(n-1)m=2mn-m-n edges.

A grid graph is Hamiltonian if either the number of rows or columns is even (Skiena 1990, p. 148). Grid graphs are also bipartite (Skiena 1990, p. 148).

The numbers of directed Hamiltonian paths on the n×n grid graph for n=1, 2, ... are given by 1, 8, 40, 552, 8648, 458696, 27070560, ... (OEIS A096969). In general, the numbers of Hamiltonian paths on the m×n grid graph for fixed m are given by a linear recurrence.

The numbers of directed Hamiltonian cycles on the n×n grid graph for n=1, 2, ... are 0, 2, 0, 12, 0, 2144, 0, 9277152, ... (OEIS A143246). In general, the numbers of Hamiltonian cycles on the m×n grid graph for fixed m are given by a linear recurrence.

The numbers of (undirected) graph cycles on the n×n grid graph for n=1, 2, ... are 0, 1, 13, 213, 9349, 1222363, ... (OEIS A140517). In general the number c_k of k-cycles on the n×n grid graph is given by c_k=0 for k odd and by a quadratic polynomial in n for k even, with the first few being

c_4=(n-1)^2
(1)
c_6=2(n-1)(n-2)
(2)
c_8={0 for n<3; 7(n-2)^2-2 otherwise
(3)
c_(10)={0 for n<4; 4[7(n-3)^2+7(n-3)-1] otherwise
(4)
c_(12)={0 for n<4; 76 for n=4; 2(62n^2-370n+523) otherwise
(5)
c_(14)={0 for n<4; 32 for n=4; 1100 for n=5; 12(49n^2-338n+556) otherwise
(6)
c_(14)={0 for n<4; 6 for n=4; 2102 for n=5; 11144 for n=6; 2(1469n^2-11452n+21395) otherwise
(7)

(E. Weisstein, Nov. 16, 2014).

The domination number of P_m square P_n is given by

 gamma(P_m square P_n)=|_((m+2)(n+2))/5_|-4
(8)

for 16<=m<=n, as conjectured by Chang (1992), confirmed up to an additive constant by Guichard (2004), and proved by Gonçalves et al. (2011). Gonçalves et al. (2011) give a piecewise formula for m<16, but the expression given for n=16 is not correct in all cases. A correct formula for n=16 attributed to Hare appears as formula (6) in Chang and Clark (1993), which however then proceeds to give an incorrect reformulation as formula (14).

GridGraphsSpecial

A generalized grid graph can also be defined as G_(m,n,r,...)=P_m square P_n square P_r square .... A generalized grid graph has chromatic number 2, except the degenerate case of the singleton graph, which has chromatic number 1. Special cases are illustrated above and summarized in the table below.

grid graphspecial case
P_1 square P_npath graph P_n
P_2 square P_nladder graph L_n
P_2 square P_2square graph C_4
P_2 square P_3domino graph
P_2 square P_2 square P_2cubical graph Q_3
P_2 square ... square P_2_()_(n)hypercube graph Q_n

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.