1 Introduction

Let \(G=(V,E)\) be a simple graph with the sets of vertices (nodes) and edges denoted by V and E, respectively. Graph G is complete if it has all possible edges, i.e., \((i,j)\in E\) for any \(i, j\in V \; (i\ne j)\). For any subset \(S\subseteq V\), \(G[S]=(S, (S\times S) \cap E)\) denotes the subgraph induced by S in G. A clique C is a subset of V such that G[C] is a complete graph [30]. The maximum clique problem is to find a clique of maximum cardinality in G [12, 35]. This problem is known to be NP-hard [20]. The size of the maximum clique in G is denoted by \(\omega (G)\) and is referred to as the clique number of G.

The concept of a clique is used in a number of application areas due to its elegance and inherent ability to logically represent cohesive subgroups (also, referred to as clusters), of “tightly knit” elements (i.e., nodes) of complex systems modeled as a graph [12, 14]. Indeed, cliques have a number of ideal cohesiveness properties [37]. For example, each vertex is connected to all other vertices in a clique, the distance between any pair of vertices in a clique is one, a clique has maximum possible edge density, etc. However, in many real-life applications, using cliques for discovering large cohesive clusters is impractical due to the fact that the definition of a clique is rather idealistic and, thus, can be too limiting. Consequently, a number of clique relaxation definitions has appeared in the literature in recent years, see, e.g., [6, 7], a unifying taxonomic framework in [37], and references therein.

In particular, one of the most popular and widely applied clique relaxation models is the \(\gamma \)-quasi-clique, an edge-based clique relaxation defined as a subset \(S\subseteq V\) such that the subgraph G[S] induced by S in G has the edge density of at least \(\gamma \), that is, \(\rho (G[S])=|(S\times S) \cap E|/ {|S| \atopwithdelims ()2}\ge \gamma \), where \(\gamma \in (0,1]\) is a fixed constant parameter [2]. The problem of finding a maximum \(\gamma \)-quasi-clique is known to be NP-hard for any fixed \(\gamma \in (0,1]\), see [36]. The cardinality of a maximum \(\gamma \)-quasi-clique in G is denoted by \(\omega _\gamma (G)\). Clearly, \(\gamma =1\) corresponds to the clique and \(\omega _1(G)=\omega (G)\).

The popularity of the \(\gamma \)-quasi-clique can be attributed to the fact that the underlying concept is rather intuitive and relatively simple. Moreover, missing edges (i.e., links in the networked system under consideration) in dense clusters can often be justified by measurement errors in real-life data sets. For example, as discussed in [50], in some biological experiments there is “a higher absolute degree of confidence when an interaction is observed, but a much lower degree when no interaction is detected.”

The concept of the \(\gamma \)-quasi-clique is further generalized using the notion of the f(k)-dense-subgraph, defined as a k-vertex subset \(S\subseteq V\) such that subgraph G[S] induced by S in G contains at least f(k) edges, where \(f: {\mathbb {Z}}_+\rightarrow {\mathbb {R}}_+\) is some fixed function. Observe that if \(f(k)=\gamma k(k - 1)/2\) then the f(k)-dense-subgraph is equivalent to the \(\gamma \)-quasi-clique. It is known that the problem of checking whether the graph contains a k-vertex f(k)-dense-subgraphs is NP-complete if

  • \(f(k)={\varTheta }(k^{1+\varepsilon })\), where \(\varepsilon \in (0,1)\) [4];

  • \(f(k)=k+{\varOmega }(k^\varepsilon )\), where \(\varepsilon \in (0,1)\) [24].

Moreover, the second result is “sharp” in the sense that the problem becomes polynomially solvable for \(f(k)=k+c\) for any constant c [24].

The concept of f(k)-dense-subgraphs encompasses other edge-based clique relaxation models from the literature. For instance, if one sets \(f(k)=k(k - 1)/2-s\), then the resulting subset of vertices is known as an s-defective clique, formally defined as a subset \(S\subseteq V\) such that the induced subgraph G[S] has at most s missing edges. Furthermore, \(f(k)=k(k-s)/2\) corresponds to an average s-plex, which is a statistical clique relaxation defined as a subset \(S\subseteq V\) such that the average degree of vertices in G[S] is at least \(|S|-s\). We refer the reader to [21, 37] for a more detailed discussion of these clique relaxation models.

The problem of finding large dense subgraphs naturally arises in a number of application areas, including biology [5, 9, 13, 23, 25, 31, 38, 42], social networks analysis [16, 17, 39, 46, 47], telecommunication [1, 2] and finance [10, 11, 26, 39, 41]. Nevertheless, the literature on exact computational methods for this class of problems is extremely sparse, and most of the focus has been on the development and application of heuristic methods, see, e.g., [1, 2]. In particular, to the best of our knowledge, there are no exact approaches for finding maximum \(f(\cdot )\)-dense subgraphs for a general function \(f(\cdot )\). With respect to the maximum \(\gamma \)-quasi-clique problem, there are only two related papers dealing with exact methods. Namely,

  1. (i)

    two mixed integer programming (MIP) models are proposed in [36] (we review them in Sect. 2.1), and

  2. (ii)

    the work in [34] describes a combinatorial branch-and-bound (B&B) algorithm and compares its performance against an exact MIP solver with the models from [36] (we provide some additional discussion on the efficiency of the method in Sect. 4).

One can argue that relative scarcity of exact methods can be attributed to the fact that \(\gamma \)-quasi-cliques are not hereditary (i.e., a subset of a \(\gamma \)-quasi-clique is not necessarily a \(\gamma \)-quasi-clique), which “introduces interesting challenges in the development of exact algorithms” [34] and preprocessing techniques. In contrast, there exist very effective exact solvers for finding maximum cliques, e.g., [33], and maximum subgraphs that satisfy a given hereditary property [44], which heavily exploit the hereditary property in their algorithmic design. Additionally, one should mention about a considerable body of work on bounds for the clique number \(\omega (G)\), in particular those that are computable in polynomial time; see a detailed discussion in [12]. Such bounds can be exploited within exact and heuristic solution approaches. A notable example includes the celebrated Lovász number \(\vartheta (\bar{G})\) [29], which is computable in polynomial time, e.g., by using semidefinite programming methods [28].

In view of the discussion above, the contributions of this paper are as follows:

  1. (i)

    We propose four new MIP models for solving the maximum \(\gamma \)-quasi-clique problem (Sect. 2.2). We provide theoretical analysis of the quality of their LP relaxations and demonstrate that the proposed models result in much stronger LP relaxations than previous MIPs from [36] for sufficiently sparse graphs (Sect. 2.3). Additionally, we describe two easily implementable iterative methods that solve a sequence of feasibility MIPs, obtained by fixing the values for some of the variables in the proposed MIP models (Sect. 2.4).

  2. (ii)

    We demonstrate that our MIP models can be generalized (in a rather simple manner, see Sect. 3) to find maximum \(f(\cdot )\)-dense subgraphs for any nonnegative function \(f(\cdot )\), including the two notable examples discussed above, namely, the s-defective clique and the average s-plex. Furthermore, our theoretical results regarding the quality of their LP relaxations established for \(\gamma \)-quasi-cliques can also be extended (admittedly, under some mild conditions).

  3. (iii)

    Finally, our computational experiments (see Sect. 4) using real-life test instances (including social, biological and communication networks) demonstrate that the proposed solution methods for finding a maximum \(\gamma \)-quasi-clique outperform previous approaches (specifically, MIPs from [36]) for sufficiently sparse graphs, which provides an experimental illustration of our theoretical results. We should emphasize here that the vast majority of real-life graphs, including those used in this paper, are rather sparse.

2 MIP models

2.1 Known formulations from [36]

For each vertex \(i\in V\), we define a binary variable \(x_i\) such that \(x_i=1\) iff \(i\in S\), where \(S\subseteq V\). Clearly, S is a \(\gamma \)-quasi-clique if the following condition holds:

$$\begin{aligned} \sum _{(i,j)\in E} x_ix_j\ge \gamma \sum \limits _{i,j\in V, \ i<j} x_{i}x_j, \end{aligned}$$
(1)

where the left- and right-hand sides of constraint (1) represent the number of edges in G[S] and the \(\gamma \)-fraction of the maximum possible number of edges in G[S], respectively.

Observe that constraint (1) is nonlinear. However, it can be linearized (see, e.g., discussion and references in [3]), which results in two linear MIP models proposed in [36]. Specifically, the first formulation is based on introducing a new variable \(y_{ij}=x_ix_j\) for each i and \(j\in V\), \(i<j\), and is given by:

Model 1

(F1)

$$\begin{aligned}&\omega _\gamma (G)=\max \limits _{\mathbf {x},\mathbf {y}}\quad \sum \limits _{i \in V} x_i \end{aligned}$$
(2a)
$$\begin{aligned}&s.t.\quad \sum \limits _{(i,j)\in E} y_{ij} \ge \gamma \sum \limits _{i,j\in V, \ i<j} y_{ij}, \end{aligned}$$
(2b)
$$\begin{aligned}&y_{ij}\le x_i,\quad y_{ij}\le x_j,\quad y_{ij}\ge x_i+x_j-1, \;\;\; \forall i,j\in V,\ i<j, \end{aligned}$$
(2c)
$$\begin{aligned}&x_i \in \{0,1\},\; y_{ij}\ge 0, \;\;\; \forall i,j \in V, \ i<j, \end{aligned}$$
(2d)

where constraints (2c) ensure that the linearization of the nonlinear term \(y_{ij}=x_ix_j\) is valid. Model F1 requires a number |V| of binary and \({\varTheta }(|V|^2)\) of continuous variables.

The second MIP is based on introducing a new variable of the form

$$\begin{aligned} u_i=x_i\Big (\gamma x_i+\sum _{j\in V}(\mathbbm {1}_{(i,j)\in E}-\gamma ) x_j\Big ) \end{aligned}$$
(3)

for each \(i\in V\), and is given by:

Model 2

(F2)

$$\begin{aligned}&\omega _\gamma (G)=\max \limits _{\mathbf {u},\mathbf {x}}\quad \sum \limits _{i\in V} x_i \end{aligned}$$
(4a)
$$\begin{aligned}&s.t.\quad \sum \limits _{i\in V} u_{i} \ge 0, \end{aligned}$$
(4b)
$$\begin{aligned}&u_i\le Mx_i, \;\;\; \forall i \in V, \end{aligned}$$
(4c)
$$\begin{aligned}&u_i\ge -Mx_i, \;\;\; \forall i \in V, \end{aligned}$$
(4d)
$$\begin{aligned}&u_i\ge \gamma x_i+\sum \limits _{j\in V}(\mathbbm {1}_{(i,j)\in E}-\gamma ) x_j -M(1-x_i), \;\;\; \forall i \in V, \end{aligned}$$
(4e)
$$\begin{aligned}&u_i\le \gamma x_i+\sum \limits _{j\in V}(\mathbbm {1}_{(i,j)\in E}-\gamma ) x_j +M(1-x_i), \;\;\; \forall i \in V, \end{aligned}$$
(4f)
$$\begin{aligned}&x_i \in \{0,1\}, \;\;\; \forall i \in V, \end{aligned}$$
(4g)

where M is a sufficiently large constant, e.g., \(M\ge |V|\), symbol \(\mathbbm {1}\) denotes the standard indicator function (i.e., in (4e) and (4f) it returns 1 iff \((i,j)\in E\)), and constraints (4c)–(4f) ensure that the linearization of the nonlinear term (3) is valid. Model F2 requires |V| binary and |V| continuous variables. Note that model F2 requires less variables than F1. However, the results of computational experiments reported in [36] indicate that, in general, neither of the models is dominated by the other one (both with respect to the quality of their LP relaxation bounds and the performance of commercial MIP solvers when solving the problem exactly).

2.2 New formulations

2.2.1 Quasi-clique size decomposition

Let \(\omega ^{u}\) and \(\omega ^\ell \) be some upper and lower bounds on the size of a maximum \(\gamma \)-quasi-clique in G, respectively. The lower bound can be set to 1 if there is no information available about the sizes of \(\gamma \)-quasi-cliques in G. On the other hand, the value of \(\omega ^\ell \) can be increased using the size of some heuristically identified quasi-clique, e.g., it can be set to be the size of any known (possibly, maximum) clique in G. The upper bound \(\omega ^u\) can be simply set to |V|, or we can use the result from [36] given by:

$$\begin{aligned} \omega ^u=\left\lfloor \frac{1}{2}+\frac{1}{2}\sqrt{1+8\frac{|E|}{\gamma }}\right\rfloor . \end{aligned}$$
(5)

It is easy to verify that if \(\omega ^u\ge |V|\) in (5), then \(|E|\ge \gamma \frac{|V|(|V|-1)}{2}\), i.e., graph G is a \(\gamma \)-quasi-clique. We should also note that in case of very large graphs, in order to derive some non-trivial lower and upper bounds, one can exploit asymptotic results regarding the size of the maximum \(\gamma \)-quasi-clique available for some classes of graphs, see, e.g., recent work in [46].

Next, we redefine \(y_{ij}\) for each \((i,j)\in E\) to be a binary variable such that \(y_{ij}=1\) iff \((i,j)\in E\cap (S\times S)\), i.e., an edge (ij) is in a subgraph G[S]. Also, define \(z_k\), \(k=1,\dots , |V|\), to be a set of binary variables that determine the size of S, namely, \(z_k=1\) iff \(|S|=k\). Using this notation, we propose the following formulation for finding a maximum \(\gamma \)-quasi-clique based on the classical value-disjunction idea (see, e.g., [32]), which is applied to the size of a maximum \(\gamma \)-quasi-clique:

Model 3

(F3)

$$\begin{aligned}&\omega _\gamma (G)=\max \limits _{\mathbf {x},\mathbf {y},\mathbf {z}}\quad \sum \limits _{i\in V} x_i \end{aligned}$$
(6a)
$$\begin{aligned}&s.t.\quad \sum \limits _{(i,j)\in E} y_{ij} \ge \gamma \sum \limits _{k=\omega ^\ell }^{\omega ^u} \frac{k(k-1)}{2}z_k, \end{aligned}$$
(6b)
$$\begin{aligned}&y_{ij}\le x_i, \quad y_{ij}\le x_j, \;\;\; \forall (i,j) \in E, \end{aligned}$$
(6c)
$$\begin{aligned}&\sum \limits _{i\in V} x_i = \sum \limits _{k=\omega ^\ell }^{\omega ^u} kz_k,\quad \sum \limits _{k=\omega ^\ell }^{\omega ^u} z_k=1, \end{aligned}$$
(6d)
$$\begin{aligned}&x_i\in \{0,1\},\ y_{ij}\ge 0, \;\;\; \forall i,j\in V,\ i<j, \end{aligned}$$
(6e)
$$\begin{aligned}&z_k \ge 0, \;\;\; \forall k\in \{\omega ^\ell ,\ldots ,\omega ^u\}, \end{aligned}$$
(6f)

where constraints (6c) ensure that \(y_{ij}\) can be set to 1 only if both vertices i and j are in S, i.e., \(x_i=x_j=1\). Constraint (6b) represents the edge density requirements for the induced subgraph G[S], while constraints (6d) enforce the proper value in the right hand-side of (6b). Clearly, variables \(y_{ij}\) can be relaxed to be continuous due to the structure of (6b) and (6c) and the fact that (6a) involves maximization of a linear function of \(x_i\), \(i\in V\), with positive coefficients. Note that the binary restrictions for \(z_k\)’s are replaced by nonnegativity in constraint (6f). The following proposition shows that this relaxation is valid.

Proposition 1

There exists an optimal solution \((\mathbf {x}^*,\mathbf {y}^*,\mathbf {z}^*)\) of MIP F3 such that \(\mathbf {z}^*\) is a binary vector.

Proof

Consider F3 without integrality restrictions for \(z_k\), \(k\in \{\omega ^\ell ,\ldots ,\omega ^u\}\). Suppose its optimal solution is given by \((\mathbf {x}^*,\mathbf {y}^*,\bar{\mathbf {z}})\), where \(\bar{\mathbf {z}}\) is not a 0–1 vector. Define \(\mathbf {z^*}=(z^*_{\omega ^\ell },\dots , z^*_{\omega ^u})\) as follows:

$$\begin{aligned} z^*_k= {\left\{ \begin{array}{ll} 1,\text { if }\sum \limits _{i\in V} x^*_i=k, \\ 0, \text { if }\sum \limits _{i\in V} x^*_i\ne k. \end{array}\right. } \end{aligned}$$
(7)

Clearly, \((\mathbf {x}^*,\mathbf {y}^*,\mathbf {z}^*)\) satisfies constraints (6c) and (6d). In particular,

$$\begin{aligned} \sum \limits _{k=\omega ^\ell }^{\omega ^u} kz^*_k=\sum \limits _{k=\omega ^\ell }^{\omega ^u} k\bar{z}_k=\sum \limits _{i\in V} x^*_i\quad \text{ and }\quad \sum \limits _{k=\omega ^\ell }^{\omega ^u} z_k^*=1 \end{aligned}$$
(8)

by our construction. Then

$$\begin{aligned} \sum \limits _{(i,j)\in E} y^*_{ij}&\ge \frac{\gamma }{2} \sum \limits _{k=\omega ^\ell }^{\omega ^u} k(k-1)\bar{z}_k \ge \frac{\gamma }{2} \left( \sum \limits _{k=\omega ^\ell }^{\omega ^u} k \bar{z}_k\right) \left( \sum \limits _{k=\omega ^\ell }^{\omega ^u} k \bar{z}_k-1\right) \\&=\frac{\gamma }{2} \left( \sum \limits _{k=\omega ^\ell }^{\omega ^u} k z^*_k\right) \left( \sum \limits _{k=\omega ^\ell }^{\omega ^u} k z^*_k-1\right) =\frac{\gamma }{2} \sum \limits _{k=\omega ^\ell }^{\omega ^u} k(k-1){z}^*_k, \end{aligned}$$

where the first inequality holds by the definition of \((\mathbf {x}^*,\mathbf {y}^*,\bar{\mathbf {z}})\), the second inequality holds by Jensen’s inequality (see, e.g., [22], and note that function \(f(k)=k(k-1)\) is convex) and the last two equalities follow from (8) and the fact that \(\mathbf {z}^*\) is a binary vector by construction. Therefore, \((\mathbf {x}^*,\mathbf {y}^*,\mathbf {z}^*)\) satisfies (6b) and is an optimal solution of F3. \(\square \)

To derive the next MIP model, we use an idea similar to the one behind F2. Note that \(y_{ij}=x_ix_j\) for all \((i,j)\in E\). Thus, the left-hand side of constraint (6b) can be rewritten as

$$\begin{aligned} \sum \limits _{(i,j)\in E} y_{ij} =\frac{1}{2}\sum \limits _{i \in V} \sum \limits _{j:\ (i,j)\in E} x_{i}x_j =\frac{1}{2}\sum \limits _{i \in V}x_{i} \sum \limits _{j:\ (i,j)\in E} x_{j}. \end{aligned}$$

Defining a new set of variables \(v_i\), \(i\in V\), such that

$$\begin{aligned} v_i=x_{i} \sum \limits _{j:\ (i,j)\in E} x_{j}, \end{aligned}$$
(9)

we obtain:

Model 4

(F4)

$$\begin{aligned}&\omega _\gamma (G)=\max \limits _{\mathbf {x},\mathbf {v},\mathbf {z}}\quad \sum \limits _{i\in V} x_i \end{aligned}$$
(10a)
$$\begin{aligned}&s.t.\quad \sum \limits _{i \in V}v_i \ge \gamma \sum \limits _{k=\omega ^\ell }^{\omega ^u} {k(k-1)}z_k, \end{aligned}$$
(10b)
$$\begin{aligned}&v_i\le \mu _i x_i, \quad v_{i}\le \sum \limits _{j:\ (i,j)\in E} x_{j}, \;\;\; \forall i \in V, \end{aligned}$$
(10c)
$$\begin{aligned}&\sum \limits _{i\in V} x_i = \sum \limits _{k=\omega ^\ell }^{\omega ^u} kz_k,\quad \sum \limits _{k=\omega ^\ell }^{\omega ^u} z_k=1, \end{aligned}$$
(10d)
$$\begin{aligned}&x_i\in \{0,1\},\ v_{i}\ge 0, \;\;\; \forall i\in V, \end{aligned}$$
(10e)
$$\begin{aligned}&z_k\ge 0, \;\;\; \forall k\in \{\omega ^\ell ,\ldots ,\omega ^u\}, \end{aligned}$$
(10f)

where \(\mu _i\) is a sufficiently large constant parameter. In particular, we let \(\mu _i=deg_G(i)\), where \(deg_G(i)\) denotes the degree of vertex i, which is its number of neighbors in G. Constraints (10c) ensure that the linearization of (9) is valid and \(v_i\) can be set to \(\sum _{j:\ (i,j)\in E} x_{j}\) only if \(i\in S\), i.e., \(x_i=1\). Just like in formulation F3, the integrality restrictions for variables \(z_k\) are relaxed in (10f). We can show that there is always an optimal solution with \(z_k\in \{0,1\}\) for all k similarly to how it was done in Proposition 1.

Note that one could easily generalize both models F3 and F4 to consider positive vertex weights in their objectives. In terms of the number of variables, F3 needs |V| binary and \(O(|V|+|E|)\) continuous variables, while F4 requires |V| binary and O(|V|) continuous variables.

2.2.2 Logarithmic reduction

Observe that MIPs F3 and F4 include \(\omega ^u\) variables \(z_i\), \(i\in \{1,\dots ,\omega ^u\}\) in the worst case (if a nontrivial lower bound is not known, i.e., \(\omega ^\ell \) is set to 1). However, this number can be reduced to \(\lfloor \log _2\omega ^u+1\rfloor +\lfloor \log _2\omega ^u+1\rfloor ^2\) by using the standard logarithmic reformulation technique [27, 32]. Specifically, let \(t_k\), \(k\in \{0,\dots ,\lfloor \log _2 \omega ^u\rfloor \}\), be binary variables such that

$$\begin{aligned} \sum \limits _{i\in V} x_i=\sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } 2^k t_k, \end{aligned}$$
(11)

which implies that

$$\begin{aligned} \begin{aligned} \left( \sum \limits _{i\in V} x_i\right) ^2&=\left( \sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } 2^k t_k\right) ^2=\sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } \sum \limits _{\ell =0}^{\lfloor \log _2\omega ^u\rfloor } 2^{k+\ell } t_kt_\ell \nonumber \\&=\sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } \sum \limits _{\ell =0}^{\lfloor \log _2\omega ^u\rfloor }2^{k+\ell } s_{k\ell }, \end{aligned} \end{aligned}$$

where \(s_{k\ell }=t_kt_\ell \) for \(k,\ell \in \{0,\dots ,\lfloor \log _2\omega ^u\rfloor \}\). Then the right-hand side of constraint (6b) can be rewritten as

$$\begin{aligned} \gamma \frac{\sum \limits _{i\in V} x_i\left( \sum \limits _{i\in V} x_i-1\right) }{2}&=\frac{\gamma }{2}\left( \left( \sum \limits _{i\in V} x_i\right) ^2-\sum \limits _{i\in V} x_i\right) \nonumber \\&=\frac{\gamma }{2}\left( \sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } \sum \limits _{\ell =0}^{\lfloor \log _2\omega ^u\rfloor } 2^{k+\ell } s_{k\ell }-\sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } 2^k t_k\right) . \end{aligned}$$
(12)

Using (11) and (12), model F3 can be modified as follows:

Model 5

(F3log)

$$\begin{aligned}&\omega _\gamma (G)=\max \limits _{{\mathbf {s},\mathbf {t},\mathbf {x},\mathbf {y}}}\quad \sum \limits _{i\in V} x_i \end{aligned}$$
(13a)
$$\begin{aligned}&{s.t.}\quad \sum \limits _{(i,j)\in E} y_{ij} \ge \frac{\gamma }{2}\left( \sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor }\sum \limits _{\ell =0}^{\lfloor \log _2\omega ^u\rfloor } 2^{k+\ell } s_{k\ell }-\sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } 2^k t_k\right) , \end{aligned}$$
(13b)
$$\begin{aligned}&y_{ij}\le x_i, \quad y_{ij}\le x_j, \;\;\; \forall (i,j) \in E, \end{aligned}$$
(13c)
$$\begin{aligned}&\sum \limits _{i\in V} x_i = \sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } 2^k t_k, \end{aligned}$$
(13d)
$$\begin{aligned}&s_{k\ell }\le t_k, \quad s_{k\ell }\le t_\ell , \quad s_{k\ell }\ge t_k+t_\ell -1, \;\;\; \forall k,\ell \in \{0,\dots , \lfloor \log _2\omega ^u\rfloor \}, \end{aligned}$$
(13e)
$$\begin{aligned}&s_{k\ell }, \ t_k,\ x_i \in \{0,1\}, \;\;\; \forall k,\ell \in \{0,\dots ,\lfloor \log _2\omega ^u\rfloor \},\ i\in V, \end{aligned}$$
(13f)
$$\begin{aligned}&y_{ij}\ge 0, \;\;\; i,j\in V,\ i<j, \end{aligned}$$
(13g)

where constraints (13e) ensure that the linearization of the nonlinear term \(s_{k\ell }=t_kt_\ell \) is valid. In fact, due to the structure of (13e) variables \(s_{k\ell }\) can be relaxed to be nonnegative continuous.

Finally, we note that, using equalities (11) and (12), formulation F4 can be modified in a similar manner. The resulting formulation is omitted for brevity. However, in the remainder in the paper we refer to the corresponding MIP model as F4log.

2.3 LP relaxation bounds

Performance of standard MIP solvers based on the branch-and-bound framework is heavily dependent on the quality of the LP relaxations in the considered MIP models. Next, we provide theoretical analysis of such relaxations in the context of the MIP formulations described in Sects. 2.1 and 2.2.

Formally, let \(\omega ^1_{LP}(\gamma )\), \(\omega ^2_{LP}(\gamma )\), \(\omega ^3_{LP}(\gamma )\), \(\omega ^4_{LP}(\gamma )\), \(\omega ^{3\ell og}_{LP}(\gamma )\), \(\omega ^{4\ell og}_{LP}(\gamma )\) be the optimal objective function values of the LP relaxations of F1, F2, F3, F4, F3log and F4log, respectively.

Theorem 1

The following inequalities hold:

$$\begin{aligned} \mathrm{(i)}\qquad&\omega ^\alpha _{LP}(\gamma )\ge |V|/2, \;\;\; \alpha \in \{1,2\};\end{aligned}$$
(14)
$$\begin{aligned} \mathrm{(ii)}\qquad&\omega ^{\alpha }_{LP}(\gamma )\le \frac{1}{2}+\frac{1}{2}\sqrt{1+8\frac{|E|}{\gamma }}, \;\;\; \alpha \in \{3,4\}; \end{aligned}$$
(15)
$$\begin{aligned} \mathrm{(iii)}\qquad&\omega ^{\alpha }_{LP}(\gamma )\le \frac{1}{2}+\frac{1}{2}\sqrt{1+16(\omega ^u)^2+8\frac{|E|}{\gamma }}, \;\;\; \alpha \in \{3\ell og,4\ell og\}; \end{aligned}$$
(16)
$$\begin{aligned} \mathrm{(iv)}\qquad&\omega ^3_{LP}(\gamma ) \le \omega ^{3\ell og}_{LP}(\gamma ) \;\;\; \text{ and }\;\;\;\omega ^4_{LP}(\gamma ) \le \omega ^{4\ell og}_{LP}(\gamma ); \end{aligned}$$
(17)
$$\begin{aligned} \mathrm{(v)}\qquad&\omega ^3_{LP}(\gamma ) \le \omega ^{4}_{LP}(\gamma ) \;\;\;\text{ and }\;\;\;\omega ^{3\ell og}_{LP}(\gamma ) \le \omega ^{4\ell og}_{LP}(\gamma );\end{aligned}$$
(18)
$$\begin{aligned} \mathrm{(vi)}\qquad&\omega ^\alpha _{LP}(\gamma )\ge \frac{2|E|}{\gamma |V|}+1, \;\;\; \alpha \in \{3,4\}. \end{aligned}$$
(19)

Proof

(i) Let \(x_i=\frac{1}{2}\) for all \(i \in V\), \(y_{ij}=0\) for all \(i,j\in V, \ i<j\), and \(u_i=0\) for all \(i\in V\). Then one can verify that \((\mathbf {x},\mathbf {y})\) and \((\mathbf {x},\mathbf {u})\) are feasible solutions of the LP relaxations of F1 and F2, respectively. Clearly, inequality (14) holds by construction.

(ii) Consider \(\alpha =3\). Denote by \((\mathbf {x},\mathbf {y},\mathbf {z})\) an optimal solution of the LP relaxation of F3. Then

$$\begin{aligned} |E| \ge \sum \limits _{(i,j)\in E} y_{ij} \ge \gamma \sum \limits _{k=\omega ^\ell }^{\omega ^u} \frac{k(k-1)}{2}z_k \ge \gamma \frac{\omega ^3_{LP}(\gamma )(\omega ^3_{LP}(\gamma )-1)}{2}, \end{aligned}$$
(20)

where the last relation holds by Jensen’s inequality taking into account that \(\omega ^3_{LP}(\gamma )=\sum _{i \in V} x_i = \sum _{k=\omega ^\ell }^{\omega ^u}k z_k.\) Then the upper bound (15) follows by solving the quadratic inequality with respect to \(\omega ^3_{LP}(\gamma )\) obtained by considering the left- and right-hand sides of (20). For \(\alpha =4\), the result follows from a similar observation that any feasible solution \((\mathbf {x},\mathbf {v},\mathbf {z})\) of the LP relaxation of F4 has to satisfy:

$$\begin{aligned} 2|E| \ge \sum \limits _{i \in V}v_i \ge \gamma \sum \limits _{k=\omega ^\ell }^{\omega ^u} k(k-1)z_k \ge \gamma \omega ^4_{LP}(\gamma )(\omega ^4_{LP}(\gamma )-1), \end{aligned}$$
(21)

where the first inequality is due to constraints (10c) and our choice of \(\mu _i\) for all \(i\in V\) in F4.

(iii) Consider \(\alpha =3\ell og\). For any optimal solution \((\mathbf {s},\mathbf {t},\mathbf {x},\mathbf {y})\) of the LP relaxation of F3log we observe that

$$\begin{aligned} |E| \ge \sum \limits _{(i,j)\in E} y_{ij} \ge&\frac{\gamma }{2}\left( \sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } \sum \limits _{\ell =0}^{\lfloor \log _2\omega ^u\rfloor }2^{k+\ell } s_{k\ell }-\sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } 2^k t_k\right) \nonumber \\ =&\frac{\gamma }{2}\left( \sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor }\sum \limits _{\ell =0}^{\lfloor \log _2\omega ^u\rfloor } 2^{k+\ell } s_{k\ell }-\omega ^{3\ell og}_{LP}(\gamma )\right) , \end{aligned}$$
(22)

where the last equality follows from (13d). Note that \(s_{k\ell }\ge t_k+t_\ell -1\) for all \(k,\ell \in \{0,\dots , \lfloor \log _2\omega ^u\rfloor \}\) by (13e), and \(t_k+t_\ell \ge t_kt_\ell \) since \(t_k,t_\ell \in [0,1]\). Hence:

$$\begin{aligned} \sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor }\sum \limits _{\ell =0}^{\lfloor \log _2\omega ^u\rfloor } 2^{k+\ell } s_{k\ell }&\ge \sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor }\sum \limits _{\ell =0}^{\lfloor \log _2\omega ^u\rfloor } 2^{k+\ell } (t_k+t_\ell -1)&\nonumber \\&\ge \sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } \sum \limits _{\ell =0}^{\lfloor \log _2\omega ^u\rfloor } 2^{k+\ell } (t_kt_\ell )-\sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor }\sum \limits _{\ell =0}^{\lfloor \log _2\omega ^u\rfloor } 2^{k+\ell } \nonumber \\&\ge \left( \sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } 2^{k} t_k \right) ^2 - \left( \sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } 2^{k} \right) ^2\nonumber \\&\ge \left( \omega ^{3\ell og}_{LP}(\gamma )\right) ^2-4(\omega ^u)^2, \end{aligned}$$
(23)

where we use (13d) and the fact that \(2\omega ^u\ge \sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } 2^{k}\). Combining (22) and (23) we obtain:

$$\begin{aligned} |E|+2\gamma (\omega ^u)^2 \ge \gamma \frac{\omega ^{3\ell og}_{LP}(\gamma )(\omega ^{3\ell og}_{LP}(\gamma )-1)}{2}, \end{aligned}$$

which is a quadratic inequality with respect to \(\omega ^{3\ell og}_{LP}(\gamma )\). It can be easily solved to derive (16). The case of \(\alpha =4\ell og\) can be proved similarly.

(iv) We provide the proof only for the first inequality in (17), namely, \(\omega ^3_{LP}(\gamma ) \le \omega ^{3\ell og}_{LP}(\gamma )\). The proof of the second inequality in (17) can be constructed in a similar manner.

Specifically, to establish the result we show that for any feasible solution of the LP relaxation of F3 there exists a feasible solution of the LP relaxation of F3log with the same objective function value. Let \((\mathbf {x},\mathbf {y},\mathbf {z})\) be a feasible solution of the LP relaxation of F3. Hence, it satisfies (6b)–(6d). Thus, using Jensen’s inequality, we can conclude that:

$$\begin{aligned} \begin{aligned} \sum \limits _{(i,j)\in E} y_{ij}&\ge \gamma \sum \limits _{k=\omega ^\ell }^{\omega ^u} \frac{k(k-1)}{2}z_k \ge \frac{\gamma \left( \sum \limits _{i\in V} x_i\left( \sum \limits _{i\in V} x_i-1\right) \right) }{2}\\&=\frac{\gamma }{2}\left( \left( \sum \limits _{i\in V} x_i\right) ^2-\sum \limits _{i\in V} x_i\right) . \end{aligned} \end{aligned}$$
(24)

Observe that \(g(\mathbf {t})=\sum _{k=0}^{\lfloor \log _2\omega ^u\rfloor } 2^k t_k\) is a continuous function for \(\mathbf {t}\in [0,1]^{\lfloor \log _2\omega ^u\rfloor +1}\subset {\mathbb {R}}_+^{\lfloor \log _2\omega ^u\rfloor +1}\), which takes all possible values in \([0,\omega ^u]\). Note that \(\sum _{i\in V} x_i\le \omega ^u\). Thus, there exists \(\mathbf {t}\in [0,1]^{\lfloor \log _2\omega ^u\rfloor +1}\subset {\mathbb {R}}_+^{\lfloor \log _2\omega ^u\rfloor +1}\) such that

$$\begin{aligned} g(\mathbf {t})=\sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } 2^k t_k=\sum \limits _{i\in V} x_i, \end{aligned}$$

and (13d) in F3log holds for \(\mathbf {x}\) and \(\mathbf {t}\). Then, the right-hand side of (24) can be rewritten as:

$$\begin{aligned} \frac{\gamma }{2}\left( \left( \sum \limits _{i\in V} x_i\right) ^2-\sum \limits _{i\in V} x_i\right)&= \frac{\gamma }{2}\left( \left( \sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } 2^k t_k\right) ^2-\sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } 2^k t_k\right) \nonumber \\&=\frac{\gamma }{2}\left( \sum \limits _{k =0}^{\lfloor \log _2\omega ^u\rfloor }\sum \limits _{\ell =0}^{\lfloor \log _2\omega ^u\rfloor } 2^{k+\ell } t_k t_\ell -\sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } 2^k t_k\right) . \end{aligned}$$
(25)

Define \(\mathbf {s}\) as \(s_{k\ell }=\max \{0,t_k+t_\ell - 1\}\) for all \( k,\ell \in \{0,\dots , \lfloor \log _2\omega ^u\rfloor \}\), which implies that constraints (13e) in F3log hold. Moreover, \((1-t_k)(1-t_\ell )=1-t_k-t_\ell +t_kt_\ell \ge 0\). Thus,

$$\begin{aligned}&s_{k\ell }\le t_kt_\ell , \;\;\; \forall k,\ell \in \{0,\dots , \lfloor \log _2\omega ^u\rfloor \}, \end{aligned}$$

and

$$\begin{aligned}&\frac{\gamma }{2}\left( \sum \limits _{k =0}^{\lfloor \log _2\omega ^u\rfloor }\sum \limits _{\ell =0}^{\lfloor \log _2\omega ^u\rfloor } 2^{k+\ell } t_k t_\ell -\sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } 2^k t_k\right) \nonumber \\&\quad \ge \frac{\gamma }{2}\left( \sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } \sum \limits _{\ell =0}^{\lfloor \log _2\omega ^u\rfloor }2^{k+\ell } s_{k\ell }\right. \left. -\sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } 2^k t_k\right) \end{aligned}$$
(26)

Combining (24), (25) and (26) we obtain:

$$\begin{aligned} \sum \limits _{(i,j)\in E} y_{ij} \ge \frac{\gamma }{2}\left( \sum \limits _{k =0}^{\lfloor \log _2\omega ^u\rfloor } \sum \limits _{ \ell =0}^{\lfloor \log _2\omega ^u\rfloor } 2^{k+\ell } s_{k\ell }-\sum \limits _{k=0}^{\lfloor \log _2\omega ^u\rfloor } 2^k t_k\right) , \end{aligned}$$

which implies that constraint (13b) is satisfied for \(\mathbf {s}\), \(\mathbf {t}\) and \(\mathbf {y}\). Summarizing all the above observations, we conclude that \((\mathbf {s},\mathbf {t},\mathbf {x},\mathbf {y})\) is a feasible solution of the LP relaxation of F3log with the same objective function value as the LP relaxation of F3.

(v) We provide the proof only for the first inequality in (18), namely, \(\omega ^3_{LP}(\gamma ) \le \omega ^{4}_{LP}(\gamma )\). The proof of the second inequality in (18) can be derived similarly. In particular, to establish the result we show that for any feasible solution of the LP relaxation of F3 there exists a feasible solution of the LP relaxation of F4 with the same objective function value.

Let \((\mathbf {x},\mathbf {y},\mathbf {z})\) be a feasible solution of the LP relaxation of F3. Without loss of generality, we assume that \(y_{ij}=\min \{x_i,x_j\}\) for any \((i,j)\in E\). Then for any \(i \in V\), we define \(v_i=\min \{deg_G(i) x_i, \sum \limits _{j:\ (i,j)\in E} x_j\}\). Clearly, \(\mathbf {v}=(v_1,\dots , v_n)^T\) satisfies constraint (10c). Moreover,

$$\begin{aligned}&2\sum \limits _{(i,j)\in E} y_{ij} = 2\sum \limits _{(i,j)\in E} \min \{x_i,x_j\} = \sum \limits _{i \in V} \sum \limits _{j:\ (i,j)\in E} \min \{x_i,x_j\} \\&\quad \quad \le \sum \limits _{i \in V} \min \{deg_G(i) x_i, \sum \limits _{j:\ (i,j)\in E} x_j\}=\sum \limits _{i \in V}v_i. \end{aligned}$$

Therefore, \(\mathbf {v}\) satisfies constraint (10b), and \((\mathbf {x},\mathbf {v},\mathbf {z})\) is a feasible solution of the LP relaxation of F4 with the same objective function value as the LP relaxation of F3.

(vi) Consider \(\alpha =3\). Let \(x_i=\delta \) for all \(i \in V\), and \(y_{ij}=\delta \) for all \((i,j)\in E\) for some \(\delta \in \left[ 0,\frac{\omega ^u}{|V|}\right] \subset {\mathbb {R}}_+\). Note that there exists \(\mathbf {z}=(z_{\omega ^\ell }, \dots , z_{\omega ^u})^\top \), such that

$$\begin{aligned} \delta |V|=\sum \limits _{i\in V} x_i = \sum \limits _{k=\omega ^\ell }^{\omega ^u} kz_k\qquad \text{ and }\qquad \sum \limits _{k=\omega ^\ell }^{\omega ^u} z_k=1. \end{aligned}$$

Therefore, constraints (6c) and (6d) hold, and \((\mathbf {x},\mathbf {y},\mathbf {z})\) is a feasible solution of the LP relaxation of F3 if constraint (6b) is also satisfied, i.e.,

$$\begin{aligned} \begin{aligned} \delta |E|&=\sum \limits _{(i,j)\in E} y_{ij} \ge \gamma \sum \limits _{k=\omega ^\ell }^{\omega ^u} \frac{k(k-1)}{2}z_k \ge \frac{\gamma }{2}\left( \left( \sum \limits _{i\in V} x_i\right) ^2-\sum \limits _{i\in V} x_i\right) \\&= \frac{\gamma }{2} \delta |V|\cdot \left( \delta |V|-1\right) , \end{aligned} \end{aligned}$$

or, equivalently,

$$\begin{aligned} \delta |V| \le \frac{2|E|}{\gamma |V|}+1. \end{aligned}$$

Hence, if one sets \(\delta =\frac{1}{|V|}\left( \frac{2|E|}{\gamma |V|}+1 \right) \), then \((\mathbf {x},\mathbf {y},\mathbf {z})\) provides a feasible solution of the LP relaxation of F3 and

$$\begin{aligned} \omega ^\alpha _{LP}(\gamma )\ge \delta |V|= \frac{2|E|}{\gamma |V|}+1. \end{aligned}$$

Finally, it is easy to verify that \(\delta \le \frac{\omega ^u}{|V|}\) and \(\frac{2|E|}{\gamma |V|}+1\le \omega ^u\) as long as G is not a \(\gamma \)-quasi-clique. The case of \(\alpha =4\) can be shown similarly. \(\square \)

Remark 1

Note that in proving inequalities (15) and (17)–(19) we do not use any non-trivial lower or upper bound for the size of the maximum \(\gamma \)-quasi-clique (see (5) and the related discussion at the beginning of Sect. 2.2.1). Thus, (15)–(19) hold even if \(\omega ^\ell \) and \(\omega ^u\) are set to 1 and |V|, respectively, in MIPs F3, F4, F3log and F4log.

Remark 2

The upper bound given by (15) is sharp. Specifically, for any \(\gamma \in (0,1]\) there exists G such that

$$\begin{aligned} \omega _\gamma (G)=\omega ^{\alpha }_{LP}(\gamma )=\frac{1}{2}+\frac{1}{2}\sqrt{1+8\frac{|E|}{\gamma }}, \end{aligned}$$

where \(\alpha \in \{3,4\}\).

More importantly, the LP relaxation bounds established in Theorem 1 allow us to conclude that it may be preferable to use formulations F3 and F4 instead of F1 and F2 if G is sufficiently sparse. Formally:

Corollary 1

Let \(\alpha \in \{1,2\}\) and \(\beta \in \{3,4\}\). If \(|E|\le \gamma \frac{|V|^2-2|V|}{8}\), then \(\omega ^\alpha _{LP}(\gamma )\ge \omega ^\beta _{LP}(\gamma )\). Moreover:

$$\begin{aligned} \omega ^\alpha _{LP}(\gamma )- \omega ^\beta _{LP}(\gamma )&\ge \frac{1}{2} \left( |V|-1-\sqrt{1+8\frac{|E|}{\gamma }}\right) . \end{aligned}$$

In particular, note that if \(|E|=O(|V|)\), then the difference between \(\omega ^\alpha _{LP}(\gamma )\) and \(\omega ^\beta _{LP}(\gamma )\) for the aforementioned \(\alpha \) and \(\beta \) becomes quite significant, namely, \({\varTheta }(|V|)\). On the other hand, if \(|E|={\varTheta }(|V|^2)\), then the bounds established in (14) and (19) imply that both \(\omega ^\alpha _{LP}(\gamma )\) and \(\omega ^\beta _{LP}(\gamma )\) behave as \({\varTheta }(|V|)\).

With respect to formulations F3log and F4log and their comparison to F1 and F2, in addition to sparsity of G, we should also require availability of some non-trivial upper bound. Specifically:

Corollary 2

Let \(\alpha \in \{1,2\}\) and \(\beta \in \{3\ell og,4\ell og\}\). If \(|E|\le \gamma \frac{|V|^2-2|V|-16(\omega ^u)^2}{8}\), then \(\omega ^\alpha _{LP}(\gamma )\ge \omega ^\beta _{LP}(\gamma )\). Moreover:

$$\begin{aligned} \omega ^\alpha _{LP}(\gamma )- \omega ^\beta _{LP}(\gamma )&\ge \frac{1}{2} \left( |V|-1-\sqrt{1+16(\omega ^u)^2+8\frac{|E|}{\gamma }}\right) . \end{aligned}$$

2.4 Feasibility MIPs and exact iterative algorithms

Next, we focus on feasibility versions of the proposed MIPs. In particular, we describe two simple and easily implementable exact methods for finding maximum \(\gamma \)-quasi-cliques that iteratively solve multiple feasibility versions of models F3 and F4. Formally, we define:

Model 6

(\(\mathbf F3 (k)\))

$$\begin{aligned}&\sum \limits _{(i,j)\in E} y_{ij} \ge \gamma \frac{k(k-1)}{2}, \end{aligned}$$
(27a)
$$\begin{aligned}&y_{ij}\le x_i, \quad y_{ij}\le x_j\;\;\; \forall (i,j) \in E, \end{aligned}$$
(27b)
$$\begin{aligned}&\sum \limits _{i\in V}x_i=k, \end{aligned}$$
(27c)
$$\begin{aligned}&x_i\in \{0,1\},\ y_{ij}\ge 0, \;\;\; \forall i,j\in V,\ i<j, \end{aligned}$$
(27d)

which is obtained from F3 by fixing \(z_k=1\) in (6b) and (6d). Then by solving mixed integer feasibility problem \(\mathbf F3 (k)\) it can be verified whether G contains a \(\gamma \)-quasi-clique of size k. Thus, in order to find the size of a maximum \(\gamma \)-quasi-clique, one can simply re-solve \(\mathbf F3 (k)\) for different values of k starting from \(k=\omega ^\ell +1\). (Recall one of our initial assumptions in Sect. 2.2.1 that \(\omega ^\ell \) is obtained by applying a heuristic approach; thus, a \(\gamma \)-quasi-clique of size \(\omega ^\ell \) is known.) Clearly, if for some k model \(\mathbf F3 (k)\) is infeasible then G does not contain a \(\gamma \)-quasi-clique of size \(k'\ge k\) (due to the quasi-hereditary property of \(\gamma \)-quasi-cliques [37]). Hence, we can apply the linear search with respect to the value of k by solving \(\mathbf F3 (k)\) for \(k=1,2, \ldots \) and stopping when \(\mathbf F3 (k)\) becomes infeasible. The largest value of k for which the problem is feasible is output as \(\omega _\gamma (G)\). We refer to this algorithmic approach as AlgF3.

Similar to \(\mathbf F3 (k)\), by fixing \(z_k=1\) in (10b) and (10d) we construct a feasibility version of F4 and denote it by \(\mathbf F4 (k)\). Consequently, by replacing \(\mathbf F3 (k)\) by \(\mathbf F4 (k)\) in algorithm AlgF3 we obtain another exact iterative algorithm, which we refer to as AlgF4 in the remainder of the paper. Note that formal descriptions of \(\mathbf F4 (k)\) and AlgF4 are omitted here for brevity.

One should mention that the iterative methods described above are parallelizable. Naturally, MIPs \(\mathbf F3 (k)\) and \(\mathbf F4 (k)\) can be solved concurrently for different values of k.

Finally, one could also use the binary search on k instead of the linear search. However, our computational experiments showed that the linear search performs better. This can be explained by observing that models \(\mathbf F3 (k)\) and \(\mathbf F4 (k)\) appear to be much easier to solve when they are feasible (see an additional discussion in Sect. 4). Thus, applying the linear search rather than binary one allows to avoid solving multiple infeasible instances of \(\mathbf F3 (k)\) and \(\mathbf F4 (k)\).

3 Finding maximum \(f(\cdot )\)-dense subgraphs

As mentioned in Sect. 1, the maximum \(\gamma \)-quasi-clique problem can be viewed as a special case of the maximum \(f(\cdot )\)-dense subgraph problem with \(f(k)=\gamma k(k-1)/2\). Next, we demonstrate that models F3 and F4 can be extended to handle these more general settings. Specifically, given some fixed nonnegative function \(f(\cdot )\) consider the following MIP:

Model 7

(\(\mathbf GF3 (f)\))

$$\begin{aligned}&\omega (f)=\max \limits _{\mathbf {x},\mathbf {y},\mathbf {z}}\quad \sum \limits _{i\in V} x_i \end{aligned}$$
(28a)
$$\begin{aligned}&\text{ s.t. }\quad \sum \limits _{(i,j)\in E} y_{ij} \ge \sum \limits _{k=\omega ^\ell }^{\omega ^u} f(k)z_k, \end{aligned}$$
(28b)
$$\begin{aligned}&y_{ij}\le x_i, \quad y_{ij}\le x_j, \;\;\; \forall (i,j) \in E, \end{aligned}$$
(28c)
$$\begin{aligned}&\sum \limits _{i\in V} x_i = \sum \limits _{k=\omega ^\ell }^{\omega ^u} kz_k,\quad \sum \limits _{k=\omega ^\ell }^{\omega ^u} z_k=1, \end{aligned}$$
(28d)
$$\begin{aligned}&x_i\in \{0,1\},\ y_{ij}\ge 0, \;\;\; \forall i,j\in V,\ i<j, \end{aligned}$$
(28e)
$$\begin{aligned}&z_k \in \{0,1\}, \;\;\; \forall k\in \{\omega ^\ell ,\ldots ,\omega ^u\}, \end{aligned}$$
(28f)

where constraint (28b) is a generalization of (6b) in F3 for an arbitrary nonnegative function \(f(\cdot )\). In this section, we assume that \(\omega ^{\ell }\) and \(\omega ^u\) correspond to the lower and upper bounds, respectively, on the size of a maximum \(f(\cdot )\)-dense subgraph in G. If non-trivial bounds, e.g., ones similar to (5) for \(\gamma \)-quasi-cliques, are not available for the given function \(f(\cdot )\), then we set \(\omega ^{\ell }=1\) and \(\omega ^{u}=|V|\).

Furthermore, we observe that \(f(k)=\gamma k(k-1)/2\) is convex. Therefore, it is not surprising that Proposition 1 can also be extended to an arbitrary nonnegative convex function. Thus, in case of convex \(f(\cdot )\), binary restrictions in (28f) can be replaced by nonnegativity ones, i.e., \(z_k\ge 0\) for all k. To the best of our knowledge, in most of the related work in the literature, function \(f(\cdot )\) is convex, see [4, 24], including the special cases considered below.

Naturally, MIP F4 can be generalized in a similar fashion by replacing constraint (10b) with:

$$\begin{aligned} \sum \limits _{i\in V} v_{i} \ge \sum \limits _{k=\omega ^\ell }^{\omega ^u} f(k)z_k, \end{aligned}$$

and we refer to the modified model as \(\mathbf GF4 (f)\).

Next, denote by \(\omega ^3_{LP}(f)\) and \(\omega ^{4}_{LP}(f)\) the optimal objective function values of the LP relaxations of MIPs \(\mathbf GF3 (f)\) and \(\mathbf GF4 (f)\), respectively. Then the following result is a direct generalization of the statement (ii) in Theorem 1.

Proposition 2

If \(f(\cdot )\) is a strictly increasing, nonnegative, convex function, then the following inequalities hold:

$$\begin{aligned}&\omega ^3_{LP}(f)\le f^{-1}(|E|),\end{aligned}$$
(29)
$$\begin{aligned}&\omega ^4_{LP}(f)\le f^{-1}(|E|). \end{aligned}$$
(30)

Proof

Denote by \((\mathbf {x},\mathbf {y},\mathbf {z})\) an optimal solution of the LP relaxation of \(\mathbf GF3 (f)\). Then using an approach similar to the one applied in the Proof of Theorem 1, by convexity of \(f(\cdot )\) we conclude that

$$\begin{aligned} |E| \ge \sum \limits _{(i,j)\in E} y_{ij} \ge \sum \limits _{k=\omega ^\ell }^{\omega ^u}f(k)z_k \ge f\left( \sum \limits _{k=\omega ^\ell }^{\omega ^u}kz_k\right) =f\left( \omega ^{3}_{LP}(f)\right) , \end{aligned}$$
(31)

where (31) is analogous to (20). Note that \(f(\cdot )\) is strictly increasing. Thus, its inverse function exists, and inequality (29) follows from (31). Inequality (30) can be shown similarly. \(\square \)

It is worth noting that algorithms AlgF3 and AlgF4 can also be extended to handle the general functional case of \(f(\cdot )\) using the feasibility versions of \(\mathbf GF3 (f)\) and \(\mathbf GF4 (f)\), respectively.

Sample special cases: \(\varvec{s}\) -defective clique and average \(\varvec{s}\) -plex. Recall that for an s-defective clique, \(f(k)=k(k - 1)/2-s\), which implies that constraint (28b) in \(\mathbf GF3 (f)\) reduces to:

$$\begin{aligned} \sum \limits _{(i,j)\in E} y_{ij} \ge \sum \limits _{k=\omega ^\ell }^{\omega ^u} \frac{k(k-1)}{2}z_k-s. \end{aligned}$$
(32)

For an average s-plex we have \(f(k)=k(k-s)/2\), and constraint (28b) is replaced by:

$$\begin{aligned} 2\sum \limits _{(i,j)\in E} y_{ij} \ge \sum \limits _{k=\omega ^\ell }^{\omega ^u} k(k-1)z_k-(s-1)\sum \limits _{i\in V} x_i. \end{aligned}$$
(33)

Finally, we note that the term \(\sum _{k=\omega ^\ell }^{\omega ^u} k(k-1)z_k\) in the right-hand sides of (32) and (33) also appears in F3 and F4. Therefore, it is clear that one can derive “logarithmic” versions of (32) and (33) in a similar fashion as described in Sect. 2.2.2 for models F3log and F4log.

4 Computational experiments

The focus of the computational study presented in this section is on the following issues. First, in Tables 1 and 2, we compare the proposed approaches for finding maximum \(\gamma \)-quasi-cliques (namely, MIP models F3, F4, F3log and F4log as well as algorithms AlgF3 and AlgF4) with MIPs F1 and F2 from [36] for small and medium-sized network instances (both real-life and synthetic). Note that all of these solution methods can be implemented using off-the-shelf MIP solvers. We do not provide comparisons of our methods with the approach from [34], which is a tailored combinatorial B&B algorithm and is not publicly available. However, we should mention that the computational results reported in [34] indicate that the developed B&B algorithm does not significantly outperform the MIP solver with F2 for a substantial subset of the considered test instances. Moreover, for the majority of the large-scale graphs in [34] the B&B algorithm fails to converge within the time limit (however, it was able to obtain the optimality gaps that were significantly better than those provided by the MIP solver with F2). On the other hand, the computational experiments reported here indicate that for sufficiently sparse graphs MIPs F1 and F2 are dominated by the proposed MIP models, which is not surprising given the results regarding the quality of their LP relaxations derived in Sect. 2.3.

Table 1 Finding maximum \(\gamma \)-quasi-cliques in real-life and synthetic networks for \(\gamma =0.9\) and \(\gamma =0.5\)
Table 2 Comparisons of the LP relaxations (at the root node) for problems in Table 1

Second, in Tables 3 and 4, for several large-scale graph instances with 5000–10,000 vertices (which cannot be tackled by F1 and F2 within a reasonable time limit), we study how the performance of the proposed methods depends on values of the parameter \(\gamma \).

Table 3 Performance of the proposed approaches for \(\gamma \in \{0.1,0.2,\ldots ,0.9\}\)
Table 4 Performance of the proposed approaches for \(\gamma \in \{0.1,0.2,\ldots ,0.9\}\)

Third, in Tables 5 and 6 for two graph instances and two distinct values of \(\gamma \in \{0.5,0.9\}\) we further explore the performance of the proposed methods with respect to the quality of the available upper and lower bounds on the size of the maximum \(\gamma \)-quasi-clique. Specifically, in Table 5 we report the computational results (including the total running time and the number of B&B nodes explored) for the proposed MIPs F3, F4, F3log and F4log with respect to the value of the upper bound \(\omega ^u_\gamma \). Additionally, in Table 6 we report the performance of AlgF3 and AlgF4 for each iteration of the methods, i.e., we provide the solution times for feasibility MIPs \(\mathbf F3 (k)\) and \(\mathbf F4 (k)\) for each value of k.

Table 5 The performance of MIPs for different values of the upper bound \(\omega ^u_\gamma (G)\)
Table 6 The performance of AlgF3 and AlgF4 for each iteration k, i.e., we report the solution times for feasibility MIPs \(\mathbf F3 (k)\) and \(\mathbf F4 (k)\) for each value of k

Finally, in Tables 7 and 8, we illustrate the applicability of our models for finding \(f(\cdot )\)-dense subgraphs. We want to emphasize that one can apply the proposed solution methodology for any arbitrary type of edge density function \(f(\cdot )\) using an off-the-shelf MIP solver.

Table 7 Performance of \(\mathbf GF3 (f)\) for the maximum s-defective clique and the maximum average s-plex problems, where \(f(|S|)=|S|(|S|-1)/2-s\) and \(f(|S|)=|S|(|S|-s)/2\), respectively
Table 8 Performance of \(\mathbf GF3 (f)\) for finding maximum f-dense subgraphs, where \(f(|S|)=\gamma |S|^{3/2}\) and \(f(|S|)=(2|E|/|V|+s)|S|\)

4.1 Hardware and software

The computational experiments were performed on a Dell laptop equipped with Windows 7 \(\times \) 64 operating system, an Intel Core i7 940XM processor (CPU 2.13 GHz, L2 8 MB) and RAM 8 GB. All MIPs were solved using FICO Xpress-Optimizer [49] with the time limit of 3600 s (1 h). The corresponding CPU times in tables below are presented in seconds.

4.2 Test instances

In our computational experiments, we use real-life instances obtained from the University of Florida Sparse Matrix Collection [18] and Pajek datasets [8], as well as graph coloring instances from [43] and biological networks from [7]. More specifically, we consider:

  • Social (book, collaboration, corporate inter-relationships and citation) networks:

    • Matrix group from SNAP in [18] (loops in graphs were removed): ca-GRQC (\(|V|=5242\), \(|E|=14484\)) and ca-HEPTh (\(|V|=9877\), \(|E|=25973\));

    • Matrix group Pajek in [18]: SmallW (\(|V|=396\), \(|E|=994\)), Erdos971 (\(|V|=472\), \(|E|=1314\)), Geom (\(|V|=7343\), \(|E|=11898\)) and EVA (\(|V|=8497\), \(|E|=6726\));

    • Matrix group Newman in [18]: netscience (\(|V|=1589\), \(|E|=2742\));

    • Erdos02 (\(|V|=6927\), \(|E|=8472\)) [8];

    • Homer (\(|V|=561\), \(|E|=1629\)) [43].

  • Internet and communication networks:

    • Matrix group Pajek in [18]: California (\(|V|=9664\), \(|E|=15969\));

    • Matrix group SNAP in [18]: AS -735 (\(|V|=7716\), \(|E|=13895\));

    • Matrix group Arenas in [18]: email (\(|V|=1,133\), \(|E|=5451\)) and PGPgiantcompo (\(|V|=10680\), \(|E|=24316\));

    • Matrix group MathWorks in [18]: undirected version of Harvard500 (\(|V|=500\), \(|E|=2043\));

  • Biological networks [7]: C.Elegans (\(|V|=453\), \(|E|=2025\)), H.Pylori (\(|V|=1570\), \(|E|=1399\)), and S.Cerevisae (\(|V|=2112\), \(|E|=2203\));

  • Transportation network from matrix group Pajek in [18]: USAir97 (\(|V|=332\), \(|E|=2126\)).

While the main focus of our experiments is on real-life networks, for illustrative purposes, we also test our approaches on several randomly generated synthetic graph instances. In particular, uniform random graphs are constructed according to a classical G(nM) model [19]. These instances are denoted by u100-1, u100-2 and u100-3. Finally, power-law random graphs (i.e., the probability that a vertex has degree k is \({\varTheta }(k^{-\beta })\) for some constant \(\beta \)) are generated as in [15, 36] and denoted by p500-1, p500-2 and p500-3.

4.3 Results and discussion

Tables 1 and 2: In the first table, we report running times for the considered solution approaches, while the second one contains the objective function values for the corresponding LP relaxations. As one would expected, due to sparsity of the graphs in our study, MIP models F3 and F4 have the best LP relaxations, with F3log and F4log lagging not too far behind. The quality of the LP relaxations of F1 and F2 is very poor. These experimental observations are verified by the theoretical results established in Theorem 1 and Corollary 1. Therefore, it is not surprising that MIPs F1 and F2 are dominated by the other approaches with respect to their running times.

Models F3 and F4 show consistently good performance for all test instances in Table 1. We should note that, while F3 has better LP relaxations than F4, the latter model requires less variables. AlgF4 provides the best results for most of the instances with \(\gamma =0.9\). We attribute this to the rather small values of \(\omega _\gamma (G)\) for sufficiently large \(\gamma \), which results in a small number of feasibility MIPs of the form \(\mathbf F4 (k)\) required to be solved during the execution of AlgF4. Also, recall that \(\mathbf F4 (k)\) has less variables than \(\mathbf F3 (k)\), which may explain the somewhat worse performance of AlgF3. On the other hand, AlgF3 outperforms AlgF4 for smaller values of \(\gamma \), which is, perhaps, due to a better quality of the LP relaxations of the underlying feasibility MIPs.

Tables 3 and 4: In this set of experiments, we solve the maximum \(\gamma \)-quasi-clique problem for large graph instances with 5000–10,000 vertices and different values of \(\gamma \in \{0.1,0.2,\ldots ,0.9\}\). The models F1 and F2 cannot handle large real-life graphs (see also the results for small- and medium-size instances in Table 1 for another confirmation of this observation), hence, we focus on the newly proposed approaches.

First, we note that for most of the instances AlgF3 and AlgF4 are not competitive, which is due to large values of \(\omega _\gamma (G)\) in the optimal solutions. Therefore, both algorithms are forced to solve a large number of feasibility MIPs, which results in their ineffectiveness for these instances (recall our previous discussion for instances with \(\gamma =0.9\) in Table 1).

Second, similar to the experiments discussed above, models F3 and F4 yield the best (or close to the best) results for the majority of the considered graphs. We should point out again the extremely high quality of their LP relaxations. However, in contrast to the previous experiments, there exist instances, where F3log and F4log outperform the other MIPs. One should recall that F3log and F4log have a less number of variables than F3 and F4; however, as we show in Theorem 1, the quality of their LP relaxations is somewhat worse. This trade-off is clearly evident in the results of our experiments for the considered large real-life graphs, e.g., networks ca-HEPTh and ca-GRQC in Table 3 and AS-735 in Table 4.

Table 5: In this set of experiment we explore how the performance of the proposed MIPs F3, F4, F3log and F4log depends on the value of the upper bound \(\omega ^u_\gamma \). We report the total running time, the running time required for the solver to identify an optimal solution (thus, the difference in these values indicates the time required by the solver to prove optimality of the obtained solution) and the total number of B&B nodes explored by the solver.

First, we observe that the total running of the MIP solver does not usually improve significantly (or may even increase) for the tighter values of \(\omega ^u_\gamma \) in the MIP models. In particular, for the easier instance (Harvard500) most of the total running time is spent for proving optimality of the obtained optimal solution (except for the model F4), which is typically identified rather early by the MIP solver (due to a good quality of the MIP-based heuristics). Naturally, if \(\omega ^u_\gamma =\omega ^\ell _\gamma =\omega _\gamma \) (see the row marked by “\(^\dagger \)”), then the solution is obtained almost immediately for F3 and F4.

On the other hand, for the more difficult instance (ca-GRQC) a considerable portion of the total running time is spent for identifying an optimal solution. Consequently, if \(\omega ^u_\gamma =\omega ^\ell _\gamma =\omega _\gamma \) (see the row marked by “\(^\dagger \)”), then the total running times for the MIP models do not improve significantly (except for the model F4) in comparison to the MIPs, where \(\omega ^u_\gamma \) is set to |V|. Therefore, the variability of the total running times required to obtain optimal solutions in our experiments may be attributed to the effect of the MIP solver parameters (recall that we use the default settings) that guide dynamically the search in the underlying B&B approach.

The above observations are not particularly surprising. However, from the practical perspective our results imply that if the decision-maker, who seeks maximum quasi-cliques, applies the MIP solver with the default settings (and is not interested in either tuning the solver parameters or using more advanced solver capabilities), then he/she could simply use |V| as an upper bound in the proposed MIP models.

Table 6: In this table we report the performance of AlgF3 and AlgF4 for each iteration of the methods, i.e., we provide the solution times for feasibility MIPs \(\mathbf F3 (k)\) and \(\mathbf F4 (k)\) for each value of k. One can observe that the feasibility MIP models are usually more difficult to solve when the problem is either infeasible (i.e., \(k=\omega _\gamma +1\)), or the value of k is close to \(\omega _\gamma \). In particular, the latter observation typically holds for more difficult instances; see the results for ca-GRQC with \(k\in \{\omega _\gamma -1,\omega _\gamma \}\). In view of the previous set of the experiments, these results are not too surprising. However, they also imply that the iterative scheme with feasibility MIPs may be favorable if there exist good quality lower and upper bounds for the size of the maximum quasi-clique. Furthermore, feasibility MIPs may be preferred if we are simply interested in verifying existence of a quasi-clique of a particular size, which may be the case in some practical applications.

Tables 7 and 8: Next, we consider the problem of finding maximum \(f(\cdot )\)-dense subgraphs for four types of the edge density function \(f(\cdot )\). The first two correspond to the maximum s-defective clique and the maximum average s-plex problems, respectively (recall our discussion in Sects. 1 and 3). Note that for both of these functions we have \(f(k)={\varTheta }(k^2)\), which implies a relatively strict edge density requirement for the obtained subgraphs. Thus, we also consider two other types of functions, namely, \(f(k)=\gamma k^{3/2}\) and \(f(k)=(2|E|/|V|+s)k\), which correspond to \(f(k)={\varTheta }(k^{3/2})\) and \(f(k)={\varTheta }(k)\), respectively. Recall that MIP F3 turned out to be the most consistent model in our previous experiments. Therefore, we use \(\mathbf GF3 (f)\) in this set of experiments. The obtained results illustrate the applicability of our models for finding \(f(\cdot )\)-dense subgraphs, where \(f(\cdot )\) can be an arbitrary nonnegative function. In particular, we want to emphasize a high quality of the LP relaxations, which allowed us to solve the problem for graphs with up to 10,000 vertices.

5 Concluding remarks

In this paper, we propose new MIP models for solving the maximum \(\gamma \)-quasi-clique problem. The key advantage of our MIPs is that for sparse graphs the corresponding LP relaxations are tighter than the LP relaxations of other MIP models available in the literature. We note that one can easily construct instances of dense graphs, for which this is not necessarily the case. However, we emphasize here that the vast majority of real-life graphs in the literature are sparse. Thus, it is not surprising that in our computational experiments the proposed exact solution approaches are capable of solving problems on large real-life instances with up to 10,000 vertices. Furthermore, we demonstrate that our methodology can be naturally generalized for solving the maximum \(f(\cdot )\)-dense subgraph problem, which seeks the largest k such that the graph has a k-vertex subgraph with at least f(k) edges for a given nonnegative function \(f(\cdot )\).

As a possible direction of future research, it is worth mentioning a somewhat related work in [45], which aims to enumerate all quasi-cliques in a graph. Therefore, it could be interesting to exploit our MIP models for developing effective methods that can solve the same problem (or a similar class of problems) and provide all (or almost all) maximal \(\gamma \)-quasi-cliques and general \(f(\cdot )\)-dense subgraphs in a given graph. Finally, a deeper investigation of the polyhedral relationships between the previous and the proposed MIP models could be interesting.