This algorithm is simple and independent of initial states, the value of weight factor can be self adaptively decided.
该算法操作简单,与初始状态无关,并且很好地解决了权重因子的自适应取值问题。
You could construct all subsets, check that the weight is less than the weight of the knapsack, and then choose the subset with the maximum value.
你可以构建所有子集,检查重量是否小于背包的重量,然后选择最大值的子集。
When the net has visited each pattern, it sets the value of a weight object to this sum.
当网络访问过每一个图案后,它将一个权重对象的值设置为这个和。
And so you could construct all subsets, check that the weight is less than the weight of the knapsack, and then choose the subset with the maximum value.
因此你可以构建所有子问题,判断它的重量,是否小于背包的重量,然后选择值最大的子问题。
Then if the weight of i is less than the available weight, I can return the value of i.
然后如果i的重量,小于剩下的重量,我将返回i的价值。
And now we want to find the subset of a that has the maximum value, subject to the weight constraint.
会有一个值与其对应,现在我们想要找出满足,重量约束条件的a的最大值子集。
应用推荐