I have a bunch of nodes arranged in a hierarchy structure as follows:
I would like to determine if one node is connected to another node, even if the connection between the two is separated by different levels in the hierarchy.
For example, node A is connected to node K through nodes B and D. Node A is also connected to node L either through nodes B and D or nodes C and G.
Nodes E, F, H, J and M are not connected to node L.
Without transversing the hierarchy from a parent node to some child node in order to determine whether two nodes are connected, I believe that it is possible to assign some numeric value to each node and through a formula that takes the numeric value of two nodes can determine that they are connected.
Is this possible?