Skip to content

tolgailtuzer/metaheuristics-for-knapsack-problem

Repository files navigation

About

The knapsack problem is a problem in combinatorial optimization: Given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible. It derives its name from the problem faced by someone who is constrained by a fixed-size knapsack and must fill it with the most valuable items.

We will solve the 0-1 Knapsack type of this problem with the following methods:

  • Simulated Annealing

  • Genetic Algorithm

  • Ant Colony Algorithm

  • Artificial Bee Colony Algorithm

Information About Input Format

Knapsack Capacity

Weights (must be separated by a space character)

Values (must be separated by a space character)

Optimal Results For Test Datasets

You can find sample test files in Datasets.

DatasetOptimal Value
test1.txt41494
test2.txt191977
test3.txt66029
test4.txt973950
test5.txt236490
test6.txt2338497
test7.txt380618
test8.txt2015213
test9.txt930173
test10.txt7872942

About

Different Metaheuristic Algorithms for solving 0-1 Knapsack Problem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published