A binary relationship $ a \rightarrow b $ (read as a is adjacent to b) indicates that there is a direct connection from a to b. In general, an object is not adjacent to itself, that is, $ a \not\rightarrow a $.
In some cases, an adjacency relations may be symmetric; that is, if $ a \rightarrow b $, it follows that $ b \rightarrow a $. In this case, one may write $ a \leftrightarrow b $.
In general, an adjacency relation is explicitly defined by the programmer.
There is no mathematical definition of a general adjacency relation as there is no rule which define the relationship. Further restrictions such as undirected graphs are symmetric or bipartite graphs may have additional mathematical constraints. For example, in a bipartite graph, if $ a \leftrightarrow c $ and $ b \leftrightarrow c $, it follows that $ a \not\leftrightarrow b $.
Operations on containers storing objects which are related using an adjacency relation include:
An adjacency relation which is also symmetric defines an equivalence relation where $ a \sim b $ if $ a $ is connected to $ b $ according to the definition of connected above. The relationship of connectedness is an equivalence relations and therefore, any of the operations on an equivalence relation may also be imposed on a container with objects related with a symmetric adjacency relationship.