背包问题算法
背包问题 (Knapsack problem)
The knapsack problem or rucksack problem is a problem in combinative or integrative optimization. In this kind of problem, there are set of items are given with a weight and a value, determine the number of each item included in a collection so that the total weight is less than or equal to the given limit and the total value is as large as possible.
背包问题或背包问题是组合或集成优化中的问题。 在这种问题中,给一组项目赋予一个权重和一个值,确定集合中包含的每个项目的数量,以使总权重小于或等于给定的限制,并且总值等于尽可能大。
小背包问题 (Fractional Knapsack problem)
In fractional knapsack fractions of an item can be taken rather than having to make a binary choice for each of them. In this objective function is mathematically represented by:
在