Cut vertex and unicyclic graphs with the maximum number of connected induced subgraphs

Audace A. V. Dossou-Olory1,2
1C2EA, Institut National de l’Eau, Université d’Abomey-Calavi, Bénin
2Institut de Mathématiques et de Sciences Physiques, Université d’Abomey-Calavi, Bénin

Abstract

Cut vertices are often used as a measure of nodes’ importance within a network. These are nodes whose failure disconnects a connected graph. Let \(N(G)\) be the number of connected induced subgraphs of a graph \(G\). In this work, we investigate the maximum of \(N(G)\) where \(G\) is a unicyclic graph with \(n\) nodes of which \(c\) are cut vertices. For all valid \(n,c\), we give a full description of those maximal (that maximise \(N(.)\)) unicyclic graphs. It is found that there are generally two maximal unicyclic graphs. For infinitely many values of \(n,c\), however, there is a unique maximal unicyclic graph with \(n\) nodes and \(c\) cut vertices. In particular, the well-known negative correlation between the number of connected induced subgraphs of trees and the Wiener index (sum of distances) fails for unicyclic graphs with \(n\) nodes and \(c\) cut vertices: for instance, the maximal unicyclic graph with \(n=3,4\mod 5\) nodes and \(c=n-5>3\) cut vertices is different from the unique graph that was shown by Tan et al. [The Wiener index of unicyclic graphs given number of pendant vertices or cut vertices. J. Appl. Math. Comput., 55:1–24, 2017] to minimise the Wiener index. Our main characterisation of maximal unicyclic graphs with respect to the number of connected induced subgraphs also applies to unicyclic graphs with \(n\) nodes, \(c\) cut vertices and girth at most \(g>3\), since it is shown that the girth of every maximal graph with \(n\) nodes and \(c\) cut vertices cannot exceed \(4\).

Keywords: unicyclic graph, cut vertex, connected induced subgraph, extremal structures

1. Introduction and main result

Real-world graphs are extremely large, which poses great challenges for efficiently analysing their structural properties. Subgraphs of a graph are important substructures that can reveal valuable information about the underlying graph [1]. For instance, subgraphs can be used to identify building blocks and extract the functional properties of complex networks [12]. Subgraph enumeration is therefore important for describing large networks, and some algorithms have been invented for efficiently enumerating all connected induced subgraphs of a \(n\)-vertex graph; see [1, 3, 11, 17, 20]. For general graphs, the fastest known algorithm in this regard has a linear time delay and appeared very recently in [1] with an application to certain protein-protein interaction networks. Although we shall not deal with algorithms in this paper, our interest is still related to enumeration: our goal is to know the maximum number of connected induced subgraphs that a given graph can contain. In many applications however, one is only interested in connected subgraphs of graphs that meet certain structural constraints [1, 4]. Thus, over the set of all \(n\)-vertex graphs (or unicyclic graphs), those graphs that extremise the number of connected induced subgraphs are characterised in [6]. Paper [13] extends the work done in [6] by taking into account other structural parameters such that number of cycles, girth, and number of pendant vertices. Specifically, in [13] the author gave a partial characterisation of the \(n\)-vertex graphs with \(d\) cycles, girth \(g\) and \(k\) pendant vertices that have the maximum number of connected induced subgraphs; for the special case \(d=1\) (i.e. unicyclic graphs) the complete structure of those ‘maximal’ unicyclic graphs was provided. Other extremal results with respect to the number of connected induced subgraphs were also obtained for a given number of vertices and any combination of the above mentioned parameters.

A cut vertex of a graph \(G\) is a vertex whose deletion increases the number of (connected) components of \(G\). Cut vertices are often used as a measure of nodes’ importance within a network. Their failure disconnects the network and downgrades its performance (e.g. blocks data transmission). In [7], the author determined the maximum number of connected induced subgraphs in a connected graph with order \(n\) and \(c\) cut vertices, and also described the structure of those graphs attaining the bound. Moreover, he showed, among other things, that the cycle has the minimum number of connected induced subgraphs among all cut vertex-free connected graphs. Our goal is to extend this analysis further to unicyclic graphs. In this paper, we shall study the maximum number of connected induced subgraphs in a unicyclic graph with order \(n\) of which \(c\) are cut vertices.

Our main motivation for this study stems from [7, Theorem 1], which states that for general connected graphs with order \(n>1\) and \(c\) cut vertices, the unique graph that realises the maximum number of connected induced subgraphs is essentially the complete graph \(K_{n-c}\) of order \(n-c\) with one path attached to each of the vertices of \(K_{n-c}\) (see [7] for a more precise description). Since this extremal graph contains several cycles, it would be natural to impose an upper bound on the number of cycles and carry out the same study. The focus of this paper will be on unicyclic graphs; as we shall see, our main result also applies to unicyclic graphs whose girth is at most \(g>3\). We mention that the work of Tan et al. [16] on the Wiener index (sum of distances between all unordered vertex pairs [8, 19]) also inspired us, as some of the constructive techniques used in [16] will be adapted to our current setting.

Let us first state the main result of this paper. Before getting to the statement, we need to give some definitions. Fix the integers \(n>3\) and \(0<c<n-2\).

i) Let \(r\) be the residue of \(n-3\) modulo \(n-c\) and \(q=\lfloor (n-3)/(n-c) \rfloor\). Set \(m_j=q+1\) for all \(1\leq j \leq r\), and \(m_j=q\) for all \(r+1\leq j \leq n-c\). Then we define \(\Delta_{n,c}\) to be the graph constructed from the triangle \(v_0v_1v_2\) by attaching \(n-c-2\) pendant paths of respective lengths \(m_1,m_2,\ldots,m_{n-c-2}\) at \(v_2\), one pendant path of length \(m_{n-c-1}\) at \(v_1\), and one pendant path of length \(m_{n-c}\) at \(v_0\).

ii) Set \(m=\lfloor n/4 \rfloor\) and let \(r\) be the residue of \(n\) modulo \(4\). Then the graph \(\Omega_{n,n-4}\) with order \(n\) and \(n-4\) cut vertices is constructed from the square \(v_0v_1v_2v_3\) by attaching the pendant paths of orders \(m_0,m_1,m_2,m_3\) at \(v_0,v_1,v_2,v_3\), respectively, where \((m_0,m_1,m_2,m_3)\) is equal to \[\begin{aligned} (m,m,m,m),(m+1,m,m,m),(m+1,m+1,m,m),(m+1,m+1,m+1,m), \end{aligned}\] when \(r\) is equal to \(0,1,2,3\), respectively.

iii) Let \(n>7\) such that \(n+k=5m\) for some integer \(m\) and some \(k\in \{0,1,2\}\). Then the graph \(\Omega_{n,n-5}\) with order \(n\) and \(n-5\) cut vertices is constructed from the square \(v_0v_1v_2v_3\) by attaching the pendant paths of orders \(m_0,m_1,m_2,m_3\) at \(v_0,v_1,v_2,v_3\), respectively, and another pendant of order \(m\) at \(v_2\), where \((m_0,m_1,m_2,m_3)\) is equal to \[\begin{aligned} (m,m,m+1,m),(m,m,m,m),(m-1,m,m,m), \end{aligned}\] when \(k\) is equal to \(0,1,2\), respectively.

Main result

Let the integers \(n>3\) and \(0< c<n-2\) be given, and \(G\) be a unicyclic graph with order \(n\) and \(c\) cut vertices that maximises the number of connected induced subgraphs. Then the following hold:

\(\bullet\) \(G\) is only isomorphic to \(\Delta_{n,c}\) if \(c=n-3\) or \(c<n-5\);

\(\bullet\) \(G\) is only isomorphic to \(\Omega_{n,c}\) if \(c=n-4>1\), or \(c=n-5>3\) and \(n=3,4\mod 5\);

\(\bullet\) \(G\) is isomorphic to both \(\Delta_{n,c}\) and \(\Omega_{n,c}\) if \(c=n-5=3\), or \(c=n-4 =1\), or \[\begin{aligned} c=n-5>0 \quad \text{and} \quad n=0\mod 5. \end{aligned}\]

In contrast to the situation for general graphs where there are relatively few extremal results on this invariant, number of connected induced subgraphs, for trees it has been studied in more detail and numerous results are available. For instance, Chung et al. [5] estimated the minimum size of that tree \(T_n\) with the property that any \(n\)-vertex tree occurs as subtree of \(T_n\); Székely and Wang [14, 15] determined the structure of both \(n\)-vertex trees and \(n\)-leaf binary trees that extremise the number of subtrees; Li and Wang [10] (resp. Andriantiana et al. [2]) found the tree with order \(n\) and \(k\) pendant vertices that minimise (resp. maximise) the number of subtrees; Yan and Yeh [20] determine the unique tree with maximum degree at least \(\Delta\) that has the smallest number of subtrees, and the unique tree with diameter at least \(d\) that has the greatest number of subtrees.

The content within this paper is structured as follows: We give formal notation and terminologies in Section 2. Section 3 contains the technical parts of our approach to the main result. In the process of proving our main theorem, Section 3 is divided into 7 steps in a chronological way. We start by proving in Subsection 3.1 that there can only be at most one branching vertex in every graph with order \(n\) and \(c\) cut vertices that has the maximum number of connected induced subgraphs. In Subsection 3.2 we show that the girth of every ‘maximal’ graph (that maximises) cannot exceed \(4\). We then prove in Subsection 3.3 that if there is a branching vertex in a maximal graph \(G\), then that vertex must belong to the cycle of \(G\). We show in Subsection 3.4 that in a maximal graph whose circle is \(C\), every two pendants paths at a branching vertex or adjacent vertices of \(C\) must have orders’ difference at most \(1\). We then proceed to describe in Subsections 3.5 and 3.6 the full structure of those maximal graphs according to whether the order of \(C\) is \(3\) or \(4\). Finally, Subsection 3.7 carries a proof of our main theorem, which characterises those \(n\)-vertex graphs with \(c\) cut vertices that have the greatest number of connected induced subgraphs. Section 4 concludes the work and points out a connection of our main result to the Wiener index (sum of distances).

All graphs considered in this paper are simple, finite and connected.

2. Preliminaries

The trivial graph is that with only one vertex. For a graph \(G\) and \(u,v \in V(G)\), we shall denote by \(\mathop{\mathrm{N}}(G),~\mathop{\mathrm{N}}(G)_v,~\mathop{\mathrm{N}}(G)_{u,v}\) the number of connected induced subgraphs of \(G\), those that involve \(v\), and those that involve both \(u\) and \(v\), respectively. On the other hand, \(G-v\) (resp. \(G-uv\)) will denote the graph that results from deleting vertex \(v\) (resp. edge \(uv\)) in \(G\), and we simply write \(G-u-v\) instead of \((G-u)-v\). More generally, \(G-S\) represents the graph obtained from \(G\) by deleting all elements of \(S\). By a \(u-v\) path in \(G\) we mean a path that connects vertices \(u\) and \(v\) in \(G\). The number of cut vertices of \(G\) will be denoted by \(c(G)\) (or simply \(c\), when the underlying graph is clear from context). It is a straightforward fact that \(c\leq n-2\) holds for every non-trivial graph with order \(n\) and \(c\) cut vertices, with equality only for the path. As usual, the \(n\)-vertex path will be denoted by \(P_n\). We mention that \(\mathop{\mathrm{N}}(P_n)=n(n+1)/2\), and \(\mathop{\mathrm{N}}(P_n)_w=n\) if \(w\) is an endvertex of \(P_n\).

A vertex of outdegree greater than \(1\) in a rooted tree \(T\) will be called a branching vertex of \(T\). If \(T\) is a rooted tree and \(v \in V(T)\), then we define \(T[v]\) to be the fringe subtree of \(T\) rooted at \(v\). In other words, \(T[v]\) consists of \(v\) and all its descendants in \(T\). If \(v \in V(G)\), then a pendant path at \(v\) is a \(v-u\) path \(P\) with the property that \(u\) is a pendant vertex of \(G\) and all internal vertices of \(P\) have degree \(2\) in \(G\): we shall refer to \(u\) as the free endvertex of \(P\), even when \(P\) is trivial (and \(u\) is not a pendant vertex). Moreover, a pendant path of order \(2\) will simply be called a pendant edge. By \(C_n: v_0,v_1,v_2,\ldots, v_{n-1}\) we mean the cycle whose vertices are \(v_0,v_1,v_2,\ldots, v_{n-1}\) in this order, i.e. \(v_{n-1}\) is adjacent to \(v_0\), and \(v_j\) is adjacent to \(v_{j+1}\) for all \(0\leq j \leq n-2\). We shall refer to \(C_3\) and \(C_4\) as the triangle \(v_0v_1v_2\) and the square \(v_0v_1v_2v_3\), respectively. The girth of a graph \(G\) is the minimum order among the cycles (if any) of \(G\).

A connected graph that has only one cycle is called a unicyclic graph. Every unicyclic graph \(G\) whose girth is \(g\) can be constructed from the cycle \(C_g\) and some (pairwise vertex disjoint) rooted trees \(T_0,\ldots,T_{g-1}\) by identifying the root of \(T_j\) with vertex \(v_j\in V(C_g)\) for all \(0\leq j \leq g-1\); see Figure 1 for a picture.

Figure 1 The shape of a unicyclic graph with girth \(g\): \(T_0,\ldots,T_{g-1}\) are trees rooted at \(v_0,v_1,\ldots,v_{g-1}\), respectively

3. Prescribed number of cut vertices

Given two integers \(n>2\) and \(0\leq c<n-2\), we define \(\mathcal{U}(n,c)\) to be the set of all unicyclic graphs with \(n\) nodes of which \(c\) are cut vertices. Clearly, \(\mathcal{U}(n,0)=\{C_n\}\). Throughout the paper, we then assume that \(n>3\) and \(0< c<n-2\) are fixed integers. By a maximal graph, we always mean a graph \(G\in \mathcal{U}(n,c)\) that has the maximum number of connected induced subgraphs. The cycle of every maximal graph will be denoted by \(C\).

For the purpose of presenting our main result, we need to go through some preparations.

3.1. At most one branching vertex

Let \(G\) be a unicyclic graph whose shape is depicted in Figure 1. Then we shall refer to the branching vertices of the rooted trees \(T_0,\ldots,T_{g-1}\) as the branching vertices of \(G\). The following lemma will be used to show that there can only be at most one branching vertex in every maximal graph.

The first part of Lemma 3.1 below can be found in [13] (the actual formulation in [13] is a bit different but yet equivalent to Lemma 3.1).

Lemma 3.1. Let \(L,M,R\) be three non-trivial connected graphs whose vertex sets are pairwise disjoints. Let \(l \in V(L),~ r\in V(R)\) and \(u,v \in V(M)\) be fixed vertices such that \(u \neq v\). Denote by \(G\) the graph obtained from \(L,M,R\) by identifying \(l\) with \(u\), and \(r\) with \(v\). Similarly, let \(G'\) (resp. \(G''\)) be the graph obtained from \(L,M,R\) by identifying both \(l,r\) with \(u\) (resp. both \(l,r\) with \(v\)); see Figure 2 for a diagram of these graphs.

Figure 2 The graphs \(G,G',G''\) described in Lemma 3.1

Then it holds that \[\begin{aligned} \mathop{\mathrm{N}}(G') > \mathop{\mathrm{N}}(G) ~~ \text{or} ~~ \mathop{\mathrm{N}}(G'') > \mathop{\mathrm{N}}(G)\,. \end{aligned}\] Furthermore, if both \(u\) and \(v\) are cut vertices of the graph \(M\), then we have \[c(G')=c(G'')=c(G).\]

Proof. It is shown in the proof of [13, Lemma 1] that \[\begin{aligned} \mathop{\mathrm{N}}(G') – \mathop{\mathrm{N}}(G)&= (\mathop{\mathrm{N}}(R)_r -1) (\mathop{\mathrm{N}}(L)_l \cdot \mathop{\mathrm{N}}(M-v)_u – \mathop{\mathrm{N}}(M-u)_v)\,,\\ \mathop{\mathrm{N}}(G'') – \mathop{\mathrm{N}}(G)&= (\mathop{\mathrm{N}}(L)_l -1) (\mathop{\mathrm{N}}(R)_r \cdot \mathop{\mathrm{N}}(M-u)_v – \mathop{\mathrm{N}}(M-v)_u)\,. \end{aligned}\]

Thus we deduce that \[\begin{aligned} &\mathop{\mathrm{N}}(G') > \mathop{\mathrm{N}}(G) ~~ \text{if} ~~ \mathop{\mathrm{N}}(M-v)_u \geq \mathop{\mathrm{N}}(M-u)_v\,,\\ &\mathop{\mathrm{N}}(G'') > \mathop{\mathrm{N}}(G) ~~ \text{if} ~~ \mathop{\mathrm{N}}(M-v)_u \leq \mathop{\mathrm{N}}(M-u)_v\,. \end{aligned}\]

The setup presented in the lemma shows that both \(u\) and \(v\) are cut vertices of \(G\), and that except possibly \(u,v\), all other vertices of \(G\) preserve their status (cut vertex/non cut vertex) in both \(G'\) and \(G''\). Clearly, \(u\) (resp. \(v\)) remains a cut vertex of \(G'\) (resp. \(G''\)). Now by the assumption that both \(u\) and \(v\) are cut vertices of \(M\), we deduce that \(u\) (resp. \(v\)) is a cut vertex of \(G''\) (resp. \(G'\)). Hence \(c(G'')=c(G')=c(G)\). ◻

As a consequence of Lemma 3.1, we obtain:

Proposition 3.2. Every maximal graph contains at most one branching vertex.

Proof. Let \(G\) be a maximal graph and suppose that \(G\) contains two distinct branching vertices, say \(u\) and \(v\). Let \(u'\) be a neighbour of \(u\) in \(T[u]\) and \(v'\) a neighbour of \(v\) in \(T[v]\). Denote by \(L\) (resp. \(R\)) the component of \(T[u]-uu'\) that contains \(u\) (resp. the component of \(T[v]-vv'\) that contains \(v\)). Then both \(L\) and \(R\) are non-trivial graphs. Set \(M=G-(V(L-u) \cup V(R-v))\). The specific choice of \(u'\) depends on the following two cases:

Case 1. \(V(T[u]) \cap V(T[v])\neq \emptyset\).

We must have \(V(T[u]) \subset V(T[v])\) or \(V(T[v]) \subset V(T[u])\). We can assume, without loss of generality, that \(V(T[v]) \subset V(T[u])\). Choose \(u'\) to be that vertex lying on the unique \(u-v\) path in \(G\) (possibly \(u'=v\)). Then we have \(V(L) \cap V(R)=\emptyset\).

Case 2. \(V(T[u]) \cap V(T[v])=\emptyset\).

We have \(V(L) \cap V(R)=\emptyset\).

Let \(w\notin \{u,v\}\) be a vertex of \(G\) that lies on its cycle. Note that for either case, we have \(w,u',v'\in V(M)\). Moreover, all \(u'-w\) paths in \(M\) must pass through \(u\), and all \(v'-w\) paths in \(M\) must pass through \(v\). Therefore, both \(u\) and \(v\) are cut vertices of \(M\). In particular, Lemma 3.1 applied to \(G\) yields a new graph with order \(|V(G)|\) and \(c(G)\) cut vertices that has more connected induced subgraphs than \(G\), a contradiction to the choice of \(G\). Hence \(G\) can only contains at most one branching vertex. ◻

3.2. Girth is at most \(4\)

By refining an approach employed in [6], we shall prove that the girth of every maximal graph cannot exceed \(4\).

Lemma 3.3. Consider \(g>3\) connected graphs \(G_0,G_1,\ldots,G_{g-1}\) whose vertex sets are pairwise disjoint. For every \(j \in \{0,1,\ldots,g-1\}\), let \(v_j\) be a fixed vertex of \(G_j\). Assume that \[\mathop{\mathrm{N}}(G_{g-2})_{v_{g-2}}=\max_{0\leq j \leq g-1} \mathop{\mathrm{N}}(G_j)_{v_j}\,,\] and let the graphs \(G\) and \(G'\) be constructed as follows:

\(\bullet\) Add the edges \(v_0v_1, v_1v_2,\ldots, v_{g-1}v_0\) to obtain the graph \(G\);

\(\bullet\) Add the edges \(v_0v_1, v_1v_2,\ldots, v_{g-2}v_0\) and \(v_{g-2}v_{g-1}\) to obtain the graph \(G'\).

The following hold:

i) If \(G\) is not a cycle, then \(c(G')=c(G)\).

ii) For \(g>4\) we have \(\mathop{\mathrm{N}}(G')>\mathop{\mathrm{N}}(G)\).

iii) For \(g=4\) we have \(\mathop{\mathrm{N}}(G')\geq \mathop{\mathrm{N}}(G)\) if and only if \(\mathop{\mathrm{N}}(G_2)_{v_2}\geq \mathop{\mathrm{N}}(G_3)_{v_3}(1+\mathop{\mathrm{N}}(G_1)_{v_1})\). Moreover, \(\mathop{\mathrm{N}}(G')=\mathop{\mathrm{N}}(G)\) if and only if \(\mathop{\mathrm{N}}(G_2)_{v_2}= \mathop{\mathrm{N}}(G_3)_{v_3}(1+\mathop{\mathrm{N}}(G_1)_{v_1})\).

Proof. We first introduce the following notation: \(M_1\) is the number of connected induced subgraphs of \(G-(V(G_{g-1})\cup V(G_{g-2} – v_{g-2}))\) that contain \(v_{g-2}\) and at least one other vertex; \(M_2\) is the number of connected induced subgraphs of \(G-(V(G_{g-2})\cup V(G_{g-1} – v_{g-1}))\) that contain \(v_{g-1}\) and at least one other vertex; \(M_3\) is the number of connected induced subgraphs of \(G-(V(G_{g-2} -v_{g-2}) \cup V(G_{g-1} – v_{g-1}))\) that contain both \(v_{g-2}\) and \(v_{g-1}\); \(M_4\) is the number of connected induced subgraphs of \(G'-(V(G_{g-1}) \cup V(G_{g-2} -v_{g-2}))\) that contain \(v_{g-2}\) and at least one other vertex. Thus it is not difficult to see that \[\begin{aligned} M_1=\sum_{r=3}^g \prod_{j=3}^r \mathop{\mathrm{N}}(G_{g-j})_{v_{g-j}}\,, \quad M_2=\sum_{l=0}^{g-3} \prod_{j=0}^l \mathop{\mathrm{N}}(G_j)_{v_j}\,, \end{aligned}\] and \[\begin{aligned} M_3=\Big(1+ \sum_{r=3}^{g-1} \prod_{j=3}^r \mathop{\mathrm{N}}(G_{g-j})_{v_{g-j}} \Big) + \sum_{l=0}^{g-4} \prod_{j=0}^l \mathop{\mathrm{N}}(G_j)_{v_j} + \sum_{l=0}^{g-4} \sum_{r=3}^{g-1-l} \prod_{j=0}^l \mathop{\mathrm{N}}(G_j)_{v_j} \cdot \prod_{j=3}^r \mathop{\mathrm{N}}(G_{g-j})_{v_{g-j}}\,. \end{aligned}\]

In the expression of \(M_3\), the first term into brackets contributes to those subgraphs that do not involve \(v_0\); the second sum contributes to those subgraphs that involve \(v_0\) but not \(v_{g-3}\); the last sum is the number of those subgraphs that contain both \(v_0\) and \(v_{g-3}\). In particular, for \(g>4\) we get \[\begin{aligned} M_3&=1+M_1+M_2 + \mathop{\mathrm{N}}(G_0)_{v_0} \sum_{r=3}^{g-2} \prod_{j=3}^r \mathop{\mathrm{N}}(G_{g-j})_{v_{g-j}} + \sum_{l=1}^{g-5} \sum_{r=3}^{g-1-l} \prod_{j=0}^l \mathop{\mathrm{N}}(G_j)_{v_j} \cdot \prod_{j=3}^r \mathop{\mathrm{N}}(G_{g-j})_{v_{g-j}}\\ & > 1+M_1+M_2\,. \end{aligned}\]

With the above notation, we can infer that the number of connected induced subgraphs of \(G\) that contain

i) a vertex of \(G_{g-2}\) and no vertex of \(G_{g-1}\) is \[\begin{aligned} \mathop{\mathrm{N}}(G_{g-2})+ \mathop{\mathrm{N}}(G_{g-2})_{v_{g-2}} M_1\,, \end{aligned}\]

ii) a vertex of \(G_{g-1}\) and no vertex of \(G_{g-2}\) is \[\begin{aligned} \mathop{\mathrm{N}}(G_{g-1})+ \mathop{\mathrm{N}}(G_{g-1})_{v_{g-1}} M_2\,, \end{aligned}\]

iii) a vertex of \(G_{g-2}\) and a vertex of \(G_{g-1}\) is \[\begin{aligned} \mathop{\mathrm{N}}(G_{g-2})_{v_{g-2}} \mathop{\mathrm{N}}(G_{g-1})_{v_{g-1}} M_3\,. \end{aligned}\]

Let us denote by \(\mathop{\mathrm{N}}(G;V(G_{g-2})\cup V(G_{g-1}))\) the number of connected induced subgraphs of \(G\) that contain an element of the set \(V(G_{g-2})\cup V(G_{g-1})\). Thus we have \[\begin{aligned} \label{NumberG} \mathop{\mathrm{N}}(G;V(G_{g-2})\cup V(G_{g-1}))=&\mathop{\mathrm{N}}(G_{g-2})+ \mathop{\mathrm{N}}(G_{g-2})_{v_{g-2}} M_1 + \mathop{\mathrm{N}}(G_{g-1})+ \mathop{\mathrm{N}}(G_{g-1})_{v_{g-1}} M_2 \notag\\ &+ \mathop{\mathrm{N}}(G_{g-2})_{v_{g-2}} \mathop{\mathrm{N}}(G_{g-1})_{v_{g-1}} M_3. \end{aligned} \tag{1}\]

Denote by \(G'_{g-2}\) the subgraph induced by \(V(G_{g-2}) \cup V(G_{g-1})\) in \(G'\). Thus we have \[\begin{aligned} \mathop{\mathrm{N}}(G'_{g-2})_{v_{g-2}}&=\mathop{\mathrm{N}}(G_{g-2})_{v_{g-2}}(1+\mathop{\mathrm{N}}(G_{g-1})_{v_{g-1}})\,,\\ \mathop{\mathrm{N}}(G'_{g-2}- v_{g-2})&=\mathop{\mathrm{N}}(G_{g-2}- v_{g-2}) +\mathop{\mathrm{N}}(G_{g-1})\,, \end{aligned}\] and the number \(\mathop{\mathrm{N}}(G';V(G_{g-2})\cup V(G_{g-1}))\) of connected induced subgraphs of \(G'\) that contain an element of \(V(G_{g-2}) \cup V(G_{g-1})\) is given by \[\begin{aligned} \label{NumberGprime} \mathop{\mathrm{N}}(G';V(G_{g-2})\cup V(G_{g-1}))=&\mathop{\mathrm{N}}(G'_{g-2}) + \mathop{\mathrm{N}}(G'_{g-2})_{v_{g-2}} M_4\notag\\ =&\mathop{\mathrm{N}}(G_{g-2})_{v_{g-2}}(1+\mathop{\mathrm{N}}(G_{g-1})_{v_{g-1}})(1+M_4)\notag\\ & + \mathop{\mathrm{N}}(G_{g-2}- v_{g-2}) +\mathop{\mathrm{N}}(G_{g-1})\,. \end{aligned} \tag{2}\]

By construction \(G-(V(G_{g-2})\cup V(G_{g-1}))\) and \(G'-(V(G_{g-2})\cup V(G_{g-1}))\) are isomorphic graphs, and it is clear that \(M_3=1+M_4\). Hence the difference (2) – (1) gives \[\begin{aligned} \mathop{\mathrm{N}}(G';V(G_{g-2})&\cup V(G_{g-1})) – \mathop{\mathrm{N}}(G;V(G_{g-2})\cup V(G_{g-1})) \\ &=\mathop{\mathrm{N}}(G_{g-2})_{v_{g-2}} (M_3 -1) – \mathop{\mathrm{N}}(G_{g-2})_{v_{g-2}} M_1 – \mathop{\mathrm{N}}(G_{g-1})_{v_{g-1}} M_2\\ &> M_2 \big(\mathop{\mathrm{N}}(G_{g-2})_{v_{g-2}} – \mathop{\mathrm{N}}(G_{g-1})_{v_{g-1}}\big)\,, \end{aligned}\] where the last step uses the inequality \(M_3> 1+ M_1+M_2\) for \(g>4\). It follows from the assumption \(\mathop{\mathrm{N}}(G_{g-2})_{v_{g-2}} \geq \mathop{\mathrm{N}}(G_{g-1})_{v_{g-1}}\) that \[\begin{aligned} \mathop{\mathrm{N}}(G')-\mathop{\mathrm{N}}(G) = \mathop{\mathrm{N}}(G';V(G_{g-2})\cup V(G_{g-1})) – \mathop{\mathrm{N}}(G;V(G_{g-2})\cup V(G_{g-1}))>0, \end{aligned}\] for \(g>4\). This completes the proof of ii). For \(g=4\), the expressions of \(M_1,M_2,M_3\) become \[\begin{aligned} M_1&=\mathop{\mathrm{N}}(G_1)_{v_1}(1+\mathop{\mathrm{N}}(G_0)_{v_0}), \\ M_2&=\mathop{\mathrm{N}}(G_0)_{v_0}(1+\mathop{\mathrm{N}}(G_1)_{v_1})\,, \\ M_3&=(1+\mathop{\mathrm{N}}(G_0)_{v_0})(1+\mathop{\mathrm{N}}(G_1)_{v_1})\,, \end{aligned}\] and they imply that \[\begin{aligned} \mathop{\mathrm{N}}(G')-\mathop{\mathrm{N}}(G)&=\mathop{\mathrm{N}}(G';V(G_2)\cup V(G_3)) – \mathop{\mathrm{N}}(G;V(G_2)\cup V(G_3))\\ &=\mathop{\mathrm{N}}(G_0)_{v_0}(\mathop{\mathrm{N}}(G_2)_{v_2}- \mathop{\mathrm{N}}(G_3)_{v_3}(1+\mathop{\mathrm{N}}(G_1)_{v_1}))\,. \end{aligned}\]

This proves iii).

It remains to prove i). It is clear that all cut vertices (resp. non cut vertices), except possibly vertices \(v_{g-2}\) and \(v_{g-1}\) of \(G\) remain cut vertices (resp. non cut vertices) of \(G'\). On the other hand, \(v_{g-1}\) is not a cut vertex of \(G\) if and only if \(|V(G_{g-1})|=1\), in which case \(v_{g-1}\) becomes a pendant vertex of \(G'\). Since \(G\) is not a cycle, we have \(|V(G_{g-2})|>1\) which implies that \(v_{g-2}\) is a cut vertex of \(G\) and thus a cut vertex of \(G'\). This proves that \(c(G')=c(G)\), completing the proof of the lemma. ◻

From now on, we assume that \(G\) is described as in Lemma 3.3. The following proposition is an immediate consequence of Lemma 3.3:

Proposition 3.4. Every maximal graph has girth \(3\) or \(4\). If a maximal graph \(G\) has girth \(4\), then it holds that \[\mathop{\mathrm{N}}(G_2)_{v_2}\leq \mathop{\mathrm{N}}(G_3)_{v_3}(1+\mathop{\mathrm{N}}(G_1)_{v_1}).\]

The final lemma of this subsection will be needed in subsequent subsections.

Lemma 3.5. Let \(G\) be the graph described in Lemma 3.3. The following hold:

For \(g=3\), we have \[\begin{aligned} \mathop{\mathrm{N}}(G)=&\mathop{\mathrm{N}}(G_0-v_0) + \mathop{\mathrm{N}}(G_1-v_1) +\mathop{\mathrm{N}}(G_2-v_2) \\ & + (1+\mathop{\mathrm{N}}(G_0)_{v_0}) (1+\mathop{\mathrm{N}}(G_1)_{v_1}) (1+\mathop{\mathrm{N}}(G_2)_{v_2}) -1\,. \end{aligned}\]

For \(g=4\), we have \[\begin{aligned} \mathop{\mathrm{N}}(G)=&\mathop{\mathrm{N}}(G_0-v_0) + \mathop{\mathrm{N}}(G_1-v_1) +\mathop{\mathrm{N}}(G_2-v_2) +\mathop{\mathrm{N}}(G_3-v_3) \\ & + (1+\mathop{\mathrm{N}}(G_0)_{v_0}) (1+\mathop{\mathrm{N}}(G_1)_{v_1}) (1+\mathop{\mathrm{N}}(G_2)_{v_2}) (1+\mathop{\mathrm{N}}(G_3)_{v_3})\\ & – (1+\mathop{\mathrm{N}}(G_0)_{v_0}\cdot \mathop{\mathrm{N}}(G_2)_{v_2} + \mathop{\mathrm{N}}(G_1)_{v_1}\cdot \mathop{\mathrm{N}}(G_3)_{v_3})\,. \end{aligned}\]

Proof. Let \(C\) be the cycle of \(G\). Simply categorise the connected induced subgraphs of \(G\) according to whether they contain a vertex of \(C\) or not. ◻

3.3. The branching vertex lies on the cycle

Our next goal is to prove that if there is a branching vertex in a maximal graph \(G\), then it must belong to the cycle of \(G\).

We begin with other graph transformations that preserve the number of cut vertices of \(G\) while affecting the number of connected induced subgraphs. The main result of this subsection will follow after a series of lemmas.

Lemma 3.6. If \(G\) is obtained from two vertex disjoint connected graphs \(G_1,G_2\) by fixing \(u_1 \in V(G_1),u_2\in V(G_2)\) and identifying \(u_1\) with \(u_2\), then it holds that \[\begin{aligned} \mathop{\mathrm{N}}(G)=\mathop{\mathrm{N}}(G_1)+\mathop{\mathrm{N}}(G_2) -1 + (\mathop{\mathrm{N}}(G_1)_{u_1} -1) (\mathop{\mathrm{N}}(G_2)_{u_2} -1)\,. \end{aligned}\]

The proof of Lemma 3.6 is straightforward by noting that \(\mathop{\mathrm{N}}(G_1)+\mathop{\mathrm{N}}(G_2) -1\) counts those connected induced subgraphs of \(G\) that are contained entirely in \(G_1\) or \(G_2\). Lemma 3.6 is used in the next two lemmas without further reference.

Lemma 3.7. Let \(u \in V(A), v\in V(B)\) be fixed vertices of two vertex disjoint connected graphs \(A\) and \(B\) such that \(|V(A)|>1\). Attach a pendant path of order \(n_1\) at \(u\), and connect \(u\) and \(v\) by another path of order \(n_2\) for some \(n_1,n_2>1\) to obtain the graph \(G\). If \(G'\) (resp. \(G''\)) is obtained the same way by replacing \(n_1\) with \(n_1-1\) and \(n_2\) with \(n_2+1\) (resp. \(n_1\) with \(n_1+1\) and \(n_2\) with \(n_2-1\)), then we have \[\mathop{\mathrm{N}}(G')>\mathop{\mathrm{N}}(G),\] if and only if \(\mathop{\mathrm{N}}(B)_v<n_1-n_2\), and \[\mathop{\mathrm{N}}(G'')>\mathop{\mathrm{N}}(G),\] if and only if \(\mathop{\mathrm{N}}(B)_v>n_1-n_2+2\). Furthermore, we have \[\begin{aligned} c(G')=c(G) ~~ \text{if} ~~ n_1> 2\,, ~~ \text{and} ~~ c(G'')=c(G) ~~ \text{if} ~~ n_2>2 ~\text{or} ~ |V(B)|>1\,. \end{aligned}\]

Proof. Simply note that \[\begin{aligned} \mathop{\mathrm{N}}(G)=&\mathop{\mathrm{N}}(G)_{u,v} +\mathop{\mathrm{N}}(G-v)_u +\mathop{\mathrm{N}}(G-u)_v+ \mathop{\mathrm{N}}(G-u-v)\\ =&~n_1\cdot \mathop{\mathrm{N}}(A)_u \cdot \mathop{\mathrm{N}}(B)_v + n_1(n_2-1)\mathop{\mathrm{N}}(A)_u + (n_2-1)\mathop{\mathrm{N}}(B)_v\\ & + \mathop{\mathrm{N}}(A-u) + \mathop{\mathrm{N}}(B-v) + \binom{n_1}{2} + \binom{n_2 -1}{2}\,. \end{aligned}\]

Expressions for \(\mathop{\mathrm{N}}(G')\) and \(\mathop{\mathrm{N}}(G'')\) can be obtained in a similar way. In particular, we get \[\begin{aligned} \mathop{\mathrm{N}}(G')-\mathop{\mathrm{N}}(G)&=(\mathop{\mathrm{N}}(A)_u -1)(n_1-n_2 – \mathop{\mathrm{N}}(B)_v)\,,\\ \mathop{\mathrm{N}}(G'')-\mathop{\mathrm{N}}(G)&=-(\mathop{\mathrm{N}}(A)_u -1)(n_1-n_2 +2 – \mathop{\mathrm{N}}(B)_v), \end{aligned}\] after simplification, where in the latter identity it is assumed that \(n_2>2\). For \(n_2=2\), vertices \(u\) and \(v\) coincide in \(G''\). This gives us \[\begin{aligned} \mathop{\mathrm{N}}(G'')_u =(n_1+1) \mathop{\mathrm{N}}(A)_u \cdot \mathop{\mathrm{N}}(B)_v\,, \quad \mathop{\mathrm{N}}(G''-u)= \mathop{\mathrm{N}}(A-u) + \mathop{\mathrm{N}}(B-v) + \binom{n_1+1}{2}\,. \end{aligned}\]

Thus we get \[\mathop{\mathrm{N}}(G'')-\mathop{\mathrm{N}}(G)=-(\mathop{\mathrm{N}}(A)_u -1)(n_1 – \mathop{\mathrm{N}}(B)_v)\,,\] which completes the proof of the first part.

If \(n_1>2\) then the graph \(G'\) can be obtained from \(G\) by first contracting one vertex, say \(x \neq u\) of the pendant path at \(u\), and then inserting \(x\) into the \(u-v\) path (i.e. subdividing one edge). This construction shows that all vertices of \(G\) preserve their status (cut vertex or not) in \(G'\). Likewise, if \(n_2>2\) then the graph \(G''\) can be obtained from \(G\) by first contracting one vertex, say \(x \notin \{u,v\}\) of the \(u-v\) path and then inserting \(x\) into the pendant path at \(u\). Thus we have \(c(G'')=c(G)\). On the other hand, if \(n_2=2\) and \(|V(B)|>1\), then \(G''\) can be constructed from \(G\) by shrinking the edge \(uv\) (i.e. identifying \(u\) with \(v\)) and inserting a new vertex, say \(y\) into the pendant path at \(u\). Since \(y\) is a cut vertex of \(G''\) and \(v\) is a cut vertex of \(G\), we obtain \(c(G'')=c(G)\). ◻

Note that if the graph \(B\) in Lemma 3.7 is trivial, then we can assume, without loss of generality that \(n_1\geq n_2\). Therefore, we obtain the following important remark:

Remark 3.8. Let \(G, G',G''\) be the graphs defined in Lemma 3.7, and assume that \(|V(B)|=1\). Then we have \[\mathop{\mathrm{N}}(G)\geq \mathop{\mathrm{N}}(G') \quad \text{and} \quad \mathop{\mathrm{N}}(G)\geq \mathop{\mathrm{N}}(G''),\] if and only if \(|n_1-n_2|\leq 1\). Moreover, if \(n_2>2\) then \(c(G'')=c(G')=c(G)\).

Lemma 3.9. Let \(H\) be a connected graph and \(x,y\) be two distinct vertices of \(H\). Let \(G\) (resp. \(G'\)) be obtained from \(H\) by attaching a pendant edge at \(y\) (resp. at \(x\)). Then it holds that \[\begin{aligned} \mathop{\mathrm{N}}(G')-\mathop{\mathrm{N}}(G)=\mathop{\mathrm{N}}(H)_x – \mathop{\mathrm{N}}(H)_y=\mathop{\mathrm{N}}(H-y)_x – \mathop{\mathrm{N}}(H-x)_y\,. \end{aligned}\] Furthermore, we have \[c(G')=c(G),\] if and only if \(x\) and \(y\) have the same status (cut vertex or not) in \(H\).

Proof. For the first part of the lemma, we note that \[\begin{aligned} \mathop{\mathrm{N}}(G')-\mathop{\mathrm{N}}(G)&=\mathop{\mathrm{N}}(H)_x -\mathop{\mathrm{N}}(H)_y =(\mathop{\mathrm{N}}(H)_{x,y} + \mathop{\mathrm{N}}(H-y)_x) – (\mathop{\mathrm{N}}(H)_{y,x} + \mathop{\mathrm{N}}(H-x)_y)\\ & = \mathop{\mathrm{N}}(H-y)_x – \mathop{\mathrm{N}}(H-x)_y\,. \end{aligned}\] All vertices except possibly \(x,y\) of \(G\) preserve their status (cut vertex or not) in \(G'\). By construction, \(x\) is a cut vertex of \(G'\) and \(y\) is a cut vertex of \(G\). Thus \(c(G')=c(G)\) holds if and only if the status of \(x\) in \(G\) (thus in \(H\)) is the same as the status of \(y\) in \(G'\) (thus in \(H\)). ◻

We can now state and prove the main result of this subsection:

Proposition 3.10. The branching vertex in a maximal graph \(G\) must lie on the cycle of \(G\).

Proof. Let \(C\) be the cycle of \(G\) and \(w\) the branching vertex of \(G\). Among all vertices of \(C\), say without loss of generality that \(v_0\) is at minimum distance from \(w\) in \(G\). Suppose that \(w\neq v_0\). Denote by \(z\) the neighbour of \(w\) (possible \(z=v_0\)) that lies on the \(w-v_0\) path in \(G\), and let \(P_m\) be a fixed pendant path at \(w\). Then \(m>1\) since \(w\) is a branching vertex of \(G\). Denote by \(B\) the component of \(G-wz\) that contains \(z\). We observe two cases:

Case 1. \(\mathop{\mathrm{N}}(B)_z>m\).

Let \(y'\) be the neighbour of \(w\) that lies on \(P_m\). Denote by \(A\) the component of \(G-\{wz,wy'\}\) that contains \(w\). Then \(|V(A)|>1\) since \(w\) is a branching vertex of \(G\). Set \(u=w\) and \(v=z\). From this decomposition, we can apply Lemma  3.7 with \(n_1=m\) and \(n_2=2\); since \(|V(B)|>1\) and by assumption \(\mathop{\mathrm{N}}(B)_v > m=n_1=n_1-n_2+2\), the graph \(G\) can be transformed into another graph \(G''\) that satisfies \(c(G'')=c(G)\) and \(\mathop{\mathrm{N}}(G'')>\mathop{\mathrm{N}}(G)\). This contradicts the maximality of \(G\). Note that the transformation that takes \(G\) to \(G''\) in Lemma  3.7 decreases the length of the \(u-v\) path by exactly \(1\).

Case 2. \(\mathop{\mathrm{N}}(B)_z \leq m\).

Let \(n_1\) (resp. \(n_2\)) be the order of the pendant path \(G_1\) at \(v_1\) (resp. \(G_2\) at \(v_2\)), and \(t\) the order of the \(w-v_0\) path in \(G\). Denote by \(x\) the free endvertex (possibly \(x=v_1\)) of \(G_1\), by \(u\) the free endvertex of \(P_m\), and by \(y\) the neighbour of \(u\) (possibly \(y=w\)) in \(G\). Note that \(G-V(B)\) is a star-like tree rooted at \(w\). Set \(H=G-u\) and \(A=G-(V(B) \cup V(P_m-w))\). Then both \(x\) and \(y\) are non cut vertices of \(H\). This is because \(y\) is a pendant vertex of \(H\) as \(m \geq \mathop{\mathrm{N}}(B)_z>2\). Construct a new graph \(G'\) from \(G\) by deleting the edge \(uy\) and adding the edge \(ux\). Note that this transformation that takes \(G\) to \(G'\) decreases the length of the pendant path \(P_m\) at \(w\) by exactly \(1\). It follows from Lemma 3.9 that \(c(G')=c(G)\) and that \[\mathop{\mathrm{N}}(G')-\mathop{\mathrm{N}}(G)=\mathop{\mathrm{N}}(H)_x – \mathop{\mathrm{N}}(H)_y.\] We are going to show that \(\mathop{\mathrm{N}}(G') – \mathop{\mathrm{N}}(G)>0\). By setting \(H_1=H- V(G_1-v_1)\) and \(H_2=G- V(P_m-w)\), we obtain \[\begin{aligned} \mathop{\mathrm{N}}(H)_x = (n_1-1) + \mathop{\mathrm{N}}(H_1)_{v_1}\,, \quad \mathop{\mathrm{N}}(H)_y= (m-2) + \mathop{\mathrm{N}}(H_2)_w\,, \end{aligned}\] and thus \(\mathop{\mathrm{N}}(G')-\mathop{\mathrm{N}}(G)=(n_1-1) – (m-2) + \mathop{\mathrm{N}}(H_1)_{v_1} – \mathop{\mathrm{N}}(H_2)_w\). Now we distinguish between two subcases depending on the order of \(C\).

Subcase 1. The order of \(C\) is \(3\).

Let us determine an expression for \(\mathop{\mathrm{N}}(H_1)_{v_1}\). It can be decomposed into \[\begin{aligned} \mathop{\mathrm{N}}(H_1)_{v_1,v_2,v_0}&=n_2(t-1+(m-1)\mathop{\mathrm{N}}(A)_w)\,, \\ \mathop{\mathrm{N}}(H_1-v_0)_{v_1,v_2}&=n_2\,,\\ \mathop{\mathrm{N}}(H_1-v_2)_{v_1}&=1+ (t-1) +(m-1)\mathop{\mathrm{N}}(A)_w\,, \end{aligned}\] and thus \[\begin{aligned} \mathop{\mathrm{N}}(H_1)_{v_1}=\mathop{\mathrm{N}}(H_1)_{v_1,v_2,v_0}+ \mathop{\mathrm{N}}(H_1-v_0)_{v_1,v_2} + \mathop{\mathrm{N}}(H_1-v_2)_{v_1} =(n_2+1)(t+(m-1)\mathop{\mathrm{N}}(A)_w)\,. \end{aligned}\]

Let us determine an expression for \(\mathop{\mathrm{N}}(H_2)_w\). Denote by \(Q\) the subgraph of \(G\) that consists of the triangle \(v_0v_1v_2\) and the pendant paths \(G_1\) and \(G_2\) at \(v_1,v_2\), respectively. We have \[\begin{aligned} \mathop{\mathrm{N}}(Q)_{v_0,v_1,v_2}=n_1\cdot n_2\,, \quad \mathop{\mathrm{N}}(Q-v_2)_{v_0,v_1}=n_1\,, \quad \mathop{\mathrm{N}}(Q-v_1)_{v_0}= 1+n_2\,, \end{aligned}\] and these quantities imply that \[\begin{aligned} \mathop{\mathrm{N}}(Q)_{v_0}&=\mathop{\mathrm{N}}(Q)_{v_0,v_1,v_2} + \mathop{\mathrm{N}}(Q-v_2)_{v_0,v_1} + \mathop{\mathrm{N}}(Q-v_1)_{v_0}\\ &=(n_1+1)(n_2+1)\,,\\ \mathop{\mathrm{N}}(B)_z&=t-2+\mathop{\mathrm{N}}(Q)_{v_0} \,, \\ \mathop{\mathrm{N}}(H_2)_w&=\mathop{\mathrm{N}}(A)_w(t-1+\mathop{\mathrm{N}}(Q)_{v_0})\,. \end{aligned}\]

Therefore, we have \[\begin{aligned} \mathop{\mathrm{N}}(G')-\mathop{\mathrm{N}}(G)&= (n_1-1) – (m-2) + \mathop{\mathrm{N}}(H_1)_{v_1} – \mathop{\mathrm{N}}(H_2)_w\\ &=n_1+ t(n_2+1) +(m-1)((n_2+1)\mathop{\mathrm{N}}(A)_w -1) – \mathop{\mathrm{N}}(A)_w(t-1+\mathop{\mathrm{N}}(Q)_{v_0})\,, \end{aligned}\] and since \[\begin{aligned} t-2+\mathop{\mathrm{N}}(Q)_{v_0}=\mathop{\mathrm{N}}(B)_z \leq m\,, \end{aligned}\] we deduce that \[\begin{aligned} \mathop{\mathrm{N}}(G')-\mathop{\mathrm{N}}(G)&\geq n_1+ t(n_2+1) +(m-1)((n_2+1)\mathop{\mathrm{N}}(A)_w -1) – \mathop{\mathrm{N}}(A)_w (m+1)\\ &=(m-1)(n_2\cdot \mathop{\mathrm{N}}(A)_w -1) – (2\mathop{\mathrm{N}}(A)_w -1) +(n_1-1) +t(n_2+1)\,. \end{aligned}\]

Note that \(\mathop{\mathrm{N}}(A)_w, t\geq 2, ~n_1, n_2\geq 1\) and thus \(m\geq 4\). If \(n_2>1\) then \[\begin{aligned} \mathop{\mathrm{N}}(G')-\mathop{\mathrm{N}}(G)&\geq (m-1)(n_2\cdot \mathop{\mathrm{N}}(A)_w -1) – (n_2 \cdot \mathop{\mathrm{N}}(A)_w -1) +(n_1-1) +t(n_2+1)\\ &= (m-2)(n_2\cdot \mathop{\mathrm{N}}(A)_w -1) +(n_1-1) +t(n_2+1)>0\,. \end{aligned}\] If \(n_2=1\) then \[\begin{aligned} \mathop{\mathrm{N}}(G')-\mathop{\mathrm{N}}(G)&\geq (m-1)(\mathop{\mathrm{N}}(A)_w -1) – (2\mathop{\mathrm{N}}(A)_w -1) +(n_1-1) +2t\\ &=(m-3)(\mathop{\mathrm{N}}(A)_w -1) +n_1 +2(t-1)>0\,. \end{aligned}\]

For either situation, \(G'\) contains more connected induced subgraphs than \(G\), a contradiction to the choice of \(G\).

Subscase 2. The order of \(C\) is \(4\).

Denote by \(n_3\) the order of the pendant path \(G_3\) at \(v_3\). We compute \(\mathop{\mathrm{N}}(H_1)_{v_1}\) and \(\mathop{\mathrm{N}}(H_2)_w\) in a similar way as in Subcase 1. The quantity \(\mathop{\mathrm{N}}(H_1)_{v_1}\) can be decomposed into \[\begin{aligned} \mathop{\mathrm{N}}(H_1)_{v_1,v_2,v_3,v_0}&=n_2\cdot n_3(t-1+(m-1)\mathop{\mathrm{N}}(A)_w)\,, \quad \mathop{\mathrm{N}}(H_1-v_0)_{v_1,v_2,v_3}=n_2\cdot n_3\,,\\ \mathop{\mathrm{N}}(H_1-v_3)_{v_1,v_2}&=n_2(1+ (t-1) +(m-1)\mathop{\mathrm{N}}(A)_w)\,, \\ \mathop{\mathrm{N}}(H_1-v_2)_{v_1}&=1+ (1+n_3)((t-1) +(m-1)\mathop{\mathrm{N}}(A)_w)\,, \end{aligned}\] and thus \[\begin{aligned} \mathop{\mathrm{N}}(H_1)_{v_1}&=\mathop{\mathrm{N}}(H_1)_{v_1,v_2,v_3,v_0}+ \mathop{\mathrm{N}}(H_1-v_0)_{v_1,v_2,v_3}+ \mathop{\mathrm{N}}(H_1-v_3)_{v_1,v_2} + \mathop{\mathrm{N}}(H_1-v_2)_{v_1}\\ &=n_2\cdot n_3 +n_2+1 + (t-1 +(m-1)\mathop{\mathrm{N}}(A)_w)(n_2\cdot n_3+n_2+n_3+1)\,. \end{aligned}\]

Denote by \(Q\) the subgraph of \(G\) that consists of the square \(v_0v_1v_2v_3\) and the pendant paths \(G_1,G_2,G_3\) at \(v_1,v_2,v_3\), respectively. We have \[\begin{aligned} \mathop{\mathrm{N}}(Q)_{v_0,v_1,v_2,v_3}&=n_1\cdot n_2\cdot n_3\,, \quad \mathop{\mathrm{N}}(Q-v_3)_{v_0,v_1,v_2}=n_1\cdot n_2\,,\\ \mathop{\mathrm{N}}(Q-v_2)_{v_0,v_1}&= n_1(1+n_3)\,, \quad \mathop{\mathrm{N}}(Q-v_1)_{v_0}= 1+ n_3(1+n_2)\,, \end{aligned}\] and these quantities imply that \[\begin{aligned} \mathop{\mathrm{N}}(Q)_{v_0}&=(n_1+1)(n_2+1)(n_3+1) – n_2\,, \\ \mathop{\mathrm{N}}(B)_z&=t-2+\mathop{\mathrm{N}}(Q)_{v_0}\,, \\ \mathop{\mathrm{N}}(H_2)_w&=\mathop{\mathrm{N}}(A)_w(t-1+\mathop{\mathrm{N}}(Q)_{v_0})\,, \end{aligned}\] and \[\begin{aligned} \mathop{\mathrm{N}}(G')-\mathop{\mathrm{N}}(G)=&~(n_1-1) – (m-2) + \mathop{\mathrm{N}}(H_1)_{v_1} – \mathop{\mathrm{N}}(H_2)_w\\ =&~n_2\cdot n_3 +n_2+n_1 +1 +(t-1)(n_2\cdot n_3 +n_2+n_3+1) \\ &+ (m-1)((n_2\cdot n_3 +n_2+n_3 +1)\mathop{\mathrm{N}}(A)_w -1) – \mathop{\mathrm{N}}(A)_w(t-1+\mathop{\mathrm{N}}(Q)_{v_0})\,. \end{aligned}\]

Since \[\begin{aligned} t-2+\mathop{\mathrm{N}}(Q)_{v_0}=\mathop{\mathrm{N}}(B)_z \leq m\,, \end{aligned}\] we deduce that \[\begin{aligned} \mathop{\mathrm{N}}(G')-\mathop{\mathrm{N}}(G)\geq&~ n_2\cdot n_3 +n_2+n_1 +1 + (t-1)(n_2\cdot n_3 +n_2+n_3+1)\\ &+(m-1)((n_2\cdot n_3 +n_2+n_3 +1)\mathop{\mathrm{N}}(A)_w -1) – \mathop{\mathrm{N}}(A)_w(m+1)\\ =&~n_2\cdot n_3 +n_2+n_1 +(t-1)(n_2\cdot n_3 +n_2+n_3+1)\\ & + (m-1)((n_2\cdot n_3 +n_2+n_3)\mathop{\mathrm{N}}(A)_w -1) -(2 \mathop{\mathrm{N}}(A)_w -1)\,. \end{aligned}\]

Using the inequality \(n_2\cdot n_3 +n_2+n_3>2\), we derive that \[\begin{aligned} \mathop{\mathrm{N}}(G')-\mathop{\mathrm{N}}(G) >&~ n_2\cdot n_3 +n_2+n_1 +(t-1)(n_2\cdot n_3 +n_2+n_3+1)\\ & + (m-2)((n_2\cdot n_3 +n_2+n_3)\mathop{\mathrm{N}}(A)_w -1)>0\,. \end{aligned}\]

This is again a contradiction to the choice of \(G\).

Summing up, we have proved that \(w\neq v_0\) is impossible. Hence \(w\) must belong to the cycle of \(G\). ◻

Let us summarise in the following definition what we already know about the structure of those maximal graphs in \(\mathcal{U}(n,c)\).

Definition 3.11. Let \(G\in \mathcal{U}(n,c)\) such that \(G\) has the maximum number of connected induced subgraphs. By Proposition 3.4 the order of the cycle \(C\) of \(G\) is \(3\) or \(4\).

\(\bullet\) If \(C\) is of order \(3\), then we denote by \(v_0,v_1,v_2\) the vertices of \(C\) in this order, and by \(G_0,G_1,G_2\) the components of \(G-\{v_0v_1,v_1v_2,v_2v_0\}\) that contain \(v_0,v_1,v_2\), respectively.

\(\bullet\) If \(C\) is of order \(4\), then we denote by \(v_0,v_1,v_2,v_3\) the vertices of \(C\) in this order, and by \(G_0,G_1,G_2,G_3\) the components of \(G-\{v_0v_1,v_1v_2,v_2v_3,v_3v_0\}\) that contain \(v_0,v_1,v_2,v_3\), respectively. In this case, by Proposition 3.4 it holds that \[\mathop{\mathrm{N}}(G_2)_{v_2} =\max_{1\leq j \leq 4} \mathop{\mathrm{N}}(G_j)_{v_j} ~~\text{and that} ~~ \mathop{\mathrm{N}}(G_2)_{v_2} \leq \mathop{\mathrm{N}}(G_3)_{v_3}(1+\mathop{\mathrm{N}}(G_1)_{v_1}).\]

If \(G\) has a branching vertex, then by Propositions 3.2 and  3.10 this vertex is unique and must lie on \(C\). Suppose that \(v_2\) is the branching vertex of \(G\). Then depending on the order of \(C\), the graphs \(G_0,G_1\) are pendant paths at \(v_0,v_1\), respectively, and the graphs \(G_0,G_1,G_3\) are pendant paths at \(v_0,v_1,v_3\), respectively.

Unless otherwise specified, we follow the notation given in Definition 3.11.

3.4. Pendant paths have orders’ difference at most \(1\)

The first part of the next lemma is a refinement of [7, Lemma 6]. Lemma 3.12 below gives some information about the pendants paths at adjacent vertices of the cycle of every maximal graph.

Lemma 3.12. Let \(H\) be a connected graph and \(uv\) an edge of \(H\). Let \(H(n_1;n_2)\) be the graph obtained from \(H\) and two vertex disjoint paths \(P_{n_1}\) and \(P_{n_2}\) by identifying \(u\) with an endvertex of \(P_{n_1}\), and \(v\) with an endvertex of \(P_{n_2}\). Assume that \(1\leq n_1\leq n_2-2\) and that \(u\) is not a pendant edge of \(H\). Then the following hold:

i) We have \[\begin{aligned} \mathop{\mathrm{N}}(H(n_1;n_2)) < \mathop{\mathrm{N}}(H(n_1+1;n_2-1))\,. \end{aligned}\]

ii) Furthermore, we have \[c(H(n_1+1;n_2-1))=c(H(n_1;n_2))\,,\] unless \(n_1=1\) and \(u\) is a cut vertex of \(H\).

Proof. It was shown in the proof of [7, Lemma 6] that \[\begin{aligned} \mathop{\mathrm{N}}(H(n_1;n_2))=&~n_1\cdot n_2\cdot \mathop{\mathrm{N}}(H)_{u,v}+n_1\cdot \mathop{\mathrm{N}}(H-v)_u + n_2\cdot \mathop{\mathrm{N}}(H-u)_v\\ &+ \binom{n_1}{2}+ \binom{n_2}{2} +\mathop{\mathrm{N}}(H-u-v)\,. \end{aligned}\]

Thus \[\begin{aligned} \mathop{\mathrm{N}}(H(n_1;n_2))- &\mathop{\mathrm{N}}(H(n_1+1;n_2-1))\\ &=(n_1-n_2+1)(\mathop{\mathrm{N}}(H)_{u,v} -1) + \mathop{\mathrm{N}}(H-u)_v – \mathop{\mathrm{N}}(H-v)_u\,, \end{aligned}\] obtained after simplification. On the other hand, one can add the edge \(uv\) to every \(v\)-containing connected induced subgraph of \(H-u\) to obtain a \(u\)-containing connected subgraph of \(H\), which can then be extended to an induced subgraph of \(H\). Therefore we get \[\begin{aligned} \mathop{\mathrm{N}}(H)_{u,v} + \mathop{\mathrm{N}}(H-v)_u = \mathop{\mathrm{N}}(H)_u\geq \mathop{\mathrm{N}}(H-u)_v +2\,, \end{aligned}\] where the final \(2\) counts the subgraphs \(u\) and \(uw\) (\(w \neq v\) is a neighbour of \(u\) in \(H\)). This implies that \(\mathop{\mathrm{N}}(H-u)_v – \mathop{\mathrm{N}}(H-v)_u \leq \mathop{\mathrm{N}}(H)_{u,v} -2\). Hence \[\begin{aligned} \mathop{\mathrm{N}}(H(n_1;n_2))- \mathop{\mathrm{N}}(H(n_1+1;n_2-1))\leq (n_1-n_2+2)(\mathop{\mathrm{N}}(H)_{u,v} -1) -1 <0\,, \end{aligned}\] which proves i). We now consider proving ii). If \(n_1>1\), then it is clear that the number of cut vertices is preserved when passing from \(H(n_1;n_2)\) to \(H(n_1+1;n_2-1)\). Assume that \(n_1=1\) and that \(u\) is not a cut vertex of \(H\) (thus of \(H(n_1;n_2)\)). Denote by \(w\) the free endvertex of \(P_{n_2}\) in \(H(1;n_2)\), and by \(w'\) the neighbour of \(w\). Then the graph \(H(2;n_2-1)\) can be constructed from \(H(1;n_2)\) by contracting \(w'\) and adding a pendant edge \(uw'\). By so doing \(w'\) (resp. \(u\)) becomes a non cut vertex (resp. cut vertex) of \(H(2;n_2-1)\). Hence \(c(H(2;n_2-1))=c(H(1;n_2))\). ◻

Proposition 3.13. If \(G\) is a maximal graph, then the orders of the pendants paths at

i) adjacent vertices of \(C\) must be as equal as possible;

ii) the branching vertex (if any) of \(G\) must be as equal as possible.

Proof. i) Let \(u,v\) be two adjacent vertices of \(C\), and \(P_{n_1}, P_{n_2}\) be pendant paths at \(u,v\), respectively such that \(n_1\leq n_2\). Set \(H=G-(V(P_{n_1}-u) \cup V(P_{n_2}-v))\). Then both \(u\) and \(v\) are non cut vertices of \(H\). By Lemma 3.12 the inequality \(n_1\leq n_2-2\) is impossible since otherwise, a new graph \(G'\) satisfying \(\mathop{\mathrm{N}}(G')>\mathop{\mathrm{N}}(G)\) and \(c(G')=c(G)\) could be constructed from \(G\). Hence we must have \(n_2-1 \leq n_1 \leq n_2\), that is \(|n_1-n_2|\leq 1\) holds.

ii) Let \(w\) be the branching vertex of \(G\) and \(P_{n_1}, P_{n_2}\) two pendant paths at \(w\). Then \(n_1,n_2>1\), and we can assume that \(n_1\leq n_2\). If \(n_2=2\) then \(n_1=2\) as well, and we are done in this case. Otherwise \(n_2>2\). By setting \(A=G-(V(P_{n_1}-w) \cup V(P_{n_2}-w))\) and invoking Remark 3.8 (see Subsection 3.3), we obtain \(|n_1-n_2|\leq 1\), which completes the proof. ◻

Proposition 3.14. Suppose that \(G\) is a maximal graph whose branching vertex is \(v_0\). Assume that \(n_0\) is the minimum order among the pendants paths at \(v_0\). Then the order of every pendant path at a neighbour of \(v_0\) in \(C\) is at most \(n_0\).

Proof. Denote by \(x\) the free endvertex of the pendant path \(P_{n_0}\) at \(v_0\), and by \(u_0\) (possibly \(u_0=x\)) the neighbour of \(v_0\) on the pendant path \(P_{n_0}\). Let \(A\) be the component of \(G_0-u_0v_0\) that contains \(v_0\).

Case 1. \(C\) is of order \(3\).

Denote by \(n_1,n_2\) the orders of the pendant paths \(G_1,G_2\) at \(v_1,v_2\), respectively. Assume without loss of generality that \(n_2\leq n_1\). Suppose to the contrary that \(n_1>n_0\). Then \(n_1=n_0+1>2\) by virtue of Proposition 3.13. Let \(u\) be the free endvertex of \(G_1\) at \(v_1\), and \(y\) the neighbour of \(u\) in \(G\). Let \(G'\) be the graph constructed from \(G\) by deleting the edge \(uy\) and adding the edge \(ux\). Set \(H=G-u\), and note that both \(x\) and \(y\) are pendant vertices of \(H\). Then Lemma 3.9 yields \(c(G')=c(G)\) and \(\mathop{\mathrm{N}}(G')-\mathop{\mathrm{N}}(G)=\mathop{\mathrm{N}}(H)_x – \mathop{\mathrm{N}}(H)_y\).

Let us derive an expression for both \(\mathop{\mathrm{N}}(H)_x\) and \(\mathop{\mathrm{N}}(H)_y\). Denote by \(Q\) the subgraph of \(G\) that consists of the triangle \(v_0v_1v_2\) and the pendant paths \(G_1-u\) and \(G_2\). Thus \(\mathop{\mathrm{N}}(Q)\) can be decomposed into \[\begin{aligned} \mathop{\mathrm{N}}(Q)_{v_0,v_1,v_2}=n_2(n_1-1)\,, \quad \mathop{\mathrm{N}}(Q-v_2)_{v_0,v_1}=n_1-1\,, \quad \mathop{\mathrm{N}}(Q-v_1)_{v_0}=1+n_2\,, \end{aligned}\] and these quantities imply that \[\begin{aligned} \mathop{\mathrm{N}}(Q)_{v_0}=n_2(n_1-1)+(n_1-1) +1+n_2\,,\quad \mathop{\mathrm{N}}(H)_x=(n_0-1)+\mathop{\mathrm{N}}(A)_{v_0} \mathop{\mathrm{N}}(Q)_{v_0}\,. \end{aligned}\] Likewise, by setting \(H'=G-V(G_1-v_1)\), we can decompose \(\mathop{\mathrm{N}}(H')\) into the following quantities: \[\begin{aligned} \mathop{\mathrm{N}}(H')_{v_1,v_0,v_2}=n_2\cdot n_0\cdot \mathop{\mathrm{N}}(A)_{v_0}\,, \quad \mathop{\mathrm{N}}(H'-v_2)_{v_1,v_0}=n_0\cdot \mathop{\mathrm{N}}(A)_{v_0}\,, \quad \mathop{\mathrm{N}}(H'-v_0)_{v_1}=1+n_2\,. \end{aligned}\]

Thus \[\begin{aligned} \mathop{\mathrm{N}}(H')_{v_1}=(n_0\cdot n_2+n_0)\mathop{\mathrm{N}}(A)_{v_0} +1+n_2\,,\quad \mathop{\mathrm{N}}(H)_y=(n_1-2)+\mathop{\mathrm{N}}(H')_{v_1}\,. \end{aligned}\] Since \(n_1=n_0+1\), it follows (after simplification) that \[\begin{aligned} \mathop{\mathrm{N}}(G')-\mathop{\mathrm{N}}(G)=&\mathop{\mathrm{N}}(H)_x – \mathop{\mathrm{N}}(H)_y\\ =&(n_0-1)+\mathop{\mathrm{N}}(A)_{v_0} \mathop{\mathrm{N}}(Q)_{v_0} – (n_1-2) – \mathop{\mathrm{N}}(H')_{v_1}\\ =&(1+n_2)(\mathop{\mathrm{N}}(A)_{v_0} -1) >0\,, \end{aligned}\] a contradiction to the maximality of \(G\).

Case 2. \(C\) is of order \(4\).

The reasoning is essentially the same as in Case 1 with a minor revision of the notation. Denote by \(n_1,n_2,n_3\) the orders of the pendant paths \(G_1,G_2,G_3\) at \(v_1,v_2,v_3\), respectively. Assume without loss of generality that \(n_3\leq n_1\). Suppose to the contrary that \(n_1>n_0\). Then \(n_1=n_0+1>2\) by virtue of Proposition 3.13. Let \(u\) be the free endvertex of the pendant path \(G_1\) at \(v_1\), and \(y\) the neighbour of \(u\) in \(G\). Construct a new graph \(G'\) from \(G\) by deleting the edge \(uy\) and adding the edge \(ux\). By setting \(H=G-u\) and invoking Lemma 3.9, we get \(c(G')=c(G)\) and \(\mathop{\mathrm{N}}(G')-\mathop{\mathrm{N}}(G)=\mathop{\mathrm{N}}(H)_x – \mathop{\mathrm{N}}(H)_y\). Now we consider evaluating \(\mathop{\mathrm{N}}(H)_x- \mathop{\mathrm{N}}(H)_y\).

Denote by \(Q\) the subgraph of \(G\) that consists of the square \(v_0v_1v_2v_3\) and the pendant paths \(G_1-u, G_2\) and \(G_3\). We have \[\begin{aligned} \mathop{\mathrm{N}}(Q)_{v_0,v_1,v_2,v_3}&=n_2\cdot n_3(n_1-1)\,, \quad \mathop{\mathrm{N}}(Q-v_3)_{v_0,v_1,v_2}=n_2(n_1-1)\,, \\ \mathop{\mathrm{N}}(Q-v_2)_{v_0,v_1}&=(n_1-1)(1+n_3)\,, \quad \mathop{\mathrm{N}}(Q-v_1)_{v_0}=1+n_3(1+n_2)\,, \end{aligned}\] and thus it holds that \[\begin{aligned} \mathop{\mathrm{N}}(Q)_{v_0}&=(n_1-1)(n_2 \cdot n_3+n_2+1+n_3)+1+n_3(1+n_2)\,,\\ \mathop{\mathrm{N}}(H)_x&=(n_0-1)+\mathop{\mathrm{N}}(A)_{v_0} \mathop{\mathrm{N}}(Q)_{v_0}\,. \end{aligned}\]

Likewise, by setting \(H'=G-V(G_1-v_1)\), the quantity \(\mathop{\mathrm{N}}(H')\) can be decomposed into \[\begin{aligned} \mathop{\mathrm{N}}(H')_{v_1,v_0,v_3,v_2}&=n_2\cdot n_3 \cdot n_0\cdot \mathop{\mathrm{N}}(A)_{v_0}\,, \quad \mathop{\mathrm{N}}(H'-v_2)_{v_1,v_0,v_3}=n_3\cdot n_0 \cdot \mathop{\mathrm{N}}(A)_{v_0}\,, \\ \mathop{\mathrm{N}}(H'-v_3)_{v_1,v_0}&=(n_2+1) n_0 \cdot \mathop{\mathrm{N}}(A)_{v_0}\,, \quad \mathop{\mathrm{N}}(H'-v_0)_{v_1}=1+n_2(1+n_3)\,, \end{aligned}\] and thus \[\begin{aligned} \mathop{\mathrm{N}}(H')_{v_1}&=(n_2 \cdot n_3+n_3+n_2+1)n_0\cdot \mathop{\mathrm{N}}(A)_{v_0} + 1+n_2(1+n_3)\,,\\ \mathop{\mathrm{N}}(H)_y&=(n_1-2)+\mathop{\mathrm{N}}(H')_{v_1}\,. \end{aligned}\]

Since \(n_1=n_0+1\) and \(n_2\leq 1+n_3\) (see Proposition 3.13), it follows that \[\begin{aligned} \mathop{\mathrm{N}}(G')-\mathop{\mathrm{N}}(G)&= (n_0-1)+\mathop{\mathrm{N}}(A)_{v_0} \mathop{\mathrm{N}}(Q)_{v_0} – (n_1-2) – \mathop{\mathrm{N}}(H')_{v_1}\\ &= (1+n_3 +n_3\cdot n_2)\mathop{\mathrm{N}}(A)_{v_0} – (1+n_2+n_3\cdot n_2)\\ &\geq 2(1+n_3 +n_3\cdot n_2) – (1+n_2+n_3\cdot n_2)\\ &= (1+n_3)-n_2 +n_3(n_2+1)>0\,. \end{aligned}\]

Hence, a contradiction to the choice of \(G\).

This completes the proof of the proposition. ◻

We recall that \(n>3\) and \(0<c<n-2\) are fixed integers and that \(G\in \mathcal{U}(n,c)\) is an arbitrary unicyclic graph with order \(n\) and \(c\) cut vertices that has the maximum number of connected induced subgraphs. From here onwards, we consistently assume that \(v_2\) is the branching vertex (if any) of \(G\).

We are now ready to characterise those maximal graphs with girth \(3\).

3.5. Maximal graphs with girth \(3\)

The following description for the graph \(\Delta_{n,c}\) is also given in Section 1.

Definition 3.15. Let \(r\) be the residue of \(n-3\) modulo \(n-c\) and \(q=\lfloor (n-3)/(n-c) \rfloor\). Set \(m_j=q+1\) for all \(1\leq j \leq r\), and \(m_j=q\) for all \(r+1\leq j \leq n-c\). Then we define \(\Delta_{n,c}\) to be the graph constructed from the triangle \(v_0v_1v_2\) by attaching \(n-c-2\) pendant paths of respective lengths \(m_1,m_2,\ldots,m_{n-c-2}\) at \(v_2\), one pendant path of length \(m_{n-c-1}\) at \(v_1\), and one pendant path of length \(m_{n-c}\) at \(v_0\).

Note that \(\Delta_{n,c}\) has \(n\) vertices of which \(c\) are cut vertices.

Proposition 3.16. If the girth of \(G\) is \(3\), then \(G\) is isomorphic to \(\Delta_{n,c}\).

Proof. Denote by \(n_0,n_1\) the orders of the pendant paths \(G_0,G_1\) at \(v_0,v_1\), respectively.

Case 1. \(G\) has no branching vertex.

Then \(G_2\) is also a pendant path at \(v_2\), and thus \(n-c=3\). So we can assume that \(|V(G_2)|\geq n_1,n_0\). By Proposition 3.13, \(n_1,n_0 \geq |V(G_2)| -1\). Hence \(G\) is isomorphic to \(\Delta_{n,c}\).

Case 2. \(v_2\) is the branching vertex of \(G\).

Let \(n_2\) (resp. \(n_2'\)) be the minimum (resp. maximum) order among the pendant paths at \(v_2\). Then Propositions 3.13 and 3.14 yield \(n_2'-1\leq n_0,n_1 \leq n_2\) and \(n_2\leq n_2' \leq n_2+1\). These inequalities imply that \(n_0=n_1 =n_2\) if \(n_2'=n_2+1\), and \(n_0,n_1\in \{n_2-1,n_2\}\) if \(n_2'=n_2\). Hence \(G\) is isomorphic to \(\Delta_{n,c}\). ◻

3.6. Maximal graphs with girth \(4\)

We require a final lemma prior to characterising those maximal graphs with girth \(4\).

Lemma 3.17. Assume that the girth of \(G\) is \(4\), and that \(G\) has a branching vertex. Then there are precisely two pendant paths at \(v_2\). Moreover, it holds that \[|V(G_3)|=|V(G_1)|=n_2,\] where \(n_2\) is the minimum order among the pendants paths at \(v_2\).

Proof. Denote by \(n_0,n_1,n_3\) the orders of the pendant paths at \(v_0,v_1,v_3\), respectively. By Proposition 3.13, \(|n_j-n_{j+1}|\leq 1\) for all \(j\in \{0,1,2,3\}\), where \(n_4=n_0\). So we have \[\begin{aligned} \mathop{\mathrm{N}}(G_2)_{v_2}\geq n_2^2\geq n_2+2 \geq n_0,n_1,n_3\,, \end{aligned}\] and thus \(\mathop{\mathrm{N}}(G_2)_{v_2}=\max_{0\leq j \leq 3} \mathop{\mathrm{N}}(G_j)_{v_j}\). Also recall that \(n_1,n_3\leq n_2\) by virtue of Proposition 3.14. Therefore, if there are more than two pendant paths at \(v_2\), then \[\mathop{\mathrm{N}}(G_2)_{v_2}\geq n_2^3>n_2 (1+n_2)\geq n_3(1+n_1)=\mathop{\mathrm{N}}(G_3)_{v_3} (1+\mathop{\mathrm{N}}(G_1)_{v_1}).\]

However, this strict inequality is impossible (see the summary in Definition 3.11). Hence there are only two pendant paths at \(v_2\).

Now assume that there are only two pendant paths at \(v_2\), and without loss of generality, say \(n_1\geq n_3\). Recall that \(n_2-1 \leq n_3 \leq n_2\) and \(n_3\leq n_1 \leq n_2\). If \(n_3=n_2-1\), then \[\mathop{\mathrm{N}}(G_2)_{v_2}\geq n_2^2>(n_2-1)(1+n_2)\geq n_3(1+n_1)=\mathop{\mathrm{N}}(G_3)_{v_3} (1+\mathop{\mathrm{N}}(G_1)_{v_1}),\] which is again a contradiction to the choice of \(G\) (see Definition 3.11). Hence we must have \(n_3= n_2\) and thus \(n_1=n_2\). This completes the proof of the lemma. ◻

The following description for the graphs \(\Omega_{n,n-4}\) and \(\Omega_{n,n-5}\) are also given in Section 1.

Definition 3.18. Define the graphs \(\Omega_{n,n-4}\) and \(\Omega_{n,n-5}\) as follows:

\(\bullet\) Set \(m=\lfloor n/4 \rfloor\) and let \(r\) be the residue of \(n\) modulo \(4\). Then \(\Omega_{n,n-4}\) is the graph with order \(n\) and \(n-4\) cut vertices constructed from the square \(v_0v_1v_2v_3\) by attaching the pendant paths of orders \(m_0,m_1,m_2,m_3\) at \(v_0,v_1,v_2,v_3\), respectively, where \((m_0,m_1,m_2,m_3)\) is equal to \[\begin{aligned} (m,m,m,m),(m+1,m,m,m),(m+1,m+1,m,m),(m+1,m+1,m+1,m), \end{aligned}\] when \(r\) is equal to \(0,1,2,3\), respectively.

\(\bullet\) Let \(n>7\) such that \(n+k=5m\) for some integer \(m>1\) and some \(k\in \{0,1,2\}\). Then \(\Omega_{n,n-5}\) is the graph with order \(n\) and \(n-5\) cut vertices constructed from the square \(v_0v_1v_2v_3\) by attaching the pendant paths of orders \(m_0,m_1,m_2,m_3\) at \(v_0,v_1,v_2,v_3\), respectively, and another pendant of order \(m\) at \(v_2\), where \((m_0,m_1,m_2,m_3)\) is equal to \[\begin{aligned} (m,m,m+1,m),(m,m,m,m),(m-1,m,m,m), \end{aligned}\] when \(k\) is equal to \(0,1,2\), respectively.

Proposition 3.19. If the girth of \(G\) is \(4\), then \(G\) is isomorphic to \(\Omega_{n,n-5}\) or \(\Omega_{n,n-4}\).

Proof. Denote by \(n_0,n_1,n_3\) the orders of the pendant paths \(G_0,G_1,G_3\) at \(v_0,v_1,v_3\), respectively.

Case 1. \(G\) has no branching vertex.

Then \(G_2\) is also a pendant path at \(v_2\), and thus \(c=n-4\). So we can assume that \(n_0 \geq n_1,|V(G_2)|,n_3\), and thus \(n_0>1\). Set \(n_2=|V(G_2)|\) and note that by Proposition 3.13, \[\begin{aligned} n_0-1 \leq n_1,n_3 \leq n_0 \quad \text{and} \quad n_0-2 \leq n_1-1 \leq n_2 \leq n_0\,. \end{aligned}\]

Claim. \(n_2 \neq n_0-2\).

Suppose to the contrary that \(n_2= n_0-2\). Then \(n_0>2\). Let \(u\) be the free endvertex of the pendant path \(G_0\) at \(v_0\), and \(y\) the neighbour of \(u\) in \(G\). Likewise, let \(x\) be the free endvertex of the pendant path \(G_2\) at \(v_2\). Delete the edge \(uy\) and add the new edge \(ux\) to obtain the graph \(G'\). Then Lemma 3.9 yields \[\begin{aligned} c(G')=c(G) \quad \text{and} \quad \mathop{\mathrm{N}}(G') -\mathop{\mathrm{N}}(G)=\mathop{\mathrm{N}}(G-u)_x-\mathop{\mathrm{N}}(G-u)_y\,. \end{aligned}\]

Let us estimate the difference \(\mathop{\mathrm{N}}(G-u)_x-\mathop{\mathrm{N}}(G-u)_y\). To achieve this, set \(L=(G-u)-V(G_2-v_2)\) and \(L'=G-V(G_0 – v_0)\). Since \(n_0-2=n_2\), one notices that \(\mathop{\mathrm{N}}(L')_{v_0}=\mathop{\mathrm{N}}(L-y)_{v_2}\). Moreover, it holds that \[\begin{aligned} \mathop{\mathrm{N}}(G-u)_x&=(n_0-3) + \mathop{\mathrm{N}}(L)_{v_2}\,, \quad \mathop{\mathrm{N}}(G-u)_y=(n_0-2) + \mathop{\mathrm{N}}(L')_{v_0}\,,\\ \mathop{\mathrm{N}}(L)_{v_2}&=\mathop{\mathrm{N}}(L-y)_{v_2} + \mathop{\mathrm{N}}(L)_{v_2,y}\,, \end{aligned}\] from which we deduce that \(\mathop{\mathrm{N}}(G-u)_x-\mathop{\mathrm{N}}(G-u)_y = \mathop{\mathrm{N}}(L)_{v_2,y}- 1>0\). This contradiction proves the claim.

Hence we must have \(n_0-1 \leq n_1,n_2, n_3 \leq n_0\). Then the sequence \((n_0,n_1,n_2,n_3)\) consists of at most two distinct values. Therefore, this sequence defines \(G\) uniquely unless \(n_0\) appears exactly two times, in which case there are only two possibilities for \(G\). Assume that \(|V(G_j)|=n_0\) for some \(j\neq 0\). Let \(H_1\) (resp. \(H_2\)) be the graph corresponding to the situation where \(v_j\), say \(v_1\) and \(v_0\) are adjacent (resp. \(v_j\) and \(v_0\) are not adjacent) in \(G\). We show that \(\mathop{\mathrm{N}}(H_1) > \mathop{\mathrm{N}}(H_2)\).

Denote by \(u_1\) (resp. \(u_2\)) the free endvertex of the pendant path \(G_1\) at \(v_1\) in \(H_1\) (resp. the pendant path \(G_2\) at \(v_2\) in \(H_2\)). Then \(H_1-u_1\) and \(H_2-u_2\) are isomorphic graphs. By setting \(L_1=H_1-V(G_1-v_1)\) and \(L_2=H_2-V(G_2-v_2)\), we get the decomposition \[\begin{aligned} \mathop{\mathrm{N}}(L_1)_{v_1,v_2,v_3,v_0}&=n_0(n_0-1)^2\,, \\ \mathop{\mathrm{N}}(L_1-v_0)_{v_1,v_2,v_3}&=(n_0-1)^2\,, \\ \mathop{\mathrm{N}}(L_1-v_3)_{v_1,v_2}&=(n_0-1)(n_0+1)\,, \\ \mathop{\mathrm{N}}(L_1-v_2)_{v_1}&=1+ n_0(1+n_0-1), \end{aligned}\] for \(\mathop{\mathrm{N}}(L_1)_{v_1}\), and the decomposition \[\begin{aligned} \mathop{\mathrm{N}}(L_2)_{v_2,v_3,v_0,v_1}&=n_0(n_0-1)^2\,, \\ \mathop{\mathrm{N}}(L_2-v_1)_{v_2,v_3,v_0}&=n_0(n_0-1)\,, \\ \mathop{\mathrm{N}}(L_2-v_0)_{v_2,v_3}&=(n_0-1)(1+n_0-1)\,, \\ \mathop{\mathrm{N}}(L_2-v_3)_{v_2}&=1+ (n_0-1)(1+n_0), \end{aligned}\] for \(\mathop{\mathrm{N}}(L_2)_{v_2}\). Direct calculations show that \(\mathop{\mathrm{N}}(L_1)_{v_1} – \mathop{\mathrm{N}}(L_2)_{v_2}=1\). On the other hand, \[\begin{aligned} \mathop{\mathrm{N}}(H_1)_{u_1}=(n_0-1)+\mathop{\mathrm{N}}(L_1)_{v_1}\,, \quad \mathop{\mathrm{N}}(H_2)_{u_2}=(n_0-1)+\mathop{\mathrm{N}}(L_2)_{v_2}\,, \end{aligned}\] and these identities imply \[\mathop{\mathrm{N}}(H_1)-\mathop{\mathrm{N}}(H_2)=\mathop{\mathrm{N}}(H_1)_{u_1} -\mathop{\mathrm{N}}(H_2)_{u_2}=\mathop{\mathrm{N}}(L_1)_{v_1} – \mathop{\mathrm{N}}(L_2)_{v_2}=1>0.\]

Hence \(G\) must be isomorphic to \(H_1\). It is easy to see that \(H_1\) is isomorphic to \(\Omega_{n,n-4}\).

Case 2. \(v_2\) is the branching vertex of \(G\).

Denote by \(n_2\) (resp. \(n_2'\)) the minimum (resp. maximum) order among the pendant paths at \(v_2\). Then \(1<n_2 \leq n_2'\). By Lemma 3.17 there are precisely two pendant paths at \(v_2\), and \(n_3=n_1=n_2\). Thus \(c=n-5\). By Definition 3.11 it holds that \[n_2\cdot n_2'=\mathop{\mathrm{N}}(G_2)_{v_2}\leq \mathop{\mathrm{N}}(G_3)_{v_3}(1+\mathop{\mathrm{N}}(G_1)_{v_1})=n_2(1+n_2),\] that is \(n_2\leq n_2'\leq 1+ n_2\). Moreover, if \(G'\) is the graph constructed from \(G\) in Lemma 3.3 (see Subsection 3.2), then \(\mathop{\mathrm{N}}(G)= \mathop{\mathrm{N}}(G')\) holds if and only if \(n_2'= 1+ n_2\).

\(\bullet\) Assume that \(n_2'= 1+ n_2\). Then \(G'\) must be isomorphic to \(\Delta_{n,n-5}\) by virtue of Proposition 3.16. In particular, we get \(n_0=n_2\). Therefore \(n=5n_2\) and \(G\) is isomorphic to the graph \(\Omega_{n,n-5}\).

\(\bullet\) Assume that \(n_2'= n_2\). Proposition 3.13 yields \(n_2-1\leq n_0 \leq n_2+1\). If \(n_0 = n_2+1\), then \(n=5n_2\) and direct calculations give \[\mathop{\mathrm{N}}(\Omega_{n,n-5}) – \mathop{\mathrm{N}}(G)=(n_2+1)^2(n_2-1)>0,\] a contradiction to the choice of \(G\). If \(n_0=n_2\), then \(n=5n_2-1\) and \(G\) is isomorphic to \(\Omega_{n,n-5}\). If \(n_0=n_2-1\), then \(n=5n_2-2\) and \(G\) is also isomorphic to \(\Omega_{n,n-5}\).

This completes the proof of the proposition. ◻

We are now prepared to prove our main theorem.

3.7. Proof of the main theorem

In this subsection, we present a proof of our main theorem. We first recall the main result stated in Section 1.

Theorem 3.20. Let the integers \(n>3\) and \(0< c<n-2\) be given, and \(G\in \mathcal{U}(n,c)\) such that \(\mathop{\mathrm{N}}(G)\geq \mathop{\mathrm{N}}(H)\) for all \(H\in \mathcal{U}(n,c)\). Then the following hold:

\(\bullet\) \(G\) is only isomorphic to \(\Delta_{n,c}\) if \(c=n-3\) or \(c<n-5\);

\(\bullet\) \(G\) is only isomorphic to \(\Omega_{n,c}\) if \(c=n-4>1\), or \(c=n-5>3\) and \(n=3,4\mod 5\);

\(\bullet\) \(G\) is isomorphic to both \(\Delta_{n,c}\) and \(\Omega_{n,c}\) if \(c=n-5=3\), or \(c=n-4 =1\), or \[\begin{aligned} c=n-5>0 \text{ and } n=0\mod 5. \end{aligned}\]

Proof. Since the girth of \(G\) is \(3\) or \(4\), it suffices to compare \(\mathop{\mathrm{N}}(\Delta_{n,c})\) with \(\mathop{\mathrm{N}}(\Omega_{n,c})\) depending on the values of \(n\) and \(c\); see Propositions 3.16 and 3.19. Recall that \(\Omega_{n,c}\) has precisely \(c=n-5\) or \(c=n-4\) cut vertices.

Case 1. \(c=n-3\) or \(c<n-5\).

Clearly, \(G\) is only isomorphic to \(\Delta_{n,c}\).

Case 2. \(c=n-4>0\).

If \(n=4m\) for some integer \(m>1\), or \(n=4m+3\) for some integer \(m>0\), then the case \(g=4\) in Lemma 3.3 gives us \(\mathop{\mathrm{N}}(\Delta_{n,n-4})< \mathop{\mathrm{N}}(\Omega_{n,n-4})\). Thus \(G\) is only isomorphic to \(\Omega_{n,n-4}\) in this case. On the other hand, using Lemma 3.5 (see Subsection 3.2) direct calculations show that \[\mathop{\mathrm{N}}(\Omega_{n,n-4})-\mathop{\mathrm{N}}(\Delta_{n,n-4})=m(m^2+m-1)>0,\] if \(n=4m+2\) for some integer \(m>0\), and \[\mathop{\mathrm{N}}(\Omega_{n,n-4})-\mathop{\mathrm{N}}(\Delta_{n,n-4})=m(m-1)(m+1),\] if \(n=4m+1\) for some integer \(m>0\). The latter identity shows that \(\mathop{\mathrm{N}}(\Omega_{n,n-4})>\mathop{\mathrm{N}}(\Delta_{n,n-4})\) for \(m>1\), and \(\mathop{\mathrm{N}}(\Omega_{n,n-4})=\mathop{\mathrm{N}}(\Delta_{n,n-4})\) for \(m=1\).

Case 3. \(c=n-5>0\).

Then we infer from the case \(g=4\) in Lemma 3.3 that \(\mathop{\mathrm{N}}(\Delta_{n,n-5})=\mathop{\mathrm{N}}(\Omega_{n,n-5})\) if \(n=5m\) for some integer \(m>1\), and \(\mathop{\mathrm{N}}(\Delta_{n,n-5})< \mathop{\mathrm{N}}(\Omega_{n,n-5})\) if \(n=5m-1\) for some integer \(m>1\). Using Lemma 3.5, direct calculations yield \[\mathop{\mathrm{N}}(\Omega_{n,n-5})-\mathop{\mathrm{N}}(\Delta_{n,n-5})=m(m-2)\geq 0,\] if \(n=5m-2\) for some integer \(m>1\). The latter identity shows that \(\mathop{\mathrm{N}}(\Omega_{n,n-5})>\mathop{\mathrm{N}}(\Delta_{n,n-5})\) for \(m>2\), and \(\mathop{\mathrm{N}}(\Omega_{n,n-5})=\mathop{\mathrm{N}}(\Delta_{n,n-5})\) for \(m=2\).

This completes the proof of the theorem. ◻

Remark 3.21. Note that explicit expressions for \(\mathop{\mathrm{N}}(\Delta_{n,c})\) and \(\mathop{\mathrm{N}}(\Omega_{n,c})\) can easily be obtained using Lemma 3.5.

4. Concluding remarks

The Wiener index of a connected graph is the sum of distances between all unordered vertex pairs. It is the oldest and also the most studied index among the so-called topological indices in mathematical chemistry [8, 9, 19].

It is remarkable that for the case \(c=n-3\) or \(c<n-5\), the same graph \(\Delta_{n,c}\) minimises the Wiener index among all graphs in \(\mathcal{U}(n,c)\); see [16, Theorem 4.7]. It is notable, however, that this negative correlation between the Wiener index and the number of connected induced subgraphs does not extend to the other remaining cases of \(n,c\). For example, if \(c=n-5>3\) and \(n=3,4\mod 5\), then \(\Delta_{n,c}\) uniquely minimises the Wiener index [16, Theorem 4.7], while \(\Omega_{n,c}\) uniquely maximises the number of connected induced subgraphs (see Theorem 3.20). This is in contrast with other topological indices [18].

Naturally, what remains for further study is the analogous minimisation problem:

Problem 4.1. Characterise those graphs in \(\mathcal{U}(n,c)\) with the smallest number of connected induced subgraphs.

The case \(c=0\) is trivial, while the case \(c=1\) is easy.

References:

  1. M. Alokshiya, S. Salem, and F. Abed. A linear delay algorithm for enumerating all connected induced subgraphs. BMC Bioinformatics, 20(319), 2019. https://doi.org/10.1186/s12859-019-2837-y.
  2. E. O. D. Andriantiana, S. Wagner, and H. Wang. Greedy trees, subtrees and antichains. Electronic Journal of Combinatorics, 20(3):P28, 2013. https://doi.org/10.37236/3101.
  3. D. Avis and K. Fukuda. Reverse search for enumeration. Discrete Applied Mathematics, 65(1):21–46, 1996. https://doi.org/10.1016/0166-218X(95)00026-N.
  4. A. Björklund, T. Husfeldt, P. Kaski, and M. Koivisto. The traveling salesman problem in bounded degree graphs. In L. Aceto, I. Damgård, L. A. Goldberg, M. M. Halldórsson, A. Ingólfsdóttir, and I. Walukiewicz, editors, Automata, Languages and Programming (ICALP 2008), volume 5125 of Lecture Notes in Computer Science, Berlin, Heidelberg. Springer, 2008. https://doi.org/10.1145/2151171.2151181.
  5. F. R. K. Chung, R. L. Graham, and D. Coppersmith. On trees containing all small trees. In G. Chartrand, editor, The Theory of Applications of Graphs, pages 265–272. John Wiley and Sons, 1981.
  6. A. A. V. Dossou-Olory. Graphs and unicyclic graphs with extremal number of connected subgraphs. Ars Combinatoria, 2020. Accepted for publication (2020). Preprint available at arXiv:1812.02422.
  7. A. A. V. Dossou-Olory. Cut and pendant vertices and the number of connected induced subgraphs of a graph. European Journal of Mathematics, 7:766–792, 2021. https://doi.org/10.1007/s40879-020-00443-8.
  1. R. C. Entringer, D. E. Jackson, and D. A. Snyder. Distance in graphs. Czechoslovak Mathematical Journal, 26(101):283–296, 1976.
  2. M. Knor, R. Škrekovski, and A. Tepeh. Mathematical aspects of wiener index. Ars Mathematica Contemporanea, 11:327–352, 2016. https://doi.org/10.26493/1855-3974.795.ebf.
  3. S. Li and S. Wang. Further analysis on the total number of subtrees of trees. Electronic Journal of Combinatorics, 19(4):P48, 2012. https://doi.org/10.37236/2186.
  4. S. Maxwell, M. R. Chance, and M. Koyutürk. Efficiently enumerating all connected induced subgraphs of a large molecular network. In A. H. Dediu, C. Martín-Vide, and B. Truthe, editors, Algorithms for Computational Biology (AlCoB 2014), volume 8542 of Lecture Notes in Computer Science. Cham: Springer, 2014. https://doi.org/10.1007/978-3-319-07953-0_14.
  5. R. Milo, S. Shen-Orr, S. Itzkovitz, N. Kashtan, D. Chklovskii, and U. Alon. Network motifs: simple building blocks of complex networks. Science, 298(5594):824–827, 2002. https://doi.org/10.1126/science.298.5594.824.
  6. A. A. D. OLORY. Maximising the number of connected induced subgraphs of unicyclic graphs. Turkish Journal of Mathematics, 46(8):3359–3372, 2022. https://doi.org/10.55730/1300-0098.3337.
  7. L. A. Székely and H. Wang. On subtrees of trees. Advances in Applied Mathematics, 34(1):138–155, 2005. https://doi.org/10.1016/j.aam.2004.07.002.
  1. L. A. Székely and H. Wang. Binary trees with the largest number of subtrees. Discrete Applied Mathematics, 155(3):374–385, 2007. https://doi.org/10.1016/j.dam.2006.05.008.
  2. S.-W. Tan, Q.-L. Wang, and Y. Lin. The wiener index of unicyclic graphs given number of pendant vertices or cut vertices. Journal of Applied Mathematics and Computing, 55(1–2):1–24, 2017. https://doi.org/10.1007/s12190-016-1022-y.
  3. T. Uno. Constant time enumeration by amortization. In F. Dehne, J. R. Sack, and U. Stege, editors, Algorithms and Data Structures (WADS 2015), volume 9214 of Lecture Notes in Computer Science, Cham. Springer, 2015. https://doi.org/10.1007/978-3-319-21840-3_49.
  4. S. Wagner. Correlation of graph-theoretical indices. SIAM Journal on Discrete Mathematics, 21(1):33–46, 2007. https://doi.org/10.1137/050631446.
  5. H. Wiener. Structural determination of paraffin boiling points. Journal of the American Chemical Society, 69(1):17–20, 1947. https://doi.org/10.1021/ja01193a005.
  6. W. Yan and Y.-N. Yeh. Enumeration of subtrees of trees. Theoretical Computer Science, 369:256–268, 2006. https://doi.org/10.1016/j.tcs.2006.09.002.