# Entropy and Enumeration of Subtrees in a Cactus Network

^{1}School of Computer, Qinghai Normal University, Xining, China^{2}Department of Mathematics, West Virginia University, Morgantown, WV, United States

For a given network, the number of spanning trees is a key parameter to measure its reliability in edge failure cases, while the number of subtrees is a key parameter to measure its reliability in both vertex and edge failures cases. Zhang et al. investigated the entropy of spanning trees, spanning forests and connected spanning subgraphs of Koch networks. In this paper, we extend Koch networks to 3–cactus networks, and study the entropy of subtrees of 3–cactus networks. We present a linear algorithm to count the number of subtrees in a 3–cactus network, determine the upper and lower bounds of the entropy of subtrees of these networks and characterize those attaining the extremal values. As an application, a linear algorithm is developed to count the number of subtrees in Koch networks, with complexity *O*(*g*), where *g* is the number of iterations. Finally, we determine the entropy of subtrees of Koch networks.

## 1. Introduction

The number of subtrees of a connected network is well-studied, as an important parameter to measure the reliability of a network for both vertex and edge failures. For a network *G*, let *p* be the probability of failure of a vertex in *G*, and *q* be the probability of failure of an edge in *G*. The reliability of the network *G*, denoted by *R*(*G*; *p, q*), is the probability that the remaining vertices can communicate with each other. Zhao [1] showed that for given numbers *m* and *n*, among the networks with *n* vertices and *m* edges, if *p* → 0 and *q* → 1 with *p* and 1 − *q* are equivalent infinitesimals, then networks with more subtrees are more reliable. Therefore, it is of interest to develop efficient algorithms to count the number of subtrees in a network and, in a given family of networks, characterize the networks with extremal number of subtrees. Denote by η(*G*) the number of subtrees of *G*. For a vertex *v* ∈ *V*(*G*), let η_{v}(*G*) denote the number of subtrees containing *v* in *G*. Székely and Wang [2] determined the maximum and minimum values of η(*G*) and characterized all extremal networks among all trees *G* with given number of vertices. Yan and Yeh [3] developed a linear algorithm to count the number of subtrees of a tree. In the same paper, they also characterized all trees having diameter at least *d* with maximum number of subtrees, as well as all trees having maximum degree at least Δ with minimum number of subtrees. On the other hand, Kirk and Wang [4] characterized all trees with a given maximum degree that have the maximum number of subtrees. Zhang and Zhang [5] and Zhang et al. [6, 7] characterized the trees attaining the maximum and minimum numbers of subtrees among all trees with the given degree sequence. Xiao et al. [8] showed that 5 + *n* + 2^{n−3} ≤ η(*T*) ≤ 2^{n−1} + *n* − 1 for any tree *T* with *n* vertices. Yang et al. [9, 10] studied the number of subtrees in spiro and polyphenyl hexagonal chains and hexagonal and phenylene chains, respectively. For more results on this topic, we refer the readers to references [11–17].

Koch networks, introduced by Zhang et al. [18], are typical fractal networks. Zhang et al. showed that Koch networks have some important properties in real life networks, such as a power law degree distribution with exponent between 2 and 3, a large clustering coefficient and a small average path length. However, the number of subtrees in Koch networks has not been determined. In this paper, we investigate the entropy and enumeration of subtrees in 3–cactus networks, which is a generalization of Koch networks. We first establish a linear algorithm to count the number of subtrees in an arbitrary 3–cactus network. Then we characterize the 3–cactus networks with upper and lower bounds of the entropy of subtrees. Finally, as an application, we obtain the entropy of subtrees in Koch networks.

## 2. Preliminaries

We first introduce some general notation and definitions that will be used throughout the paper. Undefined notation and terminology will follow Bondy and Murty [19].

We follow Zhang et al. [18] and Wu et al. [20] to define Koch networks. Denote by *G*_{m,g} the Koch network after *g* iterations, which has *N*_{g} vertices, *E*_{g} edges and *L*_{g} triangles. At *g* = 0, *G*_{m, 0} is a triangle with three vertices labeled by *X*, *Y*, and *Z*, respectively. This triangle is called the initial triangle, and its three vertices are called hub vertices. For *g* ≥ 1, *G*_{m,g} is obtained from *G*_{m,g−1} by attaching *m* triangles to each of the three vertices in each triangle in *G*_{m,g−1}. The Koch networks for *m* = 2 are shown in Figure 1.

By definition, *L*_{0} = 1 and for *g* ≥ 1, *L*_{g} = (3*m* + 1)*L*_{g−1}. This implies that ${L}_{g}={(3m+1)}^{g}$. Likewise, it is routine to derive that ${N}_{g}=2{(3m+1)}^{g}+1$ and ${E}_{g}=3{(3m+1)}^{g}$. More properties of Koch networks can be found in Zhang et al. [18].

To extend the notion of Koch networks, we introduce 3–cactus networks.

**Definition 1**. Let ${G}$(*t*) be the set of all 3–cactus networks with *t* triangles. We define a 3–cactus network *G*_{t} ∈ ${G}$(*t*) by the following recursive iterations.

Step 1: When *t* = 0, *G*_{0} is isomorphic to *K*_{1}, the graph with one vertex and no edges. The only vertex in *G*_{0} is called the **initial vertex** of *G*_{t}.

Step 2: Assume that *t* ≥ 1 and a 3–cactus network *G*_{t−1} is already generated by (*t*−1) iterations. Then, a 3–cactus network *G*_{t} can be obtained from *G*_{t−1} and a new triangle by identifying a vertex of the new triangle and a vertex of the *G*_{t−1}.

Let *G* be a subnetwork of *G*′. If the vertex set (or edge set) of *G* is a proper subset of the vertex set (or edge set) of *G*′, *G* is called a *proper subnetwork* of *G*′. Let *d*_{G}(*u*) denote the degree of vertex *u* in *G*, and (*v*_{1}, *v*_{2}, *v*_{3}) denote the triangle with vertices *v*_{1}, *v*_{2}, and *v*_{3}. A triangle (*v*_{1}, *v*_{2}, *v*_{3}) in *G* is called a *d**-pendant triangle* if two of the vertices *v*_{1}, *v*_{2}, *v*_{3} have degree 2 in *G* and the third vertex has degree equals *d* in *G* for some integer *d* ≥ 3. A *d*-pendant triangle is also called a *pendant triangle*.

By Definition 1, a network *G*_{t} ∈ ${G}$(*t*) will contain a pendant triangle with a vertex of degree at least 4. Define a 3–cactus networks *G*_{t} ∈ ${G}$(*t*) to be in **Class I** if *G*_{t} contains a 4-pendant triangle, and in **Class II** if *G*_{t} does not contain a 4-pendant triangle. The following observations follow from Definition 1.

**Observation 1**. *Let t ≥ 0 be an integer, and let G _{t} ∈* ${G}$(

*t*)

*be a network formed by Definition 1 using t iterations. Each of the following holds*.

*(i) The 3–cactus networks is a generalization of Koch networks, as building a Koch network G*_{m,g} *using g iterations amounts to* (3*m* + 1)^{g} *iterations in building a 3–cactus network*.

*(ii) G*_{t} *has t triangles*, 2*t* + 1 *vertices and* 3*t* *edges*.

*(iii) If* (*u*_{0}, *u*_{1}, *u*_{2}) *is a pendant triangle of G*_{t} *with d*_{Gt}(*u*_{1}) = *d*_{Gt}(*u*_{2}) = 2, *then t* ≥ 2 *and u*_{0} *is a cut vertex of G*_{t}.

*(iv) Every Class II 3–cactus network G contains two pendant triangles (u_{0}, u_{1}, u_{2}) and (u_{0}, v_{1}, v_{2}) sharing a common vertex*

*u*

_{0}.

**Proof:** It suffices to justify (iv) as all others are direct consequences from Definition 1. Let *G* be a Class II 3–cactus network. By Definition 1, *G* ∈ ${G}$(*t*) for some *t* ≥ 3, and if *G* ∈ ${G}$(3), then *G* has a vertex of degree 6 and all other vertices of degree 2, and so (iv) holds. Assume that *t* ≥ 4 and (iv) holds for smaller values of *t*. By Definition 1, *G* contains a pendant triangle (*x, z*_{1}, *z*_{2}) with *d*_{G}(*z*_{1}) = *d*_{G}(*z*_{2}) = 2. Since *G* is of Class II, *d*_{G}(*x*) > 4. Let ${G}^{\prime}=G-\left\{{z}_{1},{z}_{2}\right\}$. Then *G*′ ∈ ${G}$(*t* − 1). If *G*′ is of Class II, then by induction, *G*′ has two pendant triangles (*u*_{0}, *u*_{1}, *u*_{2}) and (*u*_{0}, *v*_{1}, *v*_{2}) sharing a common vertex *u*_{0}. But as *G* is of Class II, *u*_{0} cannot be a vertex of degree 4 in a 4-pendant triangle in *G*. If *x* ∉ {*u*_{0}, *u*_{1}, *u*_{2}, *v*_{1}, *v*_{2}}, then (*u*_{0}, *u*_{1}, *u*_{2}) and (*u*_{0}, *v*_{1}, *v*_{2}) are two pendant triangles in *G*, and so (iv) holds and we are done. Hence we assume that *x* ∉ {*u*_{0}, *u*_{1}, *u*_{2}, *v*_{1}, *v*_{2}}. If *x* = *u*_{0}, then (*u*_{0}, *u*_{1}, *u*_{2}), (*u*_{0}, *v*_{1}, *v*_{2}), and (*u*_{0}, *z*_{1}, *z*_{2}) are three pendant triangles with a common vertex *u*_{0}, implying (iv) also. Hence we must have *x* ∈ {*u*_{1}, *u*_{2}, *v*_{1}, *v*_{2}}. By symmetry, we assume that *x* = *u*_{1}. Then the two triangles (*u*_{0}, *u*_{1}, *u*_{2}) and (*u*_{1}, *z*_{1}, *z*_{2}) sharing a common vertex *x* = *u*_{1} with *d*_{G}(*u*_{1}) = 4, and so (*u*_{1}, *z*_{1}, *z*_{2}) is a 4-pendant triangle. This implies that *G* is of Class I, a contradiction. Therefore, we assume that *G*′ is of Class I, and so *G*′ has a 4-pendant triangle $({u}_{0}^{\prime},{u}_{1}^{\prime},{u}_{2}^{\prime})$ with ${d}_{{G}^{\prime}}({u}_{1}^{\prime})={d}_{{G}^{\prime}}({u}_{2}^{\prime})=2$. Since *G* is of Class II, we may assume that $x\in \left\{{u}_{0}^{\prime},{u}_{1}^{\prime},{u}_{2}^{\prime}\right\}$. Thus either $x={u}_{0}^{\prime}$, whence *G* has two pendant triangles $(x,{u}_{1}^{\prime},{u}_{2}^{\prime})$ and (*x, z*_{1}, *z*_{2}) satisfying (iv); or $x\in \left\{{u}_{1}^{\prime},{u}_{2}^{\prime}\right\}$, whence *G* is of Class I, contrary to the assumption that *G* is of Class II. □

Thus every Koch network is a 3–cactus network. However, there exist 3–cactus networks that are not Koch networks, as shown by the *triangle–path* ${P}_{t}^{\Delta}$ and the *triangle–star* ${S}_{t}^{\Delta}$ are two special classes of 3–cactus networks with *t* triangles. Examples of these 3–cactus networks are depicted in Figure 2.

## 3. Algorithm for Counting the Number of Subtrees

In this section, we present a linear algorithm to count the number of subtrees in a 3–cactus network and its proof of the correctness.

**Algorithm A:** Initial condition: Let *G*_{t} = (*V, E*) be a 3–cactus network with *t* triangles with the vertex set *V* = {*u*_{0}, *u*_{1}, *v*_{1}, *u*_{2}, *v*_{2}, …, *u*_{t}, *v*_{t}} and the edge set *E* = {*e*_{1}, *e*_{2}, …, *e*_{3t}}, where *u*_{i} and *v*_{i} are the vertices added at the *i*-th iteration, for each *i* = 1, 2, …, *t*. Let η(*G*_{t}) be the number of subtrees of *G*_{t}. For every *v*, we assign an ordered pair of real numbers (1, 0) as the initial weight of the vertex.

**Step 1**. Set *k* = *t*.

**Step 2**. Let (*a*_{1}, *b*_{1}), (*a*_{2}, *b*_{2}), and (*a*_{3}, *b*_{3}) denote the weights of *u*_{k}, *v*_{k} and the common neighbor of *u*_{k} and *v*_{k}, respectively. Delete the vertices *u*_{k} and *v*_{k}, and reset the value of (*a*_{3}, *b*_{3}) by the following:

**Step 3**. If *k* = 1, then stop, output η(*G*_{t}) = *a*_{3} + *b*_{3}. Otherwise, set *k*: = *k* − 1 and go to Step 2.

As there will be *t* iterations using Step 2, the complexity of Algorithm A is *O*(*t*). Since running Algorithm A to a 3–cactus networks *G*_{t} ∈ ${G}$(*t*) can be performed in a reverse order of building *G*_{t} as described in Definition 1, it is possible to arrange the iterations in Step 2 during the running of Algorithm A so that when Algorithm A terminates, only the initial vertex of *G*_{t} is left.

Example 1. *As examples, it is inspected that* η(*G*_{0}) = 1*. Let* *G*_{1} = (*u*_{0}, *u*_{1}, *u*_{2}) *be a triangle. Then* *G*_{1} *has three subtrees avoiding* *u*_{0}*, namely*, {*u*_{1}}, {*u*_{2}} *and the complete graph on* {*u*_{1}, *u*_{2}}*, in* *G*_{1} *that avoids the vertex* *u*_{0}*, and six subtrees containing* *u*_{0}*, induced by the vertex subset* {*u*_{0}} *or by the edge subsets*, {*u*_{0}*u*_{1}}, {*u*_{0}*u*_{2}}, {*u*_{0}*u*_{1}, *u*_{0}*u*_{2}}, {*u*_{0}*u*_{1}, *u*_{1}*u*_{2}}, {*u*_{0}*u*_{2}, *u*_{1}*u*_{2}}*. It follows that* η(*G*_{1}) = 3 + 6 = 9*. On the other hand, using Algorithm A, with each of* *u*_{0}, *u*_{1}, *u*_{2} *assigned the initial weight* (1, 0)*, by (**1**), we have* *a*_{3} = 6 *and* *b*_{3} = 3*. By Step 3 of Algorithm A, we also have* η(*G*_{1}) = 9.

Example 2. *Let* *H* *be the 3–cactus network generated by 6 iterations, as depicted in* *Figure 3**. Using Algorithm A to* *H*, *the steps of calculating the number of subtrees of* *H* *are shown in* *Figure 3**, which shows* η(*H*) = 21, 096 + 378 = 21, 474.

**Figure 3**. An example of calculating the number of subtrees by **Algorithm A**, where two red vertices are deleted at each step.

Theorem 1 proves the correctness of Algorithm A.

**Theorem 1**. *Let G*_{t} *be a 3–cactus network generated by t steps with vertex set V* = {

*u*

_{0},

*u*

_{1},

*v*

_{1},

*u*

_{2},

*v*

_{2}, …,

*u*

_{t},

*v*

_{t}}.

*Let*(

*a, b*)

*denote the weight of vertex u*

_{0}.

*Each of the following holds when Algorithm A stops*.

*(i) The value of a*, *denoted by η*_{u0}(*G*_{t}), *is the number of subtrees containing vertex u_{0} in G_{t}*.

*(ii) The value of b, denoted by η*(

*G*

_{t}−

*u*

_{0}),

*is the number of subtrees that do notcontain vertex u*

_{0}in

*G*

_{t}.

*(iii) The value of a + b, denoted by η*(

*G*

_{t}),

*is the number of subtrees in G*

_{t}.

**Proof:** We argue by induction on *t*. If *t* = 1, then *G*_{1} is a triangle. By Algorithm A, we have that *a* = 6 and *b* = 3, and by inspection, η(*G*_{1}) = 9. Thus, the result holds for *t* = 1. Suppose that *k* ≥ 2 and the result holds for all values of *t* < *k*.

The structural of *G*_{t} when *t* = *k* ≥ 2 is depicted in Figure 4, and we shall use Figure 4 and its notation to illustrate our arguments. Thus, *H*_{1}, *H*_{2} and *H*_{3} are the three vertex disjoint subgraphs of *G*_{t} such that *H*_{1} contains exactly one vertex *u*_{1} in the initial 3-cycle *G*_{1} = (*u*_{0}, *u*_{1}, *v*_{1}), *H*_{2} contains exactly one vertex *v*_{1} in *G*_{1} = (*u*_{0}, *u*_{1}, *v*_{1}) and *H*_{3} contains exactly one vertex *u*_{0} in *G*_{1} = (*u*_{0}, *u*_{1}, *v*_{1}), as described in Definition 1.

Relabel the vertices *u*_{1}, *v*_{1}, and *u*_{0} as *w*_{1}, *w*_{2}, and *w*_{3}, when each of them is considered as a vertex in *H*_{1}, *H*_{2}, and *H*_{3}, respectively. In the rest of the proof of this theorem, we keep in mind that *u*_{1} = *w*_{1}, *v*_{1} = *w*_{2}, and *u*_{0} = *w*_{3}.

As *G*_{1} = (*u*_{0}, *u*_{1}, *v*_{1}) is an initial 3-cycle of *G*_{t}, we can view *w*_{i} as the initial vertex of the 3–cactus network *H*_{i}. For each *i* ∈ {1, 2, 3}, since each *H*_{i} is a 3–cactus network generated by at most *t*−1 iterations, by applying Algorithm A to *H*_{i} ending at the initial vertex *w*_{i} of *H*_{i}, we obtain the weights (*a*_{1}, *b*_{1}), (*a*_{2}, *b*_{2}), (*a*_{3}, *b*_{3}) of the vertices *w*_{1}, *w*_{2}, and *w*_{3}, respectively. By the induction hypothesis, we have, for *i* ∈ {1, 2, 3}, both (A) and (B) of the following.

At this stage of Algorithm A, the graph to be computed is *G*_{1} = (*u*_{0}, *u*_{1}, *v*_{1}) with the weights assigned to *u*_{0}, *u*_{1}, *v*_{1} being (*a*_{3}, *b*_{3}), (*a*_{1}, *b*_{1}), and (*a*_{2}, *b*_{2}), respectively. Running Algorithm A at the last iteration, we delete the vertices *u*_{1} and *v*_{1}, and reset the weight (*a, b*) to the vertex *u*_{0} by (1),

Let ${T}$ denote the collection of subtrees of *G*_{t}. Define

and for *i* ∈ {1, 2}, define

Thus ${T}={\cup}_{i=0}^{7}{{T}}_{i}$ is a partition. By (A) and (B) in (2), $\left|{{T}}_{0}\right|={a}_{3}$, $\left|{{T}}_{4}\right|={a}_{1}$, $\left|{{T}}_{5}\right|={a}_{2}$ and $\left|{{T}}_{7}\right|={b}_{1}+{b}_{2}+{b}_{3}$. As the edge *u*_{0}*u*_{1} lies in every tree in ${{T}}_{1}$, we have $\left|{{T}}_{1}\right|={a}_{1}{a}_{3}$. Likewise, $\left|{{T}}_{2}\right|={a}_{2}{a}_{3}$ and $\left|{{T}}_{6}\right|={a}_{1}{a}_{2}$. Since every tree in ${{T}}_{3}$ contains exactly two edges in *G*_{1} and there are three pairs of such edges in *G*_{1}, we have $\left|{{T}}_{3}\right|=3{a}_{1}{a}_{2}{a}_{3}$. By definition and (3),

With a similar argument and using $\left|{{T}}_{7}\right|={b}_{1}+{b}_{2}+{b}_{3}$, we have

It follows that

This shows that when Algorithm A terminates, it outputs the values as stated in Theorem 1 (i), (ii), and (iii), and justifies the correctness of Algorithm A. □

## 4. Upper and Lower Bounds of the Number of Subtrees in a 3–Cactus Network

The following lemma [8] will be used in our proof.

**Lemma 1 ([8])**. *Let G be a connected network with n* (*n* ≥ 3) *vertices and let G_{1} and G_{2} be two subnetworks of G such that G = G_{1} ∪ G_{2}, V*(

*G*

_{1}) ∩

*V*(

*G*

_{2}) = {

*v*}

*and E*(

*G*

_{1}) ∩

*E*(

*G*

_{2}) = ∅.

*Then*

**Theorem 2**. *For an integer t*, ${S}_{t}^{\Delta}$ *is the unique 3–cactus network with the maximum number of subtrees in* ${G}$(*t*).

**Proof:** We prove the theorem by induction on *t*, and observe that the theorem holds when *t* ∈ {1, 2}. Let *k* ≥ 3 be an integer and assume that the result is true for *t* < *k*. We consider that case when *t* = *k*.

Let *G*′ be a 3–cactus network with *k* triangles, and let (*u, v, w*) be a pendant triangle such that ${d}_{{G}^{\prime}}(u)\ge 4$ and ${d}_{{G}^{\prime}}(w)={d}_{{G}^{\prime}}(v)=2$. By Observation 1(iii), *u* is a cut vertex. Let ${G}_{1}^{\prime}={G}^{\prime}-\left\{w,v\right\}$ and ${G}_{2}^{\prime}=(u,v,w)$.

By the induction hypothesis, $\eta ({G}_{1}^{\prime})\le \eta ({S}_{k-1}^{\Delta})$, where the equality holds if and only if ${G}_{1}^{\prime}={S}_{k-1}^{\Delta}$. If ${G}^{\prime}={S}_{k}^{\Delta}$, then ${G}_{1}^{\prime}-u=(k-1){P}_{2}$, where *P*_{2} is the path with 2 vertices. If ${G}^{\prime}\ne {S}_{k}^{\Delta}$, then (*k* − 1)*P*_{2} must be a proper subnetwork of ${G}_{1}^{\prime}-u$, which implies $\eta ({G}_{1}^{\prime}-u)>\eta ((k-1){P}_{2})$. Since ${G}_{2}^{\prime}=(u,v,w)$ and ${G}_{2}^{\prime}-u={P}_{2}$, it follows from (4) that $\eta ({G}^{\prime})\le \eta ({S}_{k}^{\Delta})$, where the equality holds if and only if ${G}^{\prime}={S}_{k}^{\Delta}$, which completes the proof. □

The next lemma presents some observations which follow from Algorithm A.

Lemma 2. *Let G*_{t} ∈ ${G}$(*t*) *be a 3–cactus network with a pendant triangle* (*u, v, w*) *such that* *d*_{Gt}(*w*) = *d*_{Gt}(*v*) = 2, *and let* *G*_{t−1} = *G*_{t} − {*w, v*}. *Then*

*(i) η*(*G*_{t}) = 5η_{u}(*G*_{t−1}) + η(*G*_{t−1}) + 3;

*(ii) η*_{w}(*G*_{t}) = 4η_{u}(*G*_{t−1}) + 2. □

Lemma 3. *Let t* ≥ 3 *be an integer and G* ∈ ${G}$(*t*) *be a Class II 3–cactus network. Then there exists a Class I 3–cactus network G*′ in ${G}$(*t*) *satisfying η*(*G*′) < η(*G*).

**Proof:** Let *G* ∈ ${G}$(*t*) be a Class II 3–cactus network. By Observation 1(iv), *G* contains two pendant triangles (*u*_{0}, *u*_{1}, *u*_{2}) and (*u*_{0}, *u, w*) such that *d*_{G}(*u*_{0}) ≥ 6 and *d*_{G}(*u*_{1}) = *d*_{G}(*u*_{2}) = *d*_{G}(*u*) = *d*_{G}(*w*) = 2, as depicted in Figure 5A. Let *H* be the graph depicted in Figure 5. Denote by *a*_{0} (*b*_{0}, respectively) the number of subtrees containing *u*_{0} (not containing *u*_{0}) in *H*. By Algorithm A, when deleting the vertices *u*_{1} and *u*_{2} from *G*, the weight of vertex *u*_{0}, denoted by (*a*_{u0}, *b*_{u0}), can be reset as follows: *a*_{u0} = 6*a*_{0} and *b*_{u0} = *b*_{0} + 3. Then in the step of deleting the vertices *u*_{0} and *w* from *G*, the weight of vertex *u* is given by η_{u}(*G*) = 4*a*_{u0} + 2, η(*G* − *u*) = 2*a*_{u0} + *b*_{u0} + 1. Thus, we have η(*G*) = 36*a*_{0} + *b*_{0} + 6.

Let *G*′ denote the graph depicted in Figure 5B, which is obtained from *H* by identifying vertex *u*_{0} of *H* and a vertex of degree 2 in ${P}_{2}^{\Delta}$. By Algorithm A, when deleting the vertices *u*_{0} and *u*_{2} from *G*′, the weight of vertex *u*_{1}, denoted by (*a*_{u1}, *b*_{u1}), is obtained as *a*_{u1} = 4*a*_{0} + 2, *b*_{u1} = 2*a*_{0} + *b*_{0} + 1. Then in the step of deleting the vertices *u*_{1} and *w* from *G*′, the weight of vertex *u* is given by ${\eta}_{u}({G}^{\prime})=4{a}_{{u}_{1}}+2$, $\eta ({G}^{\prime}-u)=2{a}_{{u}_{1}}+{b}_{{u}_{1}}+1$. Thus, we have $\eta ({G}^{\prime})=26{a}_{0}+{b}_{0}+16$. Algebraic computation yields that $\eta (G)-\eta ({G}^{\prime})=10{a}_{0}-10>0$, and so the lemma is proved. □

**Theorem 3**. *For an integer t*, ${P}_{t}^{\Delta}$ *is the unique 3–cactus network with the minimum number of subtrees in* ${G}$(*t*).

**Proof:** By Lemma 3, within the family ${G}$(*t*), for every 3–cactus network *G* in Class II, there is always a 3–cactus network *G*′ in Class I containing fewer subtrees. Thus, we only need to show that ${P}_{t}^{\Delta}$ is the unique 3–cactus network with the minimum number of subtrees, among all the networks of ${G}$(*t*) in Class I.

We prove the conclusion by induction on *t*. Let *G*_{t} ∈ ${G}$(*t*) be a 3–cactus network with a pendant triangle (*u, v, w*) such that *d*_{Gt}(*u*) = 4 and *d*_{Gt}(*w*) = *d*_{Gt}(*v*) = 2. We will prove the following results: (i) ${P}_{t}^{\Delta}$ is the unique 3–cactus network with the minimum number of subtrees in ${G}$(*t*); (ii) η_{w}(*G*_{t}) attains the minimum value if and only if ${G}_{t}={P}_{t}^{\Delta}$.

The results hold for *t* = 1 and 2. Suppose that *k* ≥ 3 and the results are true for *t* < *k*, we consider the case when *t* = *k*. Let *G*_{k−1} = *G*_{k} − {*w, v*}. Since *d*_{Gk−1}(*u*) = 2, by Lemma 2 and the induction hypothesis, we have that

and

where the equalities hold if and only if ${G}_{k}={P}_{k}^{\Delta}$. □

With Algorithm A, we can compute the numbers of subtrees of ${S}_{t}^{\Delta}$ and ${P}_{t}^{\Delta}$, respectively. Let *u*_{0} be the center of ${S}_{t}^{\Delta}$ and *v*_{0} be a vertex of degree 2 in a pendant triangle of ${P}_{t}^{\Delta}$. From Algorithm A, it follows that

and

By algebraic manipulations, we obtain that

and

By Theorems 2 and 3, $\eta ({S}_{t}^{\Delta})$ and $\eta ({P}_{t}^{\Delta})$ represent the upper and lower bounds of the number of subtrees in a 3–cactus network with *t* triangles, respectively. As shown in (5) and (6), the numbers of subtrees in ${S}_{t}^{\Delta}$ and ${P}_{t}^{\Delta}$ grow exponentially as the number of triangles increases, as seen in Figure 6, where the curves of values of $\eta ({S}_{t}^{\Delta})$ and $\eta ({P}_{t}^{\Delta})$ vs. *t* are plotted.

## 5. The Entropy of Subtrees of Koch Networks

The entropy of spanning trees has been well-studied, as seen in Lyons et al. [21] and Zhang et al. [22, 23], among others. The entropy of subtrees can be similarly defined.

**Definition 2**. *Let* *G* *be a network with* *N*(*G*) *vertices. The entropy of subtrees of* *G* *is defined as follows:*

Let *T* be a tree with *n* vertices. Székely and Wang [2] and Yan and Yeh[3] obtained the results of the number of subtrees in a tree as follows: $\frac{n(n+1)}{2}=\eta ({P}_{n})\le \eta (T)\le \eta ({K}_{1,n-1})={2}^{n-1}+n-1$, where *P*_{n} and *K*_{1,n−1} are the path and star with *n* vertices, respectively. So, we have

and

From Equations (5) and (6), we can calculate the entropies of subtrees of ${S}_{t}^{\Delta}$ and ${P}_{t}^{\Delta}$, respectively, as follows:

and

Therefore, for a tree *T* with *n* vertices and a 3–cactus network *G*_{t} with *t* triangles, we have

Now we calculate the entropy of subtrees of Koch networks. The following definition and notation will be used in this section.

Let α(*x*) and β(*x*) be two infinities when *x* is close to infinity. If $\underset{x\to \infty}{\mathrm{lim}}\frac{\alpha (x)}{\beta (x)}=1$, we say that α(*x*) and β(*x*) are *equivalent infinities*, and write α(*x*) ~ β(*x*) (*x* → ∞).

For Koch networks, another construction is given as follows. The network *G*_{m, g} is obtained from *G*_{m,i} (*i* = 0, 1, 2, …, *g* − 1) and the initial triangle by adding *m* copies of *G*_{m,i} to each of the three hub vertices of the initial triangle, as shown in Figure 7.

**Figure 7**. Another construction of Koch networks. The network after *g* iterations, *G*_{m,g}, consists of 3*m* copies of *G*_{m,i} labeled by ${G}_{m,i}^{j}\text{}(j=1,2,\dots ,3m;\text{}i=0,1,2,\dots ,g-1)$.

According to the construction, *G*_{m,g} has the form illustrated in Figure 8, where *H*_{g} is the subnetwork of *G*_{m,g} obtained from *m* copies of *G*_{m,i} (*i* = 0, 1, 2, …, *g* − 1) by identifying *mg* hub vertices *X* in *m* copies of *G*_{m,i} (*i* = 0, 1, 2, …, *g* − 1). Then η_{X}(*H*_{g}) and η(*H*_{g} − *X*) are given by

By Algorithm A to the initial triangle (*X, Y, Z*), we get that

and initial conditions are η_{X}(*G*_{m,0}) = 6 and η(*G*_{m,0} − *X*) = 3. So, we arrive at

From Equation (7), we obtain

According to the above theoretical analysis, we give a linear algorithm for counting the number of subtrees in a Koch network, as follows.

**Algorithm B:** Initial condition: Let *G*_{m,g} be a Koch network generated by *g* iterations and *X*, *Y* and *Z* be three hub vertices in *G*_{m,g}. Let η(*G*_{m,g}) denote the number of subtrees of *G*_{m,g}.

**Step 1**. Take *k* = 1, *a* = 6, *b* = 3, *x* = 1 and *y* = 0.

**Step 2**. Suppose that, at iteration *k*, the number of subtrees containing *X* in *H*_{k} and the number of subtrees not containing *X* in *H*_{k} are denoted by *x* and *y*, respectively. One gets the values *x* and *y* as

**Step 3**. Suppose that *a* and *b* denote the number of subtrees containing *X* in *G*_{m,k} and the number of subtrees not containing *X* in *G*_{m,k}, respectively. We get *a* and *b* by

**Step 4**. If *k* = *g*, then stop, output η(*G*_{m,g}) = *a* + *b*. Otherwise, *k*: = *k* + 1, go to Step 2.

It is not difficult to see that the complexity of the above algorithm is *O*(*g*). In order to calculate the entropy of subtrees of Koch networks, we need the following lemma:

Lemma 4. Let *G*_{m,g} *be a Koch network generated by g iterations. Then*

**Proof:** From Equation (10), we have the following recurrence relations:

It is easy to obtain ${\eta}_{X}({H}_{g})~{3}^{m}\times {({\eta}_{X}({H}_{g-1}))}^{3m+1}\text{}(g\to \infty )$. Note that ${\eta}_{X}({H}_{1})={6}^{m}$.

It follows that

Since η(*H*_{1} − *X*) = 3*m*, we have

From Equations (11) and (12), we get that $\underset{x\to \infty}{\mathrm{lim}}\frac{\eta ({H}_{g}-X)}{{({\eta}_{X}({H}_{g}))}^{3}}=0$. From Equation (9), it is easy to see that

From Equations (11) and (13), we conclude that

The proof is thus complete. □

From Lemma 4, we can calculate the entropy of subtrees of Koch networks, as

Next, we can compare the entropy of subtrees of Koch networks with those of ${P}_{t}^{\Delta}$ and ${S}_{t}^{\Delta}$. Observe that $ln2<\frac{ln6}{2}-\frac{ln2}{2(3m+1)}<\frac{ln6}{2}$ and $\underset{m\to \infty}{\mathrm{lim}}E({G}_{m,g})=\underset{m\to \infty}{\mathrm{lim}}(\frac{ln6}{2}-\frac{ln2}{2(3m+1)})=\frac{ln6}{2}.$ Thus, the following inequality holds.

The entropy of subtrees of Koch networks reflects the fact that although the number of subtrees of Koch networks grows exponentially, the growth rate is lower than that of the triangle–star and higher than that of the triangle–path. This result suggests that if the vertex failure probability *p* satisfies *p* → 0, the edge failure probability *q* satisfies *q* → 1, and *p* and 1 − *q* are equivalent infinitesimals, then Koch networks are less reliable than the triangle–star, and more reliable than the triangle–path. Noticing that *E*(*G*_{m,g}) can be considered as a function of the variable *m*, it is easy to see that the entropy of subtrees of Koch networks tends to the maximum entropy of subtrees of all 3–cactus networks as *m* tends to infinity.

## 6. Conclusions

In this paper, we have given the definition of the entropy of subtrees, which is used to compare the average number of subtrees for networks of different sizes. We have established a linear algorithm for counting the number of subtrees in any 3–cactus network, and characterized the 3–cactus networks with upper and lower bounds of the entropy of subtrees among all 3–cactus networks with *t* triangles. In order to avoid exponential computation, we have also proposed a linear algorithm for calculating the number of subtrees in Koch networks. Finally, we have determined the entropy of subtrees of Koch networks which tends to the maximum entropy of subtrees of all 3–cactus networks as *m* tends to infinity.

## Data Availability Statement

The original contributions presented in the study are included in the article/supplementary material, further inquiries can be directed to the corresponding author/s.

## Author Contributions

LD, HZ, and H-JL contributed the conception and design of the study. LD organized the literature, wrote the simulation programs, and performed the design of figures. LD and HZ wrote the first draft of the manuscript. All authors contributed to the manuscript revision, read, and approved the submitted version.

## Funding

This work was supported by National Science Foundation of China (Grant No. 11661069), the Program for Changjiang Scholars and Innovative Research Team in Universities (Grant No. IRT-15R40), the Key Laboratory of Qinghai Province (Grant No. 2013-Z-Y17), the Research Fund for the Chunhui Program of Ministry of Education of China, the Nature Science Foundation from Qinghai Province (Grant No. 2018-ZJ-718), and the Research Foundation from Qinghai Normal University (Grant No. 2018zr010).

## Conflict of Interest

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

## Acknowledgments

The authors were very grateful to the referees and the editor for their valuable comments and suggestions, which significantly improved the presentation of this manuscript.

## References

1. Zhao HX. *Research on subgraph polynomials and reliability of networks* (Ph.D. thesis), School of Computer, Northwestern Polytechnical University, Xi'an, China (2004).

2. Székely LA, Wang H. On subtrees of trees. *Adv Appl Math*. (2005) **34**:138–55. doi: 10.1016/j.aam.2004.07.002

3. Yan WG, Yeh Y-N. Enumeration of subtrees of trees. *Theoret Comput Sci*. (2006) **369**:256–68. doi: 10.1016/j.tcs.2006.09.002

4. Kirk R, Wang H. Largest number of subtrees of trees with a given maximum degree. *SIAM J Discrete Math*. (2008) **22**:985–95. doi: 10.1137/070687736

5. Zhang XM, Zhang XD. The minimal number of subtrees with a given degree sequence. *Graphs Comb*. (2015) **31**:309–18. doi: 10.1007/s00373-013-1383-z

6. Zhang XM, Zhang XD, Gray D, Wang H. Trees with the most subtrees-an algorithmic approach. *J Comb*. (2012) **3**:207–23. doi: 10.4310/JOC.2012.v3.n2.a5

7. Zhang XM, Zhang XD, Gray D, Wang H. The number of subtrees of trees with given degree sequence. *J Graph Theory*. (2013) **73**:280–95. doi: 10.1002/jgt.21674

8. Xiao YZ, Zhao HX, Liu Z, Mao YP. Trees with large numbers of subtrees. *Int J Comput Math*. (2017) **94**:372–85. doi: 10.1080/00207160.2015.1109640

9. Yang Y, Liu HB, Wang H, Fu HS. Subtrees of spiro and polyphenyl hexagonal chains. *Appl Math Comput*. (2015) **268**:547–60. doi: 10.1016/j.amc.2015.06.094

10. Yang Y, Liu HB, Wang H, Deng AS, Magnant C. On algorithms for enumerating subtrees of hexagonal and phenylene chains. *Comput J*. (2017) **60**:690–710. doi: 10.1093/comjnl/bxw091

11. Axenovich M, Osang G. Unavoidable subtrees. *Discrete Math*. (2013) **313**:924–30. doi: 10.1016/j.disc.2013.01.015

12. Christou M, Crochemore M, Flouri T, Iliopoulos CS, Janoušek J, Melichar B, et al. Computing all subtree repeats in ordered trees. *Inform Process Lett*. (2012) **112**:958–62. doi: 10.1016/j.ipl.2012.09.001

13. Li S, Wang S. Further analysis on the total number of subtrees of trees. *Electron J Comb*. (2012) **19**:P48. doi: 10.37236/2186

14. Martin DM, Thatte BD. The maximum agreement subtree problem. *Discrete Appl Math*. (2013) **161**:1805–17. doi: 10.1016/j.dam.2013.02.037

15. Székely LA, Wang H. Extremal values of ratios: distance problems vs. subtree problems in trees II. *Discrete Math*. (2014) **322**:36–47. doi: 10.1016/j.disc.2013.12.027

16. Vince A, Wang H. The average order of a subtree of a tree. *J Combin Theory B*. (2010) **100**:161–70. doi: 10.1016/j.jctb.2009.05.006

17. Wang H. *Some results on trees* (Ph.D. thesis), Department of Mathematics, University of South Carolina, Columbia, United States (2005).

18. Zhang ZZ, Gao SY, Chen LC, Zhou SG, Zhang HJ, Guan JH. Mapping Koch curves into scale-free small-world networks. *J Phys A Math Theor*. (2010) **43**:395101. doi: 10.1088/1751-8113/43/39/395101

19. Bondy JA, Murty USR. *Graph Theory With Applications.* New York, NY; North-Holland: The Macmillan Press Ltd. (1976).

20. Wu B, Zhang ZZ, Chen GR. Properties and applications of Laplacian spectra for Koch networks. *J Phys A Math Theor*. (2012) **45**:025102. doi: 10.1088/1751-8113/45/2/025102

21. Lyons R, Peled R, Schramm O. Growth of the number of spanning trees of the Erdős-Rényi giant component. *Combin Probab Comput*. (2008) **17**:711–26. doi: 10.1017/S0963548308009188

22. Zhang ZZ, Liu HX, Wu B, Zou T. Spanning trees in a fractal scale-free lattice. *Phys Rev E*. (2011) **83**:016116. doi: 10.1103/PhysRevE.83.016116

Keywords: cactus networks, Koch networks, the number of subtrees, entropy of subtrees, reliability

Citation: Dong L, Zhao H and Lai H-J (2020) Entropy and Enumeration of Subtrees in a Cactus Network. *Front. Phys.* 8:575648. doi: 10.3389/fphy.2020.575648

Received: 23 June 2020; Accepted: 24 August 2020;

Published: 08 October 2020.

Edited by:

Yang-Hui He, City University of London, United KingdomReviewed by:

Praveen Agarwal, Anand International College of Engineering, IndiaSimon Chiossi, Fluminense Federal University, Brazil

Copyright © 2020 Dong, Zhao and Lai. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.

*Correspondence: Haixing Zhao, h.x.zhao@163.com