What's the dominant in the text is just the stuff, the stuff in his knapsack listed with as little implication as possible.
主题占支配地位,重要的是那些在背包里几乎没有任何含义的东西。
I can see a wine bottle in your backpack.
我在你背包里看到一个葡萄酒瓶。
It's a list of the contents of the knapsack of a soldier during the Vietnam War, just a list of the contents.
故事讲述了一个越战士兵,背包里的东西,只是一系列东西而已。
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.
因此你可以构建所有子问题,判断它的重量,是否小于背包的重量,然后选择值最大的子问题。
Why do I have wine bottles in my backpack?
为什么我背包里会有葡萄酒瓶?
You are an avid backpacker, you've been all of the United States perhaps even broader.
你是个很有野心的背包客,你几乎走遍了全美,甚至更多地方。
Can you tune in to any number of designs including duffel bags, if you're the athletic type, law bears if you're more of the stuffed animal type, and then under the new category here do we have a whole bunch of meem themes shirt as well.
你们看到设计的任一编号,如果你是运动型的,有这样的背包,如果你更喜欢动物,也有玩具熊,在新的分类下,我们也提供了一系列,米依美主题的T恤。
So how long it takes to run is related to how many items I end up being able to fit into the knapsack.
所以,运行的时间是和我能够,装进背包的物品数目有关的。
Let's now go back and instantiate these ideas for the knapsack problem we looked at last time In particular, for the 0-1 knapsack problem.
让我们回来用具体例子,来说明我们上次看过的背包问题,特别是对0-1背包问题来说。
So let's look at an example of a zero-one knapsack problem.
我们要像之前一样将其最优化,现在让我们来看一个0/1背包问题的例子。
STUDENT: You can't exceed the volume that the knapsack can hold.
学生:你不能超过背包,所能容纳物品的体积。
So I haven't done magic, I've given you a really fast way to solve a knapsack problem, but it's still exponential deep down in its heart, in something.
所以我并没有施魔法,我已经告诉了你,一种快速解决背包问题的方法了,但是某些方面它的核心仍然是指数增长的。
with the continuous knapsack problem as we've formulated it, greedy is good.
因为正如我们已经归越过的,对于一般连续性背包问题贪婪算法很实用。
Typically up till now, we've looked at things that can be done in sublinear time. Or, at worst, polynomial time. We'll now look at a problem that does not fall into that. And we'll start with what's called the continuous knapsack problem.
至今为止我们已经处理过,亚线性问题,最多也就是多项式问题,我们现在要看的问题则是不能用这些解决的,我们将要开始讲连续背包问题。
But don't worry about it, it's not, I'm just using it because it's a simpler example than the one I really want to get to, which is knapsack.
但是别担心,我讲这些是因为它比我,真正想讲的问题简单一些,我想讲的是背包问题。
Hence the name of the problem.
也就是这个问题的名字0/1背包问题。
But let's look for a slight variant of it, where greedy is not so good. And that's what's called the zero-one knapsack problem.
但是让我们找一找它的一些变种,在这些变种中贪婪算法用处不大,这些问题也就是0/1背包问题。
So we'll start looking in detail at one problem, and that's the knapsack problem. Let's see.
让我们开始仔细讲讲一个问题,那就是背包问题。
So we put one item in the backpack 9 and we've got a value of 9.
所以我们在背包里放一件物品,而它的价值是。
The backpack is now full, right?
背包现在已经满了,对吧?没有空间了?
应用推荐