A Class of Random Recursive Tree Algorithms with Deletion
Arnold Saunders

TL;DR
This paper studies a class of random recursive trees that grow and shrink via probabilistic node addition and deletion, analyzing their size and structure across different regimes using generating functions.
Contribution
It introduces a class of deletion rules ensuring uniform distribution of the tree conditioned on size and derives asymptotic properties of the trees.
Findings
Tree size exhibits three regimes based on insertion probability p.
Expected leaf count and root degree are asymptotically estimated.
Results are robust across different deletion rules within the class.
Abstract
We examine a discrete random recursive tree growth process that, at each time step, either adds or deletes a node from the tree with probability and , respectively. Node addition follows the usual uniform attachment model. For node removal, we identify a class of deletion rules guaranteeing the current tree conditioned on its size is uniformly distributed over its range. By using generating function theory and singularity analysis, we obtain asymptotic estimates for the expectation and variance of the tree size of as well as its expected leaf count and root degree. In all cases, the behavior of such trees falls into three regimes determined by the insertion probability: , and . Interestingly, the results are independent of the specific class member deletion rule used.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
A class of random recursive tree algorithms with deletion
Arnold T. Saunders, Jr
Department of Statistics, The George Washington University, Washington, DC 20052
Abstract.
We examine a discrete random recursive tree growth process that, at each time step, either adds or deletes a node from the tree with probability and , respectively. Node addition follows the usual uniform attachment model. For node removal, we identify a class of deletion rules guaranteeing the current tree conditioned on its size is uniformly distributed over its range. By using generating function theory and singularity analysis, we obtain asymptotic estimates for the expectation and variance of the tree size of as well as its expected leaf count and root degree. In all cases, the behavior of such trees falls into three regimes determined by the insertion probability: , and . Interestingly, the results are independent of the specific class member deletion rule used.
Keywords. Recursive trees, Random deletions, Generating functions, Singularity analysis
1. Introduction
Tree evolution algorithms supporting both node insertion and deletion are notoriously hard to analyze. Jonassen and Knuth showed deriving the distribution of a mere three-node random binary search tree after a finite series of repeated insertions and deletions required Bessel functions and solving bivariate integral equations. In their words, “the analysis ranks among the more difficult of all exact analyses of algorithms…the problem itself is intrinsically difficult [9].” Panny later chronicled a near half century of hopeful assumptions and poor intuition about the effect of deletions on binary search tree distribution [11]. In this paper, we study the effect of a class of deletion rules on the evolution of random recursive trees.
Random recursive trees are stochastic growth processes with diverse applications in modeling searching and sorting algorithms, the spread of rumors, Ponzi schemes and manuscript provenance [13]. The idea behind the model is straightforward. Starting from a root node labeled 1, we construct a tree one vertex at a time using sequentially labeled nodes. Each newly introduced node is “randomly” attached to an existing one in the tree.
The insertion or attachment rule we use to construct the tree determines the distribution of over its range. For example, consider an insertion rule where each new node is attached to any of the existing ones with equal probability. The resulting trees are known as uniform recursive trees or uniform attachment trees. In this case, is uniformly distributed over the possible recursive trees with nodes. Much research has gone into characterizing the limiting random variables and distributions of functionals on uniform recursive trees such as node degree [3, 7], height [12], leaf count [10], etc.
Motivated by work with random graph models incorporating both insertion and deletion rules (eg, [1, 2, 5, 8, 14]), we examine the less-studied application of such rules to tree evolution models. Specifically, we start with tree containing a single node labeled 1. At each time step , we either add an incrementally-labeled node to the tree with probability or delete an existing node with probability . After a deletion, we reattach and relabel the remaining nodes so that is again a recursive tree. There is one exception to the preceding: we do not allow the tree to vanish. So if is the single node tree, it remains unchanged with probability .
We always add nodes using the uniform attachment rule. We will however identify the class of deletion rules guaranteeing , when conditioned on tree size, remains uniformly distributed over its range. We then, using singularity analysis of generating functions, provide a means for deriving the exact and asymptotic expressions of common functionals on such as tree size, leaf count and root degree.
2. Conditional Equiprobability
A simplifying property of uniform attachment trees is the equiprobability of the range of . Once we introduce deletion, this need not be the case. But if our choice of deletion rule could guarantee—conditioned on tree size—a uniformly distributed , its analysis is greatly simplified. To specify the class of such deletion rules, we must first make concrete the notion of insertion and deletion rules.
Define the size of a tree to be the number of nodes it possesses. Next define the stratum number of a tree to be one less than its size. Let stratum denote the set of all trees sharing the common stratum number . Then stratum contains trees and we can assign each one a unique integer identifier from 1 to and arrange them in canonical order. We can now capture all the probabilities of transitioning from one of the trees in stratum to one of the trees in stratum (an insertion) in a single conditional probability matrix . Analogously, we can record the probabilities of transitioning from a stratum tree to a stratum tree (a deletion) by . Insertion and deletion rules then are simply specifications of the form of matrices and for each , which we will call insertion and deletion matrices, respectively.
Since we are using uniform attachment as our insertion rule, each insertion matrix has the form
[TABLE]
where is a 0-1 matrix with row sums and columns sums 1. The exact placement of the 0s and 1s depends on the tree canonicalization used.
In the next theorem, we identify a necessary and sufficient condition on deletion matrices for conditional equiprobability and then establish the class of growth algorithms with that property.
Theorem 2.1**.**
Conditioned on stratum number, each tree is equiprobable at time if and only if
[TABLE]
Note the above is equivalent to requiring all column sums of to be identical.
Proof.
Assume that, conditioned on stratum number, each tree within a stratum is equiprobable at time . When , the assertion is trivially true so let us assume . Let denote the recursive tree at time and its stratum number. Additionally, let be a stratum tree. Then by hypothesis, we have
[TABLE]
or equivalently
[TABLE]
If we denote the distribution of within stratum by , we can summarize this result succinctly with
[TABLE]
Consequently, by conditioning on the action (ie, insertion or deletion) at time , we can express the distribution of the th stratum () at time by the following equality
[TABLE]
Next, by observing
[TABLE]
and noting the inequality
[TABLE]
holds whenever , the probabilities and in (3), subject to the given constraint , are positive, we can rearrange the terms on the left and right-hand sides of (3) to obtain
[TABLE]
Finally, when , we have
[TABLE]
Thus as claimed.
Assume for arbitrary . By using mathematical induction on , we show (2) holds.
Since strata 0 and 1 contain only one tree each, the result is trivially true for . Next assume it also holds for some arbitrary and consider the case . Since (2) always holds for and at time , we can restrict our attention to at time . Now, by conditioning on the action at time , we have
[TABLE]
Thus when we have
[TABLE]
On the other hand, when , we have
[TABLE]
In both cases we have for some . Recalling
[TABLE]
where is the set of stratum trees, we conclude as desired. ∎
A consequence of Theorem 2.1 is that if our choice of deletion algorithm obeys (1) for arbitrary , then for all , all trees in the same stratum are equiprobable. We summarize this result with the following corollary.
Corollary 2.1.1** (The Class of Conditional Equiprobable Growth Algorithms).**
If the deletion matrix for a given growth algorithm satisfies (1) for arbitrary , then it supports conditional equiprobability. Moreover since any conditional equiprobable algorithm possesses this property, this criterion describes the class of such algorithms. Finally, this class is nonempty.
Proof.
To show the class is not empty consider the “last in, first out” (LIFO) deletion rule. When invoked, we delete the last node inserted into the tree. Then each row in an arbitrary deletion matrix contains exactly one nonzero entry, . Each column of this matrix represents a stratum tree. By adding a node to this tree, we obtain trees in strata . Hence each of the column sums is , satisfying condition (1). ∎
3. Tree Size Generating Functions and Asymptotics
Having established the class of deletion rules ensuring given is equally likely to be any one of the trees in stratum , we next explore the distribution and moments of , as well as those of several functions of .
Proposition 3.1**.**
Let denote the probability the th iteration of the algorithm generates the root tree. The ordinary generating function for the sequence is
[TABLE]
The asymptotic estimate for as a function of is
[TABLE]
Observe as approaches from the right, the quantity goes to , showing vanishes more slowly for probabilities close to .
Proof.
Noting is the generating function of a biased excursion, that is, a biased random walk on the nonnegative integers starting and ending at zero, a simple modification of the generating function (see OEIS A001405) for unbiased excursions gives us (4).
For an asymptotic estimate of , we begin by noting the singularities of occur at branch points and, if , also at a simple pole . The branch points are on the unit circle when . Otherwise, by a simple calculus argument, they are outside of it.
Consider the case . Since the branch points fall outside the unit circle, is meromorphic within a disk of radius , where . Hence we can expand about the simple pole to obtain the Laurent series representation
[TABLE]
where is some function analytic at and therefore has radius of convergence . Thus
[TABLE]
where and is an arbitrarily small positive number [4, Theorem IV.10, p 258].
Next consider the case . Here the radius of convergence is determined by branch points on opposite sides of the imaginary axis. The function is star-continuable [4, Theorem VI.5, p 398] and, in the vicinity of its singularities, we have
[TABLE]
from which we obtain, by Big-Oh transfer [4, Theorem VI.3, p 390], the asymptotic bound .
Finally for the case , if is the generating function for the number of excursions of length , then we have and therefore by Stirling’s approximation
[TABLE]
∎
We apply the same methodology to the remaining generating functions in this section. Unless the determination of the asymptotic estimates introduces something new, we will state the results without proof.
Lemma 3.1**.**
Let denote the probability the th iteration of the algorithm generates a stratum 1 tree. The ordinary generating function for the sequence is
[TABLE]
Proof.
Let us condition on the last iteration to determine the probability of obtaining the root tree at iteration . Doing so yields the recurrence relation
[TABLE]
Rearranging terms so that is expressed in terms of and , then multiplying both size by and summing over gives us
[TABLE]
∎
Proposition 3.2**.**
Let denote the probability of obtaining a stratum tree on the th iteration. If we mark the stratum number with , then the bivariate generating function for the double sequence is
[TABLE]
Proof.
For fixed , , let us denote the generating function of the sequence by so that . Then for , if we condition on the last iteration, we have the recurrence relation
[TABLE]
Multiplying both sides by and summing over give us
[TABLE]
Now multiplying both sides by and summing over yields
[TABLE]
Finally, substituting the right side of (6) for and some simplification gives us (7). ∎
If we let denote the stratum number of a tree at time , then is the probability generating function of . Thus we immediately have and . This idea leads to the following generating functions for the first and second factorial moments of and asymptotic estimates for and .
Proposition 3.3**.**
Let denote the stratum number of the tree generated by the th iteration of the algorithm. The generating function for the sequence is
[TABLE]
The asymptotic form of is given by
[TABLE]
The error bound for the first and third cases is . When , the error bound is .
Proof.
Since , the expression (8) can be obtained from (7) in a straightforward manner.
For the asymptotic analysis, we cover only the case since the result will be used again later. Here, the function simplifies to
[TABLE]
implying
[TABLE]
In the neighborhood of the singularities of , we have
[TABLE]
and therefore by Big-Oh transfer
[TABLE]
Substituting this result into (9) gives us
[TABLE]
∎
Proposition 3.4**.**
Let denote the stratum number of the tree generated by the th iteration of the algorithm. The generating function for the second factorial moment of , namely , is
[TABLE]
The asymptotic form of is given by
[TABLE]
The error bound for the first and third cases is and when .
Proof.
Equation (11) follows directly from the relation .
∎
Proposition 3.5**.**
Let denote the stratum number of the tree generated by the th iteration of the algorithm. The asymptotic form of the variance of is given by
[TABLE]
The error bound is for the first case, for the second and for the third.
Proof.
Noting , the result for cases and is an immediate consequence of Propositions 3.3 and 3.4. When , applying those propositions leads to an error bound. In order to get a vanishing error bound, we need to expand (10) by an additional term, namely
[TABLE]
which yields the refined asymptotic estimate of when ,
[TABLE]
The result now follows in the same manner as the other cases.
∎
Lemma 3.2**.**
The generating function for the expected value of , where and denotes the th harmonic number , is
[TABLE]
The asymptotic form of is given by
[TABLE]
Proof.
We first note the desired expectation can be written as
[TABLE]
Thus if we can find the bivariate generating function
[TABLE]
the desired generating function is
[TABLE]
To that end, we derive
[TABLE]
Focusing on the second term of (13), we find
[TABLE]
since is the probability generating function of and therefore is the generating function of the sequence .
Substituting (14) into (13) yields
[TABLE]
and so
[TABLE]
We conclude the derivation of (12) by observing
[TABLE]
where
[TABLE]
The integral (with respect to ) follows immediately after a partial fractions expansion of and some simplification of the result.
∎
Lemma 3.3**.**
Let denote the size of the tree generated by the th iteration of the algorithm, ie, . The generating function for the mean of the reciprocal of , that is, is
[TABLE]
The asymptotic form of is given by
[TABLE]
Proof.
It is straightforward to show and using the partial fractions expansion outlined in Lemma 3.2, the integral leads to (15).
∎
Proposition 3.6**.**
Let denote the th harmonic number, where is the tree size after the th iteration of the algorithm. The generating function of is as given in lemmas 3.2 and 3.3. The asymptotic estimates of are
[TABLE]
Proof.
The results follow immediately from the identity . ∎
4. Application of Results to Tree Functionals
4.1. Tree Size
Given we use uniform attachment for the addition rule and any member of the class defined in Corollary 2.1.1 for deletion, we immediately have from Propositions 3.3 and 3.5 the asymptotics of the expected tree size and corresponding variance of tree , namely and . We note there are three behavioral regimes determined by whether insertion probability is less than, equal to, or exceeds .
4.2. Leaf Count
By conditioning on stratum number, we can obtain similar results for other tree functionals. To see this, suppose the distribution of , conditioned on , is equiprobable. That is,
[TABLE]
where is the probability of an event given a deletion probability of . Observe whenever is a stratum tree and is 0 otherwise. The conditional expectation of is thus given by
[TABLE]
where and denote the set of all possible trees and the subset of stratum trees, respectively, and is the expectation of an event given a deletion probability of .
Since the expectation depends only on , we can “ignore” the effect of deletion probability on the probabilistic behavior of the tree functional and, by iterating expectation, exploit the useful result
[TABLE]
Interestingly, this results holds regardless of the specific deletion rule from the class chosen. Whether it is LIFO or something more intricate, the moments are the same.
If we let denote the number of leaves in the tree at time , we have the well-known result [6, pp 326-327]
[TABLE]
where is Iverson bracket notation for an indicator function. By using (16) we can deduce
[TABLE]
Applying Propositions 3.1 and 3.3 yields the generating function and asymptotic estimate.
4.3. Root Degree
Let denote the degree of the root node at time . Since
[TABLE]
where is the th harmonic number [6, pp 323-324], we find
[TABLE]
and obtain the corresponding generating function and asymptotics from Proposition 3.6.
5. Summary
By allowing for the possibility of node removal during the course of their evolution, we can extend the utility of random recursive trees models. The analysis of such trees; however, is complicated by the fact that the tree size at time is no longer deterministic. Nevertheless, for the class of deletion rules identified by Corollary 2.1.1, we showed the current tree conditioned on its size is uniformly distributed over its range. This reduces the problem of studying to that of studying its stratum number. By using generating function theory, we obtain several results for the expected tree size, leaf count and root degree of tree .
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] E. Ben-Naim and P.L. Krapivsky, Addition-deletion networks , The Journal of Physics A: Mathematical and Theoretical 40 (2007), 8607–8619.
- 2[2] Narsingh Deo and Aurel Cami, Preferential deletion in dynamic models of web-like networks , Information Processing Letters 102 (2007), 156–162.
- 3[3] Marian Dondajewski and Jerzy Szymanski, On the distribution of vertex-degrees in a strata of a random recursive tree , Bulletin de l’Académie Polonaise des Sciences. Série des Sciences Mathématiques 30 (1982), 205–209.
- 4[4] Philippe Flajolet and Robert Sedgewick, Analytic combinatorics , 3rd ed., Cambridge University Press, 2009.
- 5[5] Gourab Ghoshal, Liping Chi, and Albert-László Barabási, Uncovering the role of elementary processes in network evolution , Scientific Reports 3 (2013), no. 2920.
- 6[6] Micha Hofri and Hosam Mahmoud, Algorithms of nonuniformity: Tools and paradigms , CRC Press, 2018.
- 7[7] Svante Janson, Asymptotic degree distribution in random recursive trees , Random Structures and Algorithms 26 (2005), 69–83.
- 8[8] Tony Johansson, Deletion of oldest edges in a preferential attachment graph (manuscript) , 2018.
