hexagonal_lattice_graph

Function hexagonal_lattice_graph 

Source
pub fn hexagonal_lattice_graph(
    rows: usize,
    cols: usize,
) -> Result<Graph<usize, f64>>
Expand description

Generates a hexagonal lattice graph (honeycomb structure)

§Arguments

  • rows - Number of rows
  • cols - Number of columns

§Returns

  • Result<Graph<usize, f64>> - A hexagonal lattice where each node has exactly 3 neighbors