1 Introduction

The degree of a vertex v of a graph \(G=(V(G), E(G))\) is denoted by \(\deg _G(v)\). Graphs in which all vertices have the same degree, that is, regular graphs, are in the center of interest of the graph theory community. If G is not regular, then it is called irregular, cf. [5], and one is interested in how irregular it is. For this sake, let the imbalance \(\mathrm{imb}_G(e)\) of an edge \(e = uv\in E(G)\) be defined by

$$\begin{aligned} \mathrm{imb}_G(e) = |\deg _G(u) - \deg _G(v)|\,. \end{aligned}$$

The imbalance of an edge is thus a local measure of non-regularity of a given graph, cf. [7], where Ramsey problems with repeated degrees were investigated. To measure graph’s global non-regularity, different approaches have been proposed; they are nicely presented in two recent papers [4, 31]. One of the most natural such measures is the irregularity \(\mathrm{irr}(G)\) of G (lately also called the Albertson index) defined as [6]:

$$\begin{aligned} \mathrm{irr}(G) = \sum _{uv \in E(G)} |\deg _G(u) - \deg _G(v)| = \sum _{e \in E(G)} \mathrm{imb}_G(e)\,. \end{aligned}$$

Let us explicitly mention some of the papers in which the irregularity has been studied. In [29] related extremal problems are proved; the paper [40] reports several bounds on irregularity; the paper [15] gives a spectral bound for graph irregularity that improves a bound from [40]; in [20] bipartite graphs having maximum possible irregularity are determined; the irregularity of some graph families that are important in chemistry is reported in [3]; for the irregularity of cacti see [25]; see also [30] for the role of irregularity indices used as molecular descriptors. We also point out that graphs in which \(\mathrm{imb}_G(e) = 1\) holds for all edges have been recently investigated in [18] and named stepwise irregular graphs.

In this paper we focus on the irregularity of three classes of graphs: \(\pi \)-permutation graphs, Fibonacci cubes, and trees. In the next section we give an upper bound on the irregularity of \(\pi \)-permutation graphs which is, roughly speaking, stronger by a factor of 4 than the corresponding bound for general graphs. We also characterize the \(\pi \)-permutation graphs that attain the equality. In Sect. 3 we extend the concept of the irregularity to arbitrary edge subsets and prove a related upper bound for the irregularity of permutation edges in \(\pi \)-permutation graphs. In Sect. 4 we prove an exact formula for the irregularity of Fibonacci cubes. In the final section we prove an upper bound for the irregularity of trees in terms of the diameter and characterize the graphs that attain equality. We also give bounds for the irregularity of \(\pi \)-permutation graphs over trees.

In the rest of the introduction we give some further, basic definitions used in this paper. All graphs in this paper are simple and connected. The order (= number of vertices) and the size (= number of edges) of a graph \(G=(V(G), E(G))\) are denoted with n(G) and m(G), respectively. If \(W\subseteq V(G)\), then \(\langle W\rangle \) denotes the subgraph of G induced by W. The minimum and the maximum degrees of vertices from G are denoted by \(\delta (G)\) and \(\Delta (G)\), respectively. A vertex \(v\in V(G)\) with \(\deg _G(v) = {n(G)} - 1\) is a universal vertex of G. The distance \(d_G(u,v)\) between vertices u and v of a graph G is the number of edges on a uv-geodesic. The diameter \(\mathrm{diam}(G)\) of G is the length of a longest geodesic in G. For a positive integer n we will denote the set \( \{1,\ldots , n\}\) with [n].

2 \(\pi \)-Permutation Graphs

Let \(G'\) and \(G''\) be disjoint copies of a graph G, and let \(\pi :V(G')\rightarrow V(G'')\) be a bijection; in other words, \(\pi \) is a permutation on V(G). The \(\pi \)-permutation graph \(G^{\pi }\) of G has the vertex set \(V(G^{\pi }) = V(G') \cup V(G'')\) and the edge set \(E(G^{\pi }) = E(G') \cup E(G'') \cup E_G^\pi \), where

$$\begin{aligned} E_G^\pi = \{uv:\ u\in V(G'), v\in V(G''), v = \pi (u)\}\,. \end{aligned}$$

Hence, a \(\pi \)-permutation graph is obtained from two disjoint copies of a given graph by adding a matching between them. This concept was introduced half a century ago in [11] and further investigated in a series of papers including [10, 14, 17, 19, 39]. We point out that the term “permutation graph” is also frequently used for intersection graphs of the lines representing a permutation; see, for example, [13]. In this paper we are only interested in the former interpretation which will be emphasized by speaking of \(\pi \)-permutation graphs and by the notation \(G^\pi \).

Let \(G^\pi \) be a \(\pi \)-permutation and \(G'\) and \(G''\) be two isomorphic copies of G in \(G^\pi \). If \(u\in V(G)\), then the vertices corresponding to u in \(G'\) and \(G''\) will be denoted, respectively, by \(u'\) and \(u''\). We begin with the following simple result.

Proposition 2.1

If G is a graph and \(\pi \) is a permutation on V(G), then

$$\begin{aligned} \mathrm{irr}(G^{\pi }) = 2\cdot \mathrm{irr}(G) + \sum _{u \in V(G)} |\deg _G(u) - \deg _G(\pi (u))|\,. \end{aligned}$$

In particular, if \(\pi \) induces an automorphism of G, then \(\mathrm{irr}(G^{\pi }) = 2\cdot \mathrm{irr}(G)\).

Proof

Let \(G'\) and \(G''\) be the isomorphic copies of G in \(G^\pi \). If \(u\in V(G)\), then \(\deg _{G^\pi }(u') = \deg _{G^\pi }(u'') = \deg _{G}(u) + 1\), and, consequently, \(E(G')\) and \(E(G'')\) each contribute \(\mathrm{irr}(G)\) to \(\mathrm{irr}(G^\pi )\). For the same reason, each matching edge \(u'\pi (u')\) contributes \(|\deg _G(u) - \deg _G(\pi (u))|\) to \(\mathrm{irr}(G^\pi )\), and, consequently, the first assertion follows. The second assertion then follows because automorphisms preserve degrees. \(\square \)

In [2, 36] it was proved in two different ways that if G is a graph of order \(n = n(G)\), then

$$\begin{aligned} \mathrm{irr}(G) \le \left\lfloor \frac{n}{3}\right\rfloor \left\lceil \frac{2n}{3}\right\rceil \left( \left\lceil \frac{2n}{3}\right\rceil - 1 \right) = \left\lfloor \frac{n}{3}\right\rfloor \left( n - \left\lfloor \frac{n}{3}\right\rfloor \right) \left( n - \left\lfloor \frac{n}{3}\right\rfloor -1 \right) \,. \end{aligned}$$
(1)

Moreover, let \(KS_{p,q}\), \(p,q\ge 1\), be the clique-star graph, that is, the join of a complete graph \(K_p\) and an edge-less graph \({\bar{K}_q}\). (The join of graphs G and H is the graph obtained from the disjoint union of G and H by adding all possible edges between vertices of G and vertices of H.) Then, the equality in (1) is attained if and only if G is \(KS_{\left\lfloor \frac{n}{3}\right\rfloor , \left\lceil \frac{2n}{3}\right\rceil }\) or, if \(n\equiv 2 \bmod 3\), G is \(KS_{\left\lceil \frac{n}{3}\right\rceil , \left\lfloor \frac{2n}{3}\right\rfloor }\), see [2, Theorem 2.2]. This immediately implies the following lemma which we need in the proof of our below result analogous to (1) for \(\pi \)-permutation graphs.

Lemma 2.2

If G is a graph of maximum irregularity among all graphs of order n, then G has at most \(\lceil \frac{n}{3}\rceil \) universal vertices.

Theorem 2.3

If G is a graph of order \(n = n(G)\) and \(\pi \) is a permutation on V(G), then

$$\begin{aligned} \mathrm{irr}(G^{\pi }) \le 2\left\lceil \frac{n}{3} \right\rceil \left( \left\lfloor \frac{2n}{3}\right\rfloor ^2-1 \right) \,. \end{aligned}$$

Moreover, the equality holds if and only if \(G = KS_{\left\lceil \frac{n}{3} \right\rceil , \left\lfloor \frac{2n}{3} \right\rfloor }\).

Proof

Let a graph G and a permutation \(\pi \) of V(G) be selected such that the graph \(G^{\pi }\) has the maximum irregularity among all permutation graphs over graphs of order n. Let \(V(G) = U \cup W\), where \(U= \{u_1, \ldots , u_s \}\) is the set of universal vertices of G and \(W = V(G)\setminus U = \{w_1, \ldots , w_{n-s}\}\). Without loss of generality, we may assume that \(\deg _G(w_1) \le \cdots \le \deg _G(w_{n-s})\). Under these assumptions and with Lemma 2.2 in mind, we may assume without loss of generality that

$$\begin{aligned} \pi (u_i') = w_i'', \pi (w_i') = u_i'', i\in [s],\ \mathrm{and}\ \pi (w'_{s+i}) = w''_{n-i+1}, i\in [n-s]\,. \end{aligned}$$
(2)

Let \(G'\) be the spanning subgraph of G obtained from G by removing all the edges of \(\langle W\rangle \). If \(e=uw\in E(G)\), where \(u\in U\) and \(w\in W\), then

$$\begin{aligned} \mathrm{imb}_{G'}(e) = \mathrm{imb}_G(e) + \deg _{\langle W\rangle }(w)\,. \end{aligned}$$
(3)

If \(e\in E(\langle W\rangle )\), then \(\mathrm{imb}_G(e) \le n-s-3\) and consequently

$$\begin{aligned} \sum _{e\in E(\langle W\rangle )} \mathrm{imb}_G(e) \le \frac{1}{2}\sum _{w\in W} \deg _{\langle W\rangle }(w) (n-s-3)\,. \end{aligned}$$
(4)

Setting

$$\begin{aligned} X = \sum _{e \in E_{G}^{\pi }} \mathrm{imb}_{(G')^{\pi }}(e) - \mathrm{imb}_{G^{\pi }}(e)\,, \end{aligned}$$

and having in mind that \(E_{G}^{\pi } = E_{G'}^{\pi }\), we can do the following estimations:

$$\begin{aligned} X= & {} 2 \sum _{i=1}^{s} \left( \mathrm{imb}_{(G')^{\pi }}(u_i'w_i'') - \mathrm{imb}_{G^{\pi }}(u'_iw''_i)\right) \nonumber \\&+\,\, 2 \sum _{i=1}^{n-s}| \mathrm{imb}_{(G')^{\pi }}(w'_{s+i}w''_{n-i+1}) - \mathrm{imb}_{G^{\pi }}(w'_{s+i}w''_{n-i+1})| \nonumber \\&\ge 2 \sum _{i=1}^{s}\deg _{\langle W\rangle }(w_i) - 2 \sum _{i=1}^{n-s}|\deg _{\langle W\rangle }(w_{s+i}) - \deg _{\langle W\rangle }(w_{n-i+1})|\nonumber \\&\ge 2 \left( \sum _{i=1}^{s}\deg _{\langle W\rangle }(w_i) - \sum _{i=s+1}^{n-s}\deg _{\langle W\rangle }(w_i)\,. \right) \end{aligned}$$
(5)

From (3)–(5) we get

$$\begin{aligned} \mathrm{irr}((G')^{\pi }) - \mathrm{irr}(G^{\pi })\ge & {} 2\sum _{i=1}^{n-s}\deg _{\langle W\rangle }(w_i)s - \sum _{i=1}^{n-s}\deg _{\langle W\rangle }(w_i)(n-s-3) \\&+\,\, 2 \left( \sum _{i=1}^{s}\deg _{\langle W\rangle }(w_i) - \sum _{i=s+1}^{n-s}\deg _{\langle W\rangle }(w_i) \right) \\\ge & {} 2\left( s-\frac{1}{2}(n-s-3)-1 \right) \sum _{i=1}^{n-s}\deg _{\langle W\rangle }(w_i)\\= & {} \left( 3s-n+1\right) \sum _{i=1}^{n-s}\deg _{\langle W\rangle }(w_i)\,. \end{aligned}$$

Since \(G^{\pi }\) has maximum irregularity and the expression \(3s-n+1\) is positive for \(s \ge \lceil \frac{n}{3}\rceil \), we infer that \(\sum _{i=1}^{n-s}\deg _{\langle W\rangle }(w_i) = 0\). Hence, G is a clique-star graph \(KS_{s,n-s}\). For a fixed value of s we have

$$\begin{aligned} \max \{ \mathrm{irr}(KS_{s,n-s}^{\pi }):\ \pi \ \text{ is } \text{ a } \text{ permutation } \} = 2s((n-s)^2-1)\,. \end{aligned}$$

If \(f(s) = 2s((n-s)^2-1)\), then f(s) is maximized at \(s=\lceil \frac{n}{3}\rceil \). Therefore, we conclude that

$$\begin{aligned} \mathrm{irr}(G^{\pi }) \le 2 \left\lceil \frac{n}{3}\right\rceil \left( \left\lfloor \frac{2n}{3}\right\rfloor ^2 -1 \right) \,. \end{aligned}$$

\(\square \)

Note that if \(n = n(G)\), then \(n(G^{\pi }) = 2n\). Hence, the upper bound of Theorem 2.3 bounds \(\mathrm{irr}(G^{\pi })\) from the above with, roughly, \(\frac{1}{27}n(G^\pi )^3\). On the other hand, the general bound (1) yields, roughly, \(\frac{4}{27}n(G^\pi )^3\). Hence, Theorem 2.3 improves the general upper bound in the case of \(\pi \)-permutation graphs by, roughly speaking, again a factor of 4.

3 Irregularity of Edge Subsets and \(\pi \)-Permutation Graphs

As a variant of the irregularity measure, Abdo et al. [1] suggested to consider the imbalance over all pairs of vertices, introducing in this way the total irregularity \(\mathrm{irr}_t(G)\) of a graph G with

$$\begin{aligned} \mathrm{irr}_t(G) = \sum _{\{u,v\}\subseteq V(G)} |\deg _G(u) - \deg _G(v)|\,. \end{aligned}$$

The total irregularity has been compared with the irregularity in [12] see also [9, 35, 38]. However, for our purposes, it is useful to extend the concept of irregularity from the sum of the imbalances of all the edges of a graph to arbitrary edge subsets. More precisely, if \(F\subseteq E(G)\), then let

$$\begin{aligned} \mathrm{irr}_G(F) = \sum _{f \in F} \mathrm{imb}(f)\,. \end{aligned}$$

Note that with this notation \(\mathrm{irr}(G) = \mathrm{irr}_G(E(G))\) and that Proposition 2.1 reads as:

$$\begin{aligned} \mathrm{irr}(G^{\pi }) = 2\cdot \mathrm{irr}(G) + \mathrm{irr}_{G^{\pi }}(E_G^\pi )\,. \end{aligned}$$

Hence, \(\mathrm{irr}_{G^{\pi }}(E_G^\pi )\) is of special interest, and in our next result we give a sharp upper bound for it.

Theorem 3.1

If G is a graph of order n and \(\pi \) a permutation on V(G), then

$$\begin{aligned} \mathrm{irr}_{G^\pi }(E_G^\pi ) \le 2\left\lfloor \frac{n-1}{2} \right\rfloor \left\lceil \frac{n-1}{2}\right\rceil \,. \end{aligned}$$

Moreover, equality holds if and only if \(G = KS_{\left\lfloor \frac{n-1}{2} \right\rfloor ,\left\lceil \frac{n+1}{2} \right\rceil }\) or \(G=KS_{\left\lceil \frac{n-1}{2} \right\rceil ,\left\lfloor \frac{n+1}{2} \right\rfloor }\).

Proof

Let \(G^{\pi }\) be a permutation graph that has maximum \(\mathrm{irr}_{G^\pi }(E_G^\pi )\) among all G of order n and all permutations on V(G). Moreover, assume that among such graphs, G has maximum number of universal vertices. Let \(U = \{u_1, \ldots , u_s \}\) and \(W = \{w_1, \ldots , w_{n-s} \}\) be the sets of its universal and its non-universal vertices, respectively, defined just as in the proof of Theorem 2.3. Then, (2) applies also to \(\pi \).

We claim that \(\deg _W(w_i) = 0\) for \(i\in [n-s]\). On the contrary, suppose that \(\deg _W(w_{n-s})\ge 1\). Let \(w_p\) and \(w_q\) be two adjacent vertices in W, where \(w_{n-s}\) is adjacent to \(w_p\) and non-adjacent to \(w_q\). Consider the following transformation: remove the edge \(w_pw_q\) and then add an edge between \(w_{n-s}\) and \(w_q\). Let H be the newly obtained graph. Then, we have \(\deg _{H}(w_{n-s}) =\deg _{G}(w_{n-s})+1 \) and \(\deg _{H}(w_p) =\deg _{G}(w_p)-1\). Moreover, the degrees of the other vertices remain the same. If \(\pi (w'_{n-s}) = w''_q\), then \(\mathrm{imb}_{H}(w'_{n-s}\pi (w'_{n-s})) = \mathrm{imb}_{G}(w'_{n-s}\pi (w'_{n-s})) + 2\); otherwise, \(\mathrm{imb}_{H}(w'_{n-s}\pi (w'_{n-s})) = \mathrm{imb}_{G}(w'_{n-s}\pi (w'_{n-s})) + 1\).

Also for \(w_q\) we have \(\mathrm{imb}_{H}(w'_q\pi (w'_q)) \ge \mathrm{imb}_{G}(w'_q\pi (w'_q)) - 1\). Therefore, \(\mathrm{irr}_{H}(E^{\pi }_{H}) \ge \mathrm{irr}_{G}(E_G^\pi ))\). Then we apply the above transformation until \(w_{n-s}\) is adjacent to all vertices of W. As we have assumed that G has the largest possible number of universal vertices, we have a contradiction.

Hence, \(\deg _W(w_{n-s}) =0\) and consequently \(\deg _W(w_i) =0\), \(i\in [n-s]\)). This implies that \(\mathrm{irr}_{G^\pi }(E_G^\pi ) = \sum _{i=1}^{s}\mathrm{imb}(u_iw_i) = {2(n-1-s)s}\). By Lemma 2.2, \(s \le \lfloor \frac{n}{2} \rfloor \). Hence, \(\mathrm{irr}_{G^\pi }(E_G^\pi )\) is maximized when \(s = \lfloor \frac{n-1}{2} \rfloor \) or \(s=\lceil \frac{n-1}{2}\rceil \) and then \(G = KS_{p,q}\) where \(p=\lfloor \frac{n-1}{2} \rfloor \) or \(p=\lceil \frac{n-1}{2}\rceil \) and \(q = n-p\). \(\square \)

We close this section with a certain sub-additivity result on \(\mathrm{irr}_{G^\pi }(E_G^\pi )\), where \({\pi \alpha }\) denotes the composition of the permutations \(\pi \) and \(\alpha \).

Theorem 3.2

If \(\pi \) and \(\alpha \) are permutations on V(G), then

$$\begin{aligned} \mathrm{irr}_{G^{\pi \alpha }}(E_G^{\pi \alpha }) \le \mathrm{irr}_{G^{\pi }}(E_G^{\pi }) + \mathrm{irr}_{G^{\alpha }}(E_G^{\alpha })\,. \end{aligned}$$

Proof

Set \(\beta = \pi \alpha \). Then, having in mind that the degree of each vertex of \(G^{\beta }\) (as well as of \(G^{\pi }\) and \(G^{\alpha }\)) is larger by 1 than the degree of its corresponding vertex in G, we can estimate as follows:

$$\begin{aligned} \mathrm{irr}_{G^{\beta }}(E_G^{\beta })= & {} \sum _{v \in V(G)} \mathrm{imb}_{G^{\beta }}(v' \beta (v')) = \sum _{v \in V(G)} |\deg _{G^{\beta }}(\beta (v')) - \deg _{G^{\beta }}(v')| \\= & {} \sum _{v \in V(G)} |\deg _{G}(\beta (v)) - \deg _{G}(v)| \\= & {} \sum _{v \in V(G)} |\deg _G(\beta (v)) - \deg _G(\alpha (v)) + \deg _G(\alpha (v)) - \deg _G(v)| \\\le & {} \sum _{v \in V(G)} \left( |\deg _G(\beta (v)) - \deg _G(\alpha (v))| + |\deg _G(\alpha (v)) - \deg _G(v)|\right) \\= & {} \sum _{v \in V(G)} |\deg _{G^{\pi }}(\pi (v)) - \deg _{G^{\pi }}(v)| \\&+ \sum _{v \in V(G)} |\deg _{G^{\alpha }}(\alpha (v)) - \deg _{G^{\alpha }}(v)| \\= & {} \mathrm{irr}_{G^{\pi }}(E_G^{\pi }) + \mathrm{irr}_{G^{\alpha }}(E_G^{\alpha }) \end{aligned}$$

and we are done. \(\square \)

4 Fibonacci Cubes

Fibonacci cubes were introduced by Hsu [21] as an interconnection network model. Afterward, they have been studied from different perspectives; the developments until 2013 are summarized in the survey article [23]. Among the subsequent developments on Fibonacci cubes we point out the studies of the structure of their induced hypercubes [16, 27, 33] and the investigations of their domination invariants [8, 22, 32]. Moreover, Fibonacci cubes can be recognized in linear time [37]. In this section we add to the literature on the Fibonacci cubes their irregularity.

A Fibonacci string of length n is a binary string \(b_1\ldots b_n\) with \(b_i\cdot b_{i+1}=0\) for \(1\le i<n\), that is, a binary string that contains no consecutive 1s. The Fibonacci cube \(\Gamma _n\), \(n\ge 1\), is the graph whose vertices are all Fibonacci strings of length n, two vertices being adjacent if they differ in a single coordinate. It is well known that \(|V(\Gamma _{n})| = F_{n+2}\), where \(F_0 = 0\), \(F_1 = 1\), and \(F_{n+2} = F_{n+1} + F_{n}\), \(n\ge 0\), are the Fibonacci numbers.

Theorem 4.1

If \(n\ge 1\), then

$$\begin{aligned} \mathrm{irr}(\Gamma _n) = \frac{2}{5} \Big ((n-1)F_n + 2nF_{n-1}\Big )\,. \end{aligned}$$

Proof

We proceed by induction on n. By a direct computation we see that \(\mathrm{irr}(\Gamma _1) = 0\), \(\mathrm{irr}(\Gamma _2) = 2\), \(\mathrm{irr}(\Gamma _3) = 4\), \(\mathrm{irr}(\Gamma _4) = 10\), and \(\mathrm{irr}(\Gamma _5) = 20\); hence, the stated formula holds for \(n\le 5\). From now on assume that \(n\ge 6\).

Define the following subsets of vertices of \(\Gamma _n\):

$$\begin{aligned} A_n= & {} \{00b_3\ldots b_n:\ b_3, \ldots , b_n\in \{0,1\}\}\,,\\ B_n= & {} \{10b_3\ldots b_n:\ b_3, \ldots , b_n\in \{0,1\}\}\,,\\ C_n= & {} \{010b_4\ldots b_n:\ b_4, \ldots , b_n\in \{0,1\}\}\,. \end{aligned}$$

The sets \(A_n\), \(B_n\), and \(C_n\) are disjoint and \(V(\Gamma _n) = A_n\cup B_n\cup C_n\). In addition, the subgraphs \(\langle A_n\rangle \), \(\langle B_n\rangle \), and \(\langle C_n\rangle \) are isomorphic to \( \Gamma _{n-2}\), \(\Gamma _{n-2}\), and \(\Gamma _{n-3}\), respectively. Since each vertex from \(B_n\) has exactly one neighbor outside \(B_n\) (more precisely in \(A_n\)), we see that

  • \(\mathrm{irr}_{\Gamma _n}(E(\langle B_n\rangle )) = \mathrm{irr}(\Gamma _{n-2})\).

Similarly, since each vertex from \(C_n\) has exactly one neighbor outside \(C_n\) (more precisely in \(A_n\)), we get

  • \(\mathrm{irr}_{\Gamma _n}(E(\langle C_n\rangle )) = \mathrm{irr}(\Gamma _{n-3})\).

Consider now the edges uv from \(G[A_n]\), where \(u=00u_3\ldots u_n\) and \(v=00v_3\ldots v_n\). If \(u_3 = v_3\), then u and v have the same number of neighbors outside \(A_n\). Hence, the irregularity of uv in \(\Gamma _n\) is equal to the irregularity of the corresponding edge in \(G[A_n] = \Gamma _{n-2}\). Suppose now that \(u=000u_4\ldots u_n\) and \(v=001v_4\ldots v_n\). In this case \(v_4 = 0\) and hence, also \(u_4 = 0\), so that \(u=0000u_5\ldots u_n\) and \(v=0010v_5\ldots v_n\). The irregularity of such an edge in \(\Gamma _n\) is by 1 larger than the irregularity of the corresponding edge in \(\Gamma _{n-2}\). Since there are precisely \(F_{n-2}\) such edges, we get

  • \(\mathrm{irr}_{\Gamma _n}(E(\langle A_n\rangle )) = \mathrm{irr}(\Gamma _{n-2}) + F_{n-2}\).

We still need to consider the edges between \(A_n\) and \(B_n\) and between \(A_n\) and \(C_n\). (Note that there are no edges between \(B_n\) and \(C_n\).)

Consider first the edges uv between \(A_n\) and \(B_n\), in which case \(u=00u_3\ldots u_n\) and \(v=10u_3\ldots u_n\). Among them, the edges where \(u=0000u_5\ldots u_n\) contribute \(F_{n-2}\), the edges where \(u=0010u_5\ldots u_n\) contribute nothing, and the edges where \(u=00010u_6\ldots u_n\) contribute \(F_{n-3}\). Hence,

  • the contribution of the edges between \(A_n\) and \(B_n\) is \(F_{n-2} + F_{n-3}\).

Consider next the edges uv between \(A_n\) and \(C_n\), in which case \(u=000u_4\ldots u_n\) and \(v=010u_3\ldots u_n\). Among them, the edges where \(u=0000u_5\ldots u_n\) contribute \(2F_{n-2}\) and the edges where \(u=00010u_6\ldots u_n\) contribute \(F_{n-3}\). Hence,

  • the contribution of the edges between \(A_n\) and \(C_n\) is \(2F_{n-2} + F_{n-3}\).

We have thus considered all the edges of \(\Gamma _n\). Putting together the above itemized contributions, we infer that

$$\begin{aligned} \mathrm{irr}(\Gamma _n)= & {} 2\cdot \mathrm{irr}(\Gamma _{n-2}) + \mathrm{irr}(\Gamma _{n-3}) + 4F_{n-2} + 2F_{n-3} \\= & {} 2\cdot \mathrm{irr}(\Gamma _{n-2}) + \mathrm{irr}(\Gamma _{n-3}) + 2F_{n}\,. \end{aligned}$$

Using the induction assumption we thus get

$$\begin{aligned} \mathrm{irr}(\Gamma _n)= & {} \frac{4}{5} \Big ((n-3)F_{n-2} + 2(n-2)F_{n-3}\Big )\\&+ \frac{2}{5} \Big ((n-4)F_{n-3} + 2(n-3)F_{n-4}\Big ) + 2F_n \\= & {} \frac{2}{5} \Big ((n-1)F_n + 2nF_{n-1}\Big )\,, \end{aligned}$$

where the last equality follows by a lengthy but straightforward computation using the definition of the Fibonacci numbers. \(\square \)

In [28] it is proved that \(m(\Gamma _n) = (nF_{n+1} + 2(n+1)F_n)/5\). Hence, Theorem 4.1 has the following interesting consequence.

Corollary 4.2

If \(n\ge 2\), then

$$\begin{aligned} \mathrm{irr}(\Gamma _n) = 2\cdot m(\Gamma _{n-1})\,. \end{aligned}$$

To conclude the section we remark that in [34] the so-called boundary enumerator polynomials \(D_k\) of hypercubes in Fibonacci cubes are considered and that the proof of \(D_1\) has similarities with our proof of Theorem 4.1. Namely, \(D_1\) is related to \(\sum _{uv\in E(\Gamma _n)}(\deg (u) + \deg (v) - 2)\) and the proof in [34] uses the same decomposition as we do here. Both proofs were produced independently, though. (We are adding this remark while preparing a revised version.)

5 Trees

The irregularity of trees has been already investigated. In [26] the irregularity of trees (and of unicyclic graphs) with given matching number was studied, while in [24] trees with minimum/maximum irregularity among the trees with given degree sequence and among the trees with given branching number were investigated. In the main result of this section we add to these studies the irregularity of trees of a given diameter and characterize the trees that attain the equality. Connecting the present section with Sects. 2 and 3 we also find lower and upper bounds for the irregularity of the \(\pi \)-permutation graph of an arbitrary tree.

Let \(T_i(n,d)\), \(2\le i\le d\), \(n\ge 2\), \(d\le n-1\), denote the tree obtained from the path \(P_{d+1}\) by attaching \(n-d-1\) leaves to the \(i^\mathrm{th}\) vertex of \(P_{d+1}\). Note that \(n(T_i(n,d)) = n\) and that \(\mathrm{diam}(T_i(n,d)) = d\). Observe also that if \(d = n-1\), then for every i the graph \(T_i(n,d) = T_i(n,n-1)\) is the path on n vertices. Recall also that a tree is called a caterpillar if, after its leaves are removed, a path graph remains. In other words, a caterpillar is obtained from a path graph by attaching some leaves to its vertices. Thus, the trees \(T_i(n,d)\) belong to the class of caterpillars.

Theorem 5.1

If T is a tree of order \(n\ge 2\) and with \(\mathrm{diam}(T) = d\), then

$$\begin{aligned} \mathrm{irr}(T) \le (n-d)(n-d+1), \end{aligned}$$

where the equality holds if and only if \(T \in \{T_2(n,d), \ldots , T_d(n,d)\}\).

Proof

Let T be a tree of order \(n\ge 2\) and diameter d such that \(\mathrm{irr}(T)\) is the largest possible.

We claim first that T is a caterpillar and assume on the contrary that it is not. Let P be a diametrical path of T. Since T is not a caterpillar and the path P is diametrical, P contains an inner vertex y such that the rooted tree \(T_y\), defined as the maximal subtree of T with \(V(T_y)\cap V(P) = \{y\}\), is of depth \(r\ge 2\). Clearly, \(n(T_y) \ge 3\).

Consider the following transformation. Let \(u \in V(T_y)\) be a vertex with \(d_{T_y}(y,u) = r-2\). (If \(r = 2\), then \(u = y\).) Let \(A = \{w_1, \ldots , w_k \}\) be the set of down-neighbors of u in the rooted tree \(T_y\) and \(B = N_T(u) - A\). Let \(S_i = N_T(w_i) - \{u\}\), \(i\in [k]\), and \( S= \bigcup _{i=1}^{k} S_i\). Set \(s=|S|\) and note that \(s = \sum _{i=1}^{k}(\deg _T(w_i) -1)\). Let now \(T'\) be the tree obtained from T by removing the edges between \(w_i\) and the vertices of \(S_i\), \(i\in [k]\), and then adding edges between vertices of \(S_i\) and u.

In \(T'\) the vertices \(w_i\), \(i \in [k]\), as well as all the vertices from S are leaves. The contribution to the irregularity in T and \(T'\) differs only for the edges incident with u and \(w_i\). Therefore, setting \(D = \mathrm{irr}(T') - \mathrm{irr}(T)\), we have

$$\begin{aligned} D= & {} \sum _{i=1}^{k}\left( \mathrm{imb}_{T'}(uw_i) - \mathrm{imb}_T(uw_i)\right) + \sum _{i=1}^{k}\sum _{x \in S_i}\left( \mathrm{imb}_{T'}(ux) - \mathrm{imb}_T(w_ix)\right) \\&+ \sum _{z\in B} \left( \mathrm{imb}_{T'}(uz) - \mathrm{imb}_{T}(uz)\right) \\= & {} F_1 + F_2 + F_3\,, \end{aligned}$$

where

$$\begin{aligned} F_1= & {} \sum _{i=1}^{k}\left[ ((\deg _T(u) + s)-1) - |\deg _T(u)-\deg _T(w_i)|\right] , \\ F_2= & {} \sum _{i=1}^{k}\sum _{x \in S_i} \left[ (\deg _T(u) + s -1) - (\deg _T(w_i)-1)\right] , \\ F_3= & {} \sum _{z\in B} \left[ (\deg _T(u) + s -1)- |\deg _T(u) - \deg _T(z)|\right] \,. \end{aligned}$$

Now we have

$$\begin{aligned} F_1\ge & {} \sum _{i=1}^{k} 2\cdot \min \{ \deg _T(u)-1, \deg _T(w_i)-1 \} > 0, \\ F_2= & {} \sum _{i=1}^{k}\sum _{x \in S_i} \left[ (\deg _T(u) + s -1) - (\deg _T(w_i)-1)\right] \\= & {} s\cdot \deg _T(u)+ s^2 - \sum _{i=1}^{k} \deg _T(w_i)(\deg _T(w_i) -1) \\= & {} s\cdot \deg _T(u)+ s^2 - \sum _{i=1}^{k} (\deg _T(w_i) -1)^2 - s\\= & {} s\cdot (\deg _T(u)-1) + s^2 - \sum _{i=1}^{k} (\deg _T(w_i) -1)^2 ,\\ F_3= & {} \sum _{z\in B} \left[ (\deg _T(u) + s -1)- |\deg _T(u) - \deg _T(z)| \ge -|B|\cdot s\right] \,. \end{aligned}$$

Note that \(|B| \in [2]\). If \(|B|=1\), then

$$\begin{aligned} F_2 + F_3 \ge (s + s^2 - \sum _{i=1}^{k} (\deg _T(w_i) -1)^2 )- s \ge 0\,. \end{aligned}$$

If \(|B|=2\), then \(u=y\) and \(\deg _T(u) \ge 3\). Therefore,

$$\begin{aligned} F_2 + F_3 \ge (2s + s^2 - \sum _{i=1}^{k} (\deg (w_i) -1)^2 - 2s) \ge 0\,. \end{aligned}$$

Hence, if \(S \ne \emptyset \), then \(D >0\). Applying iteratively the above transformation as many times as required, we arrive at a caterpillar.

Let now T be a caterpillar of diameter d, and let P be its diametrical path. Suppose that \(T \notin \{T_2(n,d), \ldots , T_d(n,d)\}\). Let \(v_1\) and \(v_2\) be vertices with the first and the second largest degree among the vertices of P, respectively. Note that \(\deg (v_1) \ge \deg (v_2) \ge 3\). Let \(S_i = N(v_i) - V(P)\), \(i\in [2]\). Remove the edges between \(v_2\) and \(S_2\), add edges between the vertices of \(S_2\) and \(v_1\), and denote the obtained tree with \(T'\). The contribution of the edges incident by vertices \(v_1\) and \(v_2\) is changed in \(T'\) compared with T, while the contribution of every other edge to the irregularity is the same. Therefore, setting \(D = \mathrm{irr}(T') - \mathrm{irr}(T)\), we have

$$\begin{aligned} D= & {} \sum _{w \in S_1}\left( \mathrm{imb}_{T'}(v_1w)-\mathrm{imb}_{T}(v_1w)\right) + \sum _{w \in S_2}\left( \mathrm{imb}_{T'}(v_1w)-\mathrm{imb}_{T}(v_2w)\right) \\&+ \sum _{w \in N(v_1) \cap V(P)}\left( \mathrm{imb}_{T'}(v_1w)-\mathrm{imb}_{T}(v_1w)\right) \\&+ \sum _{w \in N(v_2) \cap V(P)}\left( \mathrm{imb}_{T'}(v_2w)-\mathrm{imb}_{T}(v_2w)\right) \\= & {} |S_1|(\deg _T(v_2)-2) + \left( |S_2|((\deg _T(v_1)-2) - (\deg _T(v_2)-1)\right) \\&+ 2(\deg _T(v_2)-2) + \sum _{w \in N(v_2) \cap V(P)}\left( \mathrm{imb}_{T'}(v_2w)-\mathrm{imb}_{T}(v_2w)\right) \\\ge & {} |S_1|\left( \deg _T(v_2)-2 \right) + |S_2|\left( \deg _T(v_1)-\deg _T(v_2)-1 \right) \\&+ 2(\deg _T(v_2)-2) - 2(\deg _T(v_2)-2)\\= & {} (\deg _T(v_2)-2)(2\deg _T(v_1) + \deg _T(v_2)-3) > 0\,. \end{aligned}$$

This proves the theorem. \(\square \)

To conclude the paper we find bounds for the irregularity of the \(\pi \)-permutation graphs of tree.

Theorem 5.2

If T is a tree of order \(n \ge 3\) and \(\pi \) a permutation on V(T), then

$$\begin{aligned} 4 \le \mathrm{irr}(T^{\pi })\le 2n(n-2)\,. \end{aligned}$$

Moreover, the left equality holds if and only if \(T=P_n\) and \(\pi = \mathrm{id}\), and the right equality holds if and only if \(T=S_n\) and \(\pi \) is a permutation that maps the center of \(S_n\) into a leaf.

Proof

From the fact that path \(P_n\) has the minimum possible irregularity among the trees of order \(n \ge 3\), that is, irregularity 2, and by Proposition 2.1, we infer that \(\mathrm{irr}(T^{\pi }) \ge \mathrm{irr}(P_n ^{\pi })\) with equality holding if and only if \(T=P_n\) and \(\pi = \mathrm{id}\).

Let \(\pi \) be an arbitrary permutation on V(T). Then, we have

$$\begin{aligned} \mathrm{irr}(T^{\pi })= & {} 2\cdot \mathrm{irr}(T) + \sum _{v \in V(T)}|\deg _{T^{\pi }}(v') - \deg _{T^{\pi }}(\pi (v'))| \\\le & {} 2\cdot \mathrm{irr}(T) + 2 \sum _{v \in V(T)}|\deg _T(v) - \delta (T)| \\= & {} 2\cdot \mathrm{irr}(T) + 2 (2m(T) - n(T) \delta (T)) \\\le & {} 2\cdot \mathrm{irr}(S_n) + 2(n-2) \\= & {} \mathrm{irr}(S_n^{\pi '}). \end{aligned}$$

In the last equality \(\pi '\) is a permutation on \(V(S_n)\) that maps the center of \(S_n\) to a leaf. Since \(S_n\) is the only tree with maximum irregularity, the right equality holds if and only if \(T=S_n\) and \(\pi \) is a permutation as just described. \(\square \)