What is the best way to represent honeycomb lattice?

1.1k Views Asked by At

I am trying to simulate a honeycomb lattice, I.e, each particle interacts with each of it's 3 neighbors. I want to represent in array such that it is automated. I.e, if any atom is picked at random, code should evaluate some parameter based on connected neighbors.

honeycomb lattice

I can think of it in this way:

  1. initialize n*n array.
  2. every particle interacts with particles next to it on right and left sides
  3. particle on odd row and odd column interact with it's bottom particle
  4. particle on odd row and even column interact with it's top particle
  5. particle on even row and odd column interact with it's top particle
  6. particle on even row and even column interact with it's bottom particle

The equivalence is shown below in the pictures.

Actual honeycomb lattice

restructured structure which can be represented by arrows

Is there a better method to represent the same?

1

There are 1 best solutions below

3
asylumax On