Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
So is my problem just a special case of the generic knapsack problem you formulated with c=1? If so, it may not be sufficient to prove the NP-hardness of my knapsack problem. Is it correct?
Thanks for your answer. The function is quite simple. The only issue is the length of bits increases linearly with the size of S'. Can we find a good way to reduce the memory cost (e.g., increasing sub-linearly)?
@MartinSleziak I post this question after I have look at the question you link to in your comments. The solution for that question is still very costly. I allow values in S to satisfy some requirements or relationship. I hope that it could make the problem easier.
@MartinSleziak Thanks. I was about to say this. I know there is a similar question link posted many years ago. But my case is different, I allow values in S to satisfy some requirements or relationship. I hope that it could make the problem easier.