Function Repository Resource:

# GeneralizedGridGraph

Generates a generalized version of GridGraph

Contributed by: Max Piskunov
 ResourceFunction["GeneralizedGridGraph"][{spec1,spec2,…,speck}] gives a k-dimensional generalized grid graph according to the specifications specj .

## Details and Options

The specj can take any of the following forms:
 m m vertices in the jth dimension m → “Circular” m vertices in the jth dimension connected cyclically m → “Directed” m vertices connected by directed edges in the jth dimension m → {“Circular”, “Directed”} m vertices in the jth dimension cyclically connected by directed edges
GeneralizedGridGraph takes the same options as Graph, with the following additional option:
 “VertexNamingFunction” Automatic function to use for naming the vertices

## Examples

### Basic Examples (2)

Generate an 8×8 grid graph with directed edges:

 In[1]:=
 Out[1]=

Generate an 5×5×5 grid graph with directed edges:

 In[2]:=
 Out[2]=

### Scope (3)

Generate an ordinary grid graph:

 In[3]:=
 Out[3]=

Generate a grid graph that is circular in the first dimension, and has directed edges in the second:

 In[4]:=
 Out[4]=

Generate a grid graph that has directed edges and is circular in the first dimension:

 In[5]:=
 Out[5]=

### Options (4)

#### EdgeStyle (1)

Give an EdgeStyle:

 In[6]:=
 Out[6]=
 In[7]:=
 Out[7]=

#### VertexNamingFunction (3)

Label vertices with their coordinates:

 In[8]:=
 Out[8]=

Labeling by coordinates works with arbitrary grids:

 In[9]:=
 Out[9]=

Labeling by coordinates works in any dimension:

 In[10]:=
 Out[10]=

### Properties and Relations (1)

For plain integer specifications, GeneralizedGridGraph is the same as GridGraph:

 In[11]:=
 Out[11]=
 In[12]:=
 Out[12]=

## Version History

• 2.0.0 – 16 March 2020
• 1.0.0 – 09 March 2020