Counting paths in perfect trees

11/23/2017
by   Peter J. Humphries, et al.
0

We present some exact expressions for the number of paths of a given length in a perfect m-ary tree. We first count the paths in perfect rooted m-ary trees and then use the results to determine the number of paths in perfect unrooted m-ary trees, extending a known result for binary trees.

READ FULL TEXT VIEW PDF
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

08/31/2018

How to Fit a Tree in a Box

We study compact straight-line embeddings of trees. We show that perfect...
08/22/2019

Exact inference under the perfect phylogeny model

Motivation: Many inference tools use the Perfect Phylogeny Model (PPM) t...
11/03/2018

Efficient Projection onto the Perfect Phylogeny Model

Several algorithms build on the perfect phylogeny model to infer evoluti...
07/12/2020

Perfect Sampling of Multivariate Hawkes Process

As an extension of self-exciting Hawkes process, the multivariate Hawkes...
12/02/2019

A Generalized Matrix-Tree Theorem for Pfaffian Pairs

The matrix-tree theorem counts the number of spanning trees of undirecte...
04/19/2018

A third strike against perfect phylogeny

Perfect phylogenies are fundamental in the study of evolutionary trees b...
09/17/2018

Binary Proportional Pairing Functions

A pairing function for the non-negative integers is said to be binary pe...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1. Introduction

A tree is a connected acyclic graph with a finite vertex set and finite edge set . The distance between two vertices is the number of edges in the (unique) path in that joins and . In this paper, we focus on counting the pairs of vertices that are some given distance apart, or equivalently the paths of a given length, in a perfect tree.

Given a tree , let denote the number of pairs of vertices at distance exactly from each other. That is,

Note immediately that . Furthermore, from the observations that each vertex of degree is the central vertex of distinct paths of length and that each edge is the central edge of distinct paths of length , we obtain

Similar expressions for when become increasingly complicated.

Faudree et al. [3] constructed examples showing that two non-isomorphic trees can have identical path length distributions (that is, for all ). Tight upper and lower bounds for were given by Dankelmann [1] in terms of and either the radius or diameter of .

A binary tree , in which every vertex has degree or degree , is perfect (or balanced) if has the maximum number of vertices among all binary trees of the same diameter. De Jong et al. [2] used a recursive approach to show that the perfect binary tree of diameter with degree- vertices has

paths of length for .

We adopt a different approach to extend this to perfect -ary trees, where each vertex has degree or . In particular, we prove the following theorem.

Theorem 1.1.

Let be the perfect unrooted -ary tree of diameter . Then, for ,

where is the number of vertices in the perfect unrooted -ary tree of diameter .

We first derive an analogous theorem for perfect rooted -ary trees, where the root has degree and all other vertices have degree or . Theorem 1.2 is obtained in Section 2 by counting the paths of length in a perfect rooted

-ary tree according to minimum depth, considering odd

and even separately.

Theorem 1.2.

Let be the perfect rooted -ary tree of depth , and let satisfy . If is odd, then

and if is even, then

where is the number of vertices in the perfect rooted -ary tree of depth .

In Section 3, we use the results from Section 2 to prove Theorem 1.1.

2. Perfect rooted -ary trees

In a rooted -ary tree , there is a distinguished vertex of degree called the root, while every other vertex has degree or . The depth of is the maximum value of over all vertices . We call perfect if and only if every degree- vertex is distance from the root .

Let be the perfect rooted -ary tree of depth . For , there are exactly vertices for which . Let be a path of length in . Then there is a unique vertex , , such that for all . We call a type- path rooted at .

Lemma 2.1.

Let be the perfect rooted -ary tree of depth . If , then the number of type- paths in rooted at is . If , then the number of type- paths in rooted at is

Proof.

The case is obvious, as is the case with . Assume that and that . Then any type- path can be decomposed into a type- path rooted at and a type- path rooted at , where these two paths are disjoint. There are choices for the type- path. Once this choice has been made, there are choices for the type- path, so the total number of type- paths rooted at is . If , then this argument counts each type- path twice, hence the third equality. ∎

Let denote the number of paths of length in the perfect rooted -ary tree of depth . The preceding lemma can be used to derive exact expressions for . We consider paths of odd length and paths of even length separately, and make repeated use of the identity

Proposition 2.2.

The number of paths of length in the perfect rooted -ary tree of depth , where , is

Proof.

Let be the perfect rooted -ary tree of depth . If , then the longest path in has length , and so .

If and , then by Lemma 2.1, there are type- paths rooted at each vertex for which . Therefore,

If , then there are type- paths rooted at each vertex for which . Furthermore, for , there are type- paths rooted at each vertex for which . Therefore,

Proposition 2.3.

The number of paths of length in the perfect rooted -ary tree of depth , where , is

Proof.

Let be the perfect rooted -ary tree of depth . If , then the longest path in has length , and so .

If , then by Lemma 2.1, there are type- paths rooted at each vertex for which . Furthermore, for , there are type- paths rooted at each vertex for which . Therefore,

If , then by Lemma 2.1, there are type- paths rooted at each vertex for which and type- paths rooted at each vertex for which . Furthermore, for , there are type- paths rooted at each vertex for which . Therefore,

Theorem 1.2 now follows by combining Propositions 2.2 and 2.3 with the observation that

3. Perfect unrooted -ary trees

In an unrooted -ary tree , every vertex has degree or . The diameter of is the maximum value of over all pairs of vertices . We call perfect if and only if every degree- vertex is distance from some other vertex.

The symmetry of a perfect unrooted -ary tree of diameter depends on whether is odd or even. We introduce some notation to be used in this respect. If is odd, then can be constructed by connecting the roots of two perfect rooted -ary trees of depth with an edge . If is even, then can be constructed by connecting the roots of the perfect rooted -ary tree of depth and the perfect rooted -ary tree of depth with an edge . In either case, a path in is either contained in , contained in , or contains .

Let denote the number of paths of length in the perfect unrooted -ary tree of diameter . We consider four cases, depending on the parities of and . The proofs of the propositions below make repeated use of Lemma 2.1 and Propositions 2.2 and  2.3.

Proposition 3.1.

The number of paths of length in the perfect unrooted -ary tree of diameter , where is

Proof.

Let be the perfect unrooted -ary tree of diameter . We use the decomposition of into , , and . The number of paths in of length that contain is

If , then . If , then the depth of (and of ) is , so . Also, , and hence . If , then , and so

If , then , and so

If , then , and so

Proposition 3.2.

The number of paths of length in the perfect unrooted -ary tree of diameter , where , is

Proof.

Using the decomposition of into , , and , the number of paths of length in that contain is

and again the result is immediate for . If , then , and so

If , then , and so

Proposition 3.3.

The number of paths of length in the perfect unrooted -ary tree of diameter , where , is

Proof.

Using the decomposition of into (depth ), (depth ), and , the number of paths of length paths in that contain is

If , then . If , then , and so

If , then , and so

If , then , and so

If , then , and so

Proposition 3.4.

The number of paths of length in the perfect unrooted -ary tree of diameter , where , is

Proof.

Using the decomposition of into (depth ), (depth ), and , the number of paths of length in that contain is

and again the result is immediate for . If , then , and so

If , then , and so

If , then , and so

If , then , and so

Theorem 1.1 now follows by combining Propositions 3.1 to 3.4 with the observation that

References

  • [1] Dankelmann, P. (2011) On the distance distribution of trees. Discrete Appl. Math., 159, pp. 945–952.
  • [2] De Jong, J. V., MacLeod, J. C., and Steel, M. (2015) Neighborhoods of Phylogenetic Trees: Exact and Asymptotic Counts. SIAM J. Discr