GraphTheory[SpecialGraphs] - Maple Programming Help

Home : Support : Online Help : Mathematics : Discrete Mathematics : Graph Theory : GraphTheory Package : SpecialGraphs : GraphTheory/SpecialGraphs/GridGraph

GraphTheory[SpecialGraphs]

 GridGraph
 construct grid graph
 TorusGridGraph
 construct torus grid graph

 Calling Sequence GridGraph(m,n) TorusGridGraph(m,n)

Parameters

 m, n - positive integers

Description

 • The GridGraph(m,n) command creates the m by n grid graph on m*n vertices.
 • The TorusGridGraph(m,n) creates the m by n torus grid graph on m*n vertices.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$$\mathrm{with}\left(\mathrm{SpecialGraphs}\right):$
 > $G≔\mathrm{GridGraph}\left(5,3\right)$
 ${G}{≔}{\mathrm{Graph 1: an undirected unweighted graph with 15 vertices and 22 edge\left(s\right)}}$ (1)
 > $\mathrm{IsBipartite}\left(G\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{DrawGraph}\left(G\right)$
 > $H≔\mathrm{TorusGridGraph}\left(5,3\right):$
 > $\mathrm{IsBipartite}\left(H\right)$
 ${\mathrm{false}}$ (3)
 > $\mathrm{DrawGraph}\left(H\right)$