adjacency in a 4 tree

17 Views Asked by At

I have a mesh that is designed to partition a physical space with varying resolution. Basically the size of individual mesh cells varies depending on the location within the mesh (Visual Diagram)

I have heard there are efficient algorithms to find all the adjacent cells for a given cell, I was wondering if someone could point me in that direction

The challenge as I see it is looking up the tree of cells, for any cell two adjacent cells can be found by looking at the same 'level' of the mesh (For instance, in the diagram, cells 3.4 and 3.2 are adjacent to 3.1, but so are cells 2 and 4) It seems like conceptually I should be able to look up the tree hierarchy to find a shared node and then scan down from there, but I was hoping there was a formalized mathematical description of this process