1 Introduction

Throughout this paper, we assume that G is a connected simple graph with the vertex set \(V=\{v_1,v_2,\ldots ,v_n\}\) and size m where \(n\ge 2\). Also, it is supposed that \(\Delta =d_1\ge d_2\ge \cdots \ge d_n=\delta >0\) where \(d_i\) denotes the degree of the vertex \(v_i\in V\).

A graph invariant, or a topological index in chemical graph theory, is a numeric quantity associated with a graph which remains unchanged under graph isomorphism. A large number of topological indices have been defined in terms of vertex degrees.

The first Zagreb index, \(M_1\), defined [18] below, is actually one of the most thoroughly studied vertex-degree-based topological indices:

$$\begin{aligned} M_1=M_1(G)=\sum _{i=1}^n d_i^2. \end{aligned}$$

A modification of the first Zagreb index, defined as the sum of third powers of vertex degrees, that is

$$\begin{aligned} F = F(G) = \sum _{i=1}^n d_i^3, \end{aligned}$$

was first time encountered in 1972, in the paper [18], but was eventually disregarded. Recently, it was re-considered in [14] and named the forgotten index.

The inverse degree of a graph G, with no isolated vertices, is defined [12] as

$$\begin{aligned} ID=ID(G)=\sum _{i=1}^n \frac{1}{d_i}. \end{aligned}$$

The inverse degree first attracted attention through conjectures of the computer program Graffiti [12]. More details about the first Zagreb index, forgotten topological index and inverse degree can be found in the recent survey [3], where the mathematical properties of these indices have been summarized.

The graph G is said to be regular if \(d_1=d_2=\cdots =d_n\). A non-negative graph invariant I(G) is said to be a measure of irregularity if the following property holds: \(I(G) =0\) if and only if G is regular. A number of different irregularity measures have been proposed in the literature. A relevant list of papers concerned with various irregularity measures, but hardly exhaustive, would include [1, 2, 4, 7, 9,10,11, 16, 17, 20, 30, 32, 36, 37]. Among these irregularity measures, here, we mention only two that are of interest for the present study. The first one is the variance of the vertex degrees, proposed by Bell [4]. This irregularity measure for the graph G is defined as

$$\begin{aligned} Var(G)= \frac{1}{n}\sum _{i=1}^n \left( d_i - \frac{2m}{n} \right) ^2 = \frac{1}{n}\sum _{i=1}^n d_i^2-\left( \frac{1}{n}\sum _{i=1}^n d_i \right) ^2. \end{aligned}$$

Needless to say, \(\frac{2m}{n}\) is the average degree of G, which is equal to \(\frac{1}{n}\sum _{i=1}^n d_i\). The second one is the degree deviation, introduced by Nikiforov [32]. The degree deviation of the graph G is defined as

$$\begin{aligned} s(G)=\sum _{i=1}^n\left| d_i-\frac{2m}{n}\right| . \end{aligned}$$

It needs to be mentioned here that the degree deviation of G is actually n times the Discrepancy [21, 24, 38] of G. Some mathematical properties of the degree deviation can be found in the survey [33] and papers [8, 15, 25, 32].

In the present work we determine upper bounds for s(G) that reveal connections between s(G) and \(M_1(G)\), F(G), ID(G) and Var(G). Needless to say, the purpose of our bounds is not to gain (approximate) numerical values of s(G) of particular graphs, since their exact values are easily obtainable by direct calculation.

2 Preliminaries

In this section, we recall some known results which will be used subsequently.

Nikiforov [32] mentioned the following upper bound on the degree deviation s(G) in terms of the graph invariant Var(G) and order of G

$$\begin{aligned} s(G)\le n\sqrt{Var(G)}. \end{aligned}$$
(1)

Inequality (1) was also derived in [38], where it was shown that the equality sign in (1) holds if and only there exists a constant c such that \(|d_i -\frac{2m}{n}|=c\) for every vertex \(v_i\in V\).

In [28], the following lower bound for the first Zagreb index \(M_1(G)\) was established

$$\begin{aligned} M_1(G)\ge \frac{4m^2}{n}+\frac{1}{2}(\Delta -\delta )^2. \end{aligned}$$
(2)

In [26] (see also [5, 6]), it was proven that the equality sign in (2) holds if and only if \(d_2=d_3=\cdots =d_{n-1}=\frac{\Delta +\delta }{2}\).

In [28] (see also [5, 6, 22, 29]), the following upper bound for \(M_1(G)\) was derived

$$\begin{aligned} M_1(G)\le \frac{4m^2}{n}+\alpha (n)\cdot n(\Delta -\delta )^2, \end{aligned}$$
(3)

where

$$\begin{aligned} \alpha (n)=\frac{1}{4}\left( 1-\frac{(-1)^{n+1}+1}{2n^2} \right) \le \frac{1}{4}. \end{aligned}$$

The Jensen’s inequality [31] for real number sequences has the form mentioned in the following lemma.

Lemma 1

[31] Let \(p=(p_i)\) and \(a=(a_i)\) be positive and nonnegative real number sequences, respectively, where \(i=1,2,\ldots , n\). If r is a real number such that \(r\ge 1\) or \(r\le 0\) then

$$\begin{aligned} \sum _{i=1}^n p_ia_i^r \ge \left( \sum _{i=1}^n p_i\right) ^{1-r} \left( \sum _{i=1}^n p_ia_i\right) ^{r}\,, \end{aligned}$$
(4)

with equality if and only if either \(r=0\), or \(r=1\), or \(a_1=a_2=\cdots = a_n\). If \(0\le r\le 1\), then Inequality (4) is reversed.

Lemma 2

[34] Let \(x=(x_i)\) and \(a=(a_i)\) be positive real number sequences where \(i=1,2,\ldots ,n\). If r is a non-negative real number then it holds that

$$\begin{aligned} \sum _{i=1}^n \frac{x_i^{r+1}}{a_i^r}\ge \frac{\left( \sum _{i=1}^n x_i\right) ^{r+1}}{\left( \sum _{i=1}^n a_i\right) ^r}\,, \end{aligned}$$
(5)

with equality if and only if \(r=0\) or \(\frac{x_1}{a_1}=\frac{x_2}{a_2}=\cdots =\frac{x_n}{a_n}\) .

3 Main results

Firstly, we establish an upper bound on degree deviation s(G) in terms of graph invariants n, m, \(\Delta \), \(\delta \) and Var(G).

Theorem 1

For \(n\ge 2\), if G is a simple connected graph with order n, size m, minimum degree \(\delta \), maximum degree \(\Delta \) and variance of vertex degrees Var(G) then

$$\begin{aligned} {\begin{matrix} s(G) \le \min &{} \left\{ \Delta -\frac{2m}{n}+\sqrt{(n-1)\left( n\cdot Var(G)-\left( \Delta -\frac{2m}{n}\right) ^2 \right) },\right. \\ &{}\left. \ \ \ \frac{2m}{n}-\delta +\sqrt{(n-1)\left( n \cdot Var(G)-\left( \frac{2m}{n}-\delta \right) ^2 \right) }\right\} . \end{matrix}} \end{aligned}$$
(6)

Equality in (6) holds if and only if there exists a constant “c” such that \(\left| d_i-\frac{2m}{n} \right| =c\) for every \(i\in \{2,3,\ldots ,n\}\) or for every \(i\in \{1,2,\ldots ,n-1\}\).

Proof

For \(r=2\), \(p_i=1\), \(i=2,3,\ldots ,n\), the Inequality (4) can be rewritten as

$$\begin{aligned} (n-1)\sum _{i=2}^n a_i^2 \ge \left( \sum _{i=2}^n a_i\right) ^{2}. \end{aligned}$$
(7)

For \(a_i=\left| d_i-\frac{2m}{n} \right| \), \(i=2,3,\ldots ,n\), the above inequality becomes

$$\begin{aligned} (n-1)\sum _{i=2}^n \left( d_i-\frac{2m}{n} \right) ^2 \ge \left( \sum _{i=2}^n \left| d_i-\frac{2m}{n} \right| \right) ^{2}, \end{aligned}$$

that is

$$\begin{aligned} (n-1)\left( \sum _{i=1}^n \left( d_i-\frac{2m}{n} \right) ^2-\left( \Delta -\frac{2m}{n}\right) ^2\right) \ge \left( s(G)-\left( \Delta -\frac{2m}{n}\right) \right) ^{2}. \end{aligned}$$
(8)

Using the relation

$$\begin{aligned} 0\le \sum _{i=1}^n \left( d_i-\frac{2m}{n} \right) ^2=M_1(G)-\frac{4m^2}{n}=n\cdot Var(G), \end{aligned}$$

in (8), we get

$$\begin{aligned} s(G)\le \Delta -\frac{2m}{n}+\sqrt{(n-1)\left( n\cdot Var(G)-\left( \Delta -\frac{2m}{n}\right) ^2 \right) }. \end{aligned}$$
(9)

In a similar way, starting with the inequality

$$\begin{aligned} (n-1)\sum _{i=1}^{n-1} a_i^2 \ge \left( \sum _{i=1}^{n-1} a_i\right) ^{2}, \end{aligned}$$

we obtain

$$\begin{aligned} s(G)\le \frac{2m}{n}-\delta +\sqrt{(n-1)\left( n\cdot Var(G)-\left( \frac{2m}{n}-\delta \right) ^2 \right) }. \end{aligned}$$
(10)

From Inequalities (9) and (10), Inequality (6) follows.

Now, we consider the equality case in (6). We note that the equality sign in (7) holds if and only if \(a_2=a_3=\cdots =a_n\), which implies that the equality sign in (9) holds if and only if there exist a constant \(c'\) such that \(\left| d_i-\frac{2m}{n} \right| =c'\) for every \(i\in \{2,3,\ldots ,n\}\). Similarly, the equality sign in (10) holds if and only if there exists a constant \(c''\) such that \(\left| d_i-\frac{2m}{n} \right| =c''\) for every \(i\in \{1,2,\ldots ,n-1\}\). Therefore, the equality sign in (6) holds if and only if there exists a constant c such that \(\left| d_i-\frac{2m}{n} \right| =c\) for every \(i\in \{2,3,\ldots ,n\}\) or for every \(i\in \{1,2,\ldots ,n-1\}\). \(\square \)

From (3), it follows that

$$\begin{aligned} Var(G)\le \alpha (n)\cdot (\Delta -\delta )^2. \end{aligned}$$
(11)

By using Inequality (11) in (6), we get the next result.

Corollary 1

For \(n\ge 2\), if G is a simple connected graph with order n, size m, minimum degree \(\delta \) and maximum degree \(\Delta \) then

$$\begin{aligned} {\begin{matrix} s(G) \le \min &{} \left\{ \Delta -\frac{2m}{n}+\sqrt{(n-1)\left( \alpha (n)\cdot n(\Delta -\delta )^2-\left( \Delta -\frac{2m}{n}\right) ^2 \right) },\right. \\ &{}\left. \ \ \ \frac{2m}{n}-\delta +\sqrt{(n-1)\left( \alpha (n)\cdot n(\Delta -\delta )^2-\left( \frac{2m}{n}-\delta \right) ^2 \right) }\right\} , \end{matrix}} \end{aligned}$$

with equality if and only if G is a regular graph, where

$$\begin{aligned} \alpha (n)=\frac{1}{4}\left( 1-\frac{(-1)^{n+1}+1}{2n^2} \right) . \end{aligned}$$

Remark 1

Inequality (11) is stronger than the inequality \( Var(G)\le \frac{(\Delta -\delta )^2}{4}\,, \) which was proven in [23] (see also [13]).

Theorem 2

For \(n\ge 2\), if G is a simple connected graph with order n, size m, forgotten topological index F(G), inverse degree ID(G) and variance of vertex degrees Var(G) then

$$\begin{aligned} s(G)\le \sqrt{ID(G) \cdot \left( F(G)-4m \cdot Var(G)-\frac{8m^3}{n^2} \right) }. \end{aligned}$$
(12)

Equality sign in (12) holds if and only if there exists a constant “c” such that \(d_i\left| d_i-\frac{2m}{n} \right| =c\) for every \(i\in \{1,2,\ldots ,n\}\).

Proof

For \(r=1\), \(x_i=\left| d_i-\frac{2m}{n}\right| \), \(a_i=\frac{1}{d_i}\), \(i=1,2,\ldots ,n\), Inequality (5) transforms into

$$\begin{aligned} \sum _{i=1}^{n}d_i\left( d_i-\frac{2m}{n}\right) ^2\ge \frac{\Big (\sum _{i=1}^{n}\left| d_i-\frac{2m}{n}\right| \Big )^2}{\sum _{i=1}^{n}\frac{1}{d_i}}=\frac{\big (s(G)\big )^2}{ID(G)}. \end{aligned}$$
(13)

Now, using fact that

$$\begin{aligned} {\begin{matrix} 0&{}\le \sum _{i=1}^{n}d_i\left( d_i-\frac{2m}{n}\right) ^2=\sum _{i=1}^{n}d_i^3-\frac{4m}{n}\sum _{i=1}^{n}d_i^2+ \frac{4m^2}{n^2}\sum _{i=1}^nd_i\\ &{}=F(G)-4m\left( \frac{M_1(G)}{n}-\frac{4m^2}{n^2}\right) -\frac{8m^3}{n^2}=F(G)-4m\cdot Var(G)-\frac{8m^3}{n^2}, \end{matrix}} \end{aligned}$$

in (13), we arrive at Inequality (12).

Since \(r=1\ne 0\), equality sign in (5) holds if and only if \(\frac{x_1}{a_1}=\frac{x_2}{a_2}=\cdots =\frac{x_n}{a_n}\), which implies that the equality sign in (13), that is in (12), holds if and only if there exists a constant “c” such that \(d_i\left| d_i-\frac{2m}{n} \right| =c\) for every \(i\in \{1,2,\ldots ,n\}\). \(\square \)

From (2), it follows (see [19]) that \( Var(G)\ge \frac{(\Delta -\delta )^2}{2n}, \) and hence we have the next result as a direct consequence of Theorem 2.

Corollary 2

For \(n\ge 2\), if G is a simple connected graph with order n, size m, forgotten topological index F(G) and inverse degree ID(G) then

$$\begin{aligned} s(G)\le \sqrt{ID(G) \left( F(G)-\frac{2m}{n} (\Delta -\delta )^2-\frac{8m^3}{n^2} \right) }\,, \end{aligned}$$

with equality if and only if G is a regular graph.

Theorem 3

For \(n\ge 2\), if G is a simple connected graph with order n, size m and inverse degree ID(G) then

$$\begin{aligned} s(G)\le \frac{2m}{n}\sqrt{2m\cdot ID(G) -n^2}\,, \end{aligned}$$
(14)

with equality if and only if there is a constant “c” such that \(\frac{\left| d_i-\frac{2m}{n} \right| }{d_i}=c\) for every \(i\in \{1,2,\ldots ,n\}\).

Proof

For \(r=1\), \(x_i=\left| d_i-\frac{2m}{n}\right| \), \(a_i=d_i\), \(i=1,2,\ldots ,n\), Inequality (5) becomes

$$\begin{aligned} \sum _{i=1}^{n}\frac{\left( d_i-\frac{2m}{n}\right) ^2}{d_i}\ge \frac{\Big (\sum _{i=1}^{n}\left| d_i-\frac{2m}{n}\right| \Big )^2}{\sum _{i=1}^{n}d_i}=\frac{\big (s(G)\big )^2}{2m}\,. \end{aligned}$$
(15)

Now, using the relation

$$\begin{aligned} {\begin{matrix} 0&{}\le \sum _{i=1}^{n}\frac{\left( d_i-\frac{2m}{n}\right) ^2}{d_i}=\sum _{i=1}^{n}d_i-4m+\frac{4m^2}{n^2}\sum _{i=1}^{n}\frac{1}{d_i}\\ &{}=\frac{4m^2}{n^2}ID(G)-2m=\frac{2m}{n^2}\left( 2m\cdot ID(G)-n^2 \right) , \end{matrix}} \end{aligned}$$

in (15), we get (14).

Since \(r=1\ne 0\), equality sign in (5) holds if and only if \(\frac{x_1}{a_1}=\frac{x_2}{a_2}=\cdots =\frac{x_n}{a_n}\), from which it follows that the equality sign in (15), that is in (14), holds if and only if there is a constant c such that \(\frac{\left| d_i-\frac{2m}{n} \right| }{d_i}=c\) for every \(i\in \{1,2,\ldots ,n\}\). \(\square \)

In [27] (see also [35]), it was proven that \( ID(G)\le \frac{n(\Delta +\delta )-2m}{\Delta \delta }\,. \) Therefrom we have the following corollary of Theorem 3.

Corollary 3

For \(n\ge 2\), if G is a simple connected graph with order n, size m, minimum degree \(\delta \) and maximum degree \(\Delta \) then

$$\begin{aligned} s(G)\le \frac{2m}{n}\sqrt{\frac{2m(n(\Delta +\delta )-2m)-n^2\Delta \delta }{\Delta \delta }}\,, \end{aligned}$$

with equality if and only if G is a regular or semiregular \((\Delta ,\delta )\)-bipartite graph.

The proof of next result is fully analogous to that of Theorem 3 and hence omitted.

Theorem 4

For \(n\ge 2\), if G is a simple connected graph with order n, size m, minimum degree \(\delta \), maximum degree \(\Delta \) and inverse degree ID(G) then

$$\begin{aligned} {\begin{matrix} s(G) \le \min &{} \left\{ \Delta -\frac{2m}{n}+\sqrt{(2m-\Delta )\left( \frac{4m^2}{n^2}ID(G)-2m-\frac{\left( \Delta -\frac{2m}{n}\right) ^2}{\Delta } \right) },\right. \\ &{}\left. \ \ \ \frac{2m}{n}-\delta +\sqrt{(2m-\delta )\left( \frac{4m^2}{n^2}ID(G)-2m-\frac{\left( \frac{2m}{n}-\delta \right) ^2}{\delta } \right) }\right\} \,, \end{matrix}} \end{aligned}$$

with equality if and only if there is a constant “c” such that \(\frac{\left| d_i-\frac{2m}{n} \right| }{d_i}=c\) either for every \(i\in \{2,3,\ldots ,n\}\) or for every \(i\in \{1,2,\ldots ,n-1\}\).

Remark 2

It can be easily checked that Inequality (6) is stronger than (1) for nonregular graphs. However, Inequalities (1), (12) and (14) are incomparable; for example, Inequality (1) is stronger than Inequalities (12) and (14) if \(G\cong C_{n-1}+e\), (12) is stronger than (1) and (14) if \(G\cong P_n\), and Inequality (14) is stronger than (1) and (12) if \(G\cong K_{1,n-1}\), where \(C_{n-1}+e\) is the graph obtained from the cycle graph on \(n-1\) vertices by adding an edge.