A Novel Local Search Algorithm for Knapsack Problem Mostafa Memariani Department of Electrical Engineering, Ferdowsi University of Mashhad Mashhad, Iran E-mail: mostafa.memariani@stu-mail.um.ac.ir Ahmad Madadi Department of Computer Engineering, University of Amir Kabir Tehran, Iran E-mail: a.madadi@gmail.com Kambiz Shojaee Ghandeshtani Department of Electrical Engineering, University of Tehran Tehran, Iran E-mail: k.shojaee@ece.ut.ac.ir Mohammad Mohsen Neshati Department of Electrical Engineering, Ferdowsi University of Mashhad Mashhad, Iran E-mail: mohsen_neshati@stu-mail.um.ac.ir Abstract— Knapsack problem is an integer programming that is generally called "Multidimentional Knapsack". Knapsack problem is known as a NP-hard problem. This paper is an introduction to a new idea for solving one-dimentional knapsack that with defining the "Weight Value Index", "Sorting" and "Smart local search" forms a new algorithm. This algorithm is mathematically formulated and has run on 5 sample problems of one-dimentional knapsack, that in most of them the result is close to the optimum. The results show that this method by comparison with the others recently published in this field, despite of its simplicity, has enough required functionality in order to get the result on the tested items. Keywords-Artificial intelligence; NP-hard; Knapsack problem; Combinational optimization. I. INTRODUCTION Knapsack problem is an integer programming that is in general called "Multidimentional Knapsack". Knapsack problem is known as a NP-hard problem [1]. One- dimentional knapsack problem with "constant weight group" is a special form of multidimensional knapsack. For one-dimensional knapsack in comparison with multidimensional knapsack, more precise evolutionary algorithms have been studied. Most of the researches is regarding to one-dimentional knapsack problem. For further information about knapsack problem and different precise algorithms, please refer to [2]-[4]. The reason for naming this problem to "knapsack" is because of its similarity to making decision for a mountain climber to pack his knapsack. The person should decide the optimum combination in choosing his accessories for knapsack in a way that according to the knapsack capacity, he should select items with more value (profit). This kind of problems is of combinational optimization problems family. For several past years, precise methods such as Branch and Bound have used for solving knapsack problem [22]. In recent years, and with the development of smart optimization and evolutionary algorithms, solving more difficult problems is now possible, such that in addition to reducing the time for achieving results close to the optimum, it has increased the accuracy in solving knapsack problem. Therefore evolutionary algorithms and more definitely decoder-based evolutionary algorithms are widely used in solving knapsack problem [5], [6]. Their advantage over the more traditional direct representation of the problem is their ability to always generate and therefore carry out evolution over feasible candidate solutions, and thus focus the search on a smaller more constrained search space. Many researchers have struggled in developing evolutionary methods for knapsack problems. From them, we can name some modern evolution methods like tabu search [7], [8], genetic algorithm [9], [10] and simulated annealing [11], [12] that in most cases show good results. In recent years, genetic algorithms show that it is the best method for solving large knapsack problems and in general 0-1 integer programming problems [13], [14]. The knapsack repeatedly is used in different processing models like processor allocation in distributed systems [15], manufacturing in-sourcing [16], asset-backed securitization [17], combinatorial auctions [18], computer systems design [19], resource-allocation [20], set packing [21], cargo loading [22], project selection [23], cutting stock [24] and capital budgeting (where project has profit and consume units of resource. The goal is to determine a subset of the projects such that the total profit is maximized and all resource constraints are satisfied) [25]. Another type of knapsack is Quadratic Knapsack Problem (QKP) [26]. In the Quadratic Knapsack Problem, an object’s value density is the sum of all the values associated with it divided by its weight. It can be used in finance [27], VLSI design [28] and location problems [29]. In the second part of this paper, we will describe the knapsack problem; in third part, the proposed algorithm will be introduced. In the forth part, algorithm simulation and comparison of results have been presented and we will conclude in the final part. II. PROBLEM DESCRIPTION Suppose that some items are available and each item has a weight of 'w i ' and a value of 'v i '. In knapsack problem, 77 ADVCOMP 2010 : The Fourth International Conference on Advanced Engineering Computing and Applications in Sciences Copyright (c) IARIA, 2010 ISBN: 978-1-61208-101-4