BishopsGraph - Maple Help

GraphTheory[SpecialGraphs]

 BishopsGraph
 construct bishop's graph

 Calling Sequence BishopsGraph(m,n)

Parameters

 m, n - positive integers

Description

 • The BishopsGraph(m,n) command creates the m by n bishop's graph on m*n vertices. This is the bipartite graph which represents all legal moves of the bishop chess piece on an m by n chessboard.
 • An m by n bishop's graph has $4mn-6m-6n+8$ edges when m and n are both greater than 1, and zero edges otherwise.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $\mathrm{with}\left(\mathrm{SpecialGraphs}\right):$
 > $B≔\mathrm{BishopsGraph}\left(4,6\right)$
 ${B}{≔}{\mathrm{Graph 1: an undirected graph with 24 vertices and 52 edge\left(s\right)}}$ (1)
 > $\mathrm{IsPlanar}\left(B\right)$
 ${\mathrm{false}}$ (2)
 > $\mathrm{IsConnected}\left(B\right)$
 ${\mathrm{false}}$ (3)

The two connected components of the bishop's graph correspond to the squares reachable by the white bishop and the black bishop.

 > $\mathrm{ConnectedComponents}\left(B\right)$
 $\left[\left[{"1:1"}{,}{"1:3"}{,}{"1:5"}{,}{"2:2"}{,}{"2:4"}{,}{"2:6"}{,}{"3:1"}{,}{"3:3"}{,}{"3:5"}{,}{"4:2"}{,}{"4:4"}{,}{"4:6"}\right]{,}\left[{"1:2"}{,}{"1:4"}{,}{"1:6"}{,}{"2:1"}{,}{"2:3"}{,}{"2:5"}{,}{"3:2"}{,}{"3:4"}{,}{"3:6"}{,}{"4:1"}{,}{"4:3"}{,}{"4:5"}\right]\right]$ (4)
 > $\mathrm{DrawGraph}\left(B\right)$

Compatibility

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