I'm trying to model a situation in witch a group of entities are organized hierarchically.
We say that entity A has privileges over entity B if there a direct hierarchical connection between A and B (A->B) ore there exists a non finite succession of connection A->E1, E1->E2, E2->E3,..., En->B. It is clear that for such structure we may use graphs, ins particular trees.
To verify if A->B I've to visit all the intermediate nodes, and this has some cost.
My first idea was to find some numerical scheme by assigning an integer to each entity. Such integer must be able to model the relationship between connected nodes. The next "illumation" was to use prime factorization. Leafs are marked with prime numbers. The mark of a node that is not a leaf is obtained by multiplying markers of the childs of that node.
The problem for choosing this method is that integer markers near-root nodes increase surprisingly(not so surprisingly ... is obvious) by increasing number of leafs. Does anyone has any idea about the existence of any other scheme using integer markers?