GraphTheory[SpecialGraphs]
GridGraph
construct grid graph
TorusGridGraph
construct torus grid graph
Calling Sequence
Parameters
Description
Examples
GridGraph(m,n)
TorusGridGraph(m,n)
m, n
-
positive integers
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.
with⁡GraphTheory:with⁡SpecialGraphs:
G≔GridGraph⁡5,3
G≔Graph 1: an undirected graph with 15 vertices and 22 edge(s)
IsBipartite⁡G
true
DrawGraph⁡G
H≔TorusGridGraph⁡5,3:
IsBipartite⁡H
false
DrawGraph⁡H
See Also
SpecialGraphs
Download Help Document