[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-83607-en":3,"doc-seo-83607-105":28,"detail-sidebar-cat-0-en-105":89},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":4,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":11,"language":21,"language_code":22,"site_id":23,"html_lang":22,"table_of_contents":24,"faqs":25,"seo_title":13,"seo_description":14,"update_tm":26,"read_time":27},83607,16904993612988,"Olivia Brown","https://ap-avatar.wpscdn.com/davatar_a8503ba1806abce46bf441b54a3ca4cd",6,"Technology","Efficient Pattern Matching in Unordered Term Tree Patterns with Height Constraints","Unordered trees arise in settings where sibling order is insignificant, including abstract syntax trees and chemical structures. The work introduces unordered term tree patterns equipped with height-constrained (HC) variables that limit trunk length and the height of substituted subtrees. A formal membership problem is defined for deciding whether an unordered tree can be generated from a given pattern by replacing each HC-variable with a suitable subtree. An O(N · max{nD3/2, S}) algorithm is provided and evaluated for practical efficiency.","Efficient Pattern Matching in Unordered Term Tree Patterns with Height Constraints  \nShintaro Matsushita∗‡, Takayoshi Shoudai∗§ , and Yusuke Suzuki†  \n∗ Department of Computer Science and Engineering, Fukuoka Institute of Technology, Fukuoka 811-0295, Japan  \nEmail: ‡[mfm25113@bene.fit.ac.jp](mfm25113@bene.fit.ac.jp), § [shodai@fit.ac.jp](shodai@fit.ac.jp)  \n†Faculty of Information Sciences, Hiroshima City University, Hiroshima 731-3194, Japan  \nEmail: [y-suzuki@hiroshima-cu.ac.jp](y-suzuki@hiroshima-cu.ac.jp)  \narXiv :2607 .0 1704v 1 [ cs .DS] 2 Jul 2026  \nAbstract—Unordered trees appear in applications where the order among child vertices is insignificant, such as abstract syntax trees and chemical structures. To describe patterns in such trees, we propose unordered term tree patterns, which employ height-constrained variables that restrict trunk length and subtree height. We formalize the pattern matching problem between an unordered term tree pattern and an unordered tree, and present an O (N · max{nD3/2 , S})-time algorithm, where n and N are the numbers of vertices in the pattern and tree, D is the maximum vertex degree, and S is the sum of trunk constraints. Computational results show that the algorithm runs efficiently in practice.  \nIndex Terms—height constrained tree pattern, polynomial-time algorithm, pattern matching algorithm, membership problem  \nI. INTRODUCTION  \nUnordered trees, where the order of sibling vertices isnot significant, appear in various domains such as glycan structures, chemical compounds, and abstract syntax trees. To analyze such data, many studies have explored pattern discovery and matching techniques for unordered trees. Earlier research focused on mining frequent subtrees [1], [2] and addressing structural containment and inclusion problems [3],[4] . However, these approaches are often limited in capturing flexible and complex structures that may arise in realworld data. To overcome these limitations, several methods have been proposed to improve both the expressiveness and efficiency of pattern matching and mining [5]–[7] . In addition, surveys such as [8] have emphasized the need for more general frameworks for analyzing tree patterns.  \nAs one such framework, Shoudai et al. [9] introduced unordered term tree patterns, in which variables can represent entire subtrees. This model was later extended with heightconstrained variables (HC-variables) [10], which allow control over both the trunk length and the height of substituted subtrees. In this paper, we address the pattern matching problem for linear unordered term tree patterns with HCvariables, where linearity means that all variables have distinct labels. We propose a polynomial-time algorithm that solves  \nThis is an author preprint of a paper presented at the 20th International Conference on E-Service and Knowledge Management (ESKM 2025), IIAIAAI 2025 . The paper was accepted for inclusion in the conference proceedings published by IEEE Computer Society Conference Publishing Services (CPS) .  \nThis work was partially supported by JSPS KAKENHI Grant Numbers JP21K12021, JP24K15074, JP24K15090 .  \nFig. 1. An unordered term tree pattern t with HC-variables. Circles represent vertices, and squares denote variables with parent and child ports. A square labeled x (i, j) indicates an (i, j)-HC-variable.  \nthe membership problem of determining whether an unordered tree T can be obtained from a given pattern t by replacing each HC-variable with an appropriate subtree.  \nAn example of such a pattern t is shown in Fig. 1, which includes three HC-variables: x(4, 5), y(1, 2), and z(2, 3) . Fig. 2 shows two example unordered trees, T1 and T2. The tree T1 can be derived from t by replacing each HC-variable with a subtree satisfying the corresponding constraints. In contrast, T2 does not satisfy the constraints and therefore does not match the pattern.  \nThe proposed algorithm runs in O (N · max{nD3/2 , S}) time, where n and N denote the number of ve","cbCaicrhQ9Wmz3J3","https://ap.wps.com/l/cbCaicrhQ9Wmz3J3","pdf",806708,1,"English","en",105,"# Introduction\n# Preliminaries","[{\"question\":\"What are height-constrained variables in unordered term tree patterns?\",\"answer\":\"Height-constrained (HC) variables restrict both the trunk length and the height of the subtree substituted for the variable in unordered term tree patterns.\"},{\"question\":\"How is the pattern matching (membership) problem formulated?\",\"answer\":\"The membership problem asks whether an unordered tree T can be obtained from a pattern t by replacing each HC-variable with an appropriate subtree that satisfies its constraints.\"},{\"question\":\"What is the time complexity of the proposed algorithm?\",\"answer\":\"The algorithm runs in O(N · max{nD3/2, S}) time, where n and N are the numbers of vertices in the pattern and tree, D is the maximum vertex degree, and S is the sum of trunk constraints.\"}]",1784189223,15,{"code":4,"msg":29,"data":30},"ok",{"site_id":23,"language":22,"slug":31,"title":13,"keywords":32,"description":14,"schema_data":33,"social_meta":84,"head_meta":86,"extra_data":88,"updated_unix":26},"efficient-pattern-matching-in-unordered-term-tree-patterns-with-height-constraints","",{"@graph":34,"@context":83},[35,52,66],{"@type":36,"itemListElement":37},"BreadcrumbList",[38,42,46,49],{"item":39,"name":40,"@type":41,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":43,"name":44,"@type":41,"position":45},"https://docshare.wps.com/document/","Document",2,{"item":47,"name":12,"@type":41,"position":48},"https://docshare.wps.com/document/technology/",3,{"item":50,"name":13,"@type":41,"position":51},"https://docshare.wps.com/document/efficient-pattern-matching-in-unordered-term-tree-patterns-with-height-constraints/83607/",4,{"url":50,"name":13,"@type":53,"author":54,"headline":13,"publisher":56,"fileFormat":59,"inLanguage":22,"description":14,"dateModified":60,"datePublished":60,"encodingFormat":59,"isAccessibleForFree":61,"interactionStatistic":62},"DigitalDocument",{"name":9,"@type":55},"Person",{"url":39,"name":57,"@type":58},"DocShare","Organization","application/pdf","2026-07-16",true,{"@type":63,"interactionType":64,"userInteractionCount":4},"InteractionCounter",{"@type":65},"ViewAction",{"@type":67,"mainEntity":68},"FAQPage",[69,75,79],{"name":70,"@type":71,"acceptedAnswer":72},"What are height-constrained variables in unordered term tree patterns?","Question",{"text":73,"@type":74},"Height-constrained (HC) variables restrict both the trunk length and the height of the subtree substituted for the variable in unordered term tree patterns.","Answer",{"name":76,"@type":71,"acceptedAnswer":77},"How is the pattern matching (membership) problem formulated?",{"text":78,"@type":74},"The membership problem asks whether an unordered tree T can be obtained from a pattern t by replacing each HC-variable with an appropriate subtree that satisfies its constraints.",{"name":80,"@type":71,"acceptedAnswer":81},"What is the time complexity of the proposed algorithm?",{"text":82,"@type":74},"The algorithm runs in O(N · max{nD3/2, S}) time, where n and N are the numbers of vertices in the pattern and tree, D is the maximum vertex degree, and S is the sum of trunk constraints.","https://schema.org",{"og:url":50,"og:type":85,"og:title":13,"og:site_name":57,"og:description":14},"article",{"robots":87,"canonical":50},"index,follow",{"doc_id":7,"site_id":23},{"code":4,"msg":5,"data":90},[91,95,99,103,108,111,116,121,126,129,133],{"id":20,"doc_module":4,"doc_module_name":44,"category_name":92,"show_sort_weight":93,"slug":94},"Story & Novel",90,"story-novel",{"id":45,"doc_module":4,"doc_module_name":44,"category_name":96,"show_sort_weight":97,"slug":98},"Literature",80,"literature",{"id":51,"doc_module":4,"doc_module_name":44,"category_name":100,"show_sort_weight":101,"slug":102},"Exam",70,"exam",{"id":104,"doc_module":4,"doc_module_name":44,"category_name":105,"show_sort_weight":106,"slug":107},5,"Comic",60,"comic",{"id":11,"doc_module":4,"doc_module_name":44,"category_name":12,"show_sort_weight":109,"slug":110},50,"technology",{"id":112,"doc_module":4,"doc_module_name":44,"category_name":113,"show_sort_weight":114,"slug":115},7,"Healthcare",40,"healthcare",{"id":117,"doc_module":4,"doc_module_name":44,"category_name":118,"show_sort_weight":119,"slug":120},8,"Research & Report",30,"research-report",{"id":122,"doc_module":4,"doc_module_name":44,"category_name":123,"show_sort_weight":124,"slug":125},9,"Religion & Spirituality",20,"religion-spirituality",{"id":124,"doc_module":4,"doc_module_name":44,"category_name":127,"show_sort_weight":124,"slug":128},"World Cup","world-cup",{"id":130,"doc_module":4,"doc_module_name":44,"category_name":131,"show_sort_weight":130,"slug":132},10,"Lifestyle","lifestyle",{"id":134,"doc_module":4,"doc_module_name":44,"category_name":135,"show_sort_weight":104,"slug":136},19,"General","general"]