Existence of k-ary Trees: Subtree Sizes, Heights and Depths (1510.00958v2)
Abstract: The rooted tree is an important data structure, and the subtree size, height, and depth are naturally defined attributes of every node. We consider the problem of the existence of a k-ary tree given a list of attribute sequences. We give polynomial time (O(nlog(n))) algorithms for the existence of a k-ary tree given depth and/or height sequences. Our most significant results are the Strong NP-Completeness of the decision problems of existence of k-ary trees given subtree sizes sequences. We prove this by multi-stage reductions from NUMERICAL MATCHING WITH TARGET SUMS. In the process, we also prove a generalized version of the 3-PARTITION problem to be Strongly NP-Complete. By looking at problems where a combination of attribute sequences are given, we are able to draw the boundary between easy and hard problems related to existence of trees given attribute sequences and enhance our understanding of where the difficulty lies in such problems.