Generation of Binary Tree-Child phylogenetic networks

Phylogenetic networks generalize phylogenetic trees by allowing the modelization of events of reticulate evolution. Among the different kinds of phylogenetic networks that have been proposed in the literature, the subclass of binary tree-child networks is one of the most studied ones. However, very little is known about the combinatorial structure of these networks. In this paper we address the problem of generating all possible binary tree-child (BTC) networks with a given number of leaves in an efficient way via reduction/augmentation operations that extend and generalize analogous operations for phylogenetic trees, and are biologically relevant. Since our solution is recursive, this also provides us with a recurrence relation giving an upper bound on the number of such networks. We also show how the operations introduced in this paper can be employed to extend the evolutive history of a set of sequences, represented by a BTC network, to include a new sequence. An implementation in python of the algorithms described in this paper, along with some computational experiments, can be downloaded from https://github.com/bielcardona/TCGenerators.

Introduction Phylogenetic networks are, mathematically, a generalization of phylogenetic trees that, containing nodes with more than one ancestor, permit to model reticulated evolutionary events such as recombinations, lateral gene transfers and hybridizations. We note here that other representations, for example gene tree-species tree reconciliations [1], permit to model scenarios including other classes of evolutionary events such as duplications, losses and transfers of genes.
In this paper, we shall focus on directed phylogenetic networks (see [2] for a short survey on the phylogenetic network paradigm also covering undirected phylogenetic networks). Mathematically, such networks are, in the broadest sense, directed acyclic graphs with a single node with no incoming arcs -the root-representing the common ancestor of all the Operational Taxonomic Units (OTUs for short) under study, which are represented by the nodes with no outgoing arcs -the leaves-of the graph; internal nodes represent either (hypothetical) speciations or (hypothetical) reticulated events. Nodes with a single incoming arc -tree nodesmodel extant or non-extant OTUs, and arcs between tree nodes model direct descent through mutation; nodes with two incoming arcs -hybrid nodes-model reticulated events involving the OTUs corresponding to the two parents of the node under consideration, and whose resulting OTU is modeled as its single child. Unfortunately, this definition is too broad, both for representing biologically-meaningful evolutionary scenarios, and for giving objects that can be efficiently handled.
So far, several restrictions on this general definition have been introduced in the literature. A few of them are based on biological considerations, while the majority have been introduced to artificially narrow the space of networks under study. This led to the introduction of a panoply of different classes of phylogenetic networks, such as time-consistent networks [3], regular networks [4], orchard networks [5], galled trees [6] and galled networks [7], level-k networks [8], tree-sibling networks [9], tree-based networks [10] and LGT networks [11], just to name a few.
In this paper, we shall focus on binary tree-child networks (BTC networks, for short), which were introduced by [9] and are one of the most studied classes of phylogenetic networks [12][13][14][15]. Mathematically, being tree-child means that every internal node is compelled to have at least a child node that is a tree node. BTC networks have been introduced in order to adjust a complex biological reality in a computationally tractable way. Although the original motivation for these networks is not biological, and hence they present some limitations, the mathematical constraint on BTC networks translates biologically as follows: every non-extant OTU is required to have at least an offspring species that evolved only through mutation. This means that not all biologically-meaningful evolutionary scenarios can be modeled with BTC networks. For example, the scenarios depicted in Fig 1(a) and 1(e) are not allowed since, in these cases, the node labeled with u has no child with a single incoming arc. Still, BTC networks are one of the most permissive classes of phylogenetic networks and they permit to model quite a lot of meaningful scenarios, and those that cannot be modeled can be approximated pretty well, see Fig 1. The combinatorial study of phylogenetic networks is nowadays a challenging and active field of research. Nevertheless, the problem of counting how many phylogenetic networks are in a given subclass of networks is still open even for long-established classes. More precisely, this problem has been only recently solved for galled networks [18]; for other classes, including tree-child networks, we only have asymptotic results [19,20]. Associated to the problem of counting networks, we find the problem of their "injective" generation, i.e. without having to check for isomorphism between pairs of constructed networks.
The main result of this paper is a systematic way of recursively generating, with unicity, all BTC networks with a given number of leaves. This generation relies on a pair of reduction/ augmentation operations -both producing BTC networks-where reductions decrease by one the number of leaves in a network, and augmentations increase it. The idea of using pairs of operations has already been used to deal either with other classes of phylogenetic networks [21,22], or for BTC networks but without the unicity feature [5].
In order to give a biological meaning to these augmentation operations, assume that the evolutive history of a given group of species is known and modeled by a BTC network, and a new species has to be taken into account. The augmentation operation determines exactly how the phylogenetic network has to be modified, and what is the minimum information needed to establish this modification, in order to model the evolution of the group of species with the newly incorporated one.
As an interesting side product, this procedure gives a recursive formula providing an upper bound on the number of BTC networks. Note also that being able to generate all BTC networks with a given number of leaves may also be interesting as part of a divide-and-conquer framework to reconstruct phylogenetic networks, where we start by computing BTC networks on 3/5 leaves that are then combined together, as done for example in [23,24].
The paper is organized as follows. In Section Methods, we review the basic definitions that will be used throughout the paper. The main part of the paper is in Section Results, which is split between different subsections. Subsection Reduction of networks is devoted to the reduction procedure, while in Subsection Generation of networks we introduce the augmentation operation and prove that any BTC network can be obtained, in a unique way, via a sequence of augmentation operations applied to the trivial network with one leaf. In Subsection Bounding  ) and (e) are not BTC networks since in both cases the node labeled with u has no tree-node child. Still, the scenario in (a) can be approximated either by the scenario in (b) or by that in (c), both scenarios being BTC networks. Also, if we are lucky enough to find an OTU between the hybrid event represented by the node u and that represented by v, e.g. the node q in (d), then the hybrid event in v can be modeled. The same reasoning holds for the scenario in (e) and those in (f,g,h). Thus, if the "true" network is not BTC, we can always find a BTC network those topology is not far from the true one. In our example, the networks in (b,c) are both a head-moving rSPR [16] away from the true network in (a). The same holds for the networks in (f,g) w.r.t. the one in (e). In general, each violation of the TC property, i.e. each hybrid node that has only hybrid children, moves the reconstructible network a head-moving rSPR away from the true one. Note that the configuration in (a) is known to generate severe indistinguishability issues [17]. the number of networks, we show how to relax the conditions for the applicability of the augmentation operation to obtain a recursive formula providing an upper bound on the number of BTC networks. In Subsection An application to phylogenetic reconstruction, we give a concrete biological application of the methods we have developed. In Subsection Computational experiments, we introduce the implementation of the algorithms presented in the paper, and some experimental results, including the exhaustive generation of all BTC networks with up to six leaves and an upper bound of their number up to ten leaves. Finally, in Section Discussion we discuss how our reduction/augmentation operations extend and generalize analogous operations for phylogenetic trees.

Methods
In this section we introduce the mathematical notations that are used in the rest of the paper.
Throughout this paper, a tree node in a directed graph is a node u whose pair of degrees d(u) = (indegree u, outdegree u) is (1, 0) for the leaves, (0, 2) for the roots, or (1, 2) for internal tree nodes; a hybrid node is a node u with d(u) = (2, 1). If two nodes u and v are linked by an arc (u, v) we say that u is a parent of v, or that v is a child of u. Also, two nodes are siblings if they have a common parent.
A binary phylogenetic network over a set X of taxa is a directed acyclic graph with a single root such that all its nodes are either tree nodes or hybrid nodes, and whose leaf set is bijectively labeled by the set X. In the following, we will implicitly identify every leaf with its label. A binary phylogenetic network is tree-child if every node either is a leaf or has at least one child that is a tree node [9]; in particular, the single child of a hybrid node must be a tree node. We will denote by BT C n the set of binary tree-child phylogenetic networks over the set [n] = {1, . . ., n}.
An elementary node in a directed graph is a node u with d(u) = (1, 1) or d(u) = (0, 1). An elementary path p is a path u 1 , . . ., u k composed of elementary nodes such that neither the single parent of u 1 (if it exists) nor the single child of u k are elementary. We call these last two nodes respectively the grantor (if this node is well-defined) and heir of the nodes in the elementary path. In case of an elementary node, its grantor and heir are those of the nodes in the single elementary path that contains the given node. The elimination of an elementary path p consists in deleting all nodes in p, together with their incident arcs, and adding an arc between the grantor and the heir of p (provided that the grantor exists; otherwise, no arc is added). The elimination of an elementary node is defined as the elimination of the elementary path that contains the given node.
Given a node u, we can split it by adding a new nodeũ, an arc ðũ; uÞ, and replacing every arc (v, u) with ðv;ũÞ. If u is a tree node, thenũ is an elementary node whose heir is u, and the elimination ofũ recovers the original network. The successive splitting (say k times) of a tree node u generates an elementary path formed by k nodes, whose heir is u, and whose elimination recovers the original network.

Reduction of networks
The goal of this subsection is to define a reduction procedure on BTC networks that can be applied to any such network, and producing a BTC network with one leaf less. By successive application of this procedure, any BTC network can thus be reduced to the trivial network with a single leaf.
We start by associating to each leaf ℓ a path whose removal will produce the desired reduction (up to elementary paths).
Let ℓ be a leaf of a BTC network N. A pre-TH-path for ℓ is a path u 1 , . . ., u r = ℓ such that (see Fig 3): 1. Each node u i in the path is a tree node.
2. For each i = 1, . . ., r − 1, the child of u i different from u i+1 , denoted by v i , is a hybrid node.

For each
A TH-path is a maximal pre-TH-path, i.e. a pre-TH-path that cannot be further extended. Note that, since all nodes in a pre-TH-path p are tree nodes, if p can be extended by prepending one node, then this extension is unique. Hence, starting with the trivial pre-TH-path formed by the leaf ℓ alone, and extending it by prepending the parent of the first node in the path as many times as possible, we obtain a TH-path that is unique by construction. Let u 1 , . . ., u r = ℓ be a TH-path; different possibilities may arise that make it maximal: (1) u 1 is the root of N; (2) the parent of u 1 , call it x, is a hybrid node; (3) x is a tree node whose both children are tree nodes; (4) x is a parent of v i for some i 2 [r − 1]. We shall see in Lemma 1 that the first case cannot hold; the other three possibilities are depicted in Fig 4. For each leaf ℓ, we denote by TH(ℓ) its single TH-path and by TH(ℓ) 1 the first node of this path. Note that we allow the case r = 1. In this case, if we are not in a trivial BTC network (i.e. a network consisting of a single node), the parent of ℓ is either a hybrid node, or a tree node whose two children are tree nodes. Lemma 1. Let N be a non-trivial BTC network and let ℓ be any of its leaves. Then, TH(ℓ) 1 cannot be the root of N. Proof. Let u 1 , . . ., u r = ℓ be the path TH(ℓ) and assume for the sake of contradiction that u 1 is the root of N. For each i = 1, . . ., r − 1, let v i be the hybrid node that is a child of u i and x i the parent of v i different from u i (see Fig 5); recall that x i does not belong to TH(ℓ) by the definition of a pre-TH-path. Since u 1 is the root of N, every node of N either belongs to the path , and since this node is descendant of x σ(i) , x i is descendant of x σ(i) . Hence, starting with x 1 we get a sequence x 1 , x σ(1) , x σ(σ(1)) , . . . where each node in the sequence is a descendant of the following one. Since there is a finite number of nodes, at some point we find a repeated node, which means that N contains a cycle and hence we have a contradiction.■ We say that a leaf ℓ is of type T (resp. of type H) if the parent of TH(ℓ) 1 is a tree node (resp. a hybrid node). If ℓ is of type H, we indicate by THð'Þ the path obtained by prepending to TH(ℓ) the parent of TH(ℓ) 1 . For convenience, we let THð'Þ ¼ TH ð'Þ if ℓ is of type T. Definition 1. Let ℓ be a leaf in a BTC network N. We define the reduction of N with respect to ℓ as the result of the following procedure (see Figs 6 and 7): 1. Delete all nodes in THð'Þ (together with any arc incident on them).

Eliminate all elementary nodes.
We indicate this reduction by R(N, ℓ). If we want to emphasize the type of the deleted leaf, we indicate the reduction by T(N, ℓ) and say it is a T-reduction if ℓ is of type T, or by H(N, ℓ) and say that it is a H-reduction if ℓ is of type H.
To ease of reading, we shall introduce some notations that will be used hereafter and are also illustrated in Figs 6 and 7: Definition 2. Let u 1 , . . ., u r = ℓ be the path TH(ℓ) and let u 0 be the first node in THð'Þ. For each i 2 [r − 1], v i is the hybrid child of u i , x i the parent of v i different from u i , and y i the single child of v i . The parent(s) of u 0 is w 1 (are w 1 , w 2 ); the node w j is always a tree node, z j is its parent (if it exists, since w j could be the root of N), and t j its child different from u 0 , where j = 1 for T-reductions and j 2 [2] for H-reductions.

Remark 1.
Since N is tree-child, the nodes y i are always tree nodes, and so are t 1 and t 2 in case of an H-reduction. In case of a T-reduction, by definition of a TH-path, t 1 is either a tree node or coincides with one of the hybrid nodes v i . Also, the removal of the arcs of the form (u i , v i ) and (w j , u 0 ) makes nodes v i and w j elementary in NnTHð'Þ, where i 2 [r − 1], and j = 1 for T-reductions and j 2 [2] for H-reductions. Since no other arc is removed, no other node can be elementary. In order to find the heirs of nodes v i and w j , we must analyse under which circumstances two of these elementary nodes are adjacent in NnTHð'Þ.
1. If we had that two nodes v i and v j were connected by an arc in NnTHð'Þ, then the single child of a hybrid node in N would be also a hybrid. This contradicts the fact that N is tree-child. 2. The existence of an arc (v i , w j ) would imply the existence of a cycle in N, which is impossible.
3. Consider now the case of an arc (w j , v i ). In case of an H-reduction, it would imply that both children of w j are hybrid nodes, which is impossible. However, such an arc can be present in a T-reduction: when t 1 is equal to v i . In this last case, w 1 and v i form an elementary path in NnTHð'Þ and their common heir is y i (see Fig 8).
4. Finally, in case of an H-reduction, it can exist an arc between w 1 and w 2 , say that the arc is (w 1 , w 2 ) (which implies, t 1 = w 2 , z 2 = w 1 ). In this case, w 1 and w 2 form an elementary path in NnTHð'Þ and their common heir is t 2 (see Fig 9).
In all other cases, the elementary nodes v i and w j are isolated, and their respective heirs are y i and t j .
We study now what we call the recovering data of a reduction. This information will be used in the next subsection to recover the original network from its reduction. Definition 3. The recovering data of the reduction N 0 = R(N, ℓ) is the pair (S 1 , S 2 ), where: • S 1 is the multiset of the nodes of N 0 that are heirs of the nodes w j . The cardinality of S 1 (as a multiset) is either 1 or 2, depending on the type of the reduction, and will be denoted by |S 1 |. The nodes inside the dotted box form THð'Þ and will be removed, which will create elementary nodes that will be substituted by arcs. https://doi.org/10.1371/journal.pcbi.1007347.g006 • S 2 is the tuple (y 1 , . . ., y r−1 ) of nodes of N 0 , which are the heirs of the nodes v i . This tuple could be empty, corresponding to the case r = 1.
We introduce now a set of conditions on multisets and tuples of nodes, and prove that the recovering data associated to any of the defined reductions satisfies them.
Definition 4. Given a BTC network N 0 and a pair (S 1 , S 2 ) with • S 1 a multiset of tree nodes of N 0 , • S 2 = (y 1 , . . ., y r−1 ), with r � 1, a (potentially empty) tuple of r − 1 tree nodes of N 0 , consider the following set of conditions: 1. For every i, j 2 [r − 1] with i 6 ¼ j, the nodes y i and y j are different, and if they are siblings, then y i 2 S 1 or y j 2 S 1 .

For every
, if y i is the child of a hybrid node or has a hybrid sibling, then y i 2 S 1 .
3. No node in S 1 is a proper descendant of any node in S 2 .
We say that (S 1 , S 2 ) is T-feasible if it satisfies conditions 1, 2, 3, and 4T, and H-feasible if it satisfies conditions 1, 2, 3, and 4H. Finally, we say that (S 1 , S 2 ) is feasible if it is either T-feasible or H-feasible. Proposition 2. Let N 0 = T(N, ℓ) be a T-reduction of a BTC network N. Then, its recovering data ({τ 1 }, (y 1 , . . ., y r−1 )) is T-feasible. Proof. First, note that, by Remark 1, all nodes in ({τ 1 }, (y 1 , . . ., y r−1 )) are tree nodes and that Condition 4T holds trivially. Note also that τ 1 is equal to y i if t 1 = v i , or to t 1 if this node is different from all the nodes v i . We now prove that Conditions 1, 2 and 3 hold: 1. If y i = y j , then in N we have v i = v j , which is impossible by definition of TH-path. If y i and y j are siblings in N 0 but none of these nodes is equal to τ 1 , then v i and v j are siblings in N, which implies that their common parent has two hybrid children, which is impossible in a BTC network.
2. If y i is the child in N 0 of a hybrid node and τ 1 6 ¼ y i , then in N we have that v i , which is a hybrid node, is the child of a hybrid node, which is impossible in a tree-child network. Analogously, if y i has a sibling in N 0 which is a hybrid node, and y i 6 ¼ τ 1 , then in N we have that v i is sibling of another hybrid node, which is again impossible.
3. The existence of a non-trivial path in N 0 from y i to τ 1 would, by construction, imply the existence of a path from y i to w 1 in N. Since there exists also a path in N from w 1 to y i , this would contradict the fact that N is a DAG.■  Proof. Again we have, by Remark 1, that all nodes in the recovering data are tree nodes. Additionally, by the same remark, we have that |S 1 | = 2 -and hence the first part of Condition 4H holds-and if (w 1 , w 2 ) is an arc of N, then S 1 = {t 2 , t 2 }, otherwise S 1 = {t 1 , t 2 } with t 1 6 ¼ t 2 . Note that Condition 3 implies that Conditions 1 and 2 can be simplified as follows: for all i, j 2 [r − 1] with i 6 ¼ j, y i and y j are neither equal nor siblings, and for all i 2 [r − 1], y i is neither the child nor the sibling of a hybrid node.
Conditions 1 and Conditions 2 and 3 in their simplified form follow using the same arguments as in the previous proposition. As for the condition 4H, the nodes τ 1 and τ 2 are different from the nodes y i since the parents of τ 1 and τ 2 in N are tree nodes, while the parent of each of the nodes y i is hybrid.■ The following proposition is the main result of this subsection, since it shows that the reduction that we have defined, when applied to a BTC network, gives another BTC network with one leaf less. Hence, successive applications of these reductions reduce any BTC network to the trivial BTC network.

Proposition 4. Let N be a BTC network over X and ℓ one of its leaves. Then, R(N, ℓ) is a BTC network over X \ {ℓ}.
Proof. First, it is easy to see that, since no new path is added, the resulting directed graph is still acyclic.
Then, we need to check that R(N, ℓ) is binary. To do so, we start noting that every node in NnTHð'Þ is either a tree node, a hybrid node, or an elementary node. Indeed, the removal of THð'Þ (Phase 1 of Definition 1) only affects the nodes adjacent to this path, that is the nodes v i and w i , which, as shown in Remark 1, become elementary. The elimination of all elementary nodes (Phase 2 of Definition 1) does not affect the indegree and outdegree of any other node, apart when the root ρ of NnTHð'Þ is elementary. In such a case, the heir of ρ becomes the new root. Hence, R(N, ℓ) is binary and rooted.
Note also that the set of leaves of R(N, ℓ) is X \ {ℓ}, since in NnTHð'Þ no node becomes a leaf and the only leaf that is removed is ℓ.
Finally, we need to prove that R(N, ℓ) is tree-child. Note that, from what we have just said about how the reduction affects indegrees and outdegrees of the nodes that persist in the network, it follows that each hybrid node of R(N, ℓ) is also a hybrid node of N, and that its parents in R(N, ℓ) are the same as in N. It follows that no node in R(N, ℓ) can have that all its children are hybrid, since this would imply that N is not tree-child, a contradiction.■ Corollary 5. Let N 2 BT C n be a BTC network over [n]. Let N n = N and define recursively In particular, N 1 is the trivial BTC network with its single node labeled by 1.
We finish this subsection with the computation of the number of tree nodes and hybrid nodes that the reduced network has, both in terms of the original network and of the reduction operation that has been applied. But before, we give an absolute bound on the number of these nodes in terms of the number of leaves.

Lemma 6. Let N be BTC network over [n] with t tree nodes and h hybrid nodes. Then t
Proof. The equality t − h = 2n − 1 follows easily from the handshake lemma taking into account the number of roots, internal tree nodes, leaves and hybrid nodes in N, and their respective indegrees and outdegrees. The inequality h � n − 1 is shown in Proposition 1 in [9], and the last inequality is a simple consequence of the equality and the inequality already proved.■ Proposition 7. Let N be a BTC network and ℓ one of its leaves, and N 0 = R(N, ℓ). Let t, h (resp. t 0 , h 0 ) be the number of tree nodes and hybrid nodes of N (resp. of N 0 ). Then where jTHð'Þj is the number of nodes in THð'Þ.
Proof. Since the number of tree nodes and hybrid nodes are linked by the equality in Lemma 6, it is enough to prove that h 0 ¼ h À jTHð'Þj þ 1. From the discussion in Remark 1, it is straightforward to see that the number of hybrid nodes in N that are not in N 0 is r − 1 if ℓ is of kind T, and r otherwise. Hence, in both cases we have h 0 ¼ h À ðjTHð'Þj À 1Þ and the result follows.■

Generation of networks
In this subsection, we consider the problem of how to revert the reductions defined in the previous subsection, taking as input the reduced network and its recovering data. This will allow us to define a procedure that, starting with the trivial BTC network with one leaf, generates all the BTC networks with any number of leaves in a unique way.
We start by defining two augmentation procedures that take as input a BTC network and a feasible pair, and produce a BTC network with one leaf more. Definition 5. Let N be a BTC network over X, ℓ a label not in X, and ({τ 1 }, (y 1 , . . ., y r−1 )) a T-feasible pair. We apply the following operations to N (see Fig 10): 1. Create a path of new nodes u 1 , . . ., u r .
2. Split the node τ 1 creating one elementary node w 1 and add an arc (w 1 , u 1 ).
3. For each node y i , split it introducing one elementary node v i and add an arc (u i , v i ).

Label the node u r by ℓ.
We denote by T −1 (N, ℓ; {τ 1 }, (y 1 , . . ., y r−1 )) the resulting network and say that it has been obtained by an augmentation operation of type T.
Note that the order in which steps 2 and 3 are done is relevant in the case that τ 1 = y i for some i 2 [r − 1]. In such a case, two nodes w 1 and v i are created, linked by an arc (w 1 , v i ) (see Fig 11). Proof. We first check that the resulting directed graph is acyclic. Let us assume thatÑ contains a cycle. If we define U 1 = {u 1 , . . ., u r } and U 2 ¼ VðÑ ÞnU 1 , we have that the only arcs connecting U 1 with U 2 are (u i , v i ) (with i = 1, . . ., r − 1), and (w 1 , u 1 ) is the only arc connecting U 2 with U 1 . The cycle can be contained neither inside U 1 , since these nodes are linked by a single path, nor inside U 2 , since otherwise N would contain a cycle. Hence, the cycle must contain at least the arc (w 1 , u 1 ) and an arc (u i , v i ). This implies the existence of a path from v i to w 1 visiting only nodes in U 2 , which in turn means that N contains a path from y i to τ 1 , against Condition 3 of Definition 4.
Note that the nodes in U 1 are tree nodes by construction. Also by construction, the node w 1 is a tree node, the nodes v i are hybrid nodes and u r is a leaf which is labelled with ℓ. Finally, the other nodes keep the same degrees they had in N and henceÑ is a binary phylogenetic network over X [ {ℓ} with h + r − 1 hybrid nodes.
Since N is tree-child, in order to check thatÑ is also tree-child, we only need to check the newly added hybrid nodes, which are the parents of the nodes v i .
Let us first consider the case that τ 1 6 ¼ y i for all i 2 [r − 1]. For each node v i , its parents are u i and the parent x i of y i in N. The node u i is by construction a tree node whose other child is u i+1 , which, in turn, is a tree node. Since τ 1 6 ¼ y i , by Condition 2 of Definition 4, y i can have neither a hybrid parent nor a hybrid sibling, and it cannot be a sibling of any other node y j with j 2 [r − 1]. This latter restriction implies that y i has the same siblingx i in N andÑ . Thus both x i andx i are not hybrid nodes, and the network is tree-child. Let us now consider the case that τ 1 = y i for a single choice of i 2 [r − 1]. The hybrid node v i inÑ has as parents the nodes w 1 and u i , and these two nodes have as respective children u 1 and u i+1 , which are tree nodes. For each other node v j with j 6 ¼ i and such that y j is a not sibling of y i , the same argument as in the previous case proves that both parents of v j have a tree child. If y j is a sibling of y i , it is easy to see that the parent of v j is still tree-child since it has w 1 as child.■ Definition 6. Let N be a BTC network over X, ℓ a label not in X, and ({τ 1 , τ 2 }, (y 1 , . . ., y r−1 ) a H-feasible pair. We apply the following operations to N (see Fig 12): 1. Create a path of new nodes u 0 , u 1 , . . ., u r .
2. Split each of the nodes τ i introducing one elementary node w i and add an arc from w i to u 0 .
Note that, if τ 1 = τ 2 , two consecutive elementary nodes must be created (see Fig 13 for this case).
3. For each node y i , split it introducing one elementary node v i and add an arc (u i , v i ).
4. Label the node u r by ℓ.
We denote by H −1 (N, ℓ;{τ 1 , τ 2 }, (y 1 , . . ., y r−1 )) the resulting network and say that it has been obtained by an augmentation operation of type H. Proposition 9. Using the notations of Definition 6, the network  Generation of Binary Tree-Child phylogenetic networks Proof. The proof is completely analogous to that of Proposition 8, taking into account that one extra hybrid node is created.■ Given a BTC network over X, a label ℓ = 2 X and a feasible pair (S 1 , S 2 ), in order to unify notations we define the augmented network R −1 (N, ℓ; S 1 , S 2 ) as T −1 (N, ℓ; S 1 , S 2 ), if |S 1 | = 1, and as H −1 (N, ℓ; S 1 , S 2 ), if |S 1 | = 2. Also, we shall generically say that the offspring of a BTC network is the set of networks that can be obtained from it by means of augmentation operations.
Our next goal is to prove that different augmentation operations applied to a same BTC network or different BTC networks over the same set of taxa provide different networks. We start with the case of different networks. Proposition 10. LetÑ 1 andÑ 2 be two BTC networks, both obtained by one augmentation operation applied to two non-isomorphic BTC networks N 1 and N 2 over the same set of taxa X. ThenÑ 1 andÑ 2 are not isomorphic.
Proof. IfÑ 1 andÑ 2 have different sets of labels, then it is clear that they are not isomorphic. We can therefore assume that both augmentation operations introduced the same new leaf ℓ. Suppose thatÑ 1 'Ñ 2 . Then RðÑ 1 ; 'Þ ' RðN 2 ; 'Þ. Now, from the definitions of the reductions and augmentations it is straightforward to check that RðÑ i ; 'Þ ¼ N i and we get that N 1 ' N 2 , a contradiction.■ We treat now the case of applying different augmentation operations to the same BTC network. But first, we give a technical lemma that will be useful in the proof of the proposition.

Lemma 11. Let N be a BTC network. Then, the identity is the only automorphism (as a leaflabeled directed graph) of N.
Proof. Let ϕ be any automorphism of N. Since ϕ is an automorphism of directed graphs and sends each leaf to itself, it follows that μ(u) = μ(ϕ(u)) for each node u of N, where μ(u) is the Generation of Binary Tree-Child phylogenetic networks μ-vector of u as defined in [9]. Then, by [9, Lemma 5c], it follows that u and ϕ(u) are either equal, or one of them is the single child of the other one; according to our definition of BTC networks, this last possibility implies that one of them is a hybrid node and the other one is a tree node, which is impossible if ϕ is an automorphism. Hence ϕ(u) = u for every node u.■ Proposition 12. LetÑ 1 andÑ 2 be two BTC networks, both obtained by one augmentation operation applied to the same BTC network N. If either the kinds of operation or the feasible pairs used to constructÑ 1 andÑ 2 are different, thenÑ 1 andÑ 2 are not isomorphic.
Proof. Let us assume thatÑ 1 andÑ 2 are isomorphic. Then, it is clear that they have the same set of labels, and exactly one of them, say ℓ, is not a label of N. SinceÑ 1 andÑ 2 are isomorphic, the kind of ℓ is the same in both networks, which implies that the kind of augmentation operations used to constructÑ 1 andÑ 2 are the same. Also, sinceÑ 1 andÑ 2 are isomorphic, the nodes in the respective recovering data of the reductions RðÑ i ; 'Þ must be linked by an isomorphism of phylogenetic networks. Therefore, and since by Lemma 11 BTC networks do not have a nontrivial automorphism, the respective recovering data must be equal.■ The following proposition shows that the reduction procedure defined in the previous subsection can be reverted using the augmentation operations presented in this subsection. Proposition 13. Let N be a BTC network and ℓ a leaf of N. Let N 0 = R(N, ℓ), (S 1 , S 2 ) its recovering data, andÑ ¼ R À 1 ðN 0 ; '; S 1 ; S 2 Þ. Then, N andÑ are isomorphic.
Proof. It is straightforward to see that the operations T −1 and H −1 reverse the effects of T and H, respectively. The only points worthy of attention correspond to the cases where the single node in S 1 appears in S 2 (for reductions/augmentations of type T) or where there is a single node in S 1 with multiplicity two (for reductions/augmentations of type H). In the first case, the augmentation process creates two elementary nodes, w 1 and v i , connected by an arc (w 1 , v i ), which is the same situation as in N after the removal of the nodes in THð'Þ. In the second case, two elementary nodes τ 1 and τ 2 are created, connected by an arc, once again the same situation as in N after the removal of the nodes in THð'Þ.■ A direct consequence of the results in this subsection is the following theorem, which can be used to generate in an effective way all BTC networks over a set of taxa. See Fig 14 for an example. Theorem 14. Let N 2 BT C n be a BTC network over [n]. Then, N can be constructed from the trivial network in BT C 1 (with one node labeled by 1) by application of n − 1 augmentation operations, where at each step i, the leaf i + 1 is added. Moreover, these augmentation operations are unique.
Proof. The existence is a direct consequence of Corollary 5 and Proposition 13. Unicity comes from Propositions 10 and 12.■ It should be noted that very recently, other methods to generate all BTC networks over a set of taxa have been proposed [5], but, to our knowledge, this is the first time that the networks are generated with unicity. In previous attempts, an isomorphism check was needed after the generation phase.

Bounding the number of networks
In this subsection, we shall first give bounds for the number of BTC networks that can be obtained from a given one by means of augmentation operations. This will be done by bounding the number of feasible pairs in such a network. Then, we shall find bounds for the number of BTC networks with a fixed number n of leaves.
Let N be a BTC network over [n] with h hybrid nodes. From Lemma 6 we know that it has t = 2n + h − 1 tree nodes, and that h � n − 1 and t � 3n − 2. In the following, we shall show how to compute the number of pairs (S 1 , S 2 ) satisfying all conditions of Definition 4, except for Condition 3, via an auxiliary problem. Note that this will only give an upper bound for the number of networks, since the pairs we find can produce networks with cycles.
An auxiliary problem. Let P(N, k) be the set of tuples of length k of tree nodes of N such that (1) no pair of them are equal or siblings, and (2) none of them has a hybrid parent or Generation of Binary Tree-Child phylogenetic networks sibling. We indicate the number of such tuples as p(N, k) = |P(N, k)|, and since this number will only depend on n, h and k, we indicate it also by p (n, h, k). We consider the problem of computing p (n, h, k).
We compute first how many tree nodes are there that neither have a hybrid parent nor a hybrid sibling. Since the single child of a hybrid node must be a tree node, there are h tree nodes that have a hybrid parent. Note that each hybrid node has two siblings that must be tree nodes; also, a tree node cannot be sibling of two different hybrid nodes; hence, there are 2h tree nodes that have a hybrid sibling. Since there cannot be a tree node having the two properties (if it has a hybrid parent, then it does not have any hybrid sibling), there are 3h tree nodes that are either a child or a sibling of a hybrid node. Then, the number of tree nodes that neither have a hybrid parent nor a hybrid sibling is t − 3h = 2n − 2h − 1. Note that this set of nodes is composed by the root of the network and pairs of tree nodes that are siblings.
Consider now the problem of counting the number of tuples (y 1 , . . ., y k ) in this set that are neither equal nor siblings. We distinguish two cases: • If none of the nodes y i is the root of N, we start having 2n − 2h − 2 choices for y 1 , and at each stage the number of choices decreases by two units. Hence, the number of choices is p 0 ðn; h; kÞ ¼ ð2n À 2h À 2Þð2n À 2h À 4Þ � � � ð2n À 2h À 2kÞ • If one of the nodes y i is the root of N, then the process of constructing an element in P(N, k) can be described as first choosing at which position i one puts the root, and then filling in the remaining k − 1 positions with a tuple of the set P(N, k − 1) such that none of the nodes is the root (which is what we have just computed). Hence, the number of possibilities is p 1 ðn; h; kÞ ¼ k2 kÀ 1 ðn À h À 1Þ! ðn À h À kÞ! : Then we get that pðn; h; kÞ ¼ p 0 ðn; h; kÞ þ p 1 ðn; h; kÞ Counting pairs satisfying conditions 1, 2 and 4H. Consider pairs (S 1 , S 2 ) satisfying Conditions 1, 2 and 4H. Recall that, since condition 4H implies that S 1 and S 2 cannot have elements in common, Conditions 1 and 2 are simplified: no pair of nodes in S 2 can be siblings and none of them can either be the child of a hybrid node or have a hybrid sibling. Hence, the problem is equivalent to finding a tuple (y 1 , . . ., y r−1 ) in P(N, r − 1) and then either a tree node τ 1 or an unordered pair {τ 1 , τ 2 } of different tree nodes, in either case disjoint from those in (y 1 , . . ., y r−1 ). Once the tuple (y 1 , . . ., y r−1 ) is fixed, the number of tree nodes available for choosing τ 1 and τ 2 is t − r + 1 = 2n + h − r. Hence, the number of possible pairs is Counting pairs satisfying conditions 1, 2 and 4T. The problem now is to count the ways of choosing S 1 = {τ 1 } and a tuple S 2 = (y 1 , . . ., y r−1 ) satisfying Conditions 1, 2 and 4T. Now τ 1 can appear in S 2 , and different possibilities arise, since it allows that one of the nodes in S 2 has a sibling in S 2 , or that it has a hybrid parent or sibling. We consider, thus, these different possibilities: • τ 1 6 ¼ y i (for all i): This case is very similar to the one considered in the previous paragraph, specifically the case where only a single node τ 1 had to be taken. The number of possible pairs is F T;1 ðn; h; r À 1Þ ¼ pðn; h; r À 1Þ � ð2n þ h À rÞ: • τ 1 = y i is a child or a sibling of a hybrid node: Choosing one of these pairs is equivalent to first choosing the position i, then filling the other r − 2 positions with a tuple in P(N, r − 2), and then choosing a node that is a child or sibling of a hybrid node to be put in the position i. The number of ways to do this procedure is F T;2 ðn; h; r À 1Þ ¼ pðn; h; r À 2Þ � ðr À 1Þ � 3h; since each hybrid node has a single child and two siblings, and none of these 3h nodes appears twice, associated to two different hybrid nodes.
• τ 1 = y i is a sibling of some other node y j in S 2 : In this case one has to choose the positions i and j where to put the pair of sibling nodes, fill the other r − 3 positions with a tuple in P(N, r − 3), choose a pair of sibling tree nodes to take as y i and y j , and finally set τ 1 = y i . The choice of i and j can be done in (r − 1)(r − 2) different ways. The choice of the tuple of length r − 3 can be done in p(n, h, r − 3) ways; p 1 (n, h, r − 3) of them contain the root of N (and r − 4 tree nodes with a sibling tree node) and p 0 (n, h, r − 3) do not contain the root (and contain r − 3 tree nodes with a sibling tree node). Once this is done, the number of available pairs of sibling tree nodes is Hence, the total number of pairs is F T,3 (n, h, r − 1) = F T,3, A (n, h, r − 1) + F T,3,B (n, h, r − 1), corresponding to these two cases, with: F T;3;A ðn; h; r À 1Þ ¼ ðr À 1Þðr À 2Þ � p 1 ðn; h; r À 3Þ � ð2n À 2h À 2r þ 6Þ; F T;3;B ðn; h; r À 1Þ ¼ ðr À 1Þðr À 2Þ � p 0 ðn; h; r À 3Þ � ð2n À 2h À 2r þ 4Þ: • τ 1 = y i but none of the previous conditions hold: In this case one only has to take a tuple in P(N, r − 1) and choose which of the r −1 nodes to take as τ 1 . The number of possible pairs is then F T;4 ðn; h; r À 1Þ ¼ pðn; h; r À 1Þ � ðr À 1Þ: Note that the four conditions above are mutually exclusive. Hence, the overall number of possible pairs (S 1 , S 2 ) is the sum of all numbers found: F T ðn; h; r À 1Þ ¼ F T;1 ðn; h; r À 1Þ þ F T;2 ðn; h; r À 1Þ þ F T;3 ðn; h; r À 1Þ þ F T;4 ðn; h; r À 1Þ: Bounds for the number of networks. Each network N 2 BT C n with h hybrid nodes, appears as augmentation R −1 (N 0 , n, S 1 , S 2 ) of a unique network N 0 2 BT C nÀ 1 with h 0 hybrid nodes, where S 2 has length r − we call B(n, h) the number of networks in BT C n with h hybrid nodes, and since we have bounded the number of feasible pairs, we have that Also, since the number of hybrid nodes in a BTC network with n leaves is at most n − 1, we have that Bðn; hÞ; and the expression above allows us to compute a bound for this number of networks. See Subsection Computational experiments for an experiment with these bounds.
The asymptotic formula jBT C n j ¼ 2 2n log nþOðnÞ is given in [19], and both our experimental results in Subsection Computational experiments for n � 8 and the bounds that we have computed for n � 10 are coherent with this expression. However, the problem of finding a closed expression for the asymptotic behaviour of our bounds is still open.

An application to phylogenetic reconstruction
Several models of reticulate evolution on biological sequences have been proposed in the last decades, for example the displayed trees model [25], an extension of the multispecies coalescent (MSC) to phylogenetic networks [26] and the ancestral recombination graph model -ARG for short [27]-to only name a few. The associated problems are difficult to solve and big efforts have been done by the community to provide practitioners with fast algorithms.
Suppose we are given a BTC network N over a set of OTUs X, where each tree node is associated with a word in an alphabet (for instance a DNA sequence) s(u) 2 S � . The pair (N, s) can, for example, be the outcome of an ML search in the space of BTC networks given an alignment over X. Now, suppose we are given a new sequence and we want to update N to include it, ensuring that the resulting network is still BTC. We may want to do this, for instance, to update the network without redoing the whole ML search, or in a phylogenetic placement perspective (for example, we want to know where to place a given strain of a virus in N), or even because we use a heuristic algorithm that reconstructs a network by adding one sequence at the time.
We assume that a model of evolution is given, and we assume that we can compute the following probabilities: 1. Given s, s 0 2 S � , P S (s, s 0 ) is the probability that the sequence s evolved by descent with modification giving as a result the sequence s 0 .
2. Given s 1 , s 2 , s 0 2 S � , P H (s 1 , s 2 , s 0 ) is the probability that a hybridization between sequences s 1 and s 2 -possibly coupled with descent with modification-gives as result the sequence s 0 .
For each tree node t of N, we let ϕ t : S � ! [0, 1] be the function defined as follows. If t is the root of N, then ϕ t is the constant function equal to 1. Otherwise, if the single parent p of t is a tree node, then ϕ t (s) = P S (s(p), s). If p is a hybrid node with parents g 1 , g 2 , then ϕ t (s) = P H (s(g 1 ), s(g 2 ), s). That is, ϕ t (s) is the probability that a given sequence s is the result of the evolution of the sequences at the parent node (or grandparents, in case of hybrid parent) of t. Now, we want to extend N to another BTC network in order to include an extant OTU ℓ = 2 X identified by its sequence s ℓ 2 S � , while keeping the sequences associated to all tree nodes of N. According to the results presented in this paper, we need to identify the augmentation operation R −1 (N, ℓ; S 1 , S 2 ) that has to be applied, and determine the sequences at the newly created tree nodes. If the operation to be applied is of type T, that is,Ñ ¼ T À 1 ðN; '; S 1 ; S 2 Þ, we need to find certain nodes τ 1 , y 1 , . . ., y r−1 , with the additional condition that S 1 = {τ 1 } and S 2 = (y 1 , . . ., y r−1 ) form a T-feasible pair. Analogously, if it is of type H,Ñ ¼ H À 1 ðN; '; S 1 ; S 2 Þ, then S 1 = {τ 1 , τ 2 } and S 2 = (y 1 , . . ., y r−1 ) must form a H-feasible pair.
Intuitively, the node τ 1 in case of an augmentation of type T, or the nodes τ 1 and τ 2 in case of type H, have to be chosen in order to maximize the probability of appearance of the new OTU, while the other nodes appear in order to give a better explanation of the corresponding sequences by means of hybridization with the lineage leading to ℓ.
We present here an heuristic to find the augmentation operation, together with the assignment of sequences to new tree nodes, that deploys this intuitive idea: 1. Assume that an augmentation of type T is going to take place. To determine τ 1 , for each tree node t of N, we find a sequence σ(t) 2 S � that maximizes pðtÞ ¼ � t ðsðtÞÞ � P S ðsðtÞ; sðtÞÞ � P S ðsðtÞ; s ' Þ: The rationale behind this expression is that we look for the best way to divide the arc entering t to add the new taxon with sequence s ℓ as child of the newly created node. See Fig 15  (left) for a depiction of this. Then τ 1 is a node with the maximum value of π over all nodes of N, that is the best location where to hang s ℓ in N. For future reference, let σ T = σ(τ 1 ), π T = π(τ 1 ) and S T 1 ¼ ft 1 g.

2.
Assume that an augmentation of type H is going to take place. To determine τ 1 , τ 2 , for each unordered pair of tree nodes {t 1 , t 2 } ≔ t of N, we find sequences σ 1 (t), σ 2 (t) 2 S � that maximize 3. If π T � π H , we opt for an augmentation of type T and we let S 1 ¼ S T 1 ; otherwise, we opt for an augmentation of type H and we let S 1 ¼ S H 1 . The tree nodes in R −1 (N, ℓ; S 1 , ;) that were present in N keep their sequences. Moreover, in case of an augmentation of type T, we subdivide the arc entering τ 1 via a new node w 1 associated to the sequence σ T and we add a new leaf ℓ with sequence s ℓ as child of w 1 . In case of an augmentation of type H, we subdivide the arcs entering τ 1 and τ 2 via two new nodes w 1 , w 2 that are assigned to the two sequences s H 1 ; s H 2 ; then, we add a new hybrid node with parents w 1 and w 2 and having as child a new leaf ℓ with sequence s ℓ .
4. For each k � 1, we assume that y 1 , . . ., y k−1 are already determined. Let C be the set of tree nodes y such that (S 1 , (y 1 , . . ., y k−1 , y)) is a feasible pair. To determine y k we proceed as follows: • If k = 1 and we opted for a type H augmentation, for each y 2 C with parent p, we find a sequence σ(y) that maximizes  Generation of Binary Tree-Child phylogenetic networks and this case is really exceptional because of the definition of feasible pair, then the computation above, and the one in the next item, should be adapted. If κ(y) = π(y) − P S (s(p), s(y)) P H ðs H 1 ; s H 2 ; s ' Þ is negative, we remove y from C since this means that the hypothesis of the existence of a hybridization just above y is less likely than its absence.
• If k > 1 or we opted for a type T augmentation, for each y 2 C with parent p, we find a sequence σ(y) that maximizes pðyÞ ¼ P S ðsðy kÀ 1 Þ; sðyÞÞ � P H ðsðyÞ; sðpÞ; sðyÞÞ � P S ðsðyÞ; s ' Þ; where in case that k = 1 (and hence we opted for a type T augmentation), we let y 0 = τ 1 . See  Fig 16(right). If κ(y) = π(y) − P S (s(p), s(y))P S (σ(y k−1 ), s ℓ ) is negative, we remove y from C as in the previous case.
Then, if C is empty we output the networkÑ ¼ R À 1 ðN; '; S 1 ; ðy 1 ; . . . ; y kÀ 1 ÞÞ. Otherwise, let y k the node that maximizes κ. Then, we create a new tree node u k on the arc entering ℓ -associating the sequence σ(y k ) to it-and we subdivide the arc entering y k by a new hybrid node with second parent u k . The tree nodes in R −1 (N, ℓ; S 1 , (y 1 , . . ., y k−1 , y k )) that appeared in R −1 (N, ℓ; S 1 , (y 1 , . . ., y k−1 )) keep their associated sequence.
We emphasize that we do not claim that the heuristic we present here gives a global optimum. In fact, usually a sequence of optimal choices does not lead to a global optimum. The analysis, and eventually improvement, of this method of reconstruction is left as future work.  The network N (which is in fact a tree) that fits these extant OTUs best, together with an optimal assignment of sequences to all nodes is shown in Fig 17(left). Now, we wish to extend N in order to add a new OTU with sequence sðdÞ ¼ AACC: We thus proceed as discussed in the previous pages: 1. If we assume an augmentation of type T, it is not difficult to see that an optimal choice for τ 1 and its corresponding sequence σ T are respectively α and AAAC, with π(α) = μ 2 (1 − 2μ) 10 .
4. Now we want to find the right choice for y 1 , if any. All nodes except the least common ancestor (in N 0 ) of α and δ are in C. Taking any node y 2 C different from β we get that κ (y) < 0 and hence they are not good candidates. If we take y = β, taking into account that μ < 1/3, we find an optimal sequence σ(β) = AACC. The value of π(β) corresponds to three different evolution processes: two mutations, from AAAC to AACC and from AACC to AACC, and a hybridization of the sequences AACC and BBBB to BBCC, and hence we get π(β) = (1 − 2μ) 7 μ/2. Now, this value must be compared with the probability of evolution without this hybridization, i.e. the probability of speciations from BBBB to BBCC and from AAAC to AACC which is μ 3 (1 − 2μ) 5 . Since (1 − 2μ) 7 μ/2 > μ 3 (1 − 2μ) 5 (assuming that μ < 0.2928, which is a reasonable assumption) we conclude that the network N 1 = T −1 (N, δ; {α}, (β)), depicted in Fig 17(right), is a better explanation than N 0 . Hence, we let y 1 = β.
5. If we repeat the procedure in the previous step, we find that no hybridization improves the probability of the sequences, giving as final result the networkÑ ¼ T À 1 ðN; d; fag; ðbÞÞ in Fig 17(right).

Computational experiments
The algorithms in this paper have been implemented in python using the python library Phy-loNetworks [28]. This implementation, together with the sources for the experiments that we comment in this subsection can be downloaded from https://github.com/bielcardona/ TCGenerators. Exhaustive and sequential construction of networks in BT C n . We have implemented both the exhaustive and sequential construction of BTC networks with n leaves. The number of such networks increases very rapidly, and hence the exhaustive construction is not feasible for n � 8. For n � 7 we generated all the networks in BT C n ; see Table 1 for the number of such networks. For n = 8 we could not compute them all, since there are around twelve trillion of such networks: We took uniform samples of networks in BT C 7 and computed their We start with a tree on three leaves (left), chose a type T augmentation and find the best choice for τ 1 (middle) and the best choice for the vector (y 1 , . . ., y k ) (right, here k = 1).
https://doi.org/10.1371/journal.pcbi.1007347.g017 respective offspring, and repeated this procedure until the average number of offsprings per network stabilized up to 4 digits; this allowed us to give the estimate for jBT C 8 j.
Random construction of networks in BT C n . We have implemented the following construction, that does not generate networks uniformly, but is the closest we could get to it. We start with the network N 1 with a single node labeled by 1. At each stage i = 1, . . ., n − 1, we explicitly find all feasible pairs inside N i and choose at random and uniformly one of them to generate the network N i+1 . This procedure generates all possible networks in BT C n , but not uniformly, since different networks over the same set of taxa may have different numbers of feasible pairs. Computation of bounds for jBT C n j. Finally, we have implemented the recursive computation for the upper bounds of jBT C n j using the bounds for the offsprings of BTC networks found previously. The results for n up to 10 are given in Table 1, where it is observed that, at least for small values of n, the true number of networks and the upper bounds have the same order of magnitude.

Discussion
The main result of this paper is a systematic way of recursively generating, with unicity, all BTC networks with a given number of leaves. This procedure relies on a pair of reduction/augmentation operations that generalize analogous operations for phylogenetic trees. Indeed, given a (rooted, binary) phylogenetic tree over [n], we can obtain a phylogenetic tree over [n − 1] by deleting the leaf labeled by n and removing the elementary node that this deletion generates. Conversely, given a tree T over [n − 1] and one of its nodes u, we can construct a tree over [n] by simply hanging a pendant leaf labeled by n to the single incoming arc of u. Since different choices for T and u give different trees over [n], this gives a recursive procedure to generate, with unicity, all binary rooted phylogenetic trees over a given set of taxa: we start with the leaf labeled by 1, then we add the leaf labeled by 2, then the leaf labeled by 3 in all possible ways, and so on. Biologically, we can think of this procedure as follows: Once the evolutionary history of a given set of OTUs is correctly established (notice that, in practice, we can never be sure that we got the correct tree, but here we suppose we do) and modeled by a phylogenetic tree, extending this evolutionary history to consider a "new" OTU n consists in finding where to place n in the tree, i.e. finding the speciation event that leads to the diversification of n.
Unfortunately, when working with classes of phylogenetic networks, the removal of a single leaf (and of all elementary nodes created by this removal) does not necessarily give a phylogenetic network within the same class. In the case of BTC networks, we were able to find the Generation of Binary Tree-Child phylogenetic networks minimal set of nodes that one must remove so that, after their deletion and that of all elementary nodes created by this removal, one gets a BTC network with one leaf less. As in the case of trees, given a BTC network over [n − 1] and some set of nodes with certain restrictions (i.e. the feasible pairs S 1 and S 2 ) we can construct a BTC network over [n] leaves, in such a way that different choices for the BTC network or for the feasible pair give different BTC networks over [n]. Hence, we find a procedure to recursively generate all BTC networks over a given set of taxa. Biologically, we can think of this procedure as an extension of what can happen when adding a new OTU n to a phylogenetic tree: here the diversification of n can involve a reticulated event (when n is added as hybrid node) and the ancestors of n participate to |S 2 | reticulated events, which were impossible to detect before the introduction of n.