1. A computer-implemented method for encoding nodes of a tree structure, the method comprising: receiving nodes of a tree structure into memory; with a processor, for each node of at least one node in the tree structure, creating a numeric encoding, comprising: assigning an encoding value to the node, a root node N 0 having a fixed encoding value and any other node N j having an encoding value which is a function of an encoding value of its parent node and an integer k, where N j is the k th child of the parent node; and outputting the encoding.