Introduction

The knapsack problems, which have been intensively studied since the pioneering work of Dantzig (1957), have played an important role in industry, financial management, and so on. What is more, various integer programming problems can be relaxed to the knapsack problems. Therefore, the computing of the knapsack problems has been becoming the mark level of the computation in integer problems. To tackle this problem, many new contributions have been made in the following literature. A heuristic based upon genetic algorithms has been developed for multidimensional knapsack problem in paper (Chu and Beasley 1998). Based on the harmony search method, a new binary-coded version of harmony search (Kong et al. 2015) is presented to solve large-scale multidimensional knapsack problem. In this proposed algorithm, attention is paid to the probability distribution rather than the exact value of each decision variable, and the concept of mean harmony is developed in the memory consideration. Inspired by region partition of items, an effective hybrid algorithm based on greedy degree and expectation efficiency is constructed in the paper (Lv et al. 2016). Combining advanced features both from the path relinking method and the responsive threshold search algorithm, the first evolutionary path relinking approach is introduced in paper (Chen et al. 2016) for solving the quadratic multiple knapsack problem approximately.

In this paper, the distributed Dang and Ye’s fixed-point iterative method (Dang and Ye 2015) is implemented to solve large-scale knapsack feasibility problem. This fixed-pointed algorithm has been extended to airline disruption problem and other problems. The idea of solving multiple fleet airline disruption problems using a distributed computation approach to integer programming has been developed in the previous work (Wu et al. 2017a). The paper (Wu et al. 2017b) uses the Dang and Ye’s iterative fixed-point method for integer programming to generate feasible flight routes which are used to construct an aircraft reassignment in response to the grounding of one aircraft. Some computing of Nash equilibria methods are derived from this Dang and Ye’s algorithm, such as the method from the papers (Wu et al. 2014, 2015). Some other engineering problems (Zhang et al. 2015, 2016) can also use this fixed -point method to solve. The Dang and Ye’s fixed-pointed method can be explained as follows.

Let \(\varvec{P}=\{\varvec{x}\in R^{n}|\varvec{Ax}+\varvec{Gw}\le \varvec{b},{\text{for}}\, {\text{some}}\;\varvec{w}\in R^{p}\},\) where \(\varvec{A}\in R^{m\;\times \;n}\) is an \(m\;\times\; n\) integer matrix with \(n\ge 2,\;\varvec{G}\in R^{m\;\times\; p}\) an \(m\;\times \;p\) matrix, and \(\varvec{b}\) a vector of \(R^{m}.\)

Let \(x^{\text{max}}=(x^{\text{max}}_{1},\,x^{\text{max}}_{2},\,\ldots,x^{\text{max}}_{n})^{T}\) with \(x^{\text{max}}_{j}={\text{max}}_{x\in P}x_{j},\, j=1,2,\ldots ,n\) and \(x^{\text{min}}=(x^{\text{min}}_{1},x^{\text{min}}_{2},\ldots , x^{\text{min}}_{n})^{T}\) with \(x^{\text{min}}_{j}={\text{min}}_{x\in P}x_{j},\, j=1,2,\ldots ,n.\) Let \(D(P)=\left\{\varvec{x}\in Z^{n}|\varvec{x}^{l}\le \varvec{x} \le \varvec{x}^{u}\right\},\) where \(\varvec{x}^{l}=\lfloor \varvec{x}^{\text{min}}\rfloor\) and \(\varvec{x}^{u}=\lfloor \varvec{x}^{\text{max}}\rfloor .\) For \(\varvec{z}\in R^{n}\) and \(k\in N_{0},\) let \(P(\varvec{z},\, k)=\{\varvec{x}\in P|x_{i}=z_{i}, \,1\le i \le k,\, \text{and} \,x_{i}\le z_{i},\, k+1\le i \le n\}.\)

Given an integer point \(y\in D(P)\) with \(y_{1}\, >\,x_{i}^{l},\) Dang and Ye (2015) developed a fixed-point iterative algorithm which is presented in Fig. 1.

Fig. 1
figure 1

Flow diagram of the iterative method

In Dang and Ye’s algorithm for integer problem, a definition of an increasing mapping, which is from a finite lattice into itself, is developed. Any integer point, which is outside the P, is mapped into the first point in P that is smaller than them in the lexicographical order of \(x^{l}.\) All the integer points, which are inside the polytope, are the fixed points through this increasing mapping. Given an initial integer point, the method either proves there is no such point by a limited number of iterations or generates an integer point in the polytope. For more proofs and details about this iterative algorithm, one can consult the paper (Dang and Ye 2015). An appeal feature of this fixed-point iterative method, which will be used in this paper, is that it can be easily implemented in a distributed way.

The rest of the paper is organized as follows. Some details of transformation of the knapsack feasibility problem into a polytope judgement problem, which is based on a LLL basis reduction, will be presented in “Transformation of the knapsack feasibility problem into a polytope judgement problem” section. The computation details and numerical results will be given in “Distributed computation and numerical results” section. Some conclusions and future work will be discussed in the last “Conclusions and future work” section.

Transformation of the knapsack feasibility problem into a polytope judgement problem

In order to analyze the knapsack feasibility problem easily, this problem is defined as follows (Dantzig 1957).

Definition 1

Find a 0–1 integer solution of \(p^{T}x=d,\) where \(p=(p_{1},p_{2},...,p_{n+1})^{T} > 0\) and \(p_{i} \ne p_{j}\) for all \(i \ne j\)

After analysis, one can see this knapsack problem is one special example of the market split problem. To convert this problem into an equivalent problem of determining whether there is an integer point in a full-dimensional polytope given by \(P=\{x\in R^{n}|Ax \le b\},\) we can apply the LLL basis reduction algorithm (Khorramizadeh 2012) which has been described in paper (Wu et al. 2013).

Therefore, this knapsack feasibility problem can be formulated equivalently as follows:

Does there exist a vector

$$\begin{aligned} \varvec{\lambda }\in Z^{n\,-\,m}\;{\text{s.t.}}\,-\,\varvec{x}_{d}\, \le \,\varvec{X}_{0}\varvec{\lambda } \, \le \, \varvec{e}^{(n\,-\,m)\,\times \, 1}\,-\,\varvec{x}_{d} \end{aligned}.$$
(1)

The solving of the Definition 1 can be transformed to judge whether there exists an integer point in the polytope (1). The distributed iterative algorithm, developed by Dang and Ye (2015), has a good performance to judge whether the polytope (1) has an integer point or not.

Distributed computation and numerical results

One master computer combined with several slave computers is equipped to implement the distributed computation. The master computer takes charge of solving the solution space of the polytope, dividing the solution space to segments, sending the segments to the slave computers, receiving the computation result from the slave computers, and exporting the computation result. Each slave computer receives the segment, judges whether there exits an integer point in its segment using Dang and Ye’s fixed-point iterative method, and sends its result to the master computer. The outline of the distributed computation process in this paper is illustrated in Fig. 2

Fig. 2
figure 2

Flow diagram of the distributed computation process

In present study, the distributed computation system consists of three computers which are OptiPlex 330 with two processors. The programs are written in C++ language. Subsegments which are distributed by the master computer are mutually independent. Therefore, subsegments can be solved simultaneously. Luc Lapointe (1994) has been adopted to establish a communication network among the computers. The other settings and parameters are taken the same as the research (Wu et al. 2013). Message Passing Interface (MPI) is a tool to establish a stable communication network between the master computer and the slave computers in the distributed computation. The pseudocode of building the distributed network by MPI is described in Fig. 3.

Fig. 3
figure 3

Distributed computation pseudocode

In the following case study, two methods have been employed to solve the same example, respectively. One is distributed fixed-point method, while the other is the branch and cut method (Padberg and Rinaldi 1991) which is a classical algorithm for integer programming. The numerical results are shown in the following Table 1. For simplification, some symbols are defined as follows.

NumLPs::

The number of iterations for a certain algorithm

BC::

The branch and cut method

Table 1 Two method to solve the knapsack feasibility problems

From Table 1, we can see that the distributed algorithm is superior to the branch and cut method regarding the number of iterations.

Conclusions and future work

In this paper, a new method has been used to solve the knapsack feasibility problem. This method is divided into two steps. In the first step, the knapsack feasibility problem is transformed into a polytope judgement problem based on a LLL basis reduction. In the other step, a distributed fixed-point method for integer programming is implemented to solve the polytope judgement problem. Compared with the branch and cut method which is considered to be the best algorithm for the problem of this kind, numerical results show that this distributed fixed-point method is promising.

However, the dimension of instances is low and the number of slave computers in the numerical experiment is only three. The potential ability of this method has not been fully expressed. In the next step, these two shortcomings will be settled. With large number of slave computers, one can be confident to believe that the numerical results will be more better. Additionally, the distributed method is easy to be extended to solving other problems.