When processing a category hierarchy in a strict tree manner, a node's neighbors are its previous and next nodes, according to the logic of a pre-order tree traversal (this is a concept from mathematical tree theory). For example, if a category hierarchy were displayed as an infinitely deep table of contents, then a node's neighbors would be those listed immediately above (previous) and below (next) it.