1 Introduction

The Budgeted Maximum Coverage Problem (BMCP) [1] is a natural extension of the standard 0–1 knapsack problem [2] and the set cover problem [3]. Let \(E=\{1,...,m\}\) be a set of m elements where each element \(j\in {E}\) has a nonnegative weight \(w_j\ge {0}\) and \(I=\{1,...,n\}\) be a set of n items where each item \(i\in {I}\) has a nonnegative cost \(c_i\ge {0}\) and covers a subset of elements \(E'_i\subseteq {E}\) associated by a relationship matrix \(\mathbf {A}\). The goal of the BMCP is to select a collection \(S\subseteq {I}\) that maximizes the sum of the weights of all the elements covered by the items in S, with the capacity constraint that the sum of the costs of the items in S cannot exceed a given budget L.

The BMCP is closely related to two classical NP-hard problems, the 0–1 knapsack problem and the (weighted) set cover problem. If all the elements are unweighted, the BMCP corresponds to a variant of the weighted set cover problem [4] that aims to select a collection \(S\subseteq {I}\) and maximizes the total number of elements covered by items in S, with the capacity constraint that the total weight of the items in S cannot exceed the budget L. Further, if all the items are also unweighted, the BMCP corresponds to a variant of the set cover problem [5] of picking L items such that the total number of covered elements is maximized. Also, the BMCP could degenerate into the 0–1 knapsack problem with weighted costs and weighted profits when each item covers exactly one element and each element is covered by exactly one item. Since both the NP-hard 0–1 knapsack problem and the NP-hard (weighted) set cover problem are reducible to the BMCP, the BMCP is NP-hard and is computationally challenging.

The BMCP has a wide range of real-world applications, such as service provider operations, location of network monitors [6], news recommendation systems [7], worker employment, decision-making [8,9,10], software package installation, facility location [1], and hybrid Software Defined Network optimization [11]. And there are some studies related to the extension problems of the BMCP, such as the generalized maximum coverage problem [12], the maximum coverage problem with group budget constraint [13], the budgeted maximum coverage with overlapping costs [14], the ground-set-cost budgeted maximum coverage problem [15], etc. In summary, the BMCP is a significant and challenging NP-hard problem.

Moreover, the BMCP is highly related to the Set-Union Knapsack Problem (SUKP) [16], wherein each item has a nonnegative profit and each element has a nonnegative weight. The goal of the SUKP is to select a subset \(S\subseteq {I}\) that maximizes the total profits of the items in S, with the constraint that the sum of the weights of all the elements covered by the items in S cannot exceed a given knapsack capacity C. In a word, the BMCP is a variant problem of the SUKP, and can be transferred to the SUKP by swapping the attributes of the items and elements [17]. The SUKP has received much attention in recent years. Early in 1994, Goldschmidt et al. first presented an exact algorithm based on dynamic programming to solve the SUKP [16]. Later on, the approximation algorithms [18, 19] and (meta) heuristic algorithms [20,21,22,23,24] were proposed for the SUKP.

However, as a highly related problem to the SUKP, there are relatively few researches on the standard BMCP after it was first presented by Khuller et al.  [1]. Khuller et al. presented a \((1-1/e)\)-approximation algorithm, and claimed it is the best possible approximation unless NP \(\subseteq\) DTIME\((n^{\text {O(loglog} n)})\). Later on, some approximation algorithms [12, 15, 25] and two greedy constructive algorithms [11] were proposed for various extensions or variants of the BMCP. Recently in 2021, Li et al. [17] proposed a meta-heuristic algorithm based on tabu search and reinforcement learning, called probability learning based tabu search (PLTS), for the standard BMCP problem.

To the best of our knowledge, PLTS is the only practical algorithm proposed for solving the standard BMCP. Like the effective heuristic algorithms for the SUKP [21, 24], PLTS follows the tabu search framework and explores the solution space by very simple search operators. Such a framework with simple search operators might result in a relatively small search scope and, thus, lead the algorithm not well exploring the solution space and easy to get stuck in local optima.

To handle this issue and make up for the lack of efficient heuristics for solving the BMCP, which is a challenging NP-hard problem with widely practical applications, in this work we aim to present an effective and novel heuristic algorithm for the BMCP. Note that our method is not based on the widely adopted tabu search framework, yet could significantly improve the performance of the existing heuristic algorithms and enrich the solutions. Specifically, we propose a variable depth local search algorithm, denoted as VDLS. The VDLS first generates an initial solution by the greedy constructive algorithm proposed by Khuller et al. [1], then improves the solution by a partial depth-first tree search method that the number of the branch nodes and the depth of the search tree are restricted. As the initial solution guarantees the approximation ratio of \((1-1/e)\), the improved solution also guarantees the approximation ratio of \((1-1/e)\).

The partial depth-first search method used in the VDLS enables to explore the solution space with a deep and wide search scope, that can improve the current solution by simultaneously changing the states (selected or not) of multiple items. During the search, we define an effective neighbor structure to improve the performance of the depth-first search method by cutting relatively low-quality branch nodes. Specifically, a neighbor item of item i must cover at least one element covered by item i. With the help of the neighbor structure, VDLS can adjust the selected items while losing as few covered elements as possible, so as to explore the solution space more efficiently. Since the search depth and search scope of the partial depth-first search method used in the VDLS are much larger than those of the PLTS, and the neighbor structure used in the VDLS is effective, our VDLS algorithm significantly outperforms the PLTS for solving the BMCP.

Li et al. [17] also proposed the first set of BMCP benchmarks to facilitate the evaluation of algorithms. However, the structure of this set of BMCP benchmarks is simple and their problem scale is small in 585–1000 for the number of items/elements. To this end, we design 60 new instances in larger scales (1000–5200 for the number of items/elements) and have some latent complex structure. Then, we compare the proposed VDLS algorithm with the best-performing BMCP heuristic of the PLTS algorithm, as well as the general CPLEX solver, with 2 h and 5 h of time limit, on the existing 30 benchmarks and the 60 new instances we designed. The results show that our proposed VDLS algorithm significantly outperforms the PLTS algorithm and the CPLEX solver for solving the BMCP.

The main contributions of this work are as follows:

  • We propose an effective algorithm called the VDLS based on the partial depth-first tree search method for solving the NP-hard BMCP. VDLS can explore the solution space widely and deeply, so as to yield high-quality solutions. Our method suggests a new solving perspective other than tabu search to solve the BMCP.

  • We define an effective neighbor structure for the BMCP, which can improve the performance of the proposed local search algorithm. The neighbor structure we define is general and may be applied to improve other local search algorithms for solving this problem.

  • As the existing BMCP benchmarks only have simple structures and in small scales, we design 60 new BMCP instances in larger scales and with complex structural features to enrich the diversity of the BMCP instances.

  • Extensive experiments demonstrate that VDLS significantly outperforms the existing heuristic PLTS, as well as the CPLEX exact solver, for solving the BMCP. The improvement of VDLS over PLTS is more significant on our designed 60 instances, indicating that VDLS is more effective for solving large and complex BMCP instances, and our designed instances can distinguish different algorithms’ performance better.

The rest of this paper is organized as follows. Section 2 introduces basic conceptions and formal definitions about the BMCP. Section 3 describes our proposed approach, including the main framework of the VDLS, the greedy constructive algorithm, and the local search process based on a partial depth-first search tree, and further presents the advantages of the proposed VDLS algorithm. Section 4 presents experimental results of the proposed VDLS algorithm and the comparison with the existing heuristic. Section 5 contains the concluding remarks.

2 Problem Formulation

Given a set of m elements \(E = \{1,..., m\}\) where each element \(j \in E\) has a nonnegative weight \(w_{j} \ge 0\), a set of n items \(I = \{1,..., n\}\) where each item \(i \in I\) has a nonnegative cost \(c_{i} \ge 0\), a binary relationship matrix \(\mathbf {A} \in \{0, 1\}^{\mathrm {m} \times \mathrm {n}}\), where \(\mathbf {A}_{ji} = 1\) indicates that element j is covered by item i (otherwise \(\mathbf {A}_{ji} = 0\)), and a budget L. Let S be a subset of I, we define C(S) be the total cost of all the items in S, and W(S) be the total weight of the elements covered by all the items in S, respectively. The goal of the BMCP is to find a subset of the items, \(S \subseteq I\), that maximizes W(S) and satisfies the budget constraint, i.e., \(C(S) \le L\).

Let \(\mathbf {x} \in \{0, 1\}^{\mathrm {n}}\) be a binary vector that represents a solution S of the BMCP, where \(\mathbf {x}_{i} = 1\) if item \(i \in S\) (otherwise \(\mathbf {x}_{i} = 0\)), \(\mathbf {c} \in \mathbb {N}^{\mathrm {n}}\) be a vector of n items where \(c_{i}\) is the cost of item i. The BMCP can be formulated as the following integer linear programming problem:

$$\begin{aligned} \mathrm {Maximize}~~~~ &W(S)= \sum \limits _{j = 1}^m w_j [y_j > 0] \\ \textit{s.t.}~~~~ & {\mathbf y}= \mathbf {A} \mathbf {x}~~~~~~~~ \\ \,\,\,\, &C(S)= {\mathbf c}^{\mathrm {T}} \mathbf {x} \leqslant L \end{aligned}$$

where \([\cdot ]\) is the Iverson bracket that \([P]=1\) when statement P is true, otherwise \([P]=0\).

figure a

3 The Proposed VDLS Algorithm

The proposed variable depth local search (VDLS) algorithm consists of an initialization stage and an improvement stage. In the initialization stage, we generate an initial solution by an approximation algorithm [1], which is actually a greedy constructive method. In the improvement stage, we propose a partial depth-first tree search method to improve the initial solution. The branch size of each node and the depth of the entire depth-first search tree are restricted. The search depth is variable and controlled by an early-stop strategy, which can improve the efficiency of the algorithm.

This section first introduces the main process of the VDLS, then describes the greedy constructive algorithm and the local search process in the VDLS, respectively. Finally, we present the advantages of the proposed algorithm.

3.1 The Main Process

The main procedure of the VDLS is shown in Algorithm 1. The VDLS algorithm first generates an initial solution S by a greedy constructive algorithm (line 1), then improves the solution by a local search process based on the partial depth-first search approach until the stopping criterion is met (lines 6–18). At each iteration, the partial depth-first search approach (i.e., the LocalSearch function) tries to improve the current solution from a selected item (\(P_i\) in line 7) as the root of the search tree, until a better solution is found or the entire search tree has been traversed under the restriction. The method of selecting item as the root of the search tree is to randomly traverse all the items in I. Specifically, VDLS first generates a random permutation of \(\{1, 2,..., n\}\), denoted as P (line 5). Then, the algorithm sequentially traverses each item in P as the root of the search tree (line 14).

The VDLS algorithm stops when the cut-off time T is reached (line 6) or the partial depth-first search process starting from any item \(i \in I\) (i.e., the root of the search tree) cannot improve the current solution (lines 15–17).

figure b

3.2 The Greedy Constructive Algorithm

We then introduce the initialization method in VDLS. Khuller et al. [1] proposed a simple greedy algorithm and further proposed an approximation algorithm based on this greedy algorithm. We adopt this greedy algorithm, as depicted in Algorithm 2, to construct the initial solution.

This greedy algorithm outputs the best among two candidate solutions (lines 11–14). The first candidate is generated by a greedy heuristic (lines 1–9) that iteratively adds an item \(i \in I {\setminus }S_{\text {out}}\) into \(S_{\text {out}}\) that satisfies the total cost of all items in \(S_{\text {out}} \cup \{i\}\) not exceeding the budget L and the increased weight per unit cost of item i is maximized. The second candidate is a single item q with the maximized weight \(W(\{q\})\) (line 10).

The second option is necessary, as in some special cases, the second candidate is better than the first one. For example, \(I = \{1, 2\}\) contains two items with \(c_1 = 1, c_2 = L\) (the budget \(L>2\)), \(E = \{1, 2\}\) contains two elements with \(w_1 = 1, w_2 = L-1\), element 1 is covered by item 1 and element 2 is covered by item 2. In this case, the solution contains either item 1 or item 2. The first candidate will choose item 1 since the ratio of the total weight of the elements covered by item 1 to the cost of item 1 is greater than that of item 2 (i.e., \(w_1/c_1 > w_2/c_2\)). And the second candidate will choose item 2 since the total weight of the covered elements of item 2 is greater than that of item 1. Obviously, in the above example, the second candidate yields a better solution.

figure c

3.3 Variable Depth Local Search

Before introducing the local search procedure, we first present several definitions.

We define \(\text {Cover}(i) = \{j \mid \mathbf {A}_{ji} = 1\}\) as a set of elements covered by item i. We then define \(\Gamma (i) = \{i' \mid i' \in I, i' \ne i, \text {Cover}(i) \cap \text {Cover}(i') \ne \emptyset \}\) as a set of items that cover at least one element in Cover(i) (i.e., any item \(i' \in \Gamma (i)\) have at least one common covered element with item i). We also call the items in \(\Gamma (i)\) the neighbors of item i. Figure 1 shows a BMCP instances with five elements and six items, and presents the neighbors of each item.

Fig. 1
figure 1

The neighbor structure of a BMCP instance with 5 elements and 6 items. The edges represent the relationship between the elements and the items. The neighbors of each item are presented on the right

We define a function \(\text {flip}(S, i)\) that changes the state of item i in solution S, i.e., the flipping operator removes item i from S if \(i \in S\), otherwise it adds item i into S. And function \(\text {flip}(S, i)\) returns a solution \(S'\) obtained by flipping item i in S. The flipping is the basic operation in the entire VDLS algorithm. Moreover, we define the function \(\text {gain}(S, i)\) as the difference of the objective value after flipping item i in S. The function gain(Si) is defined as follows:

$$\begin{aligned} \text {gain}(S, i) = {\left\{ \begin{array}{ll} W(S \cup \{i\}) - W(S), &{} i \notin S \\ W(S - \{i\}) - W(S), &{} i \in S. \\ \end{array}\right. } \end{aligned}$$
(1)

The local search process in VDLS actually applies a partial depth-first search to improve the input solution \(S_{\text {in}}\). The key is how to decide the branch nodes. Algorithm 3 shows the local search procedure, which tries to find a solution better than the input solution \(S_{\text {in}}\) by flipping a selected item p (i.e., the branch node) in the current solution S recursively (line 13). The branch node p is decided according to a search tree that the maximum depth and the maximum width are restricted to d and k, respectively. The root of the search tree is a randomly selected item \(P_i \in I\) (see lines 5, 7, 9 in Algorithm 1).

After selecting the root of the search tree, the algorithm starts the partial depth-first search process. At each searching node, the algorithm first flips item p in S to obtain the current solution \(S'\). To decide the branch nodes at the next level after flipping p, the algorithm constructs a candidate set U consisting of the items in \(\Gamma (p)\) that have not been visited in the current search tree (i.e., not belonging to R, a set that records the visited items in the current search tree) and flipping any of them in the current solution \(S'\) is feasible (line 8). Then the algorithm sorts the candidate set U in descending order of \(\text {gain}(S', i), i \in U\) (line 9), since flipping an item with a larger value of \(\text {gain}\) leads to a higher-quality solution. After sorting U, the algorithm selects the top k items from U as the branch nodes at the next level (line 10).

Moreover, during each partial depth-first search process, an early-stop strategy is applied to improve the efficiency. That is, if the current solution \(S'\) is better than the input solution \(S_{\text {in}}\), then the algorithm terminates the process and returns the current solution \(S'\) (lines 2–4).

We further analyze the time complexity of each iteration of VDLS (see line 9 in Algorithm 1). As depicted in Algorithm 3, the local search process traverses a search tree where the maximum width and the maximum depth are limited by two hyperparameters, k and d. Thus the algorithm actually traverses \(O(k^d)\) nodes in this process. In the local search process, the branching strategy is based on the neighbor structure. Therefore, the time complexity of expanding each search node is impacted by the neighbor structure of VDLS, and we give a complexity analysis on the random instances as follows.

Let \(\alpha = \frac{1}{nm}\sum _{i=1}^{n}\sum _{j=1}^{m}\mathbf {A}_{ji}\) represents the density of the relationship matrix. The expectation of the number of elements covered by an item is \(\alpha m\), so the time complexity of the \(\text {flip}\) operator (see lines 1, 8 in Algorithm 3) is \(O(\alpha m)\). The probability of two items covering at least one common element is \(\sigma = 1 - (1 - \alpha ^2)^m\), and the expectation size of \(\Gamma (i)\) is \(\sigma (n - 1)\). Obtaining the list U (see lines 8, 9 in Algorithm 3) is the main time cost of expanding each search node. The process of obtaining list U consists of flipping each item in \(\Gamma (i)\) and sorting the order according to gain (Eq. 1). Therefore, the time complexity of obtaining the list U is \(O(\alpha \sigma mn + \sigma n \log(\sigma n)))\), which is also the time complexity of expanding each search node. Finally, the time complexity of each iteration of VDLS is \(O(k^d(\alpha \sigma mn + \sigma n \log(\sigma n)))\) on the random instances.

3.4 Advantages of the VDLS Algorithm

This subsection introduces the advantages of the proposed VDLS algorithm, including the effective neighbor structure we defined for the BMCP, and the search neighborhood of the partial depth-first search method.

3.4.1 Effective Neighbor Structure

We first explain why the proposed neighbor structure is reasonable and effective for the BMCP. Note that once an item i is flipped, it will affect the quality of the items that have common covered elements, i.e., the neighbors of item i (\(\Gamma (i)\)). Specifically, if item i is removed from S, then the elements covered by item i but not covered by \(S\setminus \{i\}\) become uncovered in the current solution. Thus the next potentially high-quality move might be to select another item to cover these uncovered elements, which must be a neighbor of item i, and vice versa. Therefore, it is reasonable and effective to select the candidate items from the neighbors \(\Gamma (i)\) of item i for the next step after flipping item i at the current step. By applying the neighbors as the candidate set, the search scope is significantly reduced, and the efficiency of the local search process is improved.

3.4.2 High-Quality Search Space

The VDLS algorithm has a better neighborhood search space than the existing BMCP heuristic algorithm, the PLTS algorithm [17], which only has two neighborhood operators, \(\text {flip}\) and \(\text {swap}\). The flip operator in the PLTS is the same as the function \(\text {flip}(S, i)\) in our proposed VDLS algorithm, that changes the state of an item in the current solution. And the \(\text {swap}\) operator removes an item from the current solution S and adds another item into S. These two operators are simple and are actually belonging to the special cases of our neighborhood operator, i.e., the search space of the PLTS is equal to that of the VDLS with the maximum depth \(d = 2\) and the maximum width \(k = n\) of the search tree.

In the proposed VDLS algorithm, we do a deeper search with a larger d (\(d = 8\) by default) and shrink the search width of the branch nodes in the next level of the search tree, by only considering the neighbor items that have common covered elements with the item flipped in the current search node. To further improve the search efficiency, we only consider the top k (\(k = 7\) by default) neighbors with a larger value of gain (Eq. 1) as the candidates of the branch nodes. Moreover, the early-stop strategy can improve the efficiency of the algorithm by terminating in advance.

In summary, the VDLS algorithm has a higher-quality search space than the PLTS algorithm, since the VDLS can improve the solution by flipping at most d items continuously during each search step, and the candidates of the branch nodes are refined by the neighbor structure and the restriction of the search width.

4 Experimental Results

In this section, we present the experimental results, including the comparison of VDLS with different settings of parameters (d and k), the comparison of VDLS with the existing BMCP heuristic and the general CPLEX solver, and the ablation study on the neighbor structure and branching strategy of the VDLS algorithm. We test the algorithms on the existing 30 BMCP benchmarks and 60 new instances in relatively large scales and with complex structural features that we designed. We first present the benchmark instances, the experimental setup, and then present the experimental results and discussions.

4.1 Benchmark Instances

For the BMCP, there are a set of 30 public BMCP instances Footnote 1 proposed by Li et al. [17]. Among these 30 instances, the number of items or elements (i.e., n or m) ranges from 585 to 1000, the budget of each instance L is either 1500 or 2000, and the density of relationship matrix \(\alpha = \frac{1}{mn}\sum \nolimits _{i = 1}^{n}{\sum \nolimits _{j = 1}^{m}{\mathbf {A}_{ji}}}\) is 0.075 (resp. 0.05) for the instances with \(L = 1500\) (resp. \(L = 2000\)).

The existing BMCP benchmarks are in rather small scales (nm in [500, 1000]) and built with simple structures. The relationship matrix of each instance is determined by randomly selecting \(\alpha \times n \times m\) edges with replacement between n items and m elements, and then setting \(\mathbf {A}_{ji}\) equals to 1 (resp. 0) if edge (ji) is selected (resp. not selected).

To enrich the diversity of the BMCP instances, we propose two sets with a total of 60 new BMCP instances in larger scale (nm in [1000, 1600], or [4000, 5200]) and with complex structural features. Given the number of the items and elements, i.e., n and m, the relationship matrix of each proposed instance is determined by repeating the following process t (\(t = 3\) by default) times. First, we evenly divide both items and elements into g (\(g = 25\) by default) groups. Then for the l-th (\(l \in \{1,2,...,g\}\)) pair of groups consisting of the l-th item group with \(n_l\) items and l-th element group with \(m_l\) elements, we randomly select \(\rho \times n_l \times m_l\) edges with replacement to determine the relationship matrix. \(\rho = \frac{1}{m_l n_l}\sum \nolimits _{i = 1}^{n_l}{\sum \nolimits _{j = 1}^{m_l}{\mathbf {A}_{n_l^i m_l^j}}}\) is the density of the relationship matrix between the items and elements belonging to the l-th pair of groups, where \(n_l^i\) and \(m_l^j\) are the i-th item in the l-th item group and the j-th element in the l-th element group, respectively.

The proposed 60 instances can be divided into two groups according to the scale. The first group contains 30 instances with the number of items or elements ranging from 1000 to 1600, the budget L either 2000 or 3000, and the density parameter \(\rho\) is 0.5 (resp. 0.3) for the instances with \(L =\) 2000 (resp. 3000). Note that the density parameter \(\rho\) in our proposed instances is larger than the density parameter \(\alpha\) in the existing instances proposed by Li et al. [17], because the density in each pair of item and element groups will be diluted when considering all the items and elements. The second group contains 30 instances with the number of the items or elements ranging from 4000 to 5200, the budget L either 7000 or 10,000, and the density parameter \(\rho\) is 0.5 (resp. 0.3) for the instances with \(L =\) 7000 (resp. 10,000). The proposed 60 new instances are available at https://github.com/JHL-HUST/VDLS/.

In summary, we test our algorithm on three sets of BMCP instances. The first set consists of the 30 instances proposed by Li et al. [17]. The second (resp. third) set consists of the 30 new instances with the number of items or elements ranging from 1000 to 1600 (resp. 4000–5200). The three sets of instances are listed at the first column of Table 2 (or Table 3), Tables 4 and 5, respectively, where an instance named \(bmcp\_n\_m\_\alpha \_L\) in Table 2 or Table 3 indicates an instance of the first set with n items, m elements, the density of the total relationship matrix \(\alpha\), and the budget L, and an instance named \(bmcp\_n\_m\_\rho \_L\) in Table 4 or Table 5 indicates an instance of the second set or the third set with n items, m elements, the density of the relationship matrix in each pair of item and element groups \(\rho\), and the budget L.

4.2 Experimental Setup

We compare our VDLS algorithm with the general CPLEX solver in solving the first set of instances (since it is too time consuming for the CPLEX solver to obtain high-quality lower and upper bounds when solving the instances of the second and the third sets), and compare the VDLS with the best-performing BMCP heuristic, the PLTS algorithm [17] in solving all the three sets with a total of 90 instances. Each instance is calculated ten times by each algorithm.

For the CPLEX solver (version 12.8), we employ it under the time limit of 2 h as well as 5 h for each instance based on the 0/1 integer linear programming model. The CPLEX solver finds the upper bound and lower bound of the 30 instances in the first set. For the heuristics, both the VDLS and the PLTS run ten times for each instance with different random seeds independently. Since Li et al. [17] test the PLTS under the time limit of 10 min, we first compare the VDLS and the PLTS with 10 min of time limit for each run. And we further compare these two algorithms under the time limit of 30 min to evaluate their performance with a longer cut-off time and do a more comprehensive comparison.

The experiments of the VDLS were coded in the C++ programming language and complied by g++ with the ‘-O3’ option. The experiments of all the algorithms, including CPLEX, PLTS, VDLS and its variants, were performed on a Linux server with Intel\(\circledR\) Xeon\(\circledR\) E5-2650 v3 2.30 GHz 10-core CPU and 256 G RAM. The parameters of the VDLS include the maximum depth d and maximum width k of the search tree. The comparison of the VDLS with different settings of these two parameters is presented in the following subsection.

Table 1 Comparison of VDLS with different settings of parameters with 10 or 30 min of time limit in solving the 30 instances of the first set
Table 2 Comparison of the PLTS and VDLS with both 10 min of time limit, and the CPLEX solver with 2 h and 5 h of time limit in solving the 30 instances of the first set
Table 3 Comparison of the PLTS and VDLS with both 30 min of time limit, and the CPLEX solver with 2 h and 5 h of time limit in solving the 30 instances of the first set
Table 4 Comparison results of VDLS and PLTS, with 10 or 30 min of time limit, on the 30 instances of the second set
Table 5 Comparison results of VDLS and PLTS, with 10 or 30 min of time limit, on the 30 instances of the third set
Table 6 Comparison of the VDLS and its variant algorithms, VDLS\(_{full}\) and VDLS\(_{random}\), with 30 min of time limit in solving the 30 instances of the first set
Table 7 Comparison of the VDLS and its variant algorithms, VDLS\(_{full}\) and VDLS\(_{random}\), with 30 min of time limit in solving the 30 instances of the second set
Table 8 Comparison of the VDLS and its variant algorithms, VDLS\(_{\text{full}}\) and VDLS\(_{\text{random}}\), with 30 min of time limit in solving the 30 instances of the third set

4.3 Parameter Study

To analyze the effectiveness of the parameters including d and k on the performance of VDLS, and determine the best setting of them, we compare VDLS with \(d \in [5, 10]\) and \(k \in [5, 10]\) in solving the 30 instances of the first set, under 10 or 30 min of time limit. The results are shown in Table 1. The results are expressed by the average value of the best solutions of all the 30 instances obtained by the algorithms in 10 runs. From the results we can observe that:

  1. (1)

    VDLS with medium values of d and k shows better performance. For example, \(d = 8\), \(k = 5,6,7\) and \(d = 7\), \(k = 8\). Actually, the larger the value of d or k, the higher the quality of the local optima for VDLS, and the lower the algorithm efficiency. Therefore, a medium value of d or k can well trade-off the search ability and the algorithm efficiency.

  2. (2)

    The proposed VDLS algorithm is robust and effective, since VDLS with any \(d \in [5,10]\) and \(k \in [5,10]\) outperforms the PLTS algorithm [17], which yields a result of 91,533.7 with 10 min of time limit and 91,733.9 with 30 min of time limit (see detailed results in Tables 2 and 3).

According to the results in Table 1, we finally select \(d = 8\) and \(k = 7\) as the default parameters of the VDLS algorithm. The results of VDLS in the rest of the paper are obtained by VDLS with the default parameters.

4.4 Comparison on the VDLS and the Baselines

This subsection presents the comparison results of the proposed VDLS algorithm and the baseline algorithms, including the CPLEX solver and the PLTS. We compare the best solutions, the average solutions of the VDLS and the PLTS for each instance in 10 runs, as well as the lower bound (LB) and upper bound (UB) of the CPLEX solver.

The results of the CPLEX solver with 2 h and 5 h of time limit, the PLTS and the VDLS with 10 min and 30 min of time limit, in solving the first set of instances are shown in Tables 2 and 3, respectively. The results of the PLTS and the VDLS algorithms with 10 or 30 min of time limit in solving the second and third sets of instances are shown in Tables 4 and 5, respectively.

From the results, we can observe that:

  1. (1)

    The VDLS outperforms the CPLEX solver in either 2 h or 5 h of time limit in solving all the 30 instances of the first set. And with either 10 min or 30 min of time limit, the VDLS significantly outperforms the PLTS algorithm in solving the three sets of instances, indicating the excellent performance of the proposed VDLS algorithm for the BMCP.

  2. (2)

    The advantages of the VDLS over the PLTS are more obvious when solving the large scale instances belonging to the second and third sets, which have complex structural features, indicating that the proposed VDLS algorithm is more effective for solving large BMCP instances than the PLTS, and the proposed neighbor structure is effective for solving the BMCP instances with diverse structures. The results also indicate that our designed 60 instances can distinguish the performance of different algorithms better.

4.5 Ablation Study on the Branching Strategy

The branching strategy in the tree search process of the VDLS algorithm directly influences the efficiency of the local search process and the quality of the solution. The branching strategy in the VDLS selects at most k items with the largest gain value (i.e., Eq. 1) in the candidate set U (line 8 in Algorithm 3) that consists of all the neighbors of the last flipping item that have not been visited during this local search process and flipping each of them will result in a feasible solution.

To analyze the performance of the neighbor structure defined in the VDLS as well as the greedy approach when selecting the branch nodes, we compare the VDLS with two variant algorithms.

  • The first variant algorithm \(\mathrm {VDLS}_{\text {full}}\) allows the algorithm to select the items not belonging to the neighbors of the last flipping item as the branch nodes, (i.e., replace \(\Gamma (i)\) with I to generate U).

  • The second variant algorithm \(\mathrm {VDLS}_{\text {random}}\) randomly selects at most k items in U.

Both variant algorithms run 10 times with 30 min of time limit for each instance of the three sets. The comparison results on the three sets of instances are shown in Tables 67 and 8, respectively. The results are expressed by the best solution and average solution in 10 runs of each instance.

From the results in Tables 67 and 8 we can observe that, the performance of the VDLS is better than the \(\mathrm {VDLS}_{\text {full}}\) in solving the three sets of instances, demonstrating that the neighbor structure we defined in the VDLS is reliable, and using neighbors as branch candidate set instead of all the items I can improve the efficiency of the algorithm by abandoning relatively low-quality branch nodes. Moreover, the performance of the VDLS is also better than the \(\mathrm {VDLS}_{\text {random}}\), indicating that the greedy approach used in the branching strategy of the VDLS is effective.

Table 9 Comparison of the VDLS and its variant algorithms, VDLS\(_{\text {empty\_init}}\) and VDLS\(_{\text {random\_init}}\), as well as the PLTS algorithm, with 30 min of time limit in solving the 30 instances of the first set
Table 10 Comparison of the VDLS and its variant algorithms, VDLS\(_{\text{empty\_init}}\) and VDLS\(_{\text{random\_init}}\), as well as the PLTS algorithm, with 30 min of time limit in solving the 30 instances of the second set

4.6 Ablation Study on the Initialization Method

To evaluate the effectiveness of the greedy constructive algorithm in the VDLS, we further do an ablation study on the initialization method of the VDLS algorithm by comparing the VDLS with two other variants.

  • The third variant algorithm \(\mathrm {VDLS}_{\text {empty\_init}}\) sets the initial solution \(S = \emptyset\).

  • The fourth variant algorithm \(\mathrm {VDLS}_{\text {random\_init}}\) generates the initial solution by first randomly adding an item per step, until the total cost of the added items exceeding the budget. Then the algorithm removes the last item added and yields a feasible initial solution.

We compare the best solutions and average solutions in 10 runs of the VDLS and its two variants described above, as well as the PLTS algorithm, with 30 min of time limit, in solving the three sets of BMCP instances. The results of the three sets of instances are shown in Tables 910 and 11, respectively. From the results we observe that:

  1. (1)

    The results of the VDLS are better than the results of the \(\mathrm {VDLS}_{\text {empty\_init}}\) and \(\mathrm {VDLS}_{\text {random\_init}}\) algorithms, especially for the large instances of the third set. The results indicate that the proposed local search method can yield better solutions with high-quality initial solutions, and the greedy constructive algorithm can improve the VDLS algorithm by providing high-quality initial solutions, especially for large instances.

  2. (2)

    The \(\mathrm {VDLS}_{\text {empty\_init}}\) and \(\mathrm {VDLS}_{\text {random\_init}}\) algorithms are competitive with the VDLS algorithm in solving the instances of the first and second sets. They also significantly outperform the PLTS algorithm in solving most of the 90 instances, indicating that the proposed local search method exhibits a good robustness, as the method can yield high-quality results from various initial solutions.

Table 11 Comparison of the VDLS and its variant algorithms, VDLS\(_{\text{empty\_init}}\) and VDLS\(_{\text{random\_init}}\), as well as the PLTS algorithm, with 30 min of time limit in solving the 30 instances of the third set

5 Conclusion

In this paper, we propose an effective Variable Depth Local Search (VDLS) algorithm for solving the Budgeted Maximum Coverage Problem (BMCP), which is a generalization of the NP-hard set cover problem and 0–1 knapsack problem, and a variant problem of the NP-hard Set-Union Knaspsack Problem (SUKP). VDLS first generates an initial solution by a constructive greedy algorithm, then improves the solution iteratively by a partial depth-first search method, that allows the algorithm to explore the solution space widely and deeply. We also define an effective neighbor structure for the BMCP to improve the performance and the efficiency of the local search process. The branching heuristic based on the neighbor structure allows VDLS to explore the solution space efficiently, by abandoning low-quality branch nodes.

We compare the VDLS with the general CPLEX solver and the best-performing heuristic algorithm called PLTS in solving the 30 public BMCP benchmark instances, as well as the 60 proposed new instances in relatively large scales and with complex structural features. The results show that the VDLS outperforms the CPLEX solver and the PLTS significantly, indicating its excellent performance for solving the BMCP. The improvement of VDLS over PLTS is more obviously on the 60 new instances, indicating that our method is more effective for solving large and complex instances, and our designed instances can distinguish the performance of different algorithms better. Moreover, we also do sufficient ablation studies on the branch strategy and the initialization method. The results demonstrate that our proposed neighbor structure is effective and efficient for the VDLS to solve the BMCP, and the partial depth-first search method in the VDLS is robust, that it can yield high-quality solutions with various initial solutions.

The neighbor structure we defined could also be applied to other local search algorithms for the BMCP. Moreover, since our proposed variable depth local search approach is effective in solving the BMCP, in future works we consider applying this method for other combinatorial optimization problems, such as various variants of the knapsack problems and the set cover problems.