Tree-average distances on certain phylogenetic networks have their weights uniquely determined

A phylogenetic network N has vertices corresponding to species and arcs corresponding to direct genetic inheritance from the species at the tail to the species at the head. Measurements of DNA are often made on species in the leaf set, and one seeks to infer properties of the network, possibly including the graph itself. In the case of phylogenetic trees, distances between extant species are frequently used to infer the phylogenetic trees by methods such as neighbor-joining. This paper proposes a tree-average distance for networks more general than trees. The notion requires a weight on each arc measuring the genetic change along the arc. For each displayed tree the distance between two leaves is the sum of the weights along the path joining them. At a hybrid vertex, each character is inherited from one of its parents. We will assume that for each hybrid there is a probability that the inheritance of a character is from a specified parent. Assume that the inheritance events at different hybrids are independent. Then for each displayed tree there will be a probability that the inheritance of a given character follows the tree; this probability may be interpreted as the probability of the tree. The tree-average distance between the leaves is defined to be the expected value of their distance in the displayed trees. For a class of rooted networks that includes rooted trees, it is shown that the weights and the probabilities at each hybrid vertex can be calculated given the network and the tree-average distances between the leaves. Hence these weights and probabilities are uniquely determined. The hypotheses on the networks include that hybrid vertices have indegree exactly 2 and that vertices that are not leaves have a tree-child.


Introduction
In phylogeny, the evolution of a collection of species is modelled via a directed graph in which the vertices are species and the arcs indicate direct descent, usually with modification as mutations accumulate. The leaves typically correspond to extant species, while internal vertices typically correspond to presumed ancestors. It has been common to assume that the directed graphs are trees, but more recently more general networks have also been studied so as to include the possibility of hybridization of species or lateral gene transfer. General frameworks for phylogenetic networks are discussed in [1], [2], [3], and [4]. See also the recent book [5].
There are many methods to reconstruct phylogenetic trees from information such as the DNA of extant species. The most generally accepted methods include maximum parsimony, maximum likelihood, and Bayesian. See [6] for an overview. These methods, however, are only heuristic, do not guarantee an optimal solution, and can be very time-consuming for a moderate number of species.
Suppose X denotes the set of extant species for some analysis, including an outgroup which is used to locate the root. The DNA information may be summarized via the computation of distances between members of X. If x, y X, then d(x, y) summarizes the amount of genetic difference between the DNA strings of x and y. In order to compensate at least partially for the possibility of repeated mutation at the same site, a number of different distances are in use, based on different models of mutation. Notable examples include the Jukes-Cantor [7], Kimura [8], HKY [9], and log determinant [10], [11] distances. The log determinant distance is especially interesting in that it can be proved that typically the distances add along the paths, so that the distance along a path is the sum of the distances for each edge along the path.
Some fast methods to reconstruct phylogenetic trees make use of distances between members of X. Probably the most common distance-based method is Neighborjoining [12]. It is computationally fast. It often gives a good initial tree with which heuristic methods begin in order to find an improved tree by other methods. Another more recent method FastME [13], [14] is based on the principle of balanced minimum evolution, in which one assumes that the correct tree is the one that exhibits the minimal total amount of evolution, suitably measured.
Distance-based methods have been rarely used to construct phylogenetic networks that are not necessarily trees. It is true that distances occur in common exploratory methods to display the diversity of trees for the same species such as the split decomposition (see [15] or an overview in [5]). These distances, however, are not derived from any biologically based model of evolution.
This paper studies a distance on rooted directed networks that is based upon a model of evolution. Consider, for example, the network N in Figure 1. The root is 1 and there is a hybridization event at 7 with parents 6 and 8. Vertex 7 is called a hybrid vertex or a reticulation vertex. For some characters, the character state at 7 is inherited from the parental species 6, while for other characters the character state at 7 is inherited from species 8. For character states inherited from 6 the evolutionary history is best described by the displayed tree N p , while for character states inherited from 8 the history is best described by the tree N p' . Here p and p' are parent maps telling the parent of every non-root vertex. In the example p(7) = 6 while p'(7) = 8. Each parent map p leads to a displayed tree N p .
In Figure 1, each arc might have a numerical weight measuring the amount of genetic change on the arc. In either tree N p or N p' the distance between two vertices might be plausibly defined as the sum of the weights of the edges on the unique path between the vertices. This paper explores the possibility that an appropriate distance between the vertices in the network N is a weighted average of the distances in N p and N p' .
More generally, the trees displayed by a network N will be conveniently indexed as N p where p ranges over all the parent maps. Let Par(N) denote the set of all parent maps for N. For each hybrid vertex h, the probability that a character of h is inherited from a particular parent vertex q i will be denoted a(q i , h). Assume that these inheritances at different hybrid vertices are independent events. Then for each p Par(N) we obtain that the probability Pr(p) that the tree N p models the inheritance of a particular character is given by If x and y are vertices, then the distance between x and y in N p , written d(x, y; N p ), is the sum of the weights of arcs on the unique path joining x and y in N p . The tree-average distance d(x, y; N) between x and y in N will be defined to be the expected value of the distances in the various trees N p : If a hybrid vertex h satisfies that each parent q of h has the same probability, we will call the inheritance equiprobable at h. This special case assumes that the contribution from each parent to h is the same; if there are two parents, each contributes approximately 50%.
In Figure 1 note that, for each species in the leafset X = {1, 2, 3, 4}, it is plausible that the DNA is available since 2, 3, 4 correspond to extant species and 1 to an extant outgroup species. Hence it is plausible that we know d(x, y; N) for distinct x and y in X, hence 4 2 = 6 nonzero distances. Nevertheless, N has 8 arcs and hence it is not likely that from the 6 known distances we could compute 8 independent weights for these arcs. Indeed, the equations obtained in this paper for this network have infinitely many solutions. There is a possibility of simultaneous identical mutations between 6 and 7 and between 8 and 7 which might be confused with mutations between 7 and 3.
In this paper we will assume that the weight of an arc into a hybrid vertex is 0. Thus in Figure 1, the weights of arcs (6,7) and (8,7) will be zero. Under this assumption vertex 7 corresponds roughly to the immediate offspring of a hybridization event, in which some characters came intact from 6 and the remainder intact from 8. Further mutation occurred before species 3 evolved from 7.
Note that the number of arcs of N in Figure 1 that are not directed into a hybrid vertex is 6. It is therefore plausible that given the 6 numbers d(x, y; N) for x, y {1, 2, 3, 4}, we might be able to recover the weights for each of the 6 arcs in N that are not directed into the hybrid vertex 7. These same weights would be utilized in distances for both N p and N p' . On the other hand, we should like to determine an additional parameter a(6, 7) telling the probability of inheritance by 7 of a character from 6. It is unlikely that six equations, one for each d (x, y; N), will uniquely and generically determine seven real parameters. Indeed, the methods of this paper for this example lead to six equations in seven unknowns such that for certain values of the distances the weights and probabilities are not uniquely determined. Consequently for the situation in Figure 1 we will assume that a(6, 7) = a(8, 4) = 1/2; we call the inheritance equiprobable at 7.
By contrast, Figure 2 shows another network with X = {r, x 1 , x 2 , x 3 , y} containing a single hybrid vertex h 0 . In this case there are 5 2 = 10 distances and 8 arcs not into a hybrid vertex, so it is plausible that the 10 equations would allow us to uniquely determine a ninth parameter a 1 = a(q 1 , h 0 ) satisfying 0 < a 1 <1. In fact, this paper will show how to determine all 9 parameters.
Then a(q 2 , h 0 ) = 1 -a 1 is also determined. In Figure 2 we will not need to assume equiprobability at h 0 .
In order to obtain interesting results, assumptions must be made about the network N. As an extreme case it would be easy to add many more internal vertices and edges to the network N of Figure 1 without adding any additional leaves yet increasing arbitrarily the number of arcs. For example, Figure 3 shows a network in which the network N of Figure 1 has been modified by the addition of other arcs. The 6 distances do not determine the weights for all 7 arcs that do not lead to a hybrid vertex in Figure 3.
Particular kinds of acyclic networks have been studied in various papers. Wang et al. [16] and Gusfield et al. [17] study "galled trees" in which all recombination events are associated with node-disjoint recombination cycles; the idea occurs also earlier in [18]. Choy et al. [19] and Van Iersel et al. [20] generalized galled trees to "level-k" networks. Baroni, Semple, and Steel [2] introduced the idea of a "regular" network, which coincides with its cover digraph. Cardona et al. [21] discussed "tree-child" networks, in which every vertex not a leaf has a child that is not a reticulation vertex. An arc (a, b) is redundant if there is a directed path from a to b that that does not utilize this arc. The current author has utilized "normal" networks [22] which are both treechild and contain no redundant arc.
Most results in this paper assume that the network is normal. This means, briefly, that every vertex not in X and not a leaf has a tree-child (a child with indegree one); and moreover, there is no redundant arc. For example, if X = {1, 2, 3, 4} then the network in Figure 1 is normal while the network in Figure 3 is not normal since arc (5,10) is redundant. With the assumption that there are no redundant arcs we show in Section 3 that for a given network N, the tree-average distance d is a metric on X. With the assumption of normality we also show that different parent maps p yield different displayed trees N p . Hence the average over the parent maps p is the same as the average over displayed trees. This result eliminates the logical possibility that different parent maps p 1 and p 2 might yield displayed trees that are topologically the same, yielding an uncertainty about which is the correct average to use in the definition.
The main result, Theorem 4.1, assumes that the network N is normal and also that for all hybrid vertices the indegree is exactly 2 and the outdegree is exactly 1. At each hybrid vertex h we assume either equiprobability or else that h has a grandparent on at least one side of the reticulation cycle, as in Figure 2 but not Figure 1. Then from knowledge both of N and of the tree-average distance function d, the weights for all arcs are uniquely determined and indeed can be computed by explicit formulas. Moreover, the probabilities of inheritance at each hybrid vertex are uniquely determined and can be computed by explicit formulas. This calculation is, of course, trivial if the network is equiprobable at h.
A model for a distance function containing certain parameters is called identifiable if the parameters can be reconstructed from the (exact) values of the distance function. Theorem 4.1 thus asserts that, if the tree-average distance function d on X and the network N are known, then the real parameters of the model (i.e., the weights and the probabilities) are identifiable in various cases.
A major problem, of course, is the reconstruction of N itself from a distance function d. I have obtained partial results (not included in this paper) which give a reconstruction of N itself when the distance d is the treeaverage distance and when the network N satisfies the hypotheses of Theorem 4.1 and some additional hypotheses. The reconstruction of N is possible because of the simple forms of the formulas obtained in this paper. Essentially, the formulas are simple enough that they can be used recursively when only part of the network is yet known. I plan a subsequent paper which will utilize the results in the current paper to reconstruct N from the tree-average distances.
The assumption that all hybrid vertices have indegree 2, assumed in Theorem 4.1, is plausible biologically since in sexually reproducing species an offspring arises from one egg and one sperm.
The assumption that there be no redundant arcs is essential for Theorem 4.1. Figure 3 displays a tree-child network N with X = {1, 2, 3, 4}. There are 6 independent nonzero distances between the members of X, yet there are 7 arcs not directed into hybrid vertices. It is easy to choose positive values for the tree-average distances such that there are infinitely many positive choices of the weights given the network. Note that each vertex not a leaf has a tree-child, so the network is a tree-child network [21]. Hence Theorem 4.1 cannot be extended to general tree-child networks.
Some other extensions of the current results and problems are discussed in the concluding section 6.

Fundamental Concepts
A directed graph or digraph (V, A) consists of a finite set V of vertices and a finite set A of arcs, each consisting of an ordered pair (u, v) where u V , v V , u ≠ v. We interpret (u, v) as an arrow from u to v and say that the arc starts at u and ends at v. There are no multiple arcs and no loops. If (u, v) A, say that u is a parent of v and v is a child of u. A directed path is a sequence u 0 , u 1 , ..., u k of vertices such that for i = 1, ..., there is a directed path starting at u and ending at v. The digraph is acyclic if there is no nontrivial directed path starting and ending at the same point. If the digraph is acyclic, it is easy to see that ≤ is a partial order on V . The Let X denote a finite set. Typically in phylogeny, X is a collection of species. Measurements are assumed to be possible among members of X, so that we may assume that, for example, their DNA is known for each x X.
A phylogenetic X-network N = (V, A, r, X) is a rooted acyclic digraph G = (V, A) with root r such that there is a one-to-one map j : X V whose image contains all vertices v such that either (i) v is a leaf; or (ii) v = r; or (iii) v has indegree 1 and outdegree 1.
There may be additional vertices in X. We will identify each x X with its image j(x). The set X will be called the base-set for N.
In biology the network gives a hypothesized relationship among the members of X. It is quite common also that a certain extant outgroup species r' is assumed to have evolved separately from the rest of the species in question. When this happens, we identify the species r' with the root r. Thus extant species (the leaves) are in X by (i) since measurements can be made on them. The outgroup r', which is identified with the root, is in X by (ii). If a vertex has indegree 1 and outdegree 1 then nothing uniquely determines it unless, for fortuitous reasons, it is possible to make measurements on its DNA, in which case it lies in the base-set X.
An X-tree is a phylogenetic X-network such that the underlying digraph is a tree. Figure 4 shows a phylogenetic X-network N with baseset X = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}. The root is r = 1. Note that the leaves are in X by (i), 1 X by (ii), and 10 X by (iii). Measurements such as DNA are assumed possible on members of X. Since the root 1 is actually an outgroup and the leaves are all extant, this is plausible for all members of X except 10. We are perhaps here assuming that, by some fortuitous chance, some historical DNA of 10 is also available. An then v has a tree-child c; and (2) there are no redundant arcs. The networks in Figure 2 and 4 are normal, while the network of Figure 3 is not normal. The usage here of "normal" differs slightly from that in [22] in that here hybrid vertices that are not leaves may have outdegree 1, whereas in [22] hybrid vertices that were not leaves had outdegree 2 or higher. There is an obvious one-to-one relationship between normal networks in the current sense and normal networks in the previous sense.
A normal network N is semibinary if each hybrid node has indegree 2 and outdegree 1. It follows from normality that the child of the hybrid node is necessarily normal.
A normal path from v to X is a normal path starting at v and ending at some x X. For example, in Figure 4, the path 20, 18, 19, 8 is normal and is a normal path from 20 to X. The path 18, 17, 16, 5 is not normal since 16 is hybrid. The trivial path 3 is normal.
Suppose N is normal and v V . Then there is a normal path from v to X. To see this, if v X, then the trivial path is a normal path from v to X.
Proceeding in this manner, we obtain the result.
Suppose two normal paths shared a common vertex x, say the normal paths v = v 0 , ..., v k = x and w = w 0 , ..., w j = x. If k >0 and j >0 then since x is normal with a unique parent, it follows that v k -1 = w j -1 . Repeating the argument we find that either there is an i such that v = w i or else there is an i such that w = v i . This argument, of frequent use, is called following the normal paths backwards.
A graph (or, for emphasis, an undirected graph) (V, E) consists of a finite set V of vertices and a finite set E of edges, each a subset {v 1 , v 2 } of V consisting of two distinct vertices. Thus an edge has no direction, while an arc has a direction. If N = (V, A, r, X) is a phylogenetic X-network, there is an associated undirected graph Und (N) = (V, E) in which every arc in A has its direction ignored; thus E = {{a, b}: (a, b) A or (b, a) A}.

The Tree-Average Distance
Note that r has no parent. If v is normal, then there is only one possibility for p(v), while if v is hybrid, there are at least two possibilities for p(v). In Figure 4 Given p Par (N) the set A p of p-arcs is The induced tree N p is the directed graph (V, A p ) with root r. Note that each vertex in V -{r} has a unique parent in N p . Thus N p is a tree with vertex set V . The set X, however, need not be a baseset of N p . For example, if h is hybrid in N, then in N p the vertex h has indegree 1 from the arc (p(h), h) and outdegree 1, yet need not lie in X.
Several of the proofs will require the notion of "complementary parents". Suppose p Par (N) and h is a particular hybrid vertex with exactly two parents q 1 and q 2 . Assume p(h) = q 1 . The complementary parent map p' of p with respect to h is defined by Thus p' agrees with p except at h, where p' chooses the other parent from that chosen by p.
A phylogenetic X-network is weighted provided that for each arc (a, b) A there is a non-negative number We call the function ω from the set of arcs to the reals the weight function of N. We interpret ω (a, b) as a measure of the amount of genetic change from species a to species b. If h is hybrid with parents q 1 and q 2 and unique child c, then the hybridization event is essentially assumed to be instantaneous between q 1 and q 2 with no genetic change in those character states inherited by h from q 1 or q 2 respectively. Further mutation then occurs from h to c, as measured by ω (h, c).
In any rooted tree T = (V, A, r), two vertices u and v have a unique most recent common ancestor mrca(u, v) In a network that is not a tree, two vertices u and v need not have a mrca(u, v).
Suppose that N = (V, A, r, X) is a weighted phylogenetic X-network with weight function ω. For each p Par (N) and for each u, v V , define the distance d(u, v; N p ) as follows: in N p there is a unique undirected path P (u, v) between u and v; defined (u, v; N p ) to be the sum of the weights of arcs along P (u, v). More precisely, since N p is a tree, there exists a most recent common ancestor m = mrca(u, v; N p ), a directed path P 1 given by m = u 0 , u 1 , . . ., u k = u from m to u, and a directed path P 2 given by m We shall refer to d(u, v; N p ) as the distance between u and v in N p .
Let H denote the set of hybrid vertices of N. For each h H, let P (h) denote the set of parents of h, i.e. the set of vertices u such that (u, h) A. Since h H,|P (h)| ≥ 2. For each u P (h), let a(u, h) denote the fraction of the genome that h inherits from u. We may interpret α(u, h) as the probability that a character is inherited by h from u, so for all h H, ∑[a(u, h): u P (h)] = 1.
If h and h' are distinct members of H, we will assume that the inheritances at h and h' are independent. More generally, suppose for every h H that q h is a parent of h. Then we assume that the events that a character at h is inherited from q h are independent. It is then easy to see that for each p Par(N) the probability that inheritance follows the parent map p is Pr The tree-average distance d(u, v; N) between u and v in N is defined by It is thus the expected value of the distances between u and v in the various N p .
The simplest situation has each parent of h equally likely, so a(p(h), h) = 1/|P (h)| for each p Par(N). If this situation occurs, we call the network equiprobable at h. If the network N is equiprobable at h for all h H, then we call the network equiprobable, and for each u and v in X, d(u, v; N) is the average of the values d(u, v; N p ) for p Par(N).
Theorem 3.1. Assume N = (V, A, r, X) is a phylogenetic X-network that has no redundant arcs. Assume N has a weight function ω satisfying that ω(a, b) >0 if b is normal. Then the tree-average distance on X from N is a metric on X.
Proof. A metric d on X must satisfy (1) For all x and y in X, d(x, y) ≥ 0 and d(x, y) = 0 iff x = y.
(2) For all x and y in X, d(x, y) = d(y, x).
For (3) suppose x, y, z X. For each N p , d(x, z; N p ) ≤ d(x, y; N p ) + d(y, z; N p ) from the truth of the four-point condition, see [23], p 147. Hence the result follows for distances in N as well.
To finish the proof of (1), suppose d(x, y; N) = 0; we show x = y. Assume instead x ≠ y. Since the weights are nonnegative, for every p we have d(x, y; N p ) = 0. Hence for every p Par(N), in N p the unique path between x and y contains only arcs (a, b) with b hybrid in N.
If x and y are both normal, then for every p the unique path between x and y in N p must consist of a directed path from v = mrca(x, y; N p ) to x and a path from v to y; hence it contains a normal arc whence d(x, y; N p ) >0. Thus we may assume that one vertex, say y, is hybrid.
In N choose a directed path P = y 0 , y 1 , ..., y k = y such that y 1 is not hybrid but y 2 , ..., y k are hybrid. This is always possible because there is a directed path from r to y, say u 0 = r, u 1 , u 2 , ..., u k = y. The child u 1 of r cannot be hybrid, because if it were, then its other parent q besides r must also have a path to q from r, and this path combined with the arc (q, u 1 ) would make the arc (r, u 1 ) redundant. Moreover, we may choose this path so that x does not lie in {y 1 , ..., y k } since whenever y i is hybrid there are at least two choices of the parent y i -1 , and we may select y i -1 to be distinct from x.
If x is normal in N, let Q be the trivial path z 0 = x. Otherwise we may choose a directed path Q = z 0 , z 1 , ..., z s = x such that z 0 is not hybrid but all other vertices are hybrid. Moreover, we may assume that the vertices of Q are all distinct from the vertices of P . This is because, if z i is hybrid, it cannot have two parents q 1 and q 2 which are on P since then there must be a directed path from say q 1 to q 2 , whence the arc (q 1 , z i ) is redundant.
Since the vertices on P and Q are distinct, there exists a parent map p that agrees with all the choices made in constructing both P and Q. Hence in N p , P is a path from y 0 to y, Q is a path form z 0 to x, and the paths are disjoint. In N p let v = mrca(y 0 , z 0 ; N p ). Then in N p the unique path between x and y consists of P , Q, a path from v to y 0 , and a path from v to z 0 . Since y 1 and z 0 are normal, this path includes a normal arc, so d(x, y; N p ) >0. It follows that d(x, y; N) >0, a contradiction. □ Corollary 3.2. Assume N is a normal network with weight function ω such that ω(a, b) >0 if b is normal. Then the tree-average distance on X from N is a metric on X.
The tree-average distance is defined as a weighted average in terms of parent maps. Any tree that arises as N p for some parent map p is said to be displayed in N. There is a logical possibility that several different parent maps p could yield essentially the same displayed tree. The next theorem gives sufficient conditions so that in fact the displayed trees are all distinct. Hence the treeaverage distance becomes a weighted average over all the distinct displayed trees.
The proof requires the notion of a split. A split of X is a partition of X into exactly two nonempty subsets; if these are A and B, we write the split A|B. Two splits A 1 | B 1 and A 2 |B 2 are compatible if at least one of the sets A 1 ∩ A 2 , A 1 ∩ B 2 , B 1 ∩ A 2 , and B 1 ∩ B 2 is the empty set. Removal of any edge e (but not its endpoints) from a tree T produces a split ∑(e) consisting of vertices in the connected components of T with e removed. The set of splits of a tree T will be denoted ∑(T). If T is directed, then the splits of T are obtained by reference only to the undirected tree so ∑(T) = ∑(Und(T)). By the Splits-Equivalence Theorem (see [23], p. 44) any two splits of a tree are compatible. Theorem 3.3. Assume N = (V, A, r, X) is a normal phylogenetic X-network. Suppose that every hybrid vertex that is not a leaf satisfies that it has outdegree 1 and that its unique child is normal. Suppose p and q are distinct parent maps for N. Then N p and N q are topologically distinct trees.
Proof. We show that ∑(N p ) and ∑(N q ) are distinct. Since p ≠ q there exists a hybrid vertex h such that p(h) ≠ q(h). Let q 1 = p(h) and q 2 = q(h). Choose a normal path in N from q 1 to x 1 X, a normal path from q 2 to x 2 X, and a normal path from h to y X. Note that each normal path is a path in both N p and N q . Moreover, q 1 is normal in N because otherwise its unique child would not be a tree-child. Similarly q 2 is normal in N.
If ∑(N p ) = ∑(N q ), then each pair of splits would be compatible. In N p consider the split ∑(a, q 1 ) where a is the unique parent of q 1 and we remove the arc (a, q 1 ) from N p . We may write ∑(a, q 1 ) as A 1 |B 1 where A 1 contains r. The directed path in N p from r to y includes the arc (a, q 1 ), so B 1 contains y. Then x 1 B 1 because there is a path from q 1 to x 1 and from h to y, neither of which includes (a, q 1 ). Moreover, x 2 A 1 . To see this, since N p is rooted, there is a directed path from r to q 2 . If it included the arc (a, q 1 ), then there would be a directed path in N p from q 1 to q 2 ; this is not possible since in that case the arc (q 1 , h) would be redundant in N, contradicting normality of N. Since N p contains the directed path from q 2 to x 2 missing the arc (a, q 1 ), it follows that x 2 A 1 . Hence{r, x 2 } ⊆ A 1 and {y, x 1 } ⊆ B 1 .
In N q consider the split ∑(b, q 2 ) where b is the parent of q 2 and we remove the arc (b, q 2 ) from N q . Similarly to the case of N p we may write ∑(b, q 2 ) = A 2 | B 2 where {r, x 1 } ⊆ A 2 and {y, x 2 } ⊆ B 2 . If N p were topologically the same as N q , then these splits would need to be compatible. Yet r A 1 ∩ A 2 , x 2 A 1 ∩ B 2 , x 1 B 1 ∩ A 2 , and y B 1 ∩ B 2 , contradicting compatibility. □ Corollary 3.4. Suppose N = (V, A, r, X) is a phylogenetic X-network that is normal. Suppose every hybrid vertex that is not a leaf has outdegree 1 and its unique child is normal. Suppose that there are exactly k hybrid vertices h 1 , h 2 , ..., h k and that for i = 1, ..., k, hybrid vertex h i has indegree d i . Then the total number of distinct trees displayed by N and the total number of parent maps are both ∏[d i : i = 1, ..., k].

Finding the weight function from d and N
In this section we prove the main theorem, that the weights are determined by knowledge of N and the treeaverage distances between members of X. For each hybrid vertex h we will assume either equiprobability at h or else a more complicated situation resembling Theorem 4.1. Suppose N = (V, A, r, X) is a phylogenetic X-network which is normal and semibinary. Let ω be a weight function on A satisfying ω(a, b) = 0 if b is hybrid and ω(a, b) ≥ 0 if b is normal. Assume that N is known and that the tree-average distance d(x, y; N) is known for each x and y in X.
For each hybrid vertex h with parents q 1 and q 2 , assume either (1) the inheritance is equiprobable at h; or (2) at least one parent (say q 2 ) satisfies that there exists q 3 such that (a) there is a normal path from q 3 to q 2 ; (b) there is a normal path from q 3 to some x 3 in x which is disjoint from the normal path from q 3 to q 2 except for the vertex q 3 ; (c) there is no directed path from q 3 to q 1 .
Then the weight function ω is uniquely determined and can be computed explicitly. Moreover, for each hybrid h, the probabilities a(q i , h) for each parent q i of h are uniquely determined and can be computed explicitly.
See Figure 2 to understand the assumptions about h in (2). Throughout this section we will assume the hypotheses of Theorem 4.1.
The proof primarily consists of a number of cases to handle different situations. We will present several of these special situations as lemmas and then later relate these together. Each lemma tells how certain distances or weights relate to distances between members of X. Proof. For each p Par(N), the path from a to b, the path from a to x, the path from b to y, and the path from b to z must lie in N p since none of the arcs enters a hybrid vertex. Moreover, there must be a path from r to a which includes none of the arcs on the other paths mentioned above. See Figure 5a. Hence for each p Par(N) one can verify  (2) Suppose there is a normal path from a to b X. Suppose there is a normal path from a to x X which intersects the path from a to b only in a. Then d(a, b; N) = [d(b, r; N) + d(b, x; N) -d(r, x; N)]/2.

It follows that
In particular, suppose (a, b) is an arc, b X is normal, and there is normal path from a to x X which does not include b . Then ω(a, b) = [d(b, r; N Suppose there is a normal path from a to y X where a is hybrid with indegree 2 and parents q 1 and q 2 . Assume q 1 and q 2 have normal paths to x 1 and x 2 respectively in X. Then d(a, y; N) = [d(y, Proof. See Figure 5b. We first show that the portion of the figure including the paths from q 1 to x 1 , from q 2 to x 2 , from a to y and the arcs (q 1 , a) and (q 2 , a) accurately represents the hypotheses of the lemma. (The network in Figure 3, which is not normal, has this situation with a = 10, q 1 = 5, q 2 = 6, x 1 = x 2 = 4, y = 2. Hence Figure  5b is wrong for the network in Figure 3, primarily because the normal paths from q 1 to x 1 and from q 2 to x 2 intersect.) I claim that for normal networks the normal paths from q 1 to x 1 and from q 2 to x 2 have no vertex in common. To see this, suppose there were such a common vertex w. In that case by following the normal paths backwards from w we infer that either q 1 lies on the path from q 2 to x 2 or else q 2 lies on the path from q 1 to x 1 . In the former case there is a directed path from q 2 to q 1 , whence the arc (q 2 , a) is redundant, contradicting the normality of the network. In the latter case (q 1 , a) is redundant. It follows that the paths are disjoint. In particular, Similarly, neither path can intersect the normal path from a to y. If, for example, the path from q 1 to x 1 intersected the path from a to y, then by following the normal paths backwards we would have that either q 1 lies on the path from a to y or else a lies on the path from q 1 to x 1 . In the former case there would be a directed cycle from q 1 to a to q 1 , contradicting that the network is acyclic. In the latter case the hybrid vertex a would lie on the normal path from q 1 to x 1 , contradicting that it is a normal path. Suppose p Par(N) is a parent map that satisfies p(a) = q 1 , and let p' denote the complementary parent map that agrees with p except that p'(a) = q 2 . Thus N p and N p' agree except that N p contains the arc (q 1 , a) while N p' contains instead the arc (q 2 , a). In particular they both contain the same paths from q 1 to x 1 , from q 2 to x 2 , and from a to y. Let v = mrca(q 1 , q 2 ; N p ). There is a directed path from r to v since r is the root (possibly r = v). There are directed paths from v to q 1 and v to q 2 in N p which are disjoint except for v. Figure 5b thus shows a portion of N p relevant to the lemma, together with the arc (q 2 , a).
In N p we see from Figure 5b that By substituting these formulas we see that [d(y, x 1 ; N p ) + d(y, x 2 ; N p )d(x 1 , x 2 ; N p )]/2 = d(a, y; N p ) + ω(q 1 , a).
Since ω(q 1 , a) = 0 because a is hybrid, it follows The network N p' is the same except that (q 1 , a) is replaced by (q 2 , a). A symmetric argument then shows = d(a, y; N p ) + ω(q 2 , a) = d(a, y; N p ).
Since the indegree of a is 2, every parent map p satisfies either p(a) = q 1 or p(a) = q 2 . It follows that for every p Par(N), [d(y, x 1 ; N p ) + d(y, x 2 ; N p ) -d(x 1 , x 2 ; N p )]/2 = d(a, y; N p ).
When we take the expected value over all p Par(N) we obtain by linearity [d(y, x 1 ; N) + d(y, x 2 ; N) -d(x 1 , x 2 ; N)]/2 = d(a, y; N). □ Lemma 4.5. Assume the hypotheses of Theorem 4.1. Suppose (a, b) is an arc such that b is normal, and a is hybrid with indegree 2 and parents q 1 and q 2 . Assume q 1 and q 2 have normal paths to x 1 and x 2 respectively in X. Suppose b has normal paths to w and z in X where the paths are disjoint except for b. Then Proof. See Figure 5b. As in the proof of Lemma 4.4, the portion of the figure including the paths from q 1 to x 1 , from q 2 to x 2 , from a to y and the arcs (q 1 , a) and (q 2 , a) accurately represents the hypotheses of the lemma since N is normal. Suppose p Par(N) satisfies p(a) = q 1 . Let p' denote the complementary parent map such that p'(a) = q 2 . Then all three normal paths in the statement lie in both N p and N p' since they contain no hybrid arcs. Note that N p contains (q 1 , a) and not (q 2 , a), while N p ' contains (q 2 , a) but not (q 1 , a). Moreover, the path in N p between q 1 and q 2 must be the same as the path in N p' between q 1 and q 2 . Let v = mrca(q 1 , q 2 ; N p ); then v is also mrca(q 1 , q 2 ; N p' ).
For any phylogenetic X-network M with the same base-set X write L(M) = d(x 1 , y; M) -d(r, y; M) + [d(r, Note that L is a linear expression. In both N p and N p' , d(r, In N p we find d(x 1 , y; N p ) = d(x 1 , q 1 ; N p ) + ω(q 1 , a) + d(a, y; N p ), and d(r, y; N p ) = d(r, v; N p ) + d(v, q 1 ; N p ) + ω(q 1 , a) + d(a, y; N p ). Hence In N p' we find d(x 1 , y; N p' ) = d(q 1 , x 1 ; N p' )+d(v, q 1 ; N p' ) +d(v, q 2 ; N p' )+ω(q 2 , a)+d(a, y; N p' ) d(r, y; N p' ) = d(r, v; N p' ) + d(v, q 2 ; N p' ) + ω(q 2 , a) + d(a, y; N p' ). Hence Using  x 1 ; N). □ It is interesting in the proof that different choices of the parent map p may yield different vertices v; nevertheless all these choices cancel out.
Lemma 4.8. Assume the hypotheses of Theorem 4.1. Suppose h is hybrid with indegree 2 and parents q 1 and q 2 . Assume equiprobable inheritance at h. Suppose there is a normal path from q 2 to x 2 X and from h to y X. Suppose q 1 has normal child b and there are normal paths from b to z 1 X and from b to z 2 X such that these paths intersect only at b. Then ω(q 1 , b) = [2d(z 1 , y; N) -4d(r, y; N) + d(r, z 1 ; N) + 2d(r, x 2 ; N) -d(z 1 , x 2 ; N) + 2d(z 2 , y; N) + d(r, z 2 ; N) -d(z 2 , x 2 ; N) -2d(z 1 , z 2 ; N)]/4. Since d(r, x 1 ; G p ) = u rv + u vq 1 + u q 1 x 1 it follows d(r, x 1 ; G p ) = u rv + u vq 1 This can be solved to show Note (1), (2), and (3) are equations in the unknowns a, w vq 1 , w q 3 q 2 in terms of known quantities such as w rv , w q 3 x 3 , w hy , w vq 3 , E 4 (G p ). These three equations in three unknowns can be solved to yield for G p (for any p Par(N) with p(h) = q 1 ) the following: Moreover, the value of a is independent of the choice of p.
We thus have C(G p ) = aD(G p ) for each p satisfying p (h 0 ) = q 1 .
By It follows that a = C(N) ≠ D(N). This proves (i). Similarly, for any p Par(N) satisfying p(h 0 ) = q 1 , since the path from q 1 to x 1 is normal, proving (ii). Similarly d(q 2 , x 2 ; N) = w q 2 x 2 (N) , proving (iii). □ Lemma 4.10. Assume the hypotheses of Theorem 4.1. Suppose h 0 is hybrid with indegree 2 and parents q 1 and q 2 . Suppose there is a normal path from q 3 to q 2 , from q 2 to x 2 X, from q 1 to x 1 X, from h 0 to y X, and from q 3 to x 3 X but no directed path from q 3 to q 1 .
(a) Suppose q 1 has normal child b and there are normal paths from b to x 1 X and from b to z 1 X such that these paths intersect only at b. Then ω(q 1 , b) = [d (q 1 , x 1 ; N) + d(q 1 , z 1 ; N) -d(x 1 , z 1 ; N)]/2, where d(q 1 , x 1 ; N) and d(q 1 , z 1 ; N) are determined by Lemma 4.9.
(b) Suppose q 2 has normal child c and there are normal paths form c to x 2 X and from c to z 2 X such that these paths intersect only at c. Then ω(q 2 , c) = [d (q 2 , x 2 ; N) + d(q 2 , z 2 ; N) -d(x 2 , z 2 ; N)]/2, where d(q 2 , x 2 ; N) and d(q 2 , z 2 ; N) are determined by Lemma 4.9.
Proof. For (a), Lemma 4.9 applies to yield d(q 1 , x 1 ; N). By a parallel computation with z 1 replacing x 1 , Lemma 4.9 also yields d(q 1 , z 1 ; N). Since the paths from q 1 to x 1 and z 1 are normal, it follows that ω(q 1 , b) = d(q 1 , b; N) = [d(q 1 , x 1 ; N)+d(q 1 , z 1 ; N)-d(x 1 , z 1 ; N)]/2 by an argument like that of Lemma 4.2. A similar argument shows (b). □ We now turn to the proof of the main theorem 4.1: Proof. We seek to reconstruct each weight ω (a, b) and each probability. If b is hybrid, then by assumption ω (a, b) = 0. Hence we may assume b is normal.
At the tail a we have the following exhaustive list of possibilities: Case A 1 . There is a normal path from a to some w X such that the path does not go through b. This includes the possibility where a X (in which case the trivial path at a satisfies the condition). Since r X, this includes the case a = r.
Case A 2 . a is hybrid and b is its unique child. Since a is hybrid it has two parents q 1 and q 2 . Choose a normal path from q 1 to w 1 X and from q 2 to w 2 X.
Case A 3 . a has a hybrid child h' with other parent q'. Choose a normal path from q' to w 1 X and from h' to w 2 X.
At the head b, either b X or else b is not a leaf and b has at least two children, at least one of which must be normal. Hence we have the following exhaustive list of possibilities: Case B 1 . b X. Case B 2 . b has two normal children c 1 and c 2 . For i = 1, 2 there is a normal path from c i to x i X.
Case B 3 . b has one normal child c and a hybrid child h for which there is exactly one other parent q. There is a normal path from c to x X, from h to y X, and from q to z X.
Since there are 3 cases for a and three cases for b, we must consider 9 cases. The case where A i is combined with B j will be denoted Case A i B j . We will compute ω(a, b). To compute the probabilities, it suffices to compute a(a, h') in situation A 3 .
Case A 1 B 1 . Assume there is a normal path from a to some w X such that the path does not go through b, and b X. Then Lemma 4.3 (2) shows that ω(a, b) = [d (r, b; N) + d(w, b; N) -d(r, w; N)]/2.
Case A 1 B 2 . Assume there is a normal path from a to some w X such that the path does not go through b. Assume b has two normal children c 1 and c 2 . For i = 1, and b is a normal child of a, the proof of the theorem is complete.
Corollary 4.11. Suppose N = (V, A, r, X) is a normal phylogenetic X-network such that each hybrid vertex has indegree 2 and, if it is not a leaf, outdegree 1. Let n = | X| and a be the total number of arcs directed into any normal vertex. Then a ≤ n 2 . Proof. We may assume that the arcs have weights and that each hybrid is equiprobable. Each of the weights ω(u, v) if (u, v) is an arc directed into a normal vertex v is uniquely determined from the n 2 linear equations obtained from the n 2 distances given by the tree-average distance function. Hence there are at most n 2 variables. □ Figure 1 gives an example in which n = 4 and there are exactly 4 2 = 6 arcs directed into a normal vertex. Hence the bound in Corollary 4.11 is tight.

An example
We illustrate the calculations of Section 4 to find the values of the weight function given the network and the tree-average distance. Figure 4 exhibits a phylogenetic X-network N = (V, A, r, X) with X = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} and root 1 which satisfies the hypotheses of Theorem 4.1. Observe that by Corollary 3.4, N displays exactly 4 trees, and there are exactly four parent maps. Let ω be a weight function on A such that ω(a, b) = 0 when b is hybrid but ω(a, b) ≥ 0 when b is normal. Let d(x, y) = d(x, y; N) denote the resulting tree-average distance between x and y in X. Suppose first that we assume equiprobability about the network, so each a(a, b) = 1/2 when b is hybrid. There are 24 arcs for which we compute the weights as follows: First, since 16  In the event of a true hybridization between two sexual species, it is plausible to assume that the indegree is 2 and that each parent contributes approximately equally. Hence in this case it is plausible that we would obtain the tree-average distance utilized in Theorem 4.1. Nevertheless, backcrossing of the hybrid h with one of the parental species q 1 could easily increase the fraction of the genome of q 1 in h, changing it from 50%. Similarly, if the reticulation is actually a horizontal gene transfer, common between bacteria, then there is no guarantee that the sources contribute approximately equally. Hence the occurrence of probabilities different from 1/2 seems likely.