Function Repository Resource:
Triangular Lattice Graph
Generate a graph corresponding to a triangular grid
Contributed by:
Anton Antonov
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
ResourceFunction["TriangularLatticeGraph"] takes the same options as Graph.
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]:= |