Combinatorial optimization and local search: A case study of the discount knapsack problem

https://doi.org/10.1016/j.compeleceng.2022.108551Get rights and content

Abstract

Many problems in real life can be transformed into combinatorial optimization problems. As an important heuristic, the local search algorithm has achieved outstanding performance in many classical combinatorial optimization problems. In this study, an efficient local search algorithm named KPLS is developed for a variant of the knapsack problem. Two novel ideas are proposed to help the KPLS algorithm achieve excellent performance. First, three scoring functions are designed to help the algorithm search the neighborhood space of the current solution accurately. Second, the hybrid perturbation strategy achieves a balance between greediness and randomness, which effectively facilitates the algorithm to escape from the local optimum. Eighty classic benchmark instances are adopted to evaluate the KPLS algorithm. The experimental results show that the KPLS algorithm outperforms the state-of-the-art algorithms in both the optimal solution and the average solution for most benchmark instances.

Introduction

Combinatorial optimization problems (COPs) are a class of optimization problems with discrete decision variables and a finite search space that are dedicated to finding an optimal object from a finite set of objects. The formal representation of a COP is as follows: [1]: minimizec(x)subject to:g(x)bx0,xfwhere the inequalities g(x)b and x0 are the constraints that specify a convex polytope over which the objective function c(x) is to be minimized, and f is the finite set of feasible solutions x that satisfy the constraints.

Many problems in real-world scenarios can be formulated as COPs, such as smart agriculture and smart city problems [2]. We take smart agriculture as an example to briefly introduce COPs in this scenario. For example, in some countries where land is scarce, the agricultural land is fragmented. A farmer with multiple plots plans to grow different crops in pursuit of maximum profit, each plant has a cost to be raised, and each plant has a potential profit. Allocating the right crops to each land plot to maximize profits is a typical COP agricultural land problem [3]. In addition, there is also a COP for the product storage of crops [4]. When the fruits of various crops are harvested, each fruit has a different value and volume. Obtaining a product storage solution with the greatest value for the limited warehouse space is a typical COP. Other scenarios in smart agriculture, such as the agricultural machinery scheduling problem [5] and the field coverage planning problem for agricultural machines [6], are also typical COPs.

Many COPs in smart agriculture are solved after being transformed into classical combinatorial optimization models or their variants. For example, the field route scheduling problem of autonomous tractor fleets is considered a variant of the dynamic vehicle routing problem (VRP) [7], and the crop planning problem is regarded as a typical knapsack problem (KP) [8]. Therefore, efficient algorithms and novel strategies for classical models are helpful in solving the corresponding application problems of classical models in various application scenarios.

Due to the computational complexity of COPs, heuristic methods are often adopted to solve them because they can find a high-quality solution in an acceptable time. Heuristics for solving various COPs can be divided into two categories, population-based heuristics and single solution-based heuristics. Population-based heuristic algorithms include various evolutionary algorithms, such as genetic algorithms [9], particle swarm algorithms and ant colony algorithms. This type of algorithm usually iteratively finds the optimal solution via population evolution. Heuristic algorithms based on a single solution include the local search algorithm, tabu search, variable neighbor search algorithm, etc. This type of algorithm usually finds the optimal solution in the neighborhood space by moving from the current solution to the neighborhood solution. There is no general framework behind the design of a good heuristic that guarantees a quality solution to any problem. However, effective strategies designed for a particular COP in a well-performing heuristic can be exploited to design heuristics for other COPs, such as configuration checking strategies [10] and tabu strategies.

Different from deep learning [11], [12], [13], the local search algorithm based on a single solution is a heuristic algorithm with a concise algorithm framework, and it has also achieved excellent performance on some classical COPs, such as the boolean satisfiability problem [14], [15] and the maximum satisfiability [16]. In this study, we develop an efficient local search algorithm named KPLS for the discounted knapsack problem (DKP). There are two considerations in developing a local search algorithm for this problem. First, there are some standard benchmark instances for the DKP. We design a local algorithm for it, which not only provides an efficient heuristic algorithm for the DKP but also highlights the local search algorithm in comparison with other heuristic algorithms. Second, the knapsack problem is a classic model that exists in various application scenarios. We design optimization strategies for a variant of the knapsack problem, which may provide new ideas for solving the knapsack problem in various scenarios.

The DKP is a generalization of the standard knapsack problem, which is a typical COP [17]. In real-world life, many practical problems can be formulated as a DKP, such as project selections, investment decisions, and resource allocations. A DKP is a more complex and difficult problem than the standard KP. To date, there is not much literature on the topic. Among those existing research works on solving DKPs, exact algorithms based on dynamic programming and heuristic algorithms based on evolutionary algorithms are the two main approaches. The DKP was first proposed by Guldan in his master’s thesis and solved by him using dynamic programming [18]. Rong et al. [17] partitioned the DKP into several easier subproblems by defining an alternative core and solved them using dynamic programming. The latest paper that uses an exact algorithm based on dynamic programming to solve the DKP was performed in 2016 by He et al. [19], who derived a recursive formula based on the weight minimization principle and proposed an exact algorithm for solving the DKP based on dynamic programming. Most of the existing heuristic algorithms for solving the DKP are evolutionary algorithms based on populations. These algorithms include particle swarm optimization [19], [20], genetic algorithms [21], differential evolution [22], monarch butterfly optimization [23], binary moth search algorithms [24], ring theory-based evolutionary algorithms [25] and teaching–learning-based optimization algorithms [26]. To the best of our knowledge, local search algorithms based on a single solution to solve the DKP are lacking in the existing published studies, and we aim to develop an efficient local search algorithm to solve the DKP in this study.

In this study, we develop an efficient local search algorithm named KPLS to solve the DKP, which has two main ideas. First, three effective scoring functions are designed to help the KPLS algorithm search for the optimal solution accurately at different stages. The local search algorithm based on a single solution searches for the optimal solution by iterating from the current solution to the neighbor solution. The neighbor solution is selected based on the score calculated by the scoring function for each neighbor solution. Therefore, an appropriate and efficient scoring function is an important element of the local search algorithm.

The second idea is a hybrid perturbation strategy. The search method that greedily selects the optimal solution based on the scoring function easily makes the algorithm fall into the local optimum. The hybrid perturbation strategy is proposed to help local search algorithms escape from the local optimum. There are two perturbation methods in the hybrid perturbation strategy, the greedy perturbation method and the random perturbation method. The algorithm chooses different perturbation methods to perturb the current solution according to the probability, which effectively facilitates algorithms to escape from local optima. The multimode perturbation method is beneficial to help the algorithm avoid the shortcomings of the poor quality of the perturbed solution caused by only relying on the random perturbation method or the shortcomings of the insufficient perturbation strength for the local optimal solution caused by only relying on the greedy perturbation method.

To evaluate the performance of the KPLS algorithm, it is run on all benchmark instances of the DKP. Experiments show that the KPLS algorithm achieves the optimal solution on most benchmark instances, which significantly exceeds the current optimal algorithm for solving the DKP problem.

The rest of this paper is organized as follows: Section 2 provides a detailed introduction to DKP and introduces basic definitions. Section 3 introduces the scoring function and hybrid perturbation strategy and describes the details of the KPLS algorithm. Section 4 presents the experimental results. Finally, Section 5 summarizes the work of this study.

Section snippets

Problem definition

A typical DKP involves 3n items {{a0, a1, a2}, {a3, a4, a5}, …..., {a3n3, a3n2, a3n1}}. A set of three items forms a group g, and each group gi (i{0,1,2,,n1}) contains two original items (a3i and a3i+1) and one discount item (a3i+2). The three items a3i, a3i+1 and a3i+2 have values (v3i, v3i+1, v3i+2) and weights (w3i, w3i+1,w3i+2), respectively. The value of the discount item a3i+2 is equal to the sum of the value of item a3i and item a3i+1, but it consumes less resources than the total

KPLS algorithm

In this section, the KPLS algorithm is introduced in detail, which is a new and effective local search algorithm for solving the DKP. The framework of the algorithm is first introduced, and then the core technology of the algorithm is introduced in detail. Finally, we summarize the advantages and disadvantages of the KPLS algorithm.

Experimental results

In this section, 80 classic benchmark instances from all relevant literature are used to evaluate the KPLS algorithm, which consists of two categories. The first category consists of four groups of IDKP1, UDKP1, WDKP1 and SDKP1 with a total of 40 instances, which are used in most studies [19], [21], [22], [23], [24], [25], [26]. The second category consists of four groups of IDKP2, UDKP2, WDKP2 and SDKP2 with a total of 40 instances, which are used in studies [19], [26]. The programming

Conclusions

Many problems in real-life scenarios are COPs, it is an important and meaningful research topic to design efficient algorithms for COPs. This study takes DKP as an example to explore the design of efficient local search algorithms for COPs. As a variant of the knapsack problem, this study uses DKP as an example to design an efficient local search algorithm, which not only provides an efficient algorithm for this problem but also provides ideas for solving knapsack problems in various

Declaration of Competing Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Acknowledgments

This work was supported by the National Natural Science Foundation of China (62076108, 61872159).

Xinliang Tian is a doctoral student at the College of Computer Science and Technology, Jilin University, China. His main research interests include model-based diagnosis and combinatorial optimization problems.

References (27)

  • Gutman PO, Ioslovich I. Inter-field routes scheduling and rescheduling for an autonomous tractor fleet at the farm. In:...
  • BrulardN. et al.

    An integrated sizing and planning problem in designing diverse vegetable farming systems

    Int J Prod Res

    (2019)
  • JiangY. et al.

    A pedestrian detection method based on genetic algorithm for optimize xgboost training parameters

    IEEE Access

    (2019)
  • Cited by (0)

    Xinliang Tian is a doctoral student at the College of Computer Science and Technology, Jilin University, China. His main research interests include model-based diagnosis and combinatorial optimization problems.

    Dantong Ouyang is currently a Full Professor at the College of Computer Science and Technology, Jilin University, China. Her research interests include model-based diagnosis, SAT, and model checking.

    Yiyuan Wang is an associate professor at Northeast Normal University currently. His research interests include artificial intelligence and algorithm design.

    Huisi Zhou is a doctoral student at the College of Computer Science and Technology, Jilin University, China. Her main research interests include MaxSAT and model-based diagnosis.

    Luyu Jiang is a doctoral student at the College of Computer Science and Technology, Jilin University, China. Her main research interests include MaxSAT and model-based diagnosis.

    Liming Zhang is a senior engineer in the College of Computer Science and Technology at Jilin University. His research interests include hitting set problems, model-based diagnosis, and SAT.

    This paper is for special section VSI-agr2. Reviews were processed by Guest Editor Dr. Prabhat Kumar and recommended for publication.

    View full text