1 Introduction

The linear complementarity problem is to find a real vector \(x\in {R}^{n}\) satisfying

$$\begin{aligned} {x}^{\mathrm {T}}w=0,~x \ge 0,~w=Ax+q \ge 0, \end{aligned}$$
(1)

where \(A\in {R}^{n \times n}\), \(q\in {R}^{n}\) and the superscript ‘T’ denotes the transpose of a vector. For our convenience, let us denote this problem as LCP(Aq). Many problems can be transformed into the form (1), for instance, the elastic contact problem, the linear and quadratic programming problems and the market equilibrium problems, see [1,2,3,4,5,6] and the references therein.

It is well-known that the LCP(Aq) has a unique solution for any \(q\in R^{n}\) if and only if the system matrix A is a P-matrix. The P-matrices include many types, for example, the positive definite matrix and the \(H_{+}\)-matrix, both of which have been investigated in both theory and the numerical algorithms aspects, see [1, 7,8,9,10,11] and the references therein. In recent decades, a series of solving methods for the LCP(Aq) are studied by many authors, such as the Lemke method [3], the principal pivot transformation method [12], the non-modulus linear method [13], the projected method [8], the chaotic iterative methods [14] and the modulus-based matrix splitting iteration methods [7], etc.. These solving approaches can be divided into two categories: the direct methods and the iteration methods. The first three methods mentioned above are the direct methods and the latter three methods are the iteration methods. Both the direct methods and the iteration methods have their advantages and both methods need some conditions. In general, when the LCP(Aq) has a small and dense system matrix, the direct methods are considered, and when the LCP(Aq) has a large and sparse system matrix, the iteration methods are considered. However, the criterion of applying the direct methods or the iteration methods is not unconditional, such as, if the sparse structure of A can not be applied in the iteration methods but the direct methods are simple and effective, it is more better to consider the direct methods even if A is a large matrix, since the solutions obtained by the direct methods are the exact solutions. For other materials connected with the solving methods, see [14,15,16,17,18,19,20,21,22,23,24,25,26] and the references therein. Besides the numerical algorithms for the LCP(Aq), the theoretical aspects have also been discussed, for instance, the existence and uniqueness of solution, the stability and sensitivity of the solution, the relationship between the LCP(Aq) and other problems, the error bound problems and the perturbation problems of the solution, see [1, 5, 9, 27,28,29,30] and other references.

In this paper, we study the direct method for solving the LCP(Aq) and consider a particular LCP(Aq) with the system matrix A being an M-matrix. Based on the complementarity relation existed in the LCP(Aq) and the properties of the M-matrix, by seeking the zero and the positive entry positions of the solution, we transform the LCP(Aq) into an equivalent low order linear complementarity problem with a low order linear equations. Since the low order linear complementarity problem is established, then this transformation procession can be continued. In this way, we provide a reduced order method for solving the LCP(Aq) with an M-matrix. This method integrates the reducing order procession and the construction of the solution of the linear complementarity problem in together, and the numerical results show that the reduced order method is an effective method.

The outline of this paper is as follows. We present the main results and the reduced order method in Sect. 2 and the pseudo codes of this method are given in Sect. 3.

2 Main Results

In this section, we consider the direct method for solving the LCP(Aq) with an M-matrix. Let us first give some definitions, notations and preliminary works. Most of them can be found in [5, 7, 10]. The real matrix \(A=(a_{ij})\) is denoted by \(A\ge 0\) if \(a_{ij}\ge 0, i, j=1, 2,..., n\). A matrix \(A\in R^{n\times n}\) is called an M-matrix if it satisfies \(A^{-1}\ge 0\) with \(a_{ij}\le 0 (i\ne j), i, j=1, 2,..., n.\) For an M-matrix, all of its principal sub-matrices are also M-matrices. The vector v is denoted by \(v\ge 0 ~(>0)\) if \(v_{i} \ge 0 ~(>0)\) holds for \(i=1,2,...,n\).

Lemma 1

   Let \(A\in R^{n\times n}\) be an M-matrix, and suppose \(x^{*}\) is the solution of the LCP(Aq), then

  1. (i)

    if \(q\le 0\), \(x^{*}=A^{-1}(-q)\);

  2. (ii)

    if \(q\ge 0\), \(x^{*}=0\).

Proof

Since the matrix A is an M-matrix, so \(A^{-1}\ge 0\) and the LCP(Aq) has a unique solution.

If \(q\le 0\), then \(A^{-1}(-q)\ge 0\) and \(A(A^{-1}(-q))+q=(-q)+q=0\), that is \((A^{-1}(-q))^{\mathrm {T}}[A(A^{-1}(-q))+q]=0\), so \(x^{*}=A^{-1}(-q)\).

If \(q\ge 0\), then \(0^{\mathrm {T}}(A0+q)=0\), so \(x^{*}=0\).

Therefore, the conclusion is proved.\(\square \)

Lemma 1 considers two particular cases of the LCP(Aq), in the following, we discuss the general case.

Theorem 1

   Let \(A\in R^{n\times n}\) be an M-matrix, and suppose \(x^{*}\) is the solution of the LCP(Aq). Let \(q=(q_{1},q_{2},...,q_{n})^{\mathrm {T}}\in R^{n}\). Denote \(S_{N}=\{i:q_{i}<0\}=\{i_{1},i_{2},\ldots ,i_{s}\} \ne \Phi ,\) \(S_{P}=\{j:q_{j}\ge 0\}=\{j_{1},j_{2},...,j_{t}\}\), \({\mathfrak {q}}_{1}=(q_{i_{1}},q_{i_{2}},...,q_{i_{s}})^{\mathrm {T}}\), \({\mathfrak {q}}_{2}=(q_{j_{1}},q_{j_{2}},...,q_{j_{t}})^{\mathrm {T}}\), \({\hat{x}}_{1}^{*}=(x^{*}_{i_{1}},x^{*}_{i_{2}},...,x^{*}_{i_{s}})^{\mathrm {T}}\), \({\hat{x}}_{2}^{*}=(x^{*}_{j_{1}},x^{*}_{j_{2}},...,x^{*}_{j_{t}})^{\mathrm {T}}\). Denote \(A_{(S_{N},S_{N})}\) as the principal sub-matrix of A, and denote \(A_{(S_{P},S_{N})}\) as the sub-matrix of A with the row and column indices coming from the sets \(S_{P}\), \(S_{N}\), respectively, and \(v=A^{-1}_{(S_{N},S_{N})}(-{\mathfrak {q}}_{1})\). If \({\mathfrak {q}}_{2}+A_{(S_{P},S_{N})}v\ge 0\), then \({\hat{x}}_{1}^{*}=v, {\hat{x}}_{2}^{*}=0\).

Proof

From the definition of \(S_{N}\) and \(S_{P}\), we know \(s+t=n\). Since A is an M-matrix, \(A_{(S_{N},S_{N})}\) is an M-matrix too, therefore the vector \(v=A^{-1}_{(S_{N},S_{N})}(-{\mathfrak {q}}_{1})\) is a positive vector. If we denote the indices of the vector v by \(i_{1},i_{2},...,i_{s}\) corresponding to the elements of set \(S_{N}\), and set \(x^{*}=(x^{*}_{1},x^{*}_{1},...,x^{*}_{n})^{\mathrm {T}}\), where \(x^{*}_{i}=0\) if \(i\in S_{P}\) and \(x^{*}_{i}=x^{*}_{i_{k}}=v_{i_{k}}\) if \(i\in S_{N}\), and set \(w^{*}=(w_{1}^{*},w_{2}^{*},...,w_{n}^{*})^{\mathrm {T}}\), where \(w_{i}^{*}=0\) if \(i\in S_{N}\) and \(w_{i}^{*}=q_{i}+A_{(i,S_{N})}v\ge 0\) if \(i\in S_{P}\), then we have \(x^{*}\ge 0, w^{*}\ge 0\) with

$$\begin{aligned} \left( \begin{array}{cc} I&{}-A \\ \end{array} \right) \left( \begin{array}{c} w^{*} \\ x^{*}\\ \end{array} \right) =q,\quad {x^{*}}^{\mathrm {T}}w^{*}=0. \end{aligned}$$

Thus, \(x^{*}\) is the solution of the LCP(Aq). From the constructions of \(x^{*}, w^{*}\), and the unique property of the solution for the LCP(Aq) with an M-matrix, we know \({\hat{x}}_{1}^{*}=v, {\hat{x}}_{2}^{*}=0\), which constitute the whole solution \(x^{*}\) of the LCP(Aq). So the conclusion is established. \(\square \)

From Theorem 1 and the proof, we can find that the solution of the LCP(Aq) is composed of two parts in some conditions: one is the zero entries part, and the other one is the positive entries part which can be obtained by solving a low order linear equations. If the conditions are not satisfied, we have the following result about the solution.

Theorem 2

   Let \(A\in R^{n\times n}\) be an M-matrix, and suppose \(x^{*}\) is the solution of the LCP(Aq). Let \(q=(q_{1},q_{2},...,q_{n})^{\mathrm {T}}\in R^{n}\) and \(w^{*}=Ax^{*}+q=(w^{*}_{1},w^{*}_{2},...,w^{*}_{n})^{\mathrm {T}}\in R^{n}\). Denote \(S_{N}=\{i :q_{i}<0\}=\{i_{1},i_{2},...,i_{s}\}\ne \Phi \), \(S_{P}=\{j:q_{j}\ge 0\}=\{j_{1},j_{2},...,j_{t}\}\), \({\mathfrak {q}}_{1}=(q_{i_{1}},q_{i_{2}},...,q_{i_{s}})^{\mathrm {T}}\), \({\mathfrak {q}}_{2}=(q_{j_{1}},q_{j_{2}},...,q_{j_{t}})^{\mathrm {T}}\), \({\hat{x}}_{1}^{*}=(x^{*}_{i_{1}},x^{*}_{i_{2}},...,x^{*}_{i_{s}})^{\mathrm {T}}\), \({\hat{x}}_{2}^{*}=(x^{*}_{j_{1}},x^{*}_{j_{2}},...,x^{*}_{j_{t}})^{\mathrm {T}}\), \({\hat{w}}_{1}^{*}=(w^{*}_{i_{1}},w^{*}_{i_{2}},...,w^{*}_{i_{s}})^{\mathrm {T}}\) and \({\hat{w}}_{2}^{*}=(w^{*}_{j_{1}},w^{*}_{j_{2}},...,w^{*}_{j_{t}})^{\mathrm {T}}\). Denote \(A_{(S_{N},S_{N})}\), \(A_{(S_{P},S_{P})}\), \(A_{(S_{P},S_{N})}\), \(A_{(S_{N},S_{p})}\) as the sub-matrices of A with the row and column indices coming from the sets \(S_{P}\), \(S_{N}\), respectively, and \(v=A^{-1}_{(S_{N},S_{N})}(-{\mathfrak {q}}_{1})\). If \({\mathfrak {q}}_{2}+A_{(S_{P},S_{N})}v\) has negative entries, then the LCP(Aq) can be transformed into a low order equivalent linear complementarity problem LCP(\(A^{1},q^{1}\)) with a linear system \(N^{1}x=b^{1}\), where \(A^{1}=A_{(S_{P},S_{P})}-A_{(S_{P},S_{N})}A_{(S_{N},S_{N})}^{-1}A_{(S_{N},S_{P})}\), \(q^{1}={\mathfrak {q}}_{2}+A_{(S_{P},S_{N})}v\), \(N^{1}=A_{(S_{N},S_{N})}\), \(b^{1}=-{\mathfrak {q}}_{1}-A_{(S_{N},S_{P})}{\hat{x}}_{2}^{*}\) and \({\hat{x}}_{2}^{*}\) is the solution of the LCP(\(A^{1},q^{1}\)).

Proof

For

$$\begin{aligned} A_{(S_{N},S_{N})}{\hat{x}}_{1}+A_{(S_{N},S_{P})}{\hat{x}}_{2}+{\mathfrak {q}}_{1}={\hat{w}}_{1}, \end{aligned}$$

and the matrix A beng an M-matrix, \(q_{i}<0\) for \(i\in S_{N}\), and \({\hat{w}}_{1}\ge 0\), we know that for each \(i\in S_{N}\), \(x^{*}_{i}\ne 0\) holds. Thus \({\hat{w}}_{1}=0\), that is \({\hat{w}}^{*}_{1}=0\), then the part \({\hat{x}}_{1}^{*}\) of the solution \(x^{*}\) should satisfy

$$\begin{aligned} A_{(S_{N},S_{N})}{\hat{x}}_{1}^{*}=-{\mathfrak {q}}_{1}-A_{(S_{N},S_{P})}{\hat{x}}_{2}. \end{aligned}$$
(2)

Solving this linear system equations for \({\hat{x}}_{1}^{*}\), we obtain

$$\begin{aligned} {\hat{x}}_{1}^{*}=-A_{(S_{N},S_{N})}^{-1}[{\mathfrak {q}}_{1}+A_{(S_{N},S_{P})}{\hat{x}}_{2}]. \end{aligned}$$
(3)

Then by substitution, the other part \({\hat{x}}_{2}^{*}\) of the solution \(x^{*}\) satisfies the equation

$$\begin{aligned} {\hat{w}}_{2}-[A_{(S_{P},S_{P})}-A_{(S_{P},S_{N})}A_{(S_{N},S_{N})}^{-1}A_{(S_{N},S_{P})}]\hat{x_{2}}={\mathfrak {q}}_{2}-A_{(S_{P},S_{N})}A_{(S_{N},S_{N})}^{-1}{\mathfrak {q}}_{1}. \end{aligned}$$

That is, the other part \({\hat{x}}_{2}^{*}\) of the solution \(x^{*}\) satisfies the LCP(\(A^{1},q^{1}\))

$$\begin{aligned} \hat{x_{2}}^{\mathrm {T}}\hat{w_{2}}=0, ~\hat{w_{2}}=A^{1}\hat{x_{2}}+q^{1}. \end{aligned}$$
(4)

where the matrix

$$\begin{aligned} A^{1}=A_{(S_{P},S_{P})}-A_{(S_{P},S_{N})}A_{(S_{N},S_{N})}^{-1}A_{(S_{N},S_{P})} \end{aligned}$$

is an M-matrix, which is the Schur complement of the principal sub-matrix \(A(S_{N},S_{N})\), and

$$\begin{aligned} q^{1}={\mathfrak {q}}_{2}-A_{(S_{P},S_{N})}A_{(S_{N},S_{N})}^{-1}{\mathfrak {q}}_{1}={\mathfrak {q}}_{2}+A_{(S_{P},S_{N})}v, \end{aligned}$$

which has the negative entries from the assumption of the theorem. Set the linear system (2) about \({\hat{x}}^{*}_{1}\) to be \(N^{1}x=b^{1}\), if we solve (4) for \({\hat{x}}^{*}_{2}\), then from (2), (3) and (4), the conclusion of this theorem is proved. \(\square \)

About Theorem 2, we can see that the linear complementarity problem (4) for \({\hat{x}}^{*}_{2}\) should be solved first, then \({\hat{x}}^{*}_{1}\) can be obtained from the linear system (2), and the solution \(x^{*}\) can be constructed by \({\hat{x}}^{*}_{1}\) and \({\hat{x}}^{*}_{2}\) at last. Moreover, we can find that since the low order linear complementarity problem LCP(\(A^{1},q^{1}\)) is established, the transformation process of the linear complementarity problem can be continued until the negative index set \(S_{N}=\Phi \) or the nonnegative set \(S_{P}=\Phi \) for a low order linear complementarity problem. In these series of transformations, the condition \(S_{N}\ne \Phi \) should be measured in advance each time. Since the linear complementarity problem is changed and these accompanied systems of linear equations remain the same in each transformation, we only need to solve the last low order linear complementarity problem, followed by solving the forward linear system step by step, then the solution of the original LCP(Aq) can be constructed in the end. Summarize the above discussions, we obtain the following Theorem 3 followed by the reduced order method for the LCP(Aq) from Theorem 2.

Theorem 3

   Let \(A\in R^{n\times n}\) be an M-matrix, and suppose \(x^{*}\) is the solution of the LCP(Aq). Let \(q=(q_{1},q_{2},...,q_{n})^{\mathrm {T}}\in R^{n}\) and \(w^{*}=Ax^{*}+q=(w^{*}_{1},w^{*}_{2},...,w^{*}_{n})^{\mathrm {T}}\in R^{n}\). Denote \(S_{N}=\{i :q_{i}<0\}=\{i_{1},i_{2},...,i_{s}\}\ne \Phi \), \(S_{P}=\{j:q_{j}\ge 0\}=\{j_{1},j_{2},...,j_{t}\}\), \({\mathfrak {q}}_{1}=(q_{i_{1}},q_{i_{2}},...,q_{i_{s}})^{\mathrm {T}}\), \({\mathfrak {q}}_{2}=(q_{j_{1}},q_{j_{2}},...,q_{j_{t}})^{\mathrm {T}}\), \({\hat{x}}_{1}^{*}=(x^{*}_{i_{1}},x^{*}_{i_{2}},...,x^{*}_{i_{s}})^{\mathrm {T}}\), \({\hat{x}}_{2}^{*}=(x^{*}_{j_{1}},x^{*}_{j_{2}},...,x^{*}_{j_{t}})^{\mathrm {T}}\), \({\hat{w}}_{1}^{*}=(w^{*}_{i_{1}},w^{*}_{i_{2}},...,w^{*}_{i_{s}})^{\mathrm {T}}\) and \({\hat{w}}_{2}^{*}=(w^{*}_{j_{1}},w^{*}_{j_{2}},...,w^{*}_{j_{t}})^{\mathrm {T}}\). Denote \(A_{(S_{N},S_{N})}\), \(A_{(S_{P},S_{P})}\), \(A_{(S_{P},S_{N})}\), \(A_{(S_{N},S_{p})}\) as the sub-matrices of A with the row and column indices coming from the sets \(S_{P}\), \(S_{N}\), respectively, and \(v=A^{-1}_{(S_{N},S_{N})}(-{\mathfrak {q}}_{1})\). If \(q^{1}={\mathfrak {q}}_{2}+A_{(S_{P},S_{N})}v\) has negative entries, then the LCP(Aq) can be transformed into a low order equivalent linear complementarity problem LCP(\(A^{l},q^{l}\)) with a series of linear equations:

$$\begin{aligned} \begin{array}{c} N^{r}x=b^{r},r=1,2,...,l,\\ \mathrm {LCP}(A^{l},q^{l}).\\ \end{array} \end{aligned}$$

where \(l~(>1)\) is an integer. For \(r=1\), \(N^{1},A^{1},b^{1},q^{1}\) are same with those in Theorem 2. For \(r=2,3,...,l\), we have \(N^{r}=A^{r-1}_{(S_{N}^{r-1},S_{N}^{r-1})}\), \(b^{r}=-{\mathfrak {q}}_{1}^{r-1}-A_{(S_{N}^{r-1},S_{P}^{r-1})}^{r-1}{\hat{x}}_{2}^{(r-1)*}\) with

$$\begin{aligned} \begin{aligned} S_{N}^{r-1}&=\{i :q_{i}^{r-1}<0\}=\{i_{1^{r-1}},i_{2^{r-1}},...,i_{s^{r-1}}\}\ne \Phi ,\\ S_{P}^{r-1}&=\{j :q_{j}^{r-1}\ge 0\}=\{j_{1^{r-1}},i_{2^{r-1}},...,j_{t^{r-1}}\}. \end{aligned} \end{aligned}$$

\(x^{(r-1)*}\) is the solution of the LCP(\(A^{r-1},q^{r-1}\)) with

$$\begin{aligned} \begin{aligned} A^{r-1}&=A^{r-2}_{(S_{P}^{r-2},S_{P}^{r-2})}-A^{r-2}_{(S_{P}^{r-2},S_{N}^{r-2})}{A^{r-2}_{(S_{N}^{r-2},S_{N}^{r-2})}}^{-1}A^{r-2}_{(S_{N}^{r-2},S_{P}^{r-2})},\\ q^{r-1}&={\mathfrak {q}}_{2}^{r-2}-A_{(S_{P}^{r-2},S_{N}^{r-2})}^{r-2}{A^{r-2}_{(S_{N}^{r-2},S_{N}^{r-2})}}^{-1}{\mathfrak {q}}_{1}^{r-2},\\ {\mathfrak {q}}_{1}^{r-1}&=(q_{i_{1^{r-1}}}^{r-1},q_{i_{2^{r-1}}}^{r-1},...,q_{i_{s^{r-1}}}^{r-1})^{\mathrm {T}},\\ \end{aligned} \end{aligned}$$

which is composed of \({\hat{x}}_{1}^{(r-1)*}\) and \({\hat{x}}_{2}^{(r-1)*}\) with \({\hat{x}}_{1}^{(r-1)*}\) satisfying \(N^{r-1}x=b^{r-1}\) and \({\hat{x}}_{2}^{(r-1)*}\) being the solution of the LCP(\(A^{r-2},q^{r-2}\)) for \(r=3,4,...,l\), and \({\hat{x}}_{2}^{(l)*}=0\) or \({\hat{x}}_{2}^{(l)*}={A^{l}}^{-1}(-q^{l})\).

According to Theorem 3, we obtain the reduced order method for solving the LCP(Aq) with an M-matrix, which is a direct method and the solution \(x^{*}\) is obtained by means of construction from the solutions of some low order linear system equations and a low order linear complementarity problem. The linear complementarity problem is established in each transformation and the index sets that are connected with the sign of the constant vector in the linear complementarity problem need to be noted, which are applied to construct the solution \(x^{*}\) at last. In addition, only when we determine the integer l, that is, the set \(S_{N}^{l}\) which satisfies \(S_{N}^{l}=\Phi \) or \(S_{P}^{l}=\Phi \), then the process of solving the LCP(Aq) begins. At this time, we obtain the matrices \(A^{l}\), \(N^{l}\) and the solution \(x^{(l)*}=0\) or \(x^{(l)*}={A^{l}}^{-1}(-q^{l})\) of the LCP(\(A^{l},q^{l}\)) from Lemma 1. Solving \(N^{l}x=b^{l}\) and implementing back substitution, then we begin the whole solving and construction process of \(x^{*}\). The order of the linear complementarity problems is decreased gradually and it satisfies

$$\begin{aligned} \sum _{r=1}^{l} \mathrm {Order}(N^{r}x=b^{r})+\mathrm {Order}(\mathrm {LCP}(A^{l},q^{l}))=n \end{aligned}$$

and the solution \(x^{*}\) is derived from construction, both of with are the main characters of the reduced order method, whose concrete pseudo codes are shown in Sect. 3. Besides, based on the proofs of Theorem 2 and Theorem 3, if we modify the reduced order method and add the expression of w, then \(w^{*}\) can be obtained accompanied with the solution \(x^{*}\), that is, \(w^{*}\) can also be obtained by construction rather than by the expression \(w^{*}=Ax^{*}+q\). At the end of this paragraph, we remark here that the proposed reduced order method is different from [24] and [25], both of which did not reduce the order of the complementarity problem, however, the reduced order method integrates the searching process of the integer l in Theorem 3, the solving processes of these low order linear equations and the construction of the solution \(x^{*}\) in together. In addition, the former [24] discussed the LCP(Aq) with a Stieltjes matrix, which is a particular M-matrix, and the reduced order method can solve the LCP(Aq) with a general M-matrix.

3 Algorithm

In this section, we present the pseudo codes of the reduced order method based on Lemma 1 and Theorems 13.

figure a

Footnote 1

4 Numerical Experiment

In this section, we present three examples. The first example is a low order case, which is to show the solving process of the reduced order method. The second example is a high order case, which is to show the effectiveness of the reduced order method. The third example is to show that the reduced order method can be applied to solve the LCP(Aq) with an inverse M-matrix.

Example 1

Let the system matrix A in the LCP(Aq) be

$$\begin{aligned} A=\left( \begin{array}{ccccc} 1&{}0&{}-1&{}0&{}-1 \\ -1&{}2&{}0&{}-1&{}-1 \\ 0&{}-1&{}3&{}-1&{}0\\ -1&{}0&{}-1&{}4&{}-1 \\ 0&{}-1&{}-1&{}0&{}5 \\ \end{array} \right) , \end{aligned}$$

and let the variable vector q be

$$\begin{aligned} {\bar{q}}=\left( \begin{array}{ccccc} -1,2,-1,2,1 \\ \end{array} \right) ^{\mathrm {T}},~{\hat{q}}=\left( \begin{array}{ccccc} -1,1,1,0,1 \\ \end{array} \right) ^{\mathrm {T}}, \end{aligned}$$

respectively. It’s easy to verify that the matrix A is an M-matrix.

(I) For \({\bar{q}}\), we have the sets \(S_{N}=\{1,3\}\ne \Phi \), \(S_{P}=\{2,4,5\}\) and

$$\begin{aligned}&A_{(S_{N},S_{N})}=\left( \begin{array}{cc} 1&{}-1 \\ 0&{}3\\ \end{array} \right) , {\bar{v}}=A_{(S_{N},S_{N})}^{-1}(-\bar{{\mathfrak {q}}}_{1})=\left( \begin{array}{cc} 1&{}\frac{1}{3} \\ 0&{}\frac{1}{3}\\ \end{array} \right) \left( \begin{array}{c} 1 \\ 1 \\ \end{array} \right) =\left( \begin{array}{c} \frac{4}{3} \\ \frac{1}{3} \\ \end{array} \right) . \\&\quad \bar{{\mathfrak {q}}}_{2}+A_{(S_{P},S_{N})}{\bar{v}}=\left( \begin{array}{c} 2 \\ 2 \\ 1\\ \end{array} \right) +\left( \begin{array}{cc} -1&{}0 \\ -1&{}-1 \\ 0&{}-1 \end{array} \right) \left( \begin{array}{c} \frac{4}{3} \\ \frac{1}{3} \\ \end{array} \right) =\left( \begin{array}{c} \frac{2}{3} \\ \frac{1}{3} \\ \frac{2}{3}\\ \end{array} \right) \ge 0. \end{aligned}$$

From Theorem 1, we know that the solution \({\bar{x}}^{*}\) is

$$\begin{aligned} {\bar{x}}^{*}=\left( \begin{array}{ccccc} \frac{4}{3},0, \frac{1}{3},0,0 \\ \end{array} \right) ^{\mathrm {T}}. \end{aligned}$$

(II) For \({\hat{q}}\), we also have the sets \(S_{N}=\{1,3\}\ne \Phi \), \(S_{P}=\{2,4,5\}\) and

$$\begin{aligned} {\hat{v}}= & {} A_{(S_{N},S_{N})}^{-1}(-\hat{{\mathfrak {q}}}_{1})={\bar{v}}=\left( \begin{array}{c} \frac{4}{3} \\ \frac{1}{3} \\ \end{array} \right) , \\ {\hat{q}}^{1}= & {} \hat{{\mathfrak {q}}}_{2}+A_{(S_{P},S_{N})}{\hat{v}}=\left( \begin{array}{c} 1 \\ 0 \\ 1\\ \end{array} \right) +\left( \begin{array}{cc} -1&{}0 \\ -1&{}-1 \\ 0&{}-1 \end{array} \right) \left( \begin{array}{c} \frac{4}{3} \\ \frac{1}{3} \\ \end{array} \right) =\left( \begin{array}{c} -\frac{1}{3} \\ -\frac{5}{3} \\ \frac{2}{3}\\ \end{array} \right) . \end{aligned}$$

So, from Theorem 2, the LCP(\(A,{\hat{q}}\)) can be transformed into a low order linear complementarity problem with a linear system of equations, that is,

$$\begin{aligned} \left( \begin{array}{cc} 1&{}-1 \\ 0&{}3 \\ \end{array} \right) \left( \begin{array}{c} x_{1} \\ x_{3} \\ \end{array} \right) =\left( \begin{array}{c} 1 \\ 1 \\ \end{array} \right) -\left( \begin{array}{ccc} 0&{}0&{}-1 \\ -1&{}-1&{}0 \\ \end{array} \right) \left( \begin{array}{c} {\hat{x}}^{*}_{2} \\ {\hat{x}}^{*}_{4} \\ {\hat{x}}^{*}_{5}\\ \end{array} \right) , \end{aligned}$$
(5)
$$\begin{aligned} \begin{array}{c} \left( \begin{array}{c} x_{2} \\ x_{4} \\ x_{5}\\ \end{array} \right) ^{\mathrm {T}} \left( B \left( \begin{array}{c} x_{2} \\ x_{4} \\ x_{5}\\ \end{array} \right) +{\hat{q}}^{1}\right) =0,\\ \end{array} \end{aligned}$$

where

$$\begin{aligned} B=\left( \begin{array}{ccc} 2&{}-1&{}-1 \\ 0&{}4&{}-1 \\ -1&{}0&{}5 \\ \end{array} \right) -\left( \begin{array}{cc} -1&{}0 \\ -1&{}-1\\ 0&{}-1 \\ \end{array} \right) \left( \begin{array}{cc} 1&{}-1 \\ 0&{}3 \\ \end{array} \right) ^{-1} \left( \begin{array}{ccc} 0&{}0&{}-1 \\ -1&{}-1&{}0 \\ \end{array} \right) \end{aligned}$$

and the low order linear complementarity problem is established and can be simplified as

$$\begin{aligned} \begin{array}{c} \left( \begin{array}{c} x_{2} \\ x_{4} \\ x_{5}\\ \end{array} \right) ^{\mathrm {T}} \left( \left( \begin{array}{ccc} \frac{5}{3}&{}-\frac{4}{3}&{}-2 \\ -\frac{2}{3}&{}\frac{10}{3}&{}-2 \\ -\frac{4}{3}&{}-\frac{1}{3}&{}5 \\ \end{array} \right) \left( \begin{array}{c} x_{2} \\ x_{4} \\ x_{5}\\ \end{array} \right) +\left( \begin{array}{c} -\frac{1}{3} \\ -\frac{5}{3}\\ \frac{2}{3}\\ \end{array} \right) \right) =0.\\ \end{array} \end{aligned}$$
(6)

For the linear complementarity problem (6), we have \(S_{N}^{1}=\{1,2\}\ne \Phi \), \(S_{P}^{1}=\{3\}\) and

$$\begin{aligned} A_{(S_{N}^{1},S_{N}^{1})}^{1}=\left( \begin{array}{cc} \frac{5}{3}&{}-\frac{5}{3} \\ -\frac{2}{3}&{}\frac{10}{3}\\ \end{array} \right) , {\hat{v}}^{1}={A_{(S_{N}^{1},S_{N}^{1})}^{1}}^{-1}(-\hat{{\mathfrak {q}}}_{1}^{1})=\left( \begin{array}{cc} \frac{5}{7}&{}\frac{2}{7} \\ \frac{1}{7}&{}\frac{5}{14}\\ \end{array} \right) \left( \begin{array}{c} \frac{1}{3} \\ \frac{5}{3} \\ \end{array} \right) =\left( \begin{array}{c} \frac{5}{7} \\ \frac{9}{14} \\ \end{array} \right) , \\ {\hat{q}}^{2}=\hat{{\mathfrak {q}}}_{2}^{1}+A_{(S_{P}^{1},S_{N}^{1})}^{1}{\hat{v}}^{1}=\frac{2}{3}+\left( \begin{array}{cc} -\frac{4}{3}&{}-\frac{1}{3} \\ \end{array} \right) \left( \begin{array}{c} \frac{5}{7} \\ \frac{9}{14} \\ \end{array} \right) =-\frac{1}{2}\le 0. \end{aligned}$$

So, from Theorem 3, the linear complementarity problem (6) can be transformed into a low order linear complementarity problem with a linear system again, that is,

$$\begin{aligned} \left( \begin{array}{cc} \frac{5}{3}&{}-\frac{4}{3} \\ -\frac{2}{3}&{}\frac{10}{3} \\ \end{array} \right) \left( \begin{array}{c} x_{2} \\ x_{4} \\ \end{array} \right) =\left( \begin{array}{c} \frac{1}{3}\\ \frac{5}{3} \\ \end{array} \right) -\left( \begin{array}{c} -2\\ -2 \\ \end{array} \right) {\hat{x}}^{*}_{5}, \end{aligned}$$
(7)
$$\begin{aligned} {x_{5}}^{\mathrm {T}}\left( \left( 5-\left( \begin{array}{cc} -\frac{4}{3}&{}-\frac{1}{3}\\ \end{array} \right) \left( \begin{array}{cc} \frac{5}{3}&{}-\frac{4}{3} \\ -\frac{2}{3}&{}\frac{10}{3} \\ \end{array} \right) ^{-1}\left( \begin{array}{c} -2\\ -2 \\ \end{array} \right) \right) x_{5}+{\hat{q}}^{2}\right) =0, \end{aligned}$$

where the second expression can be simplified as

$$\begin{aligned} {x_{5}}^{\mathrm {T}}(2x_{5}-\frac{1}{2})=0. \end{aligned}$$
(8)

Then, from Lemma 1, the solution of (8) is \({\hat{x}}^{*}_{5}=\frac{\frac{1}{2}}{2}=\frac{1}{4}\). Combining with (7) and (5), the solution of the original LCP(\(A,{\hat{q}}\)) can be constructed as

$$\begin{aligned} {\hat{x}}^{*}=\left( \begin{array}{ccccc} \frac{16}{7}, \frac{17}{14}, \frac{29}{28}, \frac{25}{28}, \frac{1}{4} \\ \end{array} \right) ^{\mathrm {T}}. \end{aligned}$$

From (II), we can find that the LCP(\(A,{\hat{q}}\)) is transformed into a low order linear complementarity problem (8) with two low order linear systems of equations: (5) and (7).

Example 2

In this example, we consider the high order cases and show the effectiveness of the reduced order method, that is Algorithm 1 presented in Sect. 3. Let A in the LCP(Aq) be a tridiagonal M-matrix, that is

$$\begin{aligned} A=\mathrm {trid}(-1,d,-1)\in R^{n\times n} \end{aligned}$$

with \(d=2\), \(d=3\) and \(d=4\), respectively. The matrix A with \(d=3\) arises from the American Option Pricing problems with \(\tau =1\) in [23], see [6, 23] for details. The matrix A with \(d=4\) comes from the finite difference discretization of a free boundary value problem and we consider a particular case here, see [7, 17] for details. Set q to be an arbitrary vector, that is q is generated by

$$\begin{aligned} q=\mathrm {randn}(n,1), \end{aligned}$$

where “\(\mathrm {randn}\)” is a function in Matlab software. We consider the running time (CPU), the number (l) of the produced linear equations and the residual error (ERROR), where ERROR is defined as

$$\begin{aligned} \mathrm {ERROR}=\mathrm {norm}(\min (x,Ax+q)), \end{aligned}$$

here,“norm” and “min” are two functions in Matlab software; see [7, 17]. Set \(n=1000\) and carry out 3 experiments for \(d=2\), \(d=3\) and \(d=4\), respectively, then we obtain Table 1 as follows.

Here, we set \(q_{i}\) (\(i=1,2,3\)) to be same for the three cases: \(d=2\), \(d=3\) and \(d=4\). From Table 1, we can find that although the precision of the numerical solution will decease when too many linear equations are produced in the solving procession (the number l of the linear equations is determined by the LCP(Aq) itself), the reduced order method is effective for solving the LCP(Aq) with an M-matrix.

Table 1 The reduced order method for solving the LCP(qA)

Example 3

The reduced order method is presented for the LCP(Aq) with an M-matrix, however, if the inverse of A is an M-matrix, that is, \(A^{-1}\) is an M-matrix, then the LCP(Aq) can equivalently be reformulated as

$$\begin{aligned} w^{\mathrm {T}}x=0,~w\ge 0,~x=A^{-1}w+A^{-1}(-q) \ge 0, \end{aligned}$$
(9)

which is a linear complementarity problem with an M-matrix. If we denote the reformulated linear complementarity problem as LCP\((A^{-1}, A^{-1}(-q))\), then it can be solved for \(w^{*}\) by the reduced order method. Thus we can obtain the solution \(x^{*}\) of the LCP(Aq) easily through the expression

$$\begin{aligned} x^{*}=A^{-1}w^{*}+A^{-1}(-q). \end{aligned}$$
(10)

We consider a low order case to show this solving procession as follows. Set A and q in the LCP(Aq) to be

$$\begin{aligned} A=\left( \begin{array}{ccccc} 3&{}\frac{9}{7}&{}\frac{11}{7}&{}\frac{5}{7}&{}1 \\ \frac{5}{2}&{}\frac{12}{7}&{}\frac{10}{7}&{}\frac{11}{14}&{}1 \\ \frac{5}{4}&{}\frac{11}{14}&{}\frac{15}{14}&{}\frac{13}{28}&{}\frac{1}{2}\\ \frac{5}{4}&{}\frac{9}{14}&{}\frac{11}{14}&{}\frac{17}{28}&{}\frac{1}{2} \\ \frac{3}{4}&{}\frac{1}{2}&{}\frac{1}{2}&{}\frac{1}{4}&{}\frac{1}{2} \\ \end{array} \right) ,~{\bar{q}}=\left( \begin{array}{ccccc} 1,-3,2,-1,1 \\ \end{array} \right) ^{\mathrm {T}},~{\hat{q}}=\left( \begin{array}{ccccc} -1,0,-2,1,-1 \\ \end{array} \right) ^{\mathrm {T}}, \end{aligned}$$

then A is an inverse \(M-\)matrix. By the reduced order method and (9) with (10), the solutions are

$$\begin{aligned} {\bar{x}}^{*}=\left( \begin{array}{ccccc} 0, \frac{7}{4}, 0,0 , 0\\ \end{array} \right) ^{\mathrm {T}},~{\hat{x}}^{*}=\left( \begin{array}{ccccc} 0, 0,\frac{7}{4}, 0,\frac{1}{4} \\ \end{array} \right) ^{\mathrm {T}}, \end{aligned}$$

respectively.

5 Concluding Remark

In this paper, we provide a direct method for solving the LCP(Aq) with an M-matrix, that is the reduced order method. By this method, the LCP(Aq) can ultimately be transformed into an equivalent complementarity problem with some low order linear equations. The numerical experiments show the accuracy and the effectiveness of this method.