🤖 AI Summary
This paper addresses the matching problem for partially ordered sequences. We generalize Cartesian trees to Cartesian forests and establish a bijection between Cartesian forests and Schröder trees. We introduce the Cartesian forest signature—a compact, computable, and comparable representation—along with an efficient filtering mechanism that integrates partial-order structural modeling, signature adaptation, and linear-time string matching. The proposed algorithm achieves average-case linear time complexity for both exact and approximate matching. Experiments demonstrate that our filtering strategy significantly reduces actual matching overhead and improves overall performance. Key contributions are: (1) formal definition of Cartesian forests and characterization of their combinatorial structure; (2) design of a computationally efficient, order-preserving signature scheme; and (3) the first practical, high-performance matching framework supporting partially ordered sequences.
📝 Abstract
In this paper, we introduce the notion of Cartesian Forest, which generalizes Cartesian Trees, in order to deal with partially ordered sequences. We show that algorithms that solve both exact and approximate Cartesian Tree Matching can be adapted to solve Cartesian Forest Matching in average linear time. We adapt the notion of Cartesian Tree Signature to Cartesian Forests and show how filters can be used to experimentally improve the algorithm for the exact matching. We also show a one to one correspondence between Cartesian Forests and Schr""oder Trees.