Skip to content

Repository files navigation

KnapsackProblem

The research work on Knapsack Problem algorithms
benchmarks: https://people.sc.fsu.edu/~jburkardt/datasets/knapsack_01/knapsack_01.html


Knapsack 01

  • capacity: 165
  • optimal solution: [1, 1, 1, 1, 0, 1, 0, 0, 0, 0]
  • optimal weight: 165, and profit: 309
    BruteForce optimal solution: [1, 1, 1, 1, 0, 1, 0, 0, 0, 0]
    optimal weight: 165, and profit 309
    Greedy optimal solution: [1, 1, 1, 1, 0, 1, 0, 0, 0, 0]
    optimal weight: 165, and profit 309
    Branch-And-Bound optimal solution: [1, 1, 1, 1, 0, 1, 0, 0, 0, 0]
    optimal weight: 165, and profit 309
    Dynamic optimal solution: [1, 1, 1, 1, 0, 1, 0, 0, 0, 0]
    optimal weight: 165, and profit 309
    Genetic optimal solution: [1, 1, 1, 1, 0, 1, 0, 0, 0, 0]
    optimal weight: 165, and profit 309

Knapsack 02

  • capacity: 26
  • optimal solution: [0, 1, 1, 1, 0]
  • optimal weight: 26, and profit: 51
    BruteForce optimal solution: [0, 1, 1, 1, 0]
    optimal weight: 26, and profit 51
    Greedy optimal solution: [1, 0, 1, 0, 0]
    optimal weight: 23, and profit 47
    Branch-And-Bound optimal solution: [0, 1, 1, 1, 0]
    optimal weight: 26, and profit 51
    Dynamic optimal solution: [0, 1, 1, 1, 0]
    optimal weight: 26, and profit 51
    Genetic optimal solution: [0, 1, 1, 1, 0]
    optimal weight: 26, and profit 51

Knapsack 03

  • capacity: 190
  • optimal solution: [1, 1, 0, 0, 1, 0]
  • optimal weight: 190, and profit: 150
    BruteForce optimal solution: [1, 1, 0, 0, 1, 0]
    optimal weight: 190, and profit 150
    Greedy optimal solution: [1, 1, 0, 1, 0, 0]
    optimal weight: 179, and profit 146
    Branch-And-Bound optimal solution: [1, 1, 0, 0, 1, 0]
    optimal weight: 190, and profit 150
    Dynamic optimal solution: [1, 1, 0, 0, 1, 0]
    optimal weight: 190, and profit 150
    Genetic optimal solution: [1, 0, 1, 0, 0, 1]
    optimal weight: 153, and profit 119

Knapsack 04

  • capacity: 50
  • optimal solution: [1, 0, 0, 1, 0, 0, 0]
  • optimal weight: 50, and profit: 107
    BruteForce optimal solution: [1, 0, 0, 1, 0, 0, 0]
    optimal weight: 50, and profit 107
    Greedy optimal solution: [1, 1, 0, 0, 1, 1, 0]
    optimal weight: 48, and profit 102
    Branch-And-Bound optimal solution: [1, 0, 0, 1, 0, 0, 0]
    optimal weight: 50, and profit 107
    Dynamic optimal solution: [1, 0, 0, 1, 0, 0, 0]
    optimal weight: 50, and profit 107
    Genetic optimal solution: [1, 1, 0, 0, 0, 1, 1]
    optimal weight: 50, and profit 105

Knapsack 05

  • capacity: 104
  • optimal solution: [1, 0, 1, 1, 1, 0, 1, 1]
  • optimal weight: 104, and profit: 900
    BruteForce optimal solution: [1, 0, 1, 1, 1, 0, 1, 1]
    optimal weight: 104, and profit 900
    Greedy optimal solution: [1, 1, 0, 1, 1, 1, 1, 1]
    optimal weight: 97, and profit 858
    Branch-And-Bound optimal solution: [1, 0, 1, 1, 1, 0, 1, 1]
    optimal weight: 104, and profit 900
    Dynamic optimal solution: [1, 0, 1, 1, 1, 0, 1, 1]
    optimal weight: 104, and profit 900
    Genetic optimal solution: [1, 0, 1, 1, 1, 0, 1, 1]
    optimal weight: 104, and profit 900

Knapsack 06

  • capacity: 170
  • optimal solution: [0, 1, 0, 1, 0, 0, 1]
  • optimal weight: 169, and profit: 1735
    BruteForce optimal solution: [0, 1, 0, 1, 0, 0, 1]
    optimal weight: 169, and profit 1735
    Greedy optimal solution: [1, 1, 1, 0, 0, 0, 0]
    optimal weight: 140, and profit 1478
    Branch-And-Bound optimal solution: [0, 1, 0, 1, 0, 0, 1]
    optimal weight: 169, and profit 1735
    Dynamic optimal solution: [0, 1, 0, 1, 0, 0, 1]
    optimal weight: 169, and profit 1735
    Genetic optimal solution: [0, 1, 0, 1, 0, 0, 1]
    optimal weight: 169, and profit 1735

Knapsack 07

  • capacity: 750
  • optimal solution: [1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1]
  • optimal weight: 749, and profit: 1458
    BruteForce optimal solution: [1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1]
    optimal weight: 749, and profit 1458
    Greedy optimal solution: [1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1]
    optimal weight: 740, and profit 1441
    Branch-And-Bound optimal solution: [1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1]
    optimal weight: 749, and profit 1458
    Dynamic optimal solution: [1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1]
    optimal weight: 749, and profit 1458
    Genetic optimal solution: [1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1]
    optimal weight: 749, and profit 1458

Comparison:

benchmarkalgorithmexecution meanexecution stdcapacityoptim_weightoptim_profit
1Branch-And-Bound00165165309
1BruteForce0.00160.0005165165309
1Dynamic0.0060.0007165165309
1Genetic0.01450.0089165165309
1Greedy00165165309
2Branch-And-Bound00262651
2BruteForce00262651
2Dynamic0.00060.0005262651
2Genetic0.00040.0005262447
2Greedy00262347
3Branch-And-Bound0.00020.0005190190150
3BruteForce00190190150
3Dynamic0.00440.0006190190150
3Genetic0.00040.0005190172119
3Greedy00190179146
4Branch-And-Bound005050107
4BruteForce0.00060.00055050107
4Dynamic0.00120.00045050107
4Genetic0.00140.00095050107
4Greedy005048102
5Branch-And-Bound00104104900
5BruteForce0.00040.0005104104900
5Dynamic0.00380.0008104104900
5Genetic0.00320.0008104103898
5Greedy0010497858
6Branch-And-Bound0.00020.00041701691735
6BruteForce0.00020.00051701691735
6Dynamic0.00520.00081701691735
6Genetic0.0010.00071701691735
6Greedy001701401478
7Branch-And-Bound0.00420.00087507491458
7BruteForce0.05410.01477507491458
7Dynamic0.0580.00477507491458
7Genetic0.3060.03657507491458
7Greedy0.00020.00047507401441

About

The research work on Knapsack Problem algorithms

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages