- directed_hexagonal_lattice_graph(rows, cols, /, bidirectional=False, multigraph=True)#
Generate a directed hexagonal lattice graph.
The edges propagate towards right and bottom direction if
rows (int) – The number of rows to generate the graph with.
cols (int) – The number of rows to generate the graph with.
bidirectional – A parameter to indicate if edges should exist in both directions between nodes. Defaults to
multigraph (bool) – When set to
PyDiGraphobject will not be not be a multigraph and won’t allow parallel edges to be added. Instead calls which would create a parallel edge will update the existing edge.
The generated directed hexagonal lattice graph.
- Return type:
TypeError – If either
colsare not specified
import rustworkx.generators from rustworkx.visualization import mpl_draw graph = rustworkx.generators.directed_hexagonal_lattice_graph(2, 3) mpl_draw(graph)