Skip to main content
Log in

DGSA: discrete gravitational search algorithm for solving knapsack problem

  • Original Paper
  • Published:
Operational Research Aims and scope Submit manuscript

Abstract

The 0–1 knapsack problem is one of the classic NP-hard problems. It is an open issue in discrete optimization problems, which plays an important role in the real applications. Therefore, several algorithms have been developed to solve it. The Gravitational Search Algorithm (GSA) is an optimization algorithm based on the law of gravity and mass interactions. In the GSA, the searcher agents are a collection of masses that interact with each other based on the Newtonian gravity and the laws of motion. In this algorithm the position of the agents can be considered as the solutions. The GSA is a nature-inspired algorithm that is used for finding the optimum value of continuous functions. This paper introduces a Discrete version of the GSA (DGSA) for solving 0–1 knapsack problem. In this regard, we introduce an approach for discretely updating the position of each agent. In addition, a fitness function has been proposed for 0–1 knapsack problem. Our experimental results show the effectiveness of the DGSA in comparison with other similar algorithms in terms of the accuracy and overcoming the defect of local convergence.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

References

  • An C, Fu TJ (2008) On the sequential combination tree algorithm for 0–1 knapsack problem. J Wenzhou Univ (Nat Sci) 29:10–14

    Google Scholar 

  • Bas E (2011) A capital budgeting problem for preventing workplace mobbing by using analytic hierarchy process and fuzzy 0–1 bidimensional knapsack model. Expert Syst Appl 38(10):12415–12422

    Article  Google Scholar 

  • Bhattacharjee KK, Sarmah SP (2014) Shuffled frog leaping algorithm and its application to 0/1 knapsack problem. Appl Soft Comput 19:252–263

    Article  Google Scholar 

  • Fayard D, Plateau G (1975) Resolution of the 0–1 knapsack problem comparison of methods. Math Prog 8:272–307

    Article  Google Scholar 

  • Guaci M, Dodd TJ, Grob R (2012) Why ‘GSA: a gravitational search algorithm’ is not genuinely based on the law of gravity. Nat Comput 11:719–720

    Article  Google Scholar 

  • Hatamlo A, Abdullah S, Nezamabadi-pour H (2011) Application of gravitational search algorithm on data clustering. In: 6th international conference rough sets and knowledge technology (RSKT2011), 6954, 337–346

  • Kellerer H, Pferschy U, Pisinger D (2004) Knapsack problems. Springer, Berlin

    Book  Google Scholar 

  • Li BD (2008) Research on the algorithm for 0/1 knapsack problem. Comput Digit Eng 5:23–26

    Google Scholar 

  • Li ZK, Li N (2009) A novel multi-mutation binary particle swarm optimization for 0/1 knapsack problem. In: Control and Decision Conference, 3042–3047

  • Lin FT (2008) Solving the knapsack problem with imprecise weight coefficients using genetic algorithms. Eur J Op Res 185:133–145

    Article  Google Scholar 

  • Liu Y, Liu C (2009) A schema-guiding evolutionary algorithm for 0–1 knapsack problem. In: International Association of Computer Science and Information Technology-Spring Conference, 160–164

  • Liu A, Wang J, Han G, Wang S, Wen J (2006) Improved simulated annealing algorithm solving for 0–1 knapsack problem. In: IEEE the 6th international conference on intelligent systems design and applications (ISDA’06), 1–6

  • Mavrotas G, Diakoulaki D, Kourentzis A (2008) Selection among ranked projects under segmentation, policy and logical constraints. Eur J Op Res 187(1):177–192

    Article  Google Scholar 

  • Moosavian N (2015) Soccer league competition algorithm for solving knapsack problems. Swarm Evol Comput 20:14–22

    Article  Google Scholar 

  • Rashedi E, Nezamabadi-pour H, Saryazdi S (2009) GSA: A gravitational search algorithm. Inf Sci 179:2232–2248

    Article  Google Scholar 

  • Rashedi E, Nezamabadi-pour H, Saryazdi S (2010) BGSA: binary gravitational search algorithm. Nat Comput 9:727–745

    Article  Google Scholar 

  • Shi H (2006) Solution to 0–1 knapsack problem based on improved ant colony algorithm. In: IEEE International Conference on Information Acquisition, 1062–1066

  • Yoshizawa H, Hashimoto S (2000) Landscape analyses and global search of knapsack problems. IEEE Syst Man Cybern 3:231–2315

    Google Scholar 

  • You W (2007) Study of greedy-policy-based algorithm for 0/1 knapsack problem. Comput Mod 4:10–16

    Google Scholar 

  • Zhang X, Huang S, Hu Y, Zhang Y, Mahadevan S, Deng Y (2013) Solving 0–1 knapsack problems based on amoeboid organism algorithm. Appl Math Comput 219:9959–9970

    Google Scholar 

  • Zhao JY (2007) Nonlinear reductive dimension approximate algorithm for 0–1 knapsack problem. J Inn Mong Normal Univ (Nat Sci) 36:25–29

    Google Scholar 

  • Zhu Y, Ren LH, Ding Y (2008) DNA ligation design and biological realization of knap-sack problem. Chin J Comput 31:2207–2214

    Article  Google Scholar 

  • Zou D, Gao L, Li S, Wua J (2011) Solving 0–1 Knapsack problem by a novel global harmony search algorithm. Appl Soft Comput 11:1556–1564

    Article  Google Scholar 

  • Shamsudin HC et al. (2012) A fast discrete gravitational search algorithm. In: 4th International conference on computatinal intelligence modelling and simulation, 24–28

  • Antony J (2003) Design of experiments for engineer and scientists. Elsevier, USA

    Google Scholar 

  • Bahrololoum A, Nezamabadi-pour H, Bahrololoum H, Saeed M (2014) A prototype classifier based on gravitational search algorithm. Appl Soft Comput 12:819–825

    Article  Google Scholar 

  • Belgacem T, Hifi M (2008) Sensitivity analysis of the optimum to perturbation of the profit of a subset of items in the binary knapsack problem. Discrete Optim 5:755–761

    Article  Google Scholar 

  • Deb K, Pratap A, Agarwal S, Meyarivan T (2002) A fast and elitist multiobjective genetic algorithm: NSGAII. IEEE Trans Evol Comput 6(2):182–197

    Article  Google Scholar 

  • Derrac J, Garcia S, Molina D, Herrera F (2011) A practical tutorial on the use of nonparametric statistical tests as a methodology for comparing evolutionary and swarm intelligence algorithms. Swarm and Evolutionary Computation 1:3–18

    Article  Google Scholar 

  • Do QH (2015) A hybrid gravitational search algorithm and back-propagation for training feedforward neural networks. Knowl Syst Eng 326:381–392

    Google Scholar 

  • Dowlatshahi MB, Nezamabadi-pour H (2014) GGSA: a grouping gravitational search algorithm for data clustering. Eng Appl Artif Intell 36:114–121

    Article  Google Scholar 

  • Dowlatshahi MB, Nezamabadipour H, Mashinchi M (2014) A discrete gravitational search algorithm for solving combinatorial optimization problems. Inf Sci 258:94–107

    Article  Google Scholar 

  • Farahani FS, Sheikhan M, Farrokhi A (2014) Facial emotion recognition using gravitational search algorithm for colored images. Artif Intell Signal Process 247:32–40

    Google Scholar 

  • Florios K, Mavrotas G, Diakoulaki D (2010) Solving multi-objective, multi-constraint knapsack problems using mathematical programming and evolutionary algorithms. Eur J Oper Res 203:14–21

    Article  Google Scholar 

  • Gonzalez B, Valdez F, Melin P, Prado-Arechiga G (2015a) Fuzzy logic in the gravitational search algorithm for the optimization of modular neural networks in pattern recognition. Expert Syst Appl 42:5839–5847

    Article  Google Scholar 

  • Gonzalez B, Valdez F, Melin P, Prado-Arechiga G (2015b) A gravitational search algorithm for optimization of mudular neural networks in pattern recognition. Fuzzy Logic Augment Nat-Inspir Opt Metaheuristics 574:127–137

    Google Scholar 

  • Gupta M (2013) A fast and efficient genetic algorithm to solve 0–1 knapsack problem. Int J Digit Appl Contemp Res 1(6):1–5

    Google Scholar 

  • Han KH, Kim JH (2002) Quantum-inspired evolutionary algorithm for a class of combinatorial optimization. IEEE Trans Evol Comput 6:580–593

    Article  Google Scholar 

  • Han X, Chang X, Quan L, Xiong X, Li J, Zhang Z, Liu Y (2014) Feature subset selection by gravitational search algorithm optimization. Inf Sci 281:128–146

    Article  Google Scholar 

  • He F (2009) An improved particle swarm optimization for knapsack problem. In: International conference on computational intelligence and software engineering, 1–4

  • Ji B, Li X, Huang Y, Li W (2014) Application of quantum-inspired binary gravitational search algorithm for thermal unit commitment with wind power. Energy Convers Manag 87:589–598

    Article  Google Scholar 

  • Ke L, Zhang Q, Battiti R (2014) Hybridization of the decomposition and local search for multiobjective optimization. IEEE Trans Cybern 44(10):1808–1820

    Article  Google Scholar 

  • Khan MHA (2013) An evolutionary algorithm with masked mutation for 0/1 knapsack problem. In: International conference on informatics, electronics and vision (ICIEV), 1–6

  • Kong X, Gao L, Ouyang H, Li S (2015) A simplified binary harmony search algorithm for large scale 0–1 knapsack problems. Expert Syst Appl 42:5337–5355

    Article  Google Scholar 

  • Kulkarni AJ, Shabir H (2014) Solving 0–1 knapsack problem using cohort intelligence algorithm. Int J Mach Learn Cybern 1–15. doi:10.1007/s13042-014-0272-y

  • Layeb A (2011) A novel quantum inspired cuckoo search for knapsack problems. Int J Bio-Inspir Comput 1–9

  • Layeb A (2013) A hybrid quantum inspired harmony search algorithm for 0–1 knapsack problems. J Comput Appl Math 253:14–25

    Article  Google Scholar 

  • Le LD, Ho LD, Vo D, Vasant P (2015) Hybrid differential evolution and gravitational search algorithm for novconvex economic dispatch. In: Proceeding of the 18th Asia Pacific Symposium Intelligent and Evolutionary Systems, 2:89–103

  • Li P, Duan H (2012) Path planning of unmanned aerial vehicle based on improved gravitational search algorithm. Sci China Technol Sci 55:2712–2719

    Article  Google Scholar 

  • Mahajan R, Chopra S (2012) Analysis of 0/1 knapsack problem using deterministic and probabilistic techniques. In: 2nd international conference on advanced computing and communication technologies, 150–155

  • Mavrotas G, Florios K, Figueira JR (2015) An improved version of a core based algorithm for the multi-objective multi-dimensional knapsack problem: a computational study and comparison with meta-heuristics. Appl Math Comput 270:25–43

    Google Scholar 

  • Nezamabadi-pour H (2015) a quantum-inspired gravitational search algorithm for binary encoded optimization problems. Eng Appl Artif Intell 40:62–75

    Article  Google Scholar 

  • Prajna K, Rao GSB, Reddy KVVS, Maheswari RU (2014) A new approach to dual channel speech enhancement based on gravitational search algorithm (GSA). Int J Speech Technol 17:341–351

    Article  Google Scholar 

  • Saha S, Chakraborty D (2015) Improved prediction accuracy with reduced feature set using novel binary gravitational search optimization. Comput Adv Commun Circuits Syst 335:177–183

    Google Scholar 

  • Shams M, Rashedi E, Hakimi A (2015) Clustered-gravitational search algorithm and its application in parameter optimization of a low noise amplifier. Appl Math Comput 258:436–453

    Google Scholar 

  • Su Z, Wang H (2015) A novel robust hybrid gravitational search algorithm for reusable launch vehicle approach and landing trajectory optimization. Neurocomputing 162:116–127

    Article  Google Scholar 

  • Sudin S et al (2014) A modified gravitational search algorithm for discrete optimization problem. IJSSST 15:51–55

    Google Scholar 

  • Wang Y, Feng XY, Huang YX, Zhou WG, Liang YC, Zhou CG (2005) A novel quantum swarm evolutionary algorithm for solving 0–1 knapsack problem. Adv Nat Comput 3611:698–704

    Google Scholar 

  • Xiang J, Han X, Duan F, Qiang Y, Xiong X, Lan Y, Chai H (2015) A novel hybrid system for feature selection based on an improved gravitational search algorithm and K-NN method. Appl Soft Comput 31:293–307

    Article  Google Scholar 

  • Yuan X, Ji B, Zhang S, Tian H, Hou Y (2014) A new approach for unit commitment problem via binary gravitational search algorithm. Appl Soft Comput 22:249–260

    Article  Google Scholar 

  • Zar JH (2009) Biostatistical analysis. Prentice Hall, USA

    Google Scholar 

  • Zhang Q, Li H (2007) MOEA/D: a multiobjective evolutionary algorithm based on decomposition. IEEE Trans Evol Comput 11(6):712–731

    Article  Google Scholar 

  • Zibanezhad B, Zamanifar K, Sadjady RS, Rastegari Y (2011) Applying gravitational search algorithm in the Qos-based web service selection problem. J Zhejiang Univ Sci C 12:730–742

    Article  Google Scholar 

  • Zitzler E, Laumanns M, Thiele L (2002) SPEA2: improving the strength pareto evolutionary algorithm for malitiobjective optimization. In: Proceedings evolutionary methods for design optimization and control with application to industrial problems, 95–100

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Hedieh Sajedi.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Sajedi, H., Razavi, S. DGSA: discrete gravitational search algorithm for solving knapsack problem. Oper Res Int J 17, 563–591 (2017). https://doi.org/10.1007/s12351-016-0240-2

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s12351-016-0240-2

Keywords

Navigation