The hybrid number of a ploidy profile

Polyploidization, whereby an organism inherits multiple copies of the genome of their parents, is an important evolutionary event that has been observed in plants and animals. One way to study such events is in terms of the ploidy number of the species that make up a dataset of interest. It is therefore natural to ask: How much information about the evolutionary past of the set of species that form a dataset can be gleaned from the ploidy numbers of the species? To help answer this question, we introduce and study the novel concept of a ploidy profile which allows us to formalize it in terms of a multiplicity vector indexed by the species the dataset is comprised of. Using the framework of a phylogenetic network, we present a closed formula for computing the hybrid number (i.e. the minimal number of polyploidization events required to explain a ploidy profile) of a large class of ploidy profiles. This formula relies on the construction of a certain phylogenetic network from the simplification sequence of a ploidy profile and the hybrid number of the ploidy profile with which this construction is initialized. Both of them can be computed easily in case the ploidy numbers that make up the ploidy profile are not too large. To help illustrate the applicability of our approach, we apply it to a simplified version of a publicly available Viola dataset.


Introduction
Datasets such as the Viola dataset considered in Marcussen et al. (2012) arise when species inherit multiple sets of chromosomes from their parents. Generally referred to as polyploidization, this can be due to whole genome duplication (also called autopolyplodization) as in the case of e.g. watermelons and bananas Varoquaux et al. (2000), or by obtaining an additional complete set of chromosomes via hybridization (also called allopolyploidization), as in the case of the frog genus Xenopus Ownbey (1950). This poses the following intriguing question at the center of this paper: How much information about the evolutionary past of a set of species can be gleaned from the ploidy number (i.e. the number of complete chromosome sets in a genome) of the species? Evoking parsimony to capture the idea that polyploidization is a relatively rare evolutionary event we re-phrase this question as follows: What is the minimum number of polyploidization events necessary to explain a dataset's observed ploidy profile. For a set X of species that make up a dataset, we define such a profile to be the multiplicity vector (m 1 , . . . , m n ) for n = |X |, indexed by the species in X where, for each 1 ≤ i ≤ n, the ploidy number of species i ∈ X is m i ≥ 1.
As it turns out, an answer to this question is well-known if the ploidy profile in question is presented in terms of a multi-labelled tree (see e.g. Marcussen et al. 2015Marcussen et al. , 2012. Since it is, however, not always clear how to derive a biologically meaningful multi-labelled tree from the dataset in the first place Huber et al. (2012), we focus here on ploidy profiles for which such a tree is not necessarily available.
Due to the reticulate nature of the signal left behind by polyploidization Sagitov et al. (2013), Wagner et al. (2017), Waight et al. (2020), phylogenetic networks offer themselves as a natural framework to formalize and answer our question. Although we present a definition of such structures (and all other concepts used in this section) below, from an intuition development point of view, it suffices to observe at this stage that a phylogenetic network can sometimes be thought of as a rooted directed bifurcating tree T with a pre-given set X as leaves to which additional arcs have been added via joining subdivision vertices of arcs of T so that the following property holds. The resulting graph is a rooted directed acyclic graph with leaf set X such that a subdivision vertex v of T either only has additional arcs starting at it or only additional arcs ending at it. For our purposes we only allow the case that v has one additional outgoing arc. Subdivision vertices that have at least one additional incoming arc are called hybrid vertices and are assumed to represent reticulate evolutionary events such as polyploidization. If a hybrid vertex in a phylogenetic network N also has overall degree three then N is generally called a binary phylogenetic network. We refer the interested reader to Fig. 1i for an example of a binary phylogenetic network on X = {x 1 , x 2 , x 3 , x 4 } that is obtained from the tree depicted in Fig. 1ii and to Gusfield (2014), Huber and Moulton (2013), Huson et al. (2010), Steel (2016) for methodology and construction algorithms surrounding phylogenetic networks. Note that to be able to account for autopolyploidization, we deviate from the usual notion of a phylogenetic network by allowing our phylogenetic networks to have parallel arcs (but no loops) -see e.g. Huber et al. (2021), Van Iersel et al. (2020) and the references therein for further results concerning such networks.
By taking for every leaf x of a binary phylogenetic network N on some finite set X the number of directed paths from the root of N to x, every phylogenetic network induces a multiplicity vector m indexed by the elements in X . Saying that N realizes m in this case (see Sect. 3 for an extension of this concept to phylogenetic networks) allows us to formalize our question as follows. Suppose m is a ploidy profile indexed by the elements of some finite set X . What can be said about the minimum number of hybrid vertices required by a binary phylogenetic network on X to realize m? We call this number which is central to the paper the hybrid number of m and denote it by h(m). If a binary phylogenetic network N has h(m) hybrid vertices then we also say that N attains m (see again Sect. 3 for an extension of this concept to phylogenetic networks). The interested reader is referred to Steel (2016) for an overview of the related concept of the hybrid number of a set of phylogenetic trees (i.e. leaf-labelled rooted trees without any vertices of indegree and outdegree one whose leaf set is a pre-given set).
Before proceeding with presenting an example to help illustrate this question we remark that multiplicity vectors realized by binary phylogenetic networks have been used in Rossello et al. (2008) to define a metric for a certain class of binary phylogenetic networks. Furthermore, the stronger assumption that the number of directed paths from every vertex of a binary phylogenetic network N to every leaf of N is known, has led to the introduction of the concept of an ancestral profile for N Steel et al. (2019).
Returning to our question, consider the ploidy profile m = (12, 6, 6, 5) indexed by X = {x 1 , x 2 , x 3 , x 4 } where the multiplicity of x 1 is 12, that of x 2 and x 3 is 6, and that of x 4 is 5. Since no binary phylogenetic network on one leaf and two hybrid vertices can realize the ploidy profile m = (5) because it has at most 2 2 = 4 directed paths from the root to the leaf, it follows that a binary phylogenetic network that realizes m and therefore also m must have at least three hybrid vertices. In fact, the subnetwork N in bold of the phylogenetic network depicted in Fig. 1i is the unique (subject to letting the arc a finish at a subdivision vertex of an outgoing or incoming arc of the hybrid vertex h or letting a start at a subdivision vertex of an outgoing or incoming arc of the vertex t) binary phylogenetic network that realizes m and uses a minimum number of hybrid vertices. To be able to realize the ploidy profile (6, 5) and therefore also the ploidy profile m = (6, 6, 5) at least four hybrid vertices are therefore needed. By counting directed paths from the root to each leaf of the phylogenetic network depicted in Fig. 1i with x 1 , the hybrid vertex h above x 1 , the two incoming arcs of h , and the arc (h , x 1 ) removed and any resulting vertices of indegree and outdegree one suppressed clearly realizes m . Calling that phylogenetic network N then, in a similar sense as N , we also have that N is unique. To obtain a binary phylogenetic network from N that realizes m at least one further hybrid vertex is needed. Again by counting directed paths from the root to each leaf, it is easy to check that the binary phylogenetic network N (m) depicted in Fig. 1i realizes m and postulates five hybrid vertices. As we shall see as a direct consequence of Theorem 2, h(N ) = 5. As a further consequence of that theorem, we obtain a closed formula for the hybrid number of a ploidy profile (Corollary 1).
The outline of the paper is as follows. In the next section, we present some relevant basic terminology and notation concerning phylogenetic networks. This also includes an unfold-operation for phylogenetic networks and a fold-up operation that generates Fig. 1 i One of potentially many phylogenetic networks that realize the ploidy profile m = (12, 6, 6, 5) on To improve clarity of exposition, we always assume that arcs are directed downward, away from the root. ii A (phylogenetic) tree to which subdivision vertices and arcs have been added to obtain the phylogenetic network in i -see the text for details phylogenetic networks, both of which were introduced originally in Huber and . In Sect. 3, we extend the concept of attainment from binary phylogenetic networks to phylogenetic networks and study structural properties of phylogenetic networks that attain ploidy profile. As part of this, we introduce the two main concepts of the paper: a simple ploidy profile and an attainment of a ploidy profile. In Sect. 4, we associate two binary phylogenetic networks to a simple ploidy profile m which we denote by D(m) and B(m), respectively. As we shall see, the former is based on the prime factor decomposition of a positive integer m and the latter on a binary representation of m.
In Sect. 5, we associate a sequence σ (m) to a ploidy profile m which we call the simplification sequence of m (Algorithm 1). As part of this, we also present some basic results concerning such sequences. This includes an infinite family of ploidy profiles that shows that such a sequence can grow exponentially large. Denoting the last element of the simplification sequence for m by m t , we then employ a traceback through σ (m) to obtain the aforementioned binary phylogenetic network N (m) from a binary phylogenetic network that attains m t (Algorithm 2). Motivated by our partial results for binary phylogenetic networks that realize a simple ploidy profile summarized in Theorem 1, we provide an upper bound on the hybrid number h(m) of a ploidy profile m for special cases of m (Proposition 2).
After collecting some preliminary results for N (m) in Sect. 5, we establish in Sect. 6 that N (m) attains m for a large class of ploidy profiles m (Theorem 2). In Sect. 7, we turn our attention to computing the hybrid number of the ploidy profile of a simplified version of the aforementioned Viola dataset from Marcussen et al. (2012). We conclude with Sect. 8 where we outline potential directions of further research.

Preliminaries
We start with introducing basic concepts surrounding phylogenetic networks. Subsequent to this, we briefly describe two basic operations concerning phylogenetic networks that are central for establishing a key result (Proposition 1). For the convenience of the reader, we illustrate both operations in Figs. 2 and 3 by means of an example. Throughout the paper we assume that X is a non-empty finite set. We denote the size of X by n.

Basic concepts
Suppose for the following that G is a rooted directed connected acyclic graph which might contain parallel arcs but no loops. Then we denote the vertex set of G by V (G) and its set of arcs by A(G). We denote an arc a ∈ A(G) starting at a vertex u and ending in a vertex v by (u, v) and refer to u as the tail of a and to v as the head of a. We call an arc a ∈ A(G) a cut-arc if the deletion of a disconnects G. We call a cut-arc a of G trivial if the head of a is a leaf. Following Van Iersel et al. (2020), we call an induced subgraph of G with two vertices u and v and two parallel arcs form u to v a bead of G.
Suppose v ∈ V (G). Then we refer to the number of arcs coming into v as the indegree of v, denoted by indeg G (v), and the number of outgoing arcs of v as the outdegree of v, denoted by outdeg G (v). If G is clear from the context then we will omit the subscript in indeg G (v) and outdeg G (v), respectively. We call v the root of G, denoted by ρ G , if indeg(v) = 0, and we call v a leaf of G if indeg(v) = 1 and outdeg(v) = 0. We denote the set of leaves of G by L(G). We call v a tree vertex if outdeg(v) = 2 and indeg(v) = 1. And we call v a hybrid vertex if indeg(v) ≥ 2 and outdeg(v) = 1. We denote the set of hybrid vertices of G by H (G). We call any two leaves x and y of G a cherry, denoted by {x, y}, if x and y share a parent. We say that G is binary if, outdeg(ρ G ) = 2 and, for all v ∈ V (G) − L(G) other than ρ G , we have that the degree sum is three. We say that a vertex w ∈ V (G) is above v if there exists a directed path P from w to v. In that case, we also say that v is below w. If, in addition, v = w then we say that w is strictly above v and that v is strictly below w.
We call G a (phylogenetic) network (on X ) if L(G) = X , every vertex v ∈ V (G) − L(G) other than ρ G is a tree vertex or a hybrid vertex and outdeg(ρ G ) = 2. Note that phylogenetic networks in our sense were called semi-resolved phylogenetic networks in . Also note that our definition of a phylogenetic network differs from the standard definition of such an object (see e.g. Steel 2016) by allowing beads. To emphasise that a phylogenetic network has no beads, we will sometimes refer to it as a beadless phylogenetic network.
Suppose G is a phylogenetic network on X . Then following Bordewich and Semple (2007), we define the hybrid number h(G) of G to be We refer to a phylogenetic network G (on X ) as a phylogenetic tree (on X ) if h(G) = 0. For a phylogenetic tree T on X and a non-root vertex v ∈ V (T ) we denote by T (v) the subtree of T obtained by deleting the incoming arc of v and the subsequently generated connected component that does not contain v.
Suppose that N is a phylogenetic network on X . Then we denote the number of directed paths from the root ρ N of N to a leaf x of N by m N (x). In case N is clear from the context, we will write m(x) rather than m N (x). For N a further phylogenetic network on X , we say that N and N are equivalent if there exists a graph isomorphism between N and N that is the identity on X . Furthermore, we say that N is a (binary) resolution of N if N is obtained from N by resolving all vertices in H (N ) so that every vertex in H (N ) has indegree two. Note that for any resolution N of N , we have h(N ) = |H (N )| = h(N ).

The fold-up F(U(N)) of the unfold U(N) of a phylogenetic network N
Phylogenetic trees on X were generalized in  to so called multi-labelled trees (on X ) or MUL-trees (on X ), for short, by replacing the leaf set of a phylogenetic tree by a multiset Y on X . Put differently, X is the set obtained from Y by ignoring the multiplicities of the elements in Y . As was pointed out in the same paper, every phylogenetic network N gives rise to a MUL-tree U (N ) on X by recording, for every vertex v of N , every directed path from the root ρ N of N to v. More precisely, the vertex set of U (N ) is, for all vertices v ∈ V (N ), the set of all directed paths P from ρ N to v where we identify P with its end vertex v. Two vertices P and P in U (N ) are joined by an arc (P , P) if there exists an arc a ∈ A(N ) such that P is obtained from P by extending P by the arc a. For example, the vertex u in Fig. 2i is the directed path ρ, s, u in the phylogenetic network in Fig. 2iv which crosses the arc a. The vertex v in Fig. 2i is the directed path ρ, s, u in Fig. 2iv which crosses the arc a .
Reading Fig. 2 from left to right suggests that the unfolding operation can also be reversed. We next briefly outline this reversal operation which may be thought of as the fold-up of a MUL-tree M into a phylogenetic network F(M) (see Moulton 2006 for details, Huber et al. 2016; Scholz 2020 for more on both constructions, and Fig. 3 for an example). To make this more precise, we require further terminology. Suppose that M is a MUL-tree on X . Then we denote for a non-root vertex v of M the parent of v by v. Extending the relevant notions from phylogenetic trees to MUL-trees, we say that a subMUL-tree T with root u of M is inextendible if there exists a subMUL-tree T of M with root vertex w = u such that T and T are equivalent and either v = w or v = w and T (v) and T (w) are not equivalent. By definition, every subMUL-tree of M that is equivalent with an inextendible subMUL-tree of M is necessarily also inextendible. In view of this, we refer to an inextendible subMUL-tree T of M as maximal inextendible if no subMULtree of M that is equivalent with T is a subMUL-tree of an inextendible subMUL-tree of M. So, for example, the subMUL-tree T (u) of the MUL-tree M depicted in Fig. 3i is inextendible but the subMUL-tree T (u ) is not. In fact, T (u) is maximal inextendible because the only equivalent copy of To construct F(M), we first construct a sequence γ M of subMUL-trees of M which we call a guide sequence for F(M) and which we initialize with the empty sequence. Let T denote a maximal inextendible subMUL-tree of M. Let u denote the root of T , and let U = U u ⊆ V (M) denote the set of vertices v ∈ V (M) such that the subMULtree rooted at v is equivalent with T (u). Note that, by definition, |U | ≥ 2. Then, for all v ∈ U , we first subdivide the incoming arc of v by a vertex h v (cf Fig. 2ii and then identify all vertices h v , v ∈ U , with the vertex h u (cf Fig. 2iii. By construction, h u clearly has |U | incoming arcs and also |U | outgoing arcs. From these |U | outgoing arcs of h u , we delete all but one arc and, for each deleted arc a, we remove the subMULtree T (v) rooted at the head v of a ( Fig. 2iv. We then grow γ M by adding an equivalent copy of T (u) at the end of γ M in case γ M is not the empty sequence. Otherwise we add T (u) as the first element to γ M . Replacing M with the resulting graph N U , we then find a new maximal inextendible subMUL-tree in N U and proceed as before (where we canonically extend the notions of a maximal inextendible subMUL-tree and of a subMUL-tree rooted at a vertex to N U ). In the case of the example in Fig. 3, the next maximal inextendible subMUL-tree in Fig. 3ii is one of the leaves labelled x 1 .
By construction, the process of subdividing (cf Fig. 2ii, identifying (cf Fig. 2iii, and deleting (cf Fig. 2iv terminates in a phylogenetic network on X . That network is F(M). We depict F(M) in Fig. 3(iv) for the MUL-tree M pictured in Fig. 3i.
As was pointed out in , Section 6), F(M) is independent of the order in which ties are resolved when processing maximal inextendible subMUL-trees. Also, all tree vertices of F(M) have outdegree two because M is a binary MUL-tree. However, F(M) might contain hybrid vertices whose indegree is two or more since when processing a maximal inextendible subMUL-tree T there might be more than two subMUL-trees in the graph generated thus far that are equivalent with T . Finally, F(M) cannot contain arcs whose tail and head is a hybrid vertex because the hybrid vertices of F(M) are in bijective correspondence with the elements in the guide sequence for F(M). Fig. 3 i The MUL-tree M obtained by unfolding the phylogenetic network on {x 1 , x 2 } pictured in iv. The vertices u and v as indicated in i are the root of the maximal inexendible subtrees of M to which the subdivision, identification and deletion process described in Fig. 2 is applied to obtain the rooted directed acyclic graph G presented in iii. The two leaves labelled x 1 in G are the roots of two equivalent maximal inextendible subtree of G and applying the subdivision, identification, and deletion process to it results in F(M). In each case, the equivalent subMUL-trees are indicated by a double arrow We conclude the outline of both constructions with the following remark. Suppose N is a phylogenetic network on X . Then we call two tree vertices u and

Properties of phylogenetic networks that attain the hybrid number of a ploidy profile
In this section, we collect structural properties of phylogenetic networks that attain the hybrid number of a ploidy profile. For ease of readability, we will assume from now on that for a ploidy profile m = (m 1 , . . . , m n ) on X the elements in X are always ordered in such a way that m(x i ) = m i holds for all 1 ≤ i ≤ n and that m is in descending order, that is, m i ≥ m i+1 holds for all 1 ≤ i ≤ n − 1.
We start with some notations and definitions. Suppose that N is a phylogenetic network on X = {x 1 , . . . , x n } and that m = (m 1 , . . . , m n ) is a ploidy profile on X . Then we call m simple if m i = 1 for all 2 ≤ i ≤ n (i. e. m 1 is the only component of m that is at least 2). Moreover, we call m strictly simple if m is simple and |X | = 1. We say that N realizes a ploidy profile m if the elements in X can be ordered in such a way that m i = m(x i ) holds for all 1 ≤ i ≤ n. In this case, we also call N a realization of m. Furthermore, we say that N is a binary realization of m if N is binary. We say that N attains m if N realizes m and h(m) = h(N ) = h∈H (N ) (indeg(h) − 1). In this case, we refer to N as an attainment of m. If N is an attainment and also binary then we call N a binary attainment of m.
As is straight-forward to verify using the construction of the phylogenetic network indicated in Fig. 4 and the definition of m(x), x ∈ X , every ploidy profile m = (m 1 , . . . , m n ) on X = {x 1 , . . . , x n } with n ≥ 1 is realized by a phylogenetic network that contains at most n i=1 (m i − 1) hybrid vertices. Thus, the hybrid number of a ploidy profile always exists. As we shall see in Proposition 2, this bound can be improved for many ploidy profiles.
To be able to collect some simple properties of attainments which we will do next, we require further terminology and notation. Suppose N is a binary phylogenetic network on X . Then we say that N is semi-stable if N is equivalent to a resolution of F(U (N )). Motivated by the fact that a beadless phylogenetic network N that is equivalent to F(U (N )) was called stable in Huber et al. (2016), we canonically extend this concept to our types of phylogenetic networks by saying that a phylogenetic network N is stable if N is equivalent with F(U (N )).
For example, the binary phylogenetic network N depicted in Fig. 5i is semi-stable but not stable since U (N ) is the MUL-tree depicted in Fig. 5ii and F(U (N )) is the phylogenetic network depicted in Fig. 5iii. The phylogenetic network N pictured in Fig. 5iv is not semi-stable. In fact, for a binary phylogenetic network N to be stable it cannot contain the phylogenetic network N pictured in Fig. 5iv as an induced subgraph (where x 1 and x 2 need not be leaves in N ) since F(U (N )) is the phylogenetic network depicted in Fig. 5v. As we shall see below, certain types of binary phylogenetic networks called beaded trees are examples of stable phylogenetic networks. Although introduced in Van Iersel et al. (2020) in the context of a study of binary phylogenetic networks whose root have indegree one and not zero as in our case, the main feature of beaded trees is that a hybrid vertex must be contained in a bead. In view of this, we call a binary phylogenetic network N on X a beaded tree if N is either a phylogenetic tree on X or every hybrid vertex is contained in a bead (see e. g. Huber et al. 2021 for more on such graphs). Then since a beaded tree N cannot contain an identifiable pair of vertices, it follows by (R3) that the compressed phylogenetic networks C(N ) and The phylogenetic network N depicted in i is semi-stable but not stable since it is not equivalent with F(U (N )) i. e. the phylogenetic network depicted in iii. the MUL-tree U (N ) is pictured in ii. The phylogenetic network pictured in iv is not semi-stable. For a phylogenetic network to be stable it cannot contain the phylogenetic network N pictured in iv as an induced subgraph since F(U (N )) F(U (N )) are equivalent. Since N is a beaded tree and so does not contain arcs whose tail and head are hybrid vertices, it follows that C(N ) is in fact N . Thus, N must be stable.
Suppose N is an attainment of a ploidy profile m on X that contains a cut-arc a. Then deleting a results in two connected components N 1 and N 2 , one of which contains the root of N , say N 1 , and the other is a phylogenetic network on X − L(N 1 ). For x / ∈ L(N 1 ) we let N x 1 denote the phylogenetic network on L(N 1 ) ∪ {x} obtained from N 1 by adding a pendant arc a to tail(a) and labelling the head of a by x. For any phylogenetic network N on X , we denote by m(N ) the ploidy profile on X realized by N .

Lemma 1
Suppose that N is an attainment of a ploidy profile m on X . Then the following holds.

(i) F(U (N )) and any resolution of F(U (N )) is an attainment of m.
(ii) N is semi-stable. (iii) Suppose N contains a cut-arc a and N 1 and N 2 are the connected components of N obtained by deleting a. If ρ N ∈ V (N 1 ) and x / ∈ L(N 1 ) then N x 1 is an attainment of m(N x 1 ) and N 2 is an attainment of m(N 2 ).
is an attainment of m. To see the remainder, suppose for contradiction that F(U (N )) has a resolution D that is not an attainment of m. Then Since N is an attainment of m it cannot contain a pair of identifiable vertices as otherwise h(F(U (N ))) < h(N ) would hold which is impossible in view of Assertion (i). By (R3) it follows that the compressed networks C(N ) and C(F(U (N ))) are equivalent. Hence N must be a resolution of F(U (N )).
(iii): Since a is a cut-arc of N and therefore cannot have a head that is a hybrid vertex, we have h(m) = h(m(N x 1 )) + h(m(N 2 )). Since every directed path from the root of N to a leaf of N 2 must cross a because a is a cut-arc of N it follows that m N (y) = m N x 1 (x) × m N 2 (y) holds for all y ∈ L(N 2 ). This implies the statement. The unfold and fold-up operations described in Sect. 2.2 lie at the heart of the proof of Proposition 1.
Proposition 1 Suppose m is a ploidy profile on X = {x 1 , . . . , x n } and that N is an attainment of m. Then there must exist a directed path P from the root of F(U (N )) to x 1 in F(U (N )) such that every hybrid vertex in F(U (N )) lies on P. If, in addition, N is stable then P must be a directed path in N .
Without loss of generality we may assume that l ≥ 2 since otherwise F(U (N )) only contains one hybrid vertex and, so, the proposition holds. Then there must exist some i ∈ {2, . . . , l} such that T i is not a subMUL-tree of T i−1 as otherwise all hybrid vertices of F(U (N )) would lie on a directed path from ρ to x 1 . Without loss of generality, we may assume that i is as small as possible with this property, i. e. T j+1 is a subMUL-tree of T j , for all 1 delete the incoming arc of the root r j of R j . Next choose t equivalent copies of T 1 in U (N ) and, for all 1 ≤ j ≤ t, subdivide the incoming arc of the root of T j by a vertex s j . Note that this is possible since T 1 is the first element in γ U (N ) and so cannot be U (N ). Last-but-not-least, add the arcs (s j , r j ), for all 1 ≤ j ≤ t. Since this might have resulted in arcs whose head is not contained in X and also vertices that have indegree one and outdegree one, we clean the resulting MUL-tree by removing the former and repeatedly suppressing the latter. Also we repeatedly identify the root with its unique child if this has rendered it a vertex with outdegree one.
By construction, F(M) is a phylogenetic network that realizes m. Furthermore, The remainder of the proposition is an immediate consequence because N and F(U (N )) are equivalent in this case.
Since, as mentioned above, beaded trees are stable phylogenetic networks the corresponding result for beaded trees in (Van Iersel et al. 2020, Lemma 13) is a consequence of Proposition 1 (once an incoming arc has been added to the root).
Lemma 2 Suppose m = (m 1 , . . . , m n ) is a simple ploidy profile on X such that m 1 is a prime number. Then any cut-arc in an attainment of m must be trivial.
Proof Suppose N is an attainment of m. Then the phylogenetic network N obtained from N by removing, for all 2 ≤ i ≤ n, the cut arcs ending in a leaf x i of N as well as the leaves x i (suppressing the resulting vertices of indegree one and outdegree one and also the root in case this has rendered it an outdegree one vertex) is a phylogenetic network on X = {x 1 }. Note that since none of the elements x i indexing m i , 2 ≤ i ≤ n, contributes to h(N ), we have h(N ) = h(N ). Thus, N is an attainment of the ploidy profile m 1 = (m 1 ). Put m = m 1 and x = x 1 . If m ∈ {2, 3} then the lemma clearly holds since the only cut arc of N is the incoming arc of x 1 and therefore is trivial. So assume that m ≥ 4. Assume for contradiction that N has a non-trivial cut-arc a. Let N 1 and N 2 denote the connected components of N obtained by deleting a. Assume without loss of generality that the root of N is contained in V (N 1 ). Let y / ∈ L(N 1 ). Then since for all leaves z in a phylogenetic network M the number of directed paths from the root of M to z is m M (z) it follows that m = m N (x) = m N y y), m N 2 (x)} and m is prime this is impossible.

Realizing simple ploidy profiles
We start this section with associating to a simple ploidy profile m a binary phylogenetic network D(m) that is based on the prime factor decomposition of m 1 and also a binary phylogenetic network B(m) that is based on the unique bitwise representation of m 1 .
As we shall see, other ways to define binary realizations of m that are based on the prime factor decomposition of m 1 or on the bitwise representation of m 1 and that are similar in spirit to the definitions of D(m) and B(m) are conceivable. Furthermore, the ploidy profiles considered in Fig. 6 suggest that the relationship between the number of hybrid vertices in D(m) and in B(m) is not straight forward. Suppose that m = (m 1 , . . . , m n ), n ≥ 1, is a ploidy profiles on X = {x 1 , . . . , x n }.

The phylogenetic network D(m)
We begin with introducing further terminology. Suppose that m is a positive integer and that, for all 1 ≤ i ≤ k, p i is a prime and α i ≥ 1 is an integer such that p α 1 1 p α 2 2 · . . .· p α k k is a prime factor decomposition of m. Without loss of generality, we may assume throughout the remainder of the paper that the primes p 1 , . . . , p k are indexed in such a way that p i > p i+1 holds for all 1 ≤ i ≤ k − 1. For all 1 ≤ i ≤ k, let p i = ( p i ) denote the strictly simple ploidy profile on Y = {x 1 }. Also let A(p i ) denote a binary phylogenetic network on Y that attains p i . Note that A(p i ) need not be unique. For all 1 ≤ i ≤ k, we then define a binary phylogenetic network A(p i ) α i on Y as follows:

The phylogenetic network A(p i )˛i
We take the root ρ i of A(p i ) to be the root of A(p i ) α i . If α i = 1 then we take A(p i ) α i to be A(p i ). If α i ≥ 2 then we make α i equivalent copies of A(p i ) and order them in some way. Next, we identify the unique leaf of the first of the α i copies of A(p i ) under that ordering with the root of the second copy of A(p i ) and so on until we have processed all α i copies of A(p i ) this way. The resulting directed acyclic graph is A(p i ) α i in this case.
To illustrate this construction, assume that m = 4. Then k = 1, p 1 = 2 = α 1 , and Y = {x 1 }. Furthermore, the phylogenetic network depicted in Fig. 3iv with the leaf x 2 and its incoming arc removed, and the resulting vertex of indegree and outdegree one suppressed, is A(p 1 ) α 1 .

From A(p i )˛i to D(m) in case m is strictly simple
Suppose m is strictly simple. Then we obtain D(m) by 'stacking' the networks A(p 1 ) α 1 , . . . , A(p k ) α k obtained as described above for a prime factor decomposition p α 1 1 p α 2 2 · . . . · p α k k of m = m 1 and a choice of attainment A(p i ) of p i = ( p i ), for all 1 ≤ i ≤ k. If k = 1 then D(m) is A(p 1 ) α 1 . So assume k ≥ 2. Then we define D(m) to be the phylogenetic network on {x 1 } obtained by identifying, for all 1 For the convenience of the reader, we depict D(m) for the strictly simple ploidy profile m = (9) on {x} in Fig. 6iv.

From A(p i )˛i to D(m) in case m is not strictly simple
For all primes p in the prime factor decomposition of m 1 , choose a binary attainment A(p) of the strictly simple ploidy profile p = ( p) and construct the network D(m ) for the strictly simple ploidy profile m = (m 1 ) as described above. That network we then process further as follows. First, we choose an outgoing arc a of the root of D(m ) and subdivide it with n − 1 subdivision vertices s 2 , . . . , s n where, starting at the tail of a, the first subdivision vertex is s 2 , the next is s 3 , and so on. To the vertices s i , 2 ≤ i ≤ n we then add the arcs (s i , x i ) to obtain D(m).
As an immediate consequence of the construction of D(m), we have that D(m) does not contain an identifiable pair of vertices. In view of (R1) it follows that D(m) is semi-stable. In summary, we therefore have the following result.

Lemma 3 Suppose m is a simple ploidy profile on X . Then D(m) is a binary, semistable phylogenetic network on X that realizes m.
Note that as the strictly simple ploidy profile m = (m) with m = 265 shows, the phylogenetic network depicted in Fig. 6v uses fewer hybrid vertices to attain m than the phylogenetic network D(m) depicted in Fig. 6vi. Thus, an attainment of a simple ploidy profile m need not be obtained from a prime factor decomposition of the first component of m.

The phylogenetic network B(m)
We start with associating two vectors to a positive integer m which we call the bitwise representation (of m) and the binary representation (of m), respectively. For m a positive integer, the first is the 0- For ease of presentation, and unless stated otherwise, we denote by v f m the most significant bit that is one. The second is the vector (i 1 , . . . , i q ), q ≥ 1 and i j = 0, for all 1 ≤ j ≤ q − 1, such that m = q j=1 2 i j holds. Informally speaking, the j-th entry of that vector is the exponent of the term 2 i j in the bitwise representation of m. Note that 2 i 1 indexes the component v f m of v m . For example, the bitwise representation of m = 11 is (1, 0, 1, 1) and the binary representation of m is (3, 1, 0).

The phylogenetic network B(m) in case m is strictly simple
Then m = (m 1 ) and X = {x 1 }. Let B(q) denote the beaded tree with unique leaf x 1 and q ≥ 0 hybrid vertices. Let (i 1 , . . . , i q ) denote the binary representation of m 1 . Then B(m) is obtained from the beaded tree B(i 1 ) as follows. Choose one the two outgoing arcs of the root of B(i 1 ) and subdivide it with q − 1 vertices s 2 , . . . , s q not contained in B(i 1 ) so that s 2 is the child of the root of B(i 1 ), s 3 is the child of s 2 , and so on. For all 1 ≤ j ≤ q, we then add an arc a j to s j whose head is a subdivision vertex of the outgoing arc of the hybrid vertex of B(i 1 ) that has precisely i j hybridization vertices of B(i 1 ) strictly below it.
We refer the interested reader to Fig. 6iii for an illustration of B(m) for the strictly simple ploidy profile m = (9).

The phylogenetic network B(m) in case m is not strictly simple
We first construct the phylogenetic network B(m ) for the strictly simple ploidy profile m = (m 1 ) on {x 1 }. Next, we choose one of the two outgoing arcs of the root of B(m ) and subdivide that arc with n − 1 subdivision vertices t 2 , . . . , t n such that t 2 is the child of the root of B(m ), t 3 is the child of t 2 and so on. Finally, we attach to each t i the arc (t i , x i ), 2 ≤ i ≤ n.
To illustrate this construction, consider the simple ploidy profile m 1 = (5, 1) on X = {x 1 , x 2 }. Then m = (5) and the phylogenetic network D depicted in Fig. 8 is  B(m). In fact, B(m) is a binary attainment of m.
As indicated in Fig. 6, the relationship between D(m), B(m), and a binary attainment of a simple ploidy profile m is far from clear in general. This holds even if m = (m) is strictly simple and m is a prime. Indeed for m = 47 the hybrid number of m is at most eight since the phylogenetic network depicted in Fig. 6vi realizes m. However h(B(m)) = 9. This implies that, in general, B(m) with m = ( p) and p a prime cannot be used as an attainment with which to initialize the construction of D(m).
As an immediate consequence of the construction of B(m), we have the following companion result of Lemma 3 since similar arguments as in the case of D(m) imply that B(m) is semi-stable.

Lemma 4 Suppose m is a simple ploidy profile on X . Then B(m) is a binary, semistable phylogenetic network on X that realizes m.
To gain insight into the structure of B(m), we next present formulae for counting, for a simple ploidy profile m, We remark in passing that in case m = (m) is strictly simple then any binary phylogenetic network N that realizes m has 2h(N ) + 1 vertices since N has only one leaf and, so, the number of tree vertices of N plus the root must equal its number of hybrid vertices. Note that in case N is B(m) then this also follows from Theorem 1 since n = 1 and i 1 + dim(i m 1 ) − 1 is the number of hybrid vertices of N and therefore also the number of tree vertices of N plus the root.

Realizing general ploidy profiles
To help establish a formula for computing the hybrid number of a ploidy profile, we start by associating a binary phylogenetic network N (m) on X to a ploidy profile m on X that realizes m. This network is recursively obtained via a two-phase process which we present in the form of pseudo-code in Algorithms 1 (Phase I) and 2 (Phase II). We next outline both phases and refer the reader to Fig. 7 for an illustration of the three cases considered in Algorithm 2 and to Fig. 8  To formally state Algorithm 1, we require further notations. Suppose m = (m 1 , . . . , m n ) is a ploidy profile on X . Then we denote for all 1 ≤ i ≤ n the element of X that indexes m i by x(m i ). Furthermore, for any non-empty sequence σ and any z, we denote by σ ∪ {z} the sequence obtained by adding z to the end of σ .

Algorithm 1
The simplification sequence of a ploidy profile. Phase II is concerned with generating the phylogenetic network N (m) from the simplification sequence of m and the set X (m) (for both see Phase I), and an attainment A(m t ) of m t . Note that in case an attainment for m t is not known, we can always initialize the construction of N (m) with D(m) or B(m). The number of hybrid vertices of the generated network in this case is an upper bound on h(N (m)) and therefore also on the hybrid number of m.
To obtain N (m), we use a trace-back through σ (m) starting with m t . More precisely, assume that m i = (m 1 , . . . , m k ), some k ≥ 2 and m i+1 are two ploidy profiles in σ (m), some 0 ≤ i ≤ s(m) − 1. Then to obtain N (m i ) from N (m i+1 ) we distinguish again between the cases that α := m 1 − m 2 = 0, α > m 2 and α ≤ m 2 , see Fig. 7. Note that there might be non-equivalent attainments of m t with which to initialize the construction of N (m).

Algorithm 2
The construction of the phylogenetic network N (m) from a ploidy profie m and an attainment for m t . if α ≤ m 2 then 11: let j be such that m j+1 < α ≤ m j . Subdivide the incoming arc of x(m j ) by a new vertex v and replace x(m 1 ) by the cherry {x(m 1 ), x(m 2 )}. Subdivide the incoming arc of x(m 1 ) by a new vertex u. Add the arc (v, u) and delete x(m j ) as well as its incoming arc (v, x(m j )) (suppressing v as indeg(v) = 1 = outdeg(v) now holds). For all 2 ≤ k ≤ j − 1, put x(m k+1 ) ← x(m k ) and, for all remaining k, put x(m k ) ← x(m k ).

12:
Put m ← m and return to line 4.
To illustrate the construction of N (m), consider the ploidy profile m = (12, 6, 6, 5) on X = {x 1 , . . . , x 4 }. Then m, (6, 6, 6, 5), (6, 6, 5), (6, 5), (5, 1) is the simplification sequence σ (m) associated to m because, by definition, the first element of σ (m) is always m. The ploidy profile (5, 1) is m t . The phylogenetic network D on X = {x 1 , x 2 } on the left of Fig. 8 is an attainment of m t in the form of B(m t ). Initializing Algorithm 2 with B(m t ) yields the phylogenetic network N (m) at the right of that figure. Apart from the second arrow which is labelled (6, 5) → (6, 6, 6, 5) as it combines the steps (6, 5) → (6, 6, 5) and (6, 6, 5) → (6, 6, 6, 5), each arrow is labelled with the corresponding traceback step in σ (m).  (m 1 , m 2 . . . , m n ) considered in Algorithm 2. For α = m 1 − m 2 , the case α = 0 is depicted in i, the case α > m 2 in ii, and the case α ≤ m 2 in iii. In iii, the dashed arc and the vertex x(m j ) are deleted and the vertex v is suppressed. In each case, the grey disk indicates the part of the phylogenetic network of no relevance to the discussion Fig. 8 The construction of N (m) for the ploidy profile m = (12, 6, 6, 5) on X = {x 1 , x 2 , x 3 , x 4 } where we have combined the steps (6, 5) → (6, 6, 5) and (6, 6, 5) → (6, 6, 6, 5) into the step (6, 5) → (6, 6, 6, 5). The leftmost network D on X = {x 1 , x 2 } is an attainment of m t = (5, 1) in the form of B(m) and initializes the construction of N (m). The network N (m 2 ) on X realizes the ploidy profile m 2 = (6, 5) and the network N (m 1 ) on X realizes the ploidy profile m 1 = (6, 6, 6, 5). The rightmost network is N (m). The arrow labels indicate how a ploidy profile in σ (m) was obtained For any attainment A(m t ) of the terminal element m t of the simplification sequence σ (m) of a ploidy profile m on X , the graph N (m) is a phylogenetic network on X that realizes m. Also, at each step in the traceback through σ (m) the number of vertices is increased by exactly two. Denoting the number of vertices of N (m) by n(m) and the number of vertices in a binary attainment A(m t ) of m t by a(m t ), we obtain our next result.

Lemma 5 Suppose m is a ploidy profile on X . Then for any binary attainment of m t used in the initialization of the construction of N (m), we have that N (m) is a binary phylogenetic network on X that realizes m. Furthermore, n(m) = a(m t ) + 2s(m).
In combination with Theorem 1, it follows that N (m) has at most b(m t )+2s(m) = 2(i 1 + dim(i m 1 )+n +s(m)+l)−3 vertices and also at most i 1 + dim(i m 1 ) − 1+s(m) hybrid vertices where m t = (m 1 , . . . , m l ), some l ≥ 1, and i 1 is the first component in the binary representation i m 1 of m 1 . Furthermore, we have Proposition 2 Suppose m = (m 1 , . . . , m n ) is a ploidy profile on X such that B(m t ) is a binary attainment of m t . For all 1 ≤ k ≤ n, let (i k,1 , . . . , i k,l k ) denote the binary representation of m k , some l k ≥ 1. Then the following holds.
Proof (i) To see the stated inequality, we construct a binary phylogenetic network B on X = {x 1 , . . . , x n } from m as follows. For all 1 ≤ k ≤ n, we first construct B k = B(m k ) where m k is the strictly simple ploidy profile (m k ). Next, we add a new vertex ρ and, for all 1 ≤ k ≤ n, an arc from ρ to the root of B k . If the resulting phylogenetic network on X is binary then that network is B. Otherwise, B is a phylogenetic network obtained by resolving ρ so that ρ has outdegree two.
(ii) This is a straight forward consequence of (i) and the fact that in this case B k is the beaded tree B(i k,1 ).
Note that as the example of the ploidy profile (k l , k) for some l, k ≥ 2 shows, there exists an infinite family of ploidy profiles m for which the length of the simplification sequence for m is at least k l−1 + 1 and therefore grows exponentially in l. As a consequence of this, we also have, for any attainment of m t , that the number of hybrid vertices in N (m) can grow exponentially in l. In view of this, we next study simplification sequences for special types of ploidy profiles. To this end we call an element j ∈ {1, . . . , n} maximum if m j is the last component of a ploidy profile m = (m 1 , . . . , m n ), n ≥ 1, that is not one. (m 1 , . . . , m n ) is a ploidy profile on X . Let q denote the maximum index of m. Then the following holds (i) If k ≥ 2 is an integer such that m i = k holds for all 1 ≤ i ≤ q then s(m) = q − 1.

Proposition 3 Suppose m =
(ii) If k ≥ 1 and l ≥ q + 2 are integers such that m i = k(l − i) holds for all 1 ≤ i ≤ q then s(m) = l + q − 3.
Proof Note first that for both statements, we may assume without loss of generality that q = n since elements in X with ploidy number one do not contribute to s(m). (i): Since m i = m i+1 holds for all 1 ≤ i ≤ n − 1, the difference in dimension between any two consecutive ploidy profiles in σ (m) is one. Hence, q − 1 operations are needed to transform m into m t . Consequently, s(m) = q − 1.
(ii): Since m i−1 −m i = k holds for all 2 ≤ i ≤ q, it follows that q −1 operations are needed to transform m into a ploidy profile m of the form (k(l−q), k, . . . , k, 1, . . . , 1) where the components after the last k may or may not exist. To transform m into a ploidy profile m of the from (k, k, . . . , k, 1, . . . , 1) a further l − q − 1 operations are needed. By Assertion (i), a further q − 1 operations are needed to transform m into a simple ploidy profile. Since σ (m) is the concatenation of the underlying simplification sequences it follows that s(m) = q − 1 + l − q − 1 + q − 1 = q + l − 3.
Together with Lemma 5, the next result may be viewed as the companion result of Lemmas 3 and 4 for general ploidy profiles.

Proposition 4 For any ploidy profile m on X and any binary attainment of the terminal element in σ (m), the graph N (m) is a binary, semi-stable phylogenetic network on X that realizes m.
Proof In view of Lemma 5, it suffices to show that N (m) is semi-stable. Assume for contradiction that there exists a ploidy profile m = (m 1 , . . . , m n ) on X such that N (m) is not semi-stable. Since the construction of N (m) is initialized with an attainment of the terminal element m t of σ (m) : m 0 = m, m 1 , . . . , m l = m t , some l ≥ 0 and, by Lemma 1(ii), an attainment is semi-stable there must exist some 0 ≤ i ≤ l such that the network N (m i ) is not semi-stable but all networks N (m j ), i + 1 ≤ j ≤ l are semi-stable. Without loss of generality, we may assume that i = 0. Put m = m 1 .
We claim first that m 1 = m 2 . Indeed, if m 1 = m 2 then α = 0. Hence, Line 6 in Algorithm 2 is executed to obtain N (m) from N (m ). Since, by assumption, N (m) is not semi-stable it follows that N (m ) is not semi-stable; a contradiction. Thus, m 1 = m 2 , as claimed.
We next claim that m 1 > m 2 cannot hold either. Assume for contradiction that m 1 > m 2 . Put α = m 1 − m 2 . Assume first that α > m 2 . Then Line 8 in Algorithm 2 is executed to obtain N (m) from N (m ). Since N (m ) is semi-stable, and this does not introduce an identifiable pair of vertices in N (m), it follows that N (m) is also semi-stable which is impossible.
So assume that α ≤ m 2 . Then Line 10 in Algorithm 2 is executed to obtain N (m) from N (m ). Similar arguments as in the previous two cases imply again a contradiction. This completes the proof of the claim.
Thus, m 1 < m 2 must hold. Consequently, m is not a ploidy profile; a contradiction. Thus, N (m) must be semi-stable.

The hybrid number of a ploidy profile
In this section, we prove Theorem 2 which implies a closed formula for the hybrid number of a ploidy profile (Corollary 1). To help illustrate our theorem, we remark that for Line 8 in Algorithm 2 not to be executed we must have for every element m = (m 1 , . . . , m n ), some n ≥ 2, in the simplification sequence of m that m 1 > 2m 2 does not hold.

Theorem 2 Suppose m is a ploidy profile on X such that, for every ploidy profile in σ (m), Line 8 in Algorithm 2 is not executed. If A(m t ) is an attainment for m t with which the construction of N (m) is initialized then N (m) is an attainment for m.
Proof Put m = (m 1 , . . . , m n ) and assume that m is such that A(m t ) is an attainment of m t . Suppose X = {x 1 , . . . , x n }, 1 ≤ n. Note that we may assume that n ≥ 2 as otherwise m is simple. Hence, m = m t and, so, the theorem follows by assumption on m t . Similar arguments as before imply that we may also assume that m is not simple.
Assume for contradiction that N (m) is not an attainment of m. Let Q denote an attainment of m. Then h(Q) < h (N (m)). In view of Proposition 1, there must exist a directed path R in F(U (Q)) from the root ρ of F(U (Q)) to x 1 that contains all hybrid vertices of F(U (Q)). Since h(Q) = h(F(U (Q))) as C(Q) and F(U (Q)) are equivalent by (R3), it follows that we may also assume that Q is binary and that R gives rise to a path P from ρ to x 1 that contains all hybrid vertices of Q.
Since the construction of N (m) is initialized with an attainment of m t , there must exist a ploidy profile m in σ (m) such that there exists a binary phylogenetic network Q that realizes m and for which h(Q) < h(N (m)) holds. Without loss of generality, we may assume that m is such that for all ploidy profiles m succeeding m in σ (m) we have h(N (m )) ≤ h(Q ) for all binary phylogenetic networks Q that realize m . For ease of presentation we may assume that m = m.
Put m = m 1 = (m 1 , . . . , m l ), some l ≥ 1. Also, put α = m 1 − m 2 , N = N (m), and N = N (m ). Since Line 8 in Algorithm 2 is not executed for any element in σ (m), it follows that either α = 0 or that α ≤ m 2 since either Line 6 or Line 10 of that algorithm must be executed in a pass through the algorithm's while loop. Case (a): Assume that α = 0. Let x 1 = x(m 1 ) and x 2 = X (m 2 ) as in Line 7 in Algorithm 2. Let 2 ≤ r ≤ n such that m 1 = m r holds. By the minimality of h(Q) it follows that the induced subgraph T of Q connecting the elements in X 1 = {x 1 , . . . , x r } must be a phylogenetic tree on X 1 where, for all 3 ≤ j ≤ k, we put x j = x(m j ). Subject to potentially having to relabel the leaves of T , we may assume that {x 1 , x 2 } is a cherry in T . Since α = 0 the directed acyclic graph Q obtained from Q by deleting x 1 and its incoming arc (suppressing resulting vertices of indegree and outdegree one) and renaming x i+1 by x(m i ), for all 1 ≤ i ≤ n − 1, is a phylogenetic network on {x(m 1 ), . . . , x(m n−1 )}. Clearly, Q realizes m since Q realizes m. By assumption on m it follows that N is an attainment of m . Hence, h(N ) ≤ h(Q ). Since N is obtained from N by executing Line 6 in Algorithm 2 it follows that Consequently, N must attain m in this case. Case (b): Assume that α ≤ m 2 . Let j, x 1 , and x 2 be as in Line 11 in Algorithm 2. We start with analyzing the structure of Q with regards to x 1 and x 2 . To this end, note first that m 2 ≥ 2 must hold since otherwise m is simple and the theorem follows in view of our observation at the beginning of the proof.
By assumption on Q, there must exist a hybrid vertex h on P such that there is a directed path P h from h to x 2 because m 2 ≥ 2. Without loss of generality, we may assume that h is such that every vertex on P h other than h is either a tree vertex or a leaf of Q. Let t be the last vertex on P that is also contained in P h . We next transform Q into a new phylogenetic network Q that is an attainment of m (see Fig. 9 for an illustration). To do this, note first that since m 2 = m 1 there must exist a hybrid vertex on P below t. We modify Q as follows to obtain a further attainment Q of m. If t is the parent of x 2 then Q is Q. So assume that t is not the parent of x 2 . Then we delete the subtree T of Q that is rooted at the child of t not contained in P. Note that T must have at least two leaves. Next, we subdivide the incoming arc of t by |L(T )| − 1 subdivision vertices. To each created subdivision vertex we add an arc and bijectively label the heads of these arcs by the elements in L(T ) − {x 2 }. Next, we add an arc to t and label its head by x 2 so that t is now the parent of x 2 . By construction, Q is a phylogenetic network on X that attains m because h(Q) = h(Q ).
Let h * be a hybrid vertex on the subpath P * of P from t to x 1 so that no vertex strictly below h * is a hybrid vertex of Q . Let a * 1 denote the incoming arc of h * that lies on P * . Furthermore, let a * 2 denote the incoming arc of h * that does not lie on P * . For i = 1, 2, let p i denote the tail of a * i . Note that p 1 = p 2 might hold. Also note that the assumptions on Q imply that p 1 must be below t. Finally, note that p 1 must be a hybrid vertex unless p 1 = p 2 . Fig. 9 The transformation of Q i into the phylogenetic networks Q ii and Q iii as described in Case (b) of Theorem 2 for p 1 = p 2 . In each case, the dashed lines indicate paths. Note that in iii the dashed line could also start at ρ Q We claim that if p 1 = p 2 then any vertex v on P * other than t and x 1 must be a hybrid vertex. Assume for contradiction that there exists a vertex v / ∈ {t, x 1 } on P * that is a tree vertex. We show first that p 2 must also be below t. Since all hybrid vertices of Q lie on P, it follows that, v contributes at least 2m 2 to the number of directed paths from ρ to x 1 as m 2 is the number of directed paths from ρ to x 2 and therefore, also from ρ to t. Since h * 1 contributes at least one further directed path from ρ to x 1 in case p 2 is not below t, it follows that m 1 ≥ β + 2m 2 for some β ≥ 1. Hence, m 2 ≥ α = m 1 − m 2 ≥ β + 2m 2 − m 2 ≥ m 2 because β ≥ 1. Thus, m 2 = β + m 2 ; a contradiction as β ≥ 1. Hence, p 2 must also be below t, as required.
We next show that p 2 must be a vertex on P * . Indeed, if p 2 were not a vertex of P * then it cannot be a hybrid vertex in view of our assumptions on Q. Thus, p 2 must be a tree vertex in this case. Since p 1 = p 2 we obtain a contradiction as the choice of h * implies that h * is the parent of x 1 . Thus, p 2 must be a vertex of P * , as required. Since p 2 is a tree vertex it contributes at least 2m 2 directed paths from ρ to x 1 . Since p 1 contributes at least a further m 2 directed paths from ρ to x 1 , we obtain a contradiction using similar arguments as before. Thus any vertex on P * other than t and x 1 must be a hybrid vertex in case p 1 = p 2 , as claimed.
We claim that if p 1 = p 2 then P * has precisely 4 vertices and there exists two arcs from p 1 to h * . To see this claim, note that p 1 contributes at least 2m 2 directed paths from ρ to x 1 because it is a tree vertex. If there existed a vertex v on P * distinct from x 1 , h * , p 1 , t then v would contribute at least m 2 further directed paths from ρ to x 1 . Thus, we have again at least 3m 2 directed paths from ρ to x 1 . Similar arguments as in the previous claim yield again a contradiction. By the choice of h * it follows that t, p 1 , h * and x 1 are the only vertices on P * . Since p 1 and p 2 are the parents of h * and p 1 = p 2 , it follows that there are two parallel arcs from p 1 to h * . This concludes the proof of our second claim.
Bearing in mind the previous two claims, we next transform Q into a new phylogenetic network Q on X as follows. If p 1 = p 2 then we first delete a * 2 from Q and add an arc from p 2 to the child t 1 of t on P * . Next, we remove the arc (t, t 1 ) and suppress h * and t as they are now vertices with indegree one and outdegree one. The resulting directed acyclic graph is Q . By construction, Q is clearly a phylogenetic network on X . Furthermore, the construction combined with our two claims, implies that Q If p 1 = p 2 then we delete one of the two parallel arcs from p 1 to h * and suppress p 1 and h * as this has rendered them vertices of indegree one and outdegree one. The resulting directed acyclic graph is Q in this case. As before, Q is a phylogenetic network that, in view of our second claim, realizes m . Similar arguments as in the case that p 1 = p 2 yield again a contradiction. This concludes the proof of the theorem in this case, and therefore, the proof of the theorem.
To illustrate Theorem 2, note that the ploidy profile m = (12, 6, 6, 5) in Fig. 1 satisfies the assumptions of Theorem 2. Consequently, the phylogenetic network N (m) depicted in that figure is an attainment of m.
As the example depicted in Fig. 10 indicates, the assumption that Line 8 in Algorithm 2 is not executed is necessary for Theorem 2 to hold. In fact, if m is a ploidy profile such that N (m) contains the subgraph highlighted by the dashed rectangle in the network in

A Viola dataset
In this section, we turn our attention to computing the hybrid number of the ploidy profile of a Viola dataset that appeared in more general form in Marcussen et al. (2012). Denoting that dataset by X , the authors of Marcussen et al. (2012) constructed a MUL-tree M on X and then used the PADRE software  to derive a phylogenetic network N to help them shed light on the evolutionary past of their Viola species (Marcussen et al. 2012, Figure 4). We depict a simplified network N representing that past in Fig. 11i the only difference being that we have removed species that are not below a hybrid vertex of N as they do not contribute to the number of hybrid vertices of N . If more than one species were below a hybrid vertex of N , then we have also randomly removed all but one of them thereby ensuring that the hybrid vertex is still present in N . The resulting simplified dataset comprises the taxa x 1 =V.langsdorffii, x 2 =V.tracheliifolia, x 3 = V.grahamii, x 4 =V.721palustris, x 5 =V.blanda, x 6 =V.933palustris, x 7 =V.glabella, x 8 =V.macloskeyi, x 9 =V.repens x 10 =V.verecunda, x 11 =Viola, and x 12 =Rubellium (see Huber and Maher 2022 for more details on the simplified dataset). The labels of the internal vertices of N represent the ploidy number of the ancestral species represented by that vertex where we canonically extend the concept of a ploidy profile to the interior vertices of a phylogenetic network. By counting directed paths from the root to each leaf, it is easy to check, h(N ) = 9.
By taking directed paths from the root to the leaves of N , we obtain the ploidy profile m = (9, 7, 7, 4, 4, 4, 2, 2, 2, 2, 2, 1) on X . Note, since the root is diploid (labelled 2×), multiplying each component of m by two results in the ploidy numbers induced by the hybrid vertices in the network. The simplification sequence for m  V.tracheliifolia, V.grahamii, V.721palustris, V.blanda, V.933palustris, V.glabella, V.macloskeyi, V.repens, V.verecunda, Viola, Rubellium} adapted from a more general phylogenetic network that appeared as Figure 4 in Marcussen et al. (2012). Hybrid vertices are indicated with a filled circle and labelled by their corresponding ploidy number i. e. the number of directed paths from the root to the vertex times two because the root is assumed to be diploid. Leaves are labelled by the first two characters of their names (omitting 'V.', where applicable) contains twelve elements and m t = (2, 1, 1, 1). Since an attainment of m t must have one hybrid vertex and D(m t ) are equal B(m t ) and have one hybrid vertex each, it follows that B(m t ) is an attainment for m t . The phylogenetic network N (m) obtained by initializing Algorithm 2 with B(m t ) is depicted in Fig. 11ii. Since at no stage in the construction of N (m) Line 8 of that algorithm is executed, it follows by Theorem 2 that N (m) is an attainment of m. Counting again directed paths from the root to each leaf, it is easy to check that N (m) has five hybrid vertices implying that h(m) = 5. To compute the hybrid number of a ploidy profile whose components are not too large and, thererfore, we can find an attainment of its terminal element, we refer the interested reader to our R-function 'ploidy profile hybrid number bound (PPHNB)' which is obtainable from [1].

Discussion
Motivated by the signal left behind by polyploidization, we have introduced and studied the problem of computing the hybrid number h(m) of a ploidy profile m. Our arguments apply, however, to any type of dataset that induces a multiplicity vector. Although stated within a phylogenetics context, the underlying optimization problem is, at its heart, a natural mathematical problem: "Given a multiplicity vector m find a rooted, leaf-labelled, directed acyclic graph G so that m is the path-multiplicity vector of G and the cyclomatic number of G is minimum". Our results might therefore be also of relevance beyond phylogenetics.
Using the framework of a phylogenetic network, we provide a construction of a phylogenetic network N (m) that is guaranteed to attain a ploidy profile m for a large class of ploidy profiles provided the construction of N (m) is initialized with an attainment A(m t ) of the terminal element m t of the simplification sequence σ (m) associated to m. Members of that class include the ploidy profiles described in Proposition 3(ii). As a consequence, we obtain an exact formula for the hybrid number of m and also the size of the vertex set of N (m) in terms of the length s(m) of σ (m) and the number a(m t ) of vertices of A(m t ) for the members of our class. In case the ploidy numbers that make up m are not too large, both c(s(m)) and a(m t ) can be computed easily by computing σ (m) to obtain c(s(m)) and using, for example, an exhaustive search for a(m t ). Having said this, we also present an infinite family of ploidy profiles m for which σ (m) grows exponentially. Motivated by this, we provide a bound for h(m) and show that that bound is sharp for certain types of ploidy profiles. To help demonstrate the applicability of our approach, we compute the hybrid number of a simplified version of a Viola dataset that appeared in more general form in Marcussen et al. (2012). Our result suggests that the authors of Marcussen et al. (2012) potentially overestimate the number of polyploidization events that gave rise to their dataset.
Despite these encouraging results, numerous questions that might merit further research remain. These include "What can be said about h(m) if the ploidy profile m is not a member of our class?", and "Can we shed more light on the length of σ (m) and also into attainments of the terminal element of σ (m)?". Looking a little bit further afield, it might also be of interest to explore the relationship between so called accumulation phylogenies introduced in Baroni and Steel (2006)  Publisher's Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.