# Complexity of constructing minimum depth decision trees

I am interested in the computational complexity of

Problem 1: Given a finite, non-empty set $$J$$, given $$A, B \subseteq \{0,1\}^J$$ such that $$A \cap B = \emptyset$$, and given $$n \in \mathbb{N}$$, does there exist a binary decision tree of depth at most $$n$$ with decisions $$x_j \overset{?}{=} 1$$ for any $$x \in \{0,1\}^J$$ and any $$j \in J$$ such that, at any leaf of the tree, there are only elements of $$A$$ or only elements of $$B$$?

I often see claims of Problem 1 being NP-complete due to a famous reduction of 3-dimensional perfect matching, via exact cover by 3-sets, by Hyafil and Rivest (1976). My understanding, however, is that they establish NP-completeness of the slightly different

Problem 2: Given a finite, non-empty set $$J$$, given $$A \subseteq \{0,1\}^J$$ and given $$n \in \mathbb{N}$$, does there exist a binary decision tree of depth at most $$n$$ with decisions $$x_j \overset{?}{=} 1$$ for any $$x \in \{0,1\}^J$$ and any $$j \in J$$ such that, at any leaf of the tree, there is at most one element of $$A$$?

Can anyone help me fill the gap or point me to other work establishing complexity results for Problem 1?

Remark: While Hyafil and Rivest (1976) establish a result for an average depth, their argument is easily adapted to the minimum depth.

One further remark (risking to make the question seem less relevant to some): Consider the following generalization of Problem 1 that specializes to the latter for $$m = 2$$.

Problem 3: Given a finite, non-empty set $$J$$, given $$m \in \mathbb{N}$$, given pairwise disjoint $$A_1, \ldots, A_m \subseteq \{0,1\}^J$$, and given $$n \in \mathbb{N}$$, does there exist a binary decision tree of depth at most $$n$$ with decisions $$x_j \overset{?}{=} 1$$ for any $$x \in \{0,1\}^J$$ and any $$j \in J$$ such that, at any leaf of the tree, there are elements of at most one of the sets $$A_1, \ldots, A_m$$?

Problem 2 is polynomially reducible to Problem 3, for instance, by defining for each $$a \in A$$ of Problem 1 a separate subset $$A_a = \{a\}$$ of Problem 3. This reduction requires, however, that we can choose $$m = |A|$$. It is not generally possible in the special case of Problem 3 where $$m = 2$$, which is Problem 1.

At the same time, reducibility of Problem 2 to Problem 3 is sufficient for many informal claims, e.g., of exact learning of binary classification trees from examples being NP-hard due to Hyafil and Rivest (1976), or of extending partial pseudo-Boolean functions by minimum depth decision trees being NP-hard due to Hyafil and Rivest (1976). I just do not see how this holds for two-class classification and Boolean functions, respectively.

I think I can see a fairly easy reduction from 3DM. Let $$B=\{0^J\}$$, i.e., it is a singleton set with the only zero element. The points of $$A$$ correspond to the points of the 3DM that are to be matched. If a triple is matchable, then there is a coordinate where these 3 points are 1, while all other points are 0. The equivalence is straightforward.
I think an interesting question left open is if A is given (as part of the input), and our goal is to separate it from $$\{0,1\}^J\setminus A$$.
• What depth limit $n$ does your reduction output? Also, how does a 3D-matching for the given instance correspond to a BDD of depth at most $n$ (for the Problem 1 instance the reduction produces)? Feb 15, 2020 at 16:44
• What do you mean by depth limit? I imagine that the 3DM has 3*n points that are to be matched, so $|A|=3n$. Which each question we can separate at most 3 members of $A$ from $B$. Feb 15, 2020 at 21:21
• You're intending to reduce 3DM to Problem 1 in the post, right? That problem asks for a binary decision tree of depth at most a given value ($n$)... Am I missing something? Are you perhaps thinking of number of queries instead of depth? Feb 16, 2020 at 0:39
• Yes, there is a great misunderstanding. This is converted to $A=(1,2,3,4,5,6)$, and the coordinates are indexed with $(156, 146, 145, 136, 135, 126)$, so with standard notation we would get $A=(111111,000001,000110,011000,101010,110101)$. Feb 16, 2020 at 20:43
• Thanks for your patience! So given a 3D matching instance -- a set of triples $X$ from universe of elements $\{1,2,\ldots,3n\}$, the reduction outputs an instance of Problem 1 with $J$ equal to $|X|$, $B=\{0^J\}$, depth limit equal to $n$, and $A=\{A_1, A_2, \ldots, A_{3n}\}$ where $A_{ij} = 1$ if element $i$ is in triple $j$ (else $A_{ij}=0$). So the $A_i$s that pass the test $x_j=1$ (separating them from $B$) correspond to the elements $i$ in the triple $j$. So, a sequence of $n$ tests that separate all $A_i$s from $B$ corresponds to a sequence of triples that contain all the elements. Feb 17, 2020 at 1:57
{"ft_lang_label":"__label__en","ft_lang_prob":0.8805012,"math_prob":0.9995653,"size":2588,"snap":"2023-40-2023-50","text_gpt3_token_len":745,"char_repetition_ratio":0.11764706,"word_repetition_ratio":0.28635347,"special_character_ratio":0.28941268,"punctuation_ratio":0.12222222,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9999428,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-09-27T03:55:11Z\",\"WARC-Record-ID\":\"<urn:uuid:79e507fe-bfd1-47e7-8c84-fd09395342c6>\",\"Content-Length\":\"166733\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:52a77e1b-8029-4b30-93f0-4a392a02dc27>\",\"WARC-Concurrent-To\":\"<urn:uuid:7a169853-f447-4358-bb6c-35d4f68e27fa>\",\"WARC-IP-Address\":\"104.18.10.86\",\"WARC-Target-URI\":\"https://cstheory.stackexchange.com/questions/46351/complexity-of-constructing-minimum-depth-decision-trees\",\"WARC-Payload-Digest\":\"sha1:RSC6NR2WCLTWM6SZZAN3K3A5E2WD2MKG\",\"WARC-Block-Digest\":\"sha1:PQ4QP6YF4IDLXL5ZT4WIEHETILAHLLYP\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-40/CC-MAIN-2023-40_segments_1695233510259.52_warc_CC-MAIN-20230927035329-20230927065329-00222.warc.gz\"}"}