Skip to content
This repository has been archived by the owner on Dec 8, 2019. It is now read-only.

failing test #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

karpikpl
Copy link

@karpikpl karpikpl commented Oct 22, 2017

I think there's an issue with the algorithm - see provided test

@ojchase
Copy link

ojchase commented Apr 13, 2019

Indeed. This implementation doesn't appear to solve the knapsack problem at all. It simply fills the knapsack with the biggest item it can until there's not enough capacity for the remaining items. The possibility of smaller items being optimal is what makes this problem NP-Complete.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants