Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有谁知道如何使用背包算法实现这个问题的算法?
我目前使用的方法广泛使用了 LINQ 和 Collections of Collections 以及一些字典。对于那些不知道我在说什么的人,请查看切割库存问题。
正如您在给定的链接中提到的,这个问题实际上是ILP的一个实例,通常是 NP 难的。
直接来自维基百科:求解整数线性程序的高级算法包括: