Problem Description(s)

Decision Version

Given a subset of items with values and weights, can a total value of be achieved, without exceeding weight ?

Is NP-Complete

Optimisation Version

Given a subset of items with weights and values, what is the maximum value that can be obtained with the least weight ?

Solutions

Brute-force approach

A brute-force approach is:

  1. Every item can either be in the knapsack, or not in the knapsack.
  2. Therefore we can say that each item has 2 states, and those are multiplied for a given combination

This is equivalent to testing the Power Set of the items in the knapsack.

Therefore, we have a time complexity of , making this algorithm intractable

Dynamic Programming approach

#todo

Analysis

Time Complexity
ApproachTime Complexity
Brute-force