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.
I can think of it in this way:
- initialize n*n array.
- every particle interacts with particles next to it on right and left sides
- particle on odd row and odd column interact with it's bottom particle
- particle on odd row and even column interact with it's top particle
- particle on even row and odd column interact with it's top particle
- particle on even row and even column interact with it's bottom particle
The equivalence is shown below in the pictures.
Is there a better method to represent the same?



There is a reference here that might be of use:
https://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/AV0405/MARTIN/Hex.pdf
Also, there is a SE answer that might be of help:
Generate, fill and plot a hexagonal lattice in Python
Also, this:
https://www.redblobgames.com/grids/hexagons/