So far we have assumed that each key was equally likely as a search argument.
If one has data giving the probability that the search argument is Ki (a key already in the tree), and the probability that the search argument lies between Ki and Ki+1, then again techniques are known for reordering the tree to optimise the expected search time.
Essentially one makes sure that the more frequently accessed keys have the shortest search paths from the root.
One well-known technique used when only the second set of probabilities is known, and the others assigned the value zero, is the Hu-Tucker algorithm.
Again the interested reader may consult Knuth.
At this point it is probably a good idea to point out that these efficiency considerations are largely irrelevant when it comes to representing a document classification by a tree structure.
The situation in document retrieval is different in the following aspects:
(1) we do not have a useful linear ordering on the documents;
(2) a search request normally does not seek the absence or presence of a document.
In fact, what we do have is that documents are more or less similar to each other, and a request seeks documents which in some way best match the request.
A tree structure representing a document classification is therefore chosen so that similar documents may be close together.
Therefore to rearrange a tree structure to satisfy some 'balancedness' criterion is out of the question.
The search efficiency is achieved by bringing together documents which are likely to be required together.
This is not to say that the above efficiency considerations are unimportant in the general context of IR.
Many operations, such as the searching of a dictionary, and using a suffix stripping algorithm can be made very efficient by appropriately structuring the binary tree.
The discussion so far has been limited to binary trees.
In many applications this two-way split is inappropriate.
The natural way to represent document classifications is by a general tree structure, where there is no restriction on the number of branches leaving a node.
Another example is the directory of an index sequential file which is normally represented by an m-way tree, where m is the number of branches leaving a node.
Finally, more comments are in order about the manipulation of tree structures in mass storage devices.
Up to now we have assumed that to follow a set of pointers poses no particular problems with regard to retrieval speed.
Unfortunately, present random access devices are sufficiently slow for it to be impossible to allow an access for, say, each node in a tree.
There are ways of partitioning trees in such a way that the number of disk accesses during a tree search can be reduced. |