5. The method of claim 4 , wherein: the optimal conditional rule for a node or leaf is the rule that is optimal for the condition that a parent node of the node or leaf is associated with a particular canonical suffix-rewriting rule; and selecting an optimal canonical suffix-rewriting rule for each node according to the optimal conditional rules for the node comprises: determining an optimal canonical suffix-rewriting rule for a root of the suffix tree; and determining an optimal canonical suffix-rewriting rule for each remaining node in the tree, wherein the optimal canonical suffix-rewriting rule for a node in the tree is the optimal conditional rule for the canonical suffix-rewriting rule associated with a parent of the node.
4. The method of claim 1 , wherein selecting the minimum colored subset of the nodes and leaves in the suffix tree comprises determining optimal conditional rules for each node and leaf in the suffix tree, and then selecting the minimum colored subset and the optimal canonical suffix-rewriting rule for each node and leaf in the subset according to the optimal conditional rules.