1 Introduction

Quadratically constrained quadratic optimization (QCQO) problems arise in various applications and are among the well-studied optimization problems [5, 9, 11, 16, 24, 27, 33]. Special cases of QCQO include the well-known trust region subproblem (TRS) and extended TRS (e-TRS). Though TRS is nonconvex, it has the necessary and sufficient optimality conditions and exact semidefinite relaxation (SDR) [15, 26]. However, for e-TRS, the necessary and sufficient optimality conditions and the SDR hold under certain assumptions [12, 13, 22]. A variant of QCQO that is minimizing a quadratic function subject to the intersection of the inside and outside of several balls with extra linear constraints is studied in [7]. The authors proposed a Branch and Bound (BB) algorithm to solve it and reported preliminary numerical results.

In this paper, we study a special case of the problem in [7] that minimizes a quadratic function subject to the intersection of several balls and linear inequality constraints (QOBL). Variants of this problem appear for example in solving nonconvex source localization problems and numerical solution of parameter identification [6, 8]. As a special case of QCQO, one may apply algorithms such as the Extended Adaptive Ellipsoid-based (EAE) algorithm to solve QOBL [16, 23]. We show that  QOBL can be reduced to m e-TRS using the hyperplanes induced by the intersection of each pair of balls constraints. To solve e-TRS, we utilize alternating direction method of multipliers (ADMM) and the BB algorithm of [7]. The rest of the paper is organized as follows. In Sect. 2, we give our main results, namely reducing  QOBL to m e-TRS. In Sect. 3, we briefly discuss the ADMM [10] for solving e-TRS. Finally, in Sect. 4, numerical results are given to show the efficiency of the proposed approach in comparison with some existing algorithms.

2 Main Results

Consider the following quadratic optimization problem with ball and linear inequality constraints:

$$\begin{aligned} \min \quad&\frac{1}{2}x^TAx +a^Tx \\&||x-c_i||^2 \le \delta _i^2,~~~~i \in \mathcal {I}:=\lbrace 1, \ldots , m\rbrace , \\&b_k^T x \le \beta _k ,~~~~ k=1,\ldots , p, \end{aligned}$$
(QOBL)

where \(A\in \mathbb {R}^{n\times n}\) is a symmetric matrix, \(a, c_i ,b_k \in \mathbb {R}^n\), \(\beta _k \in \mathbb {R}\) and \(\delta _i \in \mathbb {R}_+\). When \(m=1\) and \(p=0\),  QOBL reduces to the well-known TRS [15] and when \(m=1\) and \(p\ge 1\), it reduces to the following e-TRS:

$$\begin{aligned} \min \quad&\frac{1}{2}x^TAx +a^Tx \\&||x-c||^2 \le \delta ^2, \\&b_k^T x \le \beta _k ,~~~~ k=1,\ldots , p, \end{aligned}$$
(p-eTRS)

that has been widely studied in recent years [1, 2, 12, 13, 17, 21, 22, 25, 28,29,30,31].

The following notations are used throughout this section:

Fig. 1
figure 1

Graphical representation of notations. a The feasible region of QOBL, where the blue lines are linear constraints. b \(\mathcal {M}_i\), \(i=1,2,3\). c \(\mathcal {R}_i\), \(i=1,2,3\)

For clarity, we have also shown them in Fig. 1. In the following lemma, we discuss a case where QOBL is infeasible.

Lemma 2.1

If there exist \(i, j \in \mathcal {I}\) such that \(||c_i- c_j||> \delta _i + \delta _j \), then QOBL is infeasible (see Fig. 2a).

Proof

Let \(||c_i- c_j||> \delta _i + \delta _j \) and \(x \in \mathcal {B}_i\), then

$$\begin{aligned} ||x - c_j|| =&||x - c_j+c_i-c_i|| \ge ||c_j- c_i|| - ||x -c_i||> \delta _j + \delta _i - ||x -c_i|| \ge \delta _j \\&\Longrightarrow ||x - c_j|| >\delta _j \Longrightarrow \mathcal {B}_i \cap \mathcal {B}_j= \emptyset . \end{aligned}$$

\(\square \)

We will discuss other cases where QOBL becomes infeasible in the rest of the paper (see Fig. 2b). The following lemma discusses the redundancy of ball constraints.

Fig. 2
figure 2

Infeasible QOBL examples

Lemma 2.2

Let \(\delta _i\le \delta _j\). If \(||c_i- c_j||\le \delta _j- \delta _i \), then constraint \(||x- c_j||^2\le \delta _j^2\) is redundant (see Fig. 3).

Proof

Let \(x \in \mathcal {B}_i\), then

$$\begin{aligned} ||x - c_j|| =&||x - c_j+c_i-c_i|| \le ||c_j- c_i|| + ||x -c_i||\le \delta _j - \delta _i + ||x -c_i|| \le \delta _j \\&\Longrightarrow \mathcal {B}_i\subset \mathcal {B}_j. \end{aligned}$$

Therefore, constraint \(||x- c_j||^2\le \delta _j^2\) is redundant. \(\square \)

Following Lemma 2.2, we make the following assumption for the rest of the paper.

Assumption 1

For all \(i\in \mathcal {I}\), there is no \(j\in \mathcal {I}\setminus \{i\}\) such that \(\mathcal {B}_i \subseteq \mathcal {B}_j\) and the Slater condition holds for QOBL. Also, we assume \(m\ge 3\).

As noted earlier, the case with \(m=1\) corresponds to the well-studied p-eTRS, see for example [2, 7, 12, 22, 30] and the case with \(m=2\) is handled by a similar approach as in [4]. In the following results, our goal is to characterize the feasible region of QOBL as the union of the feasible region of m, \((m+p-1)-\)eTRS. The first result shows that if \( \mathcal {M}_j\) is nonempty, then it has a point on the boundary of \( \mathcal {B}_j\).

Fig. 3
figure 3

Red ball is redundant

Lemma 2.3

Suppose QOBL satisfies Assumption 1. If \(\mathcal {M}_j\ne \emptyset \), then there exists \(y \in \mathcal {M}_j\) such that \(||y-c_j||^2=\delta _j^2\).

Proof

Let \(x \in \mathcal {M}_j\), then \(||x-c_j||^2\le \delta _j^2\) and \(2(c_j-c_i)^Tx\le \alpha _{ji}\) \(\forall i \in \mathcal {I}\setminus \{j\}\). If \(||x-c_j||^2<\delta _j^2\), since \(2(c_j-c_i)^Tx\le \alpha _{ji}\) \(\forall i \in \mathcal {I}\setminus \{j\}\), we have \(||x-c_i||^2-\delta _i^2 \le ||x-c_j||^2-\delta _j^2 <0\). Then, there exist \(d \in \mathbb {R}^n\) and \(\epsilon >0\), such that for \(y=x+\epsilon d\) we have

$$\begin{aligned} ||y-c_i||^2-\delta _i^2 \le ||y-c_j||^2-\delta _j^2 =0, ~~\forall i \in \mathcal {I}\setminus \{j\}. \end{aligned}$$

Therefore, \(||y-c_j||^2=\delta _j^2\) and \(2(c_j-c_i)^Ty\le \alpha _{ji}\) \(\forall i \in \mathcal {I}\setminus \{j\}\), which completes the proof. \(\square \)

In the previous lemma, we showed that when \(\mathcal {M}_j\) is nonempty, it intersects the boundary of a ball. In the following lemma, we will show that when \(p=0\) the intersection of \(\mathcal {M}_j\) with the boundary of a ball is a part of the boundary of the feasible region of QOBL.

Lemma 2.4

Suppose QOBL satisfies Assumption 1 and \(p=0\). Then, we have \( \mathcal {M}_j \bigcap \partial \mathcal {B}_j=\partial \left( \bigcap _{i=1}^m \mathcal {B}_i \right) \bigcap \partial \mathcal {B}_j\).

Proof

(\( \Longrightarrow \)) Note that

$$\begin{aligned} \partial \left( \bigcap _{i=1}^m \mathcal {B}_i \right)&= \bigcup _{t=1}^m \lbrace x|~ ||x-c_t||^2=\delta _t^2,~~ ||x-c_i||^2\le \delta _i^2,~\forall i\in \mathcal {I}\setminus \{t\} \rbrace . \end{aligned}$$
(1)

Let \(x \in \mathcal {M}_j \bigcap \partial \mathcal {B}_j \), then \(||x-c_j||^2 = \delta _j^2, ~~ 2(c_j-c_i)^Tx\le \alpha _{ji},~\forall i\in \mathcal {I}\setminus \{j\} \). Further,

$$\begin{aligned}&2(c_j-c_i)^Tx\le \alpha _{ji} \Longrightarrow 2c_j^Tx-2c_i^Tx \le c_j^Tc_j- c_i^Tc_i+\delta _i^2-\delta _j^2 \\&\Longrightarrow x^Tx+c_i^Tc_i - 2c_i^Tx - \delta _i^2\le x^Tx+ c_j^Tc_j -2c_j^Tx-\delta _j^2 \\&\Longrightarrow ||x-c_i||^2-\delta _i^2 \le ||x-c_j||^2 -\delta _j^2. \end{aligned}$$

Now, from \(||x-c_j||^2=\delta _j^2\), we have \(||x-c_i||^2\le \delta _i^2\) for all \(i\in \mathcal {I}\setminus \{j\}\), and from (1), we have \( x \in \partial \left( \bigcap _{i=1}^m \mathcal {B}_i \right) \). Thus, \(\mathcal {M}_j \bigcap \partial \mathcal {B}_j \subseteq \partial \left( \bigcap _{i=1}^m \mathcal {B}_i \right) \bigcap \partial \mathcal {B}_j\).

(\(\Longleftarrow \)) Now, suppose that \( x \in \partial \left( \bigcap _{i=1}^m \mathcal {B}_i \right) \bigcap \partial \mathcal {B}_j\). Then, from (1), there exists \(j \in \mathcal {I}\) such that \(||x-c_j||^2=\delta _j^2\) and \(||x-c_i||^2\le \delta _i^2\) for all \(i\in \mathcal {I}\setminus \{j\} \) or

$$\begin{aligned}&||x-c_j||^2 = \delta _j^2, ~~ 2(c_j-c_i)^Tx\le \alpha _{ji},~\forall i\in \mathcal {I}\setminus \{j\}. \end{aligned}$$

This implies \( x \in \mathcal {M}_j \bigcap \partial \mathcal {B}_j\). Thus \( \partial \left( \bigcap _{i=1}^m \mathcal {B}_i \right) \bigcap \partial \mathcal {B}_j \subseteq \mathcal {M}_j \bigcap \partial \mathcal {B}_j \). \(\square \)

Fig. 4
figure 4

Red ball is called \(\mathcal {B}_1\) and \(\mathcal {M}_1\) is empty

The following theorem enables us to find redundant ball constraints containing the feasible region, but does not completely contain any of the other ball constraints (see Fig. 4). We should note that these types of redundant ball constraints are not of the type discussed in Lemma 2.2.

Theorem 2.1

Suppose QOBL satisfies Assumption 1 and \(p=0\). Then, \(\mathcal {M}_j=\emptyset \) if and only if and .

Proof

\(\left( \Longleftarrow \right) \) Let and . By contradiction, suppose \(\mathcal {M}_j\ne \emptyset \), then from Lemma 2.3, \(\mathcal {M}_j \bigcap \partial B_j\ne \emptyset \). Further by Lemma 2.4 and \( \bigcap _{i=1}^m \mathcal {B}_i =\bigcap _{i=1,i\ne j}^m \mathcal {B}_i\), we have

$$\begin{aligned} \mathcal {M}_j \bigcap \partial \mathcal {B}_j = \partial \left( \bigcap _{i=1,i\ne j}^m \mathcal {B}_i \right) \bigcap \partial \mathcal {B}_j. \end{aligned}$$
(2)

Now, since , from (2) \(\mathcal {M}_j \bigcap \partial \mathcal {B}_j = \emptyset \) which is a contradiction. Thus, \(\mathcal {M}_j = \emptyset \).

\(\left( \Longrightarrow \right) \) Let \(\mathcal {M}_j=\emptyset \). Suppose by contradiction, there exists \( x \in {\bigcap }_{i=1,i\ne j}^m \mathcal {B}_i \setminus \mathcal {B}_j\) such that \(||x-c_j||^2\ge \delta _j^2\). Since \({\bigcap }_{i=1}^m \mathcal {B}_i \ne \emptyset \), by Assumption 1 there exists \(y \in {\bigcap }_{i=1}^m \mathcal {B}_i\) such that \(||y-c_j||^2\le \delta _j^2\). Now, let \(z_\lambda =\lambda y+(1-\lambda )x\), then there exist \(\lambda ^*\) such that \(||z_{\lambda ^*}-c_j||^2=\delta _j^2\). Since \(z_{\lambda ^*} \in {\bigcap }_{i=1,i\ne j}^m \mathcal {B}_i \), we have \(||z_{\lambda ^*}-c_i||^2\le \delta _i^2\), \(\forall i \in \mathcal {I}\setminus \{j\}\). Then

$$\begin{aligned} ||z_{\lambda ^*}-c_i||^2- \delta _i^2 \le 0=||z_{\lambda ^*}-c_j||^2- \delta _j^2&\Longrightarrow 2(c_j-c_i)^Tz_{\lambda ^*}\le \alpha _{ji},~\forall i \in \mathcal {I}\setminus \{j\}. \end{aligned}$$

This means \(z_{\lambda ^*} \in \mathcal {M}_j\), which is a contradiction with \(\mathcal {M}_j = \emptyset \). Therefore,

$$\begin{aligned} {\bigcap }_{i=1,i\ne j}^m \mathcal {B}_i \subseteq \mathcal {B}_j. \end{aligned}$$

Also, since \(\mathcal {M}_j=\emptyset \), we have \( \mathcal {M}_j \bigcap \partial \mathcal {B}_j=\emptyset \). Then from Lemma 2.4, \(\partial \left( \bigcap _{i=1}^m \mathcal {B}_i \right) \) \(\bigcap \partial \mathcal {B}_j=\emptyset \). \(\square \)

The following theorem, which is the main result of this paper, shows that the feasible region of QOBL is the union of the feasible region of m, \((m+p-1)-\)eTRS (see Fig. 5).

Theorem 2.2

Suppose QOBL satisfies Assumption 1. Then, \(\mathcal {R}=\bigcup _{i=1}^m \mathcal {R}_i \).

Proof

(\( \Longrightarrow \)) Suppose \(x \in \mathcal {R}\), then and \( x \in \mathcal {P}\). Without loss of generality, we assume that

$$\begin{aligned} ||x-c_1||^2- \delta _1^2 \le ||x-c_2||^2- \delta _2^2 \le \cdots \le ||x-c_m||^2- \delta _m^2 . \end{aligned}$$

Thus,

$$\begin{aligned} 2(c_m-c_i)^Tx\le \alpha _{mi},~\text{ for } \text{ all } i\in \mathcal {I}\setminus \lbrace m\rbrace \Longrightarrow x\in \mathcal {M}_m \Longrightarrow x \in \bigcup _{i=1}^m \mathcal {M}_i. \end{aligned}$$

Since \(x \in \mathcal {P}\),

$$\begin{aligned} x \in \left( \bigcup _{i=1}^m \mathcal {M}_i\right) \bigcap \mathcal {P}&\Longrightarrow x \in \bigcup _{i=1}^m \left( \mathcal {M}_i\bigcap \mathcal {P}\right) \nonumber \\&\Longrightarrow x \in \bigcup _{i=1}^m \mathcal {R}_i \Longrightarrow \mathcal {R} \subseteq \bigcup _{i=1}^m \mathcal {R}_i. \end{aligned}$$
(3)

(\( \Longleftarrow \)) Let , then there exists \(k \in \mathcal {I}\) such that \(x \in \mathcal {R}_k= \mathcal {M}_k \cap \mathcal {P}\). Also

$$\begin{aligned} x \in \mathcal {M}_k \Longrightarrow 2(c_k-c_i)^Tx\le \alpha _{ki},~\forall i \in \mathcal {I}\setminus \lbrace k\rbrace , \end{aligned}$$

or

$$\begin{aligned} ||x-c_i||^2- \delta _i^2 \le ||x-c_k||^2- \delta _k^2, ~\forall i \in \mathcal {I}\setminus \lbrace k\rbrace . \end{aligned}$$

Furthermore, \(x \in \mathcal {R}_k\) implies that \( ||x-c_k||^2 \le \delta _k^2\). Thus

$$\begin{aligned} ||x-c_i||^2 \le \delta _i^2,~\forall i \in \mathcal {I}&\Longrightarrow x \in \mathcal {M} \Longrightarrow x \in \mathcal {M} \cap \mathcal {P} \Longrightarrow x \in \mathcal {R}. \end{aligned}$$

This implies \(\bigcup _{i=1}^m \mathcal {R}_i \subseteq \mathcal {R}.\)\(\square \)

Fig. 5
figure 5

Feasible region of QOBL when \(m=3\) and \(p=4\). The blue lines are the linear constraints of QOBL

Therefore, from Theorem 2.2, solving QOBL reduces to solve m, \((m+p-1)-\)eTRS as follows for all \(i \in \mathcal {I}\) (see Fig. 5):

figure a

Using Theorem 2.1, in the following lemma, we show that infeasible (\(PR_i\)) means a redundant ball constraint (see Fig. 6).

Lemma 2.5

The (\(PR_i\)) is feasible if and only if \(||x_{c_i}^*-c_i||^2\le \delta _i^2\), where \(x_{c_i}^*\) is the optimal solution of the following convex quadratic problem:

figure b

Moreover, If \(||x_{c_i}^*-c_i||^2>\delta _i^2\) or (\(CR_i\)) is infeasible, then the ith ball constraint is redundant (see Fig. 6).

Proof

The feasibility of (\(PR_i\)) is straightforward. If \(||x_{c_i}^*-c_i||^2>\delta _i^2\) or (\(CR_i\)) is infeasible, then \(\mathcal {R}_i\) is empty, and from Theorem 2.1, the ith ball constraint is redundant. \(\square \)

Fig. 6
figure 6

Red ball is redundant and \(\mathcal {R}_i\) related to it is empty

Corollary 2.1

If \(||x_{c_i}^*-c_i||^2>\delta _i^2\) or (\(CR_i\)) is infeasible for all \(i\in \mathcal {I}\), then QOBL is infeasible.

Based on the previous results, the algorithm for solving QOBL can be outlined as follows.

figure c

As we see, the main computational costs of algorithm is solving m, \((m+p-1)-\)eTRS. In the next section, we discuss the solution approach for p-eTRS.

3 Solving p-eTRS

As mentioned in the introduction, p-eTRS has been widely studied in recent years. The BB algorithm of [7] is a recent efficient algorithm to solve p-eTRS that we use in our numerical experiments. Also, we utilize the ADMM approach that has been widely used to solve various classes of optimization problems [3, 10, 19, 20, 30, 32]. Consider the following ith \((m+p-1)-\)eTRS (\(i \in \mathcal {I}\)) that arises in the QOBL algorithm:

figure d

One can write it in the following equivalent form:

$$\begin{aligned} \min \quad&\frac{1}{2}x^TAx +a^Tx \nonumber \\&||x-c_i||^2 \le \delta _i^2, \\&2(c_i-c_j)^Tz\le \alpha _{ij},~~~~j\in \mathcal {I}\setminus \{i\}, \nonumber \\&b_k^T z \le \beta _k ,~~~~ k=1,\ldots , p \nonumber \\&x=z. \nonumber \end{aligned}$$
(4)

Now to define the ADMM steps, consider the augmented Lagrangian of (4) as follows:

$$\begin{aligned} {L}\left( x, z , \lambda \right) = \frac{1}{2}x^TAx +a^Tx + \lambda ^T \left( x - z \right) + \frac{\rho }{2} || x - z||^2, \end{aligned}$$

where \(\lambda _i\)’s are Lagrange multipliers and \(\rho \in \mathbb {R}_+\) is the appropriate penalty parameter. Let \(z_k\) be a feasible point for \((m+p-1)-\)eTRS that is obtained by solving m (\(CR_i\)). The ADMM iterations are as follows:

  • Step 1: \(x^{k+1}=\underset{||x-c_i||^2 \le \delta _i^2}{\mathrm {argmin}} \quad {L}\left( x, z^{k} , \lambda ^k \right) .\)

  • Step 2: \(z^{k+1}=\underset{2(c_i-c_j)^Tz\le \alpha _{ij},~j\in \mathcal {I}\setminus \{i\}}{\underset{b_k^Tz\le \beta _k, ~ k=1, \ldots , p}{\mathrm {argmin}}} \quad {L}\left( x^{k+1} , z, \lambda ^k \right) .\)

  • Step 3: \(\lambda ^{k+1}=\lambda ^k + \gamma \rho \left( x^{k+1}-z^{k+1} \right) \), where \(\gamma \in (0, 1)\) is a constant.

In Step 1, we solve the following TRS:

$$\begin{aligned} \min \quad&\frac{1}{2}x^T\left( A +\rho I_n \right) x +\left( a+\lambda -\rho z^k\right) ^T x \nonumber \\&||x-c_i||^2 \le \delta _i^2. \end{aligned}$$
(5)

Let \(x^{k+1}\) be the optimal solution of (5). In Step 2, we solve the following problem:

$$\begin{aligned} \min \quad&\frac{\rho }{2} z^Tz -(\lambda +\rho x^{k+1})^Tz \nonumber \\&2(c_i-c_j)^Tz\le \alpha _{ij},~~~~j\in \mathcal {I}\setminus \{i\} \\&b_k^T z \le \beta _k ,~~~~ k=1,\ldots , p. \nonumber \end{aligned}$$
(6)

As we see, if \(\rho \ge -\lambda _{\min }(A) \), then in Step 1 and Step 2, we have convex optimization problems, where \(\lambda _{\min }(A)\) is the smallest eigenvalue of A.

It should also be noted that the convergence results for the ADMM algorithms under some mild assumptions are established in [10, 20, 30, 32] for different classes of optimization problems. The convergence of ADMM to the first-order stationary point is given in the following theorem.

Theorem 3.1

([30]). Let \((x^*, z^*, \lambda ^*)\) be any accumulation point of \(\lbrace (x^k, z^k, \lambda ^k)\rbrace \) generated by the ADMM. Then by boundedness assumptions of \(\lbrace \lambda ^k \rbrace \) and \(\sum _{k=0}^\infty \vert \vert \lambda ^{k+1} -\lambda ^k \vert \vert ^2 < \infty \), \(x^*\) satisfies the first-order stationary conditions.

4 Numerical Results

In this section, we compare the QOBL algorithm with CVX [18] (solves the semidefinite programming (SDP) relaxation of QOBL) and the EAE algorithm [16, 23]. The SDP relaxation of QOBL is as follows:

$$\begin{aligned} \min ~~~&\mathrm {Trace}(AX)+a^Tx \\ s.t.~~~&\mathrm {Trace}(X)-2c_i^Tx+||c_i||^2-\delta _i^2 \le 0,~~i \in \mathcal {I}, \\&b_k^Tx \le \beta _k,~~k=1, \ldots , p, \\&~~ X\succeq xx^T, \end{aligned}$$
(SDP)

which is exact when

$$\begin{aligned} \mathrm {dim} \Big (\mathrm {Ker}\left( A- \lambda _{\min }(A)I_n \right) \Big ) \ge m+p + 1, \end{aligned}$$
(7)

where \(I_n\) is the identity matrix and \(\mathrm {Ker}(A) := \lbrace d \in \mathbb {R}^n| Ad=0 \rbrace \) [14]. To solve p-eTRS within the QOBL algorithm, we use the BB algorithm of [7] and ADMM. Implementation is done in MATLAB R2017a on a 2.50 GHz laptop with 8 GB of RAM, and the results in tables are the average of 10 runs for each dimension. It is worth noting that p-eTRSs inside the QOBL algorithm can be solved in parallel. We report the results for both parallel and non-parallel implementations. (CPU time in parentheses are for the parallel version.) The used machine allows solving two p-eTRSs in parallel.

Table 1 Notations in the tables
Table 2 Comparison of the QOBL algorithm with CVX when SDP relaxation of QOBL is exact
Table 3 Comparison of the QOBL algorithm with the EAE algorithm when \(m\ge 5\) and \(p=0\)
Table 4 Comparison of the QOBL algorithm with the EAE algorithm when \(p\ne 0\)
Table 5 Results of parallel QOBL algorithm when \(m\ge n\) and \(p=0\)

We generate instances of QOBL such that the Slater condition holds. To this end, first we generate a random matrix \(C \in \mathbb {R}^{n \times m}\). Let \(c_i\), \(i \in \mathcal {I}\) be the columns of the matrix C. Then, we set \(y\in \mathbb {R}^{n}\) as the convex combination of the columns of C, i.e.,

$$\begin{aligned} y=\sum _{i=1}^m \lambda _i c_i,~~~\text{ such } \text{ that } ~~~\sum _{i=1}^m \lambda _i=1,~~ \lambda _i\ge 0. \end{aligned}$$
(8)

Next, we set \(\delta _i=||c_i -y||+\epsilon _i\) \(\forall i \in \mathcal {I}\), where \(\epsilon _i \in (0,1)\).

  • Test class 1: In this class, we compare the QOBL algorithm when using ADMM with CVX (that solves the SDP relaxation). To do so, we consider \(m<n\) and generate \(A\in \mathbb {R}^{n \times n}\) randomly such that multiplicity of its smallest eigenvalue is greater than m and \(p=0\). Therefore, the SDP relaxation is exact. The results are reported in Table 2. As we see, for dimensions \(50\le n \le 300\), CVX is better in terms of CPU time, while for the rest of the problems, the QOBL algorithm is faster and CVX cannot solve larger problems. The parallel version of the QOBL algorithm also shows significant CPU time reduction for larger problems.

  • Test class 2: In this class, we compare the QOBL algorithm and EAE algorithm of [16]. To solve p-eTRS inside the QOBL algorithm, we use the BB algorithm of [7] and ADMM. We generate \(A\in \mathbb {R}^{n \times n}\) randomly and we set \(p=0\). The results are summarized in Table 3. As we see, the EAE algorithm is able to solve problems for \(n\le 100\) and except for one instance, the non-parallel QOBL algorithm with ADMM is always faster than it, while they have almost equal objective values. Also, when \(m\le 20\), the non-parallel QOBL algorithm with the BB algorithm is faster than the EAE algorithm in terms of CPU time. When the number of ball constraints is increasing, the QOBL algorithm with ADMM is better than the QOBL algorithm with the BB algorithm in terms of CPU time, while having almost equal objective values. Here, also we see significant time reduction of the parallel QOBL algorithm. Also, in both parallel and non-parallel versions, the QOBL algorithm with ADMM is faster than the QOBL algorithm with the BB algorithm for \(m>10\).

  • Test class 3: In this class, we compare the QOBL algorithm and EAE algorithm, when \(p \ne 0\). By considering y as in (8), we add linear inequality constraints as follows:

    • 1- Generate \(b_k \in \mathbb {R}^{n}\) for \(k=1, \ldots , p\) randomly,

    • 2- Let \(\beta _k =b_k^Ty+\epsilon \) where \(\epsilon \in (0,1)\).

    Therefore, y as given in (8) is an interior point of QOBL. The corresponding results are summarized in Table 4. A similar observation as in the previous tables also hold here and the QOBL algorithm in overall, performs better than the EAE algorithm. Also, when the number of ball and linear constraints, and dimensions are increasing, the QOBL algorithm with ADMM is the best among all.

  • Test class 4: In this class, we apply the parallel QOBL algorithm to instances when \(m \ge n\). We generate \(A\in \mathbb {R}^{n \times n}\) randomly, and we set \(p=0\). To solve \((m+p-1)-\)eTRS inside the QOBL algorithm, we use ADMM. The results are summarized in Table 5 that can be further enhanced by running on cluster machines.

5 Conclusions

In this paper, we studied an indefinite quadratic minimization problem with balls and linear inequality constraints (QOBL). We showed that by solving several extended trust-region subproblems (e-TRS), the optimal solution of QOBL can be found. Our experiments showed that when SDP relaxation is exact, the new approach is better than CVX for larger dimensions. For general instances, our comparison with the EAE algorithm of [7] showed that the new approach is significantly faster. Also using ADMM for solving e-TRS, inside the QOBL algorithm, for majority of problems is faster than the BB algorithm of [7]. Parallelization also is another important feature of the QOBL algorithm.