Some links that might be helpful for this story.
knapsack (0-1) problem
Copyright 2022 Robin A. Reynolds-Haertle