title: Fast Knapsack Solver For big problems
body: <p>I want to approximately solve the knapsack problem for big data sets using Python.</p>
  
  <p>Right now, I am using <a href="https://pypi.python.org/pypi/knapsack/0.0.2" rel="nofollow noreferrer">this implementation</a>, which works well for small examples like:</p>
  
  <pre><code>import knapsack
  weight = np.random.randint(10, size = 10)
  value = np.random.randint(10, size = 10)
  capacity = 5
  knapsack.knapsack(weight, value).solve(capacity)
  </code></pre>
  
  <p>but when we scale it up to:</p>
  
  <pre><code>import knapsack
  weight = np.random.randint(10, size = 1000)
  value = np.random.randint(10, size = 1000)
  capacity = 500
  knapsack.knapsack(weight, value).solve(capacity)
  </code></pre>
  
  <p>the program just gets stuck and gives an error. I was wondering if there is some implementation of the knapsack problem where we can state something like compute for 10 seconds and return me the best solution found so far, is this possible?</p>