Function Repository Resource:
Triangular Lattice Graph
Generate a graph corresponding to a triangular grid
ResourceFunction["TriangularLatticeGraph"][n] returns a triangular lattice graph with dimensions n×n. | |
ResourceFunction["TriangularLatticeGraph"][{rows,columns}] returns a triangular lattice graph with dimensions rows×columns. |
Details and Options
Examples
Basic Examples (1) 
A 4×7 hexagonal grid graph:
| In[1]:= |
| Out[1]= |
Scope (3) 
Using only one argument:
| In[2]:= |
| Out[2]= |
Use a different graph embedding:
| In[3]:= |
| Out[3]= |
Use a different plot theme:
| In[4]:= |
| Out[4]= |
Applications (1) 
Make a (full) triangular grid graph with vertices that are the centers of a hexagonal graph:
| In[5]:= |
| Out[6]= |
Properties and Relations (4) 
The resource function "HexagonalGridGraph" takes width and height as argument, while TriangularLatticeGraph takes rows and columns. The latter is more consistent with GridGraph. Here is a comparison:
| In[7]:= |
| Out[7]= |
The resource function "TriangulaGridGraph" takes only one argument for the graph size and makes triangle shaped graphs. Here is a comparison:
| In[8]:= |
| Out[8]= |
The mesh points of the Voronoi tessellation of the points of a triangular lattice graph contain the points of a hexagonal grid graph. Here is a demonstration:
| In[9]:= |
| Out[13]= |
The opposite is also true:
| In[14]:= |
| Out[14]= |
Large graphs may be formatted differently in OutputForm than smaller graphs. A 50×60 hexagonal grid graph shows explicit edges and vertices:
| In[15]:= |
| Out[15]= |
A 60×60 hexagonal grid graph displays as an elided Graph expression:
| In[16]:= |
| Out[16]= |