A Subpath Kernel for Rooted Unordered Trees

Daisuke Kimura, Tetsuji Kuboyama, Tetsuo Shibuya, Hisashi Kashima

Abstract

Rooted unordered trees are essential for representing hierarchical data such as XML documents and glycan structures. However, existing tree kernels often struggle with a trade-off between computational efficiency and structural expressiveness. This paper introduces a novel Subpath Kernel that captures vertical hierarchical relationships by considering sequences of node labels from any node toward the root. By adapting the Multikey Quicksort algorithm, the authors achieve an average-case time complexity of $O(N \log N)$, outperforming state-of-the-art linear-time kernels by a factor of 2–3 in practical applications while maintaining superior classification accuracy.

Introduction

Data structures like XML/HTML, natural language parse trees, and biological glycans are naturally represented as rooted trees. Learning from such data is difficult because the feature space of possible sub-structures grows exponentially. Traditional convolution kernels are expressive but computationally prohibitive ($O(|T_1||T_2|)$). Conversely, linear-time kernels often rely on "complete subtrees," which are highly sensitive to noise; a single differing leaf node can prevent a match. Furthermore, many of these trees are unordered, meaning the sequence of a node's children is irrelevant, adding to the combinatorial challenge.

The Subpath Kernel

The proposed Subpath Kernel addresses these issues by focusing on "subpaths"—vertical sequences of node labels starting from any node and moving toward the root. This approach captures the "is-a-part-of" hierarchy (e.g., nested tags in XML) without the rigidity of complete subtree matching.

Definition of the subpath set for a rooted unordered tree T.

As shown in Figure 4, the subpath set includes all vertical paths of varying lengths. This flexibility allows the kernel to identify similarities in the middle of trees even if the leaf nodes or specific branchings differ, making it more robust than complete subtree kernels.

Efficient Computation via Multikey Quicksort

To compute the kernel efficiently, the authors treat every path from a node to the root as a string. They adapt the Multikey Quicksort algorithm to sort these paths across two trees simultaneously.

Trace of the Multikey Quicksort algorithm partitioning paths from two trees (T1 and T2) using a pivot.

By counting common prefixes during the sorting process, the kernel value is computed in $O(N \log N)$ time on average with $O(N)$ space. While some kernels claim $O(N)$ theoretical complexity, this approach is faster in practice due to smaller constant factors and a more natural handling of tree branching compared to complex suffix structures.

Experimental Evaluation

The kernel was evaluated on XML and glycan classification tasks:

  • XML Classification: Predicting user origins based on web-browsing visit paths. The Subpath Kernel achieved 83.06% accuracy, surpassing both linear-time kernels (81.68%) and standard ordered tree kernels (82.18%).
  • Glycan Classification: In bioinformatics datasets (Cystic Fibrosis and Leukemia), the kernel showed the highest accuracy for Cystic Fibrosis (78.75%) and remained highly competitive for Leukemia.

In terms of efficiency, the proposed method was 2 to 3 times faster than existing state-of-the-art linear-time implementations across all test cases.

Conclusion

The Subpath Kernel provides a powerful balance of speed and accuracy for rooted unordered trees. By prioritizing vertical hierarchical information and utilizing an optimized sorting algorithm, it overcomes the limitations of both rigid linear kernels and slow convolution kernels. Future work includes extending the method to "soft" kernels that allow for label mismatches, which would further enhance its utility in biological domains where mutations are common.

Summary updated

BibTeX
@inproceedings{kimura2011subpath,
  author = {Daisuke Kimura and Tetsuji Kuboyama and Tetsuo Shibuya and Hisashi Kashima},
  title = {{A Subpath Kernel for Rooted Unordered Trees}},
  booktitle = {PAKDD},
  year = {2011},
  doi = {10.1007/978-3-642-20841-6\_6},
}
Figure