Basic Examples (1)

A 4×7 hexagonal grid graph:

({{"[◼]", "TriangularLatticeGraph" }})[{4,7}]

Scope (3)

Using only one argument:

({{"[◼]", "TriangularLatticeGraph" }})[4]

Use a different graph embedding:

({{"[◼]", "TriangularLatticeGraph" }})[{12,8},GraphLayout->"SpringElectricalEmbedding",VertexCoordinates->Automatic]

Use a different plot theme:

({{"[◼]", "TriangularLatticeGraph" }})[{18,18},PlotTheme->"LargeGraph"]

Applications (1)

Make a (full) triangular grid graph with vertices that are the centers of a hexagonal graph:

g1=ResourceFunction["HexagonalGridGraph"][{7,4}];
g2=({{"[◼]", "TriangularLatticeGraph" }})[{3,6}];
g2=Graph[g2,VertexCoordinates->Thread[VertexList[g2]->Map[#+{(Sqrt[3]),1}&,GraphEmbedding[g2]]]];
Show[g1,HighlightGraph[g2,g2]]

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:

Row[{ResourceFunction["HexagonalGridGraph"][{3,6}],({{"[◼]", "TriangularLatticeGraph" }})[{3,6}],GridGraph[{3,6}]}]

The resource function "TriangulaGridGraph" takes only one argument for the graph size and makes triangle shaped graphs. Here is a comparison:

Row[{ResourceFunction["TriangularGridGraph"][4],({{"[◼]", "TriangularLatticeGraph" }})[{5,4}]}]

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:

n=10;
points=GraphEmbedding@({{"[◼]", "TriangularLatticeGraph" }})[n];
ℛ=VoronoiMesh[points];
lines=MeshPrimitives[ℛ,"Lines"];
Legended[
Graphics[{GrayLevel[0.7],lines,Red,Point@Map[#+2*{(Sqrt[3]),1}&,GraphEmbedding@ResourceFunction["HexagonalGridGraph"][{n-1,n-1}]],Black,Point[points]},ImageSize->Large],
SwatchLegend[{GrayLevel[0.7],Red,Black},{"Voronoi mesh","Hexagonal grid graph embedding","Triangular lattice graph embedding"}]]

The opposite is also true:

VoronoiMesh[GraphEmbedding@ResourceFunction["HexagonalGridGraph"][{10,10}]]

Large graphs may be formatted differently in OutputForm than smaller graphs. A 50×60 hexagonal grid graph shows explicit edges and vertices:

({{"[◼]", "TriangularLatticeGraph" }})[{50,60}]

A 60×60 hexagonal grid graph displays as an elided Graph expression:

({{"[◼]", "TriangularLatticeGraph" }})[{60,60}]