用贪婪算法解决背包问题_解决主要算法问题的贪婪策略

用贪婪算法解决背包问题

Introduction:

介绍:

Let's start the discussion with an example that will help to understand the greedy technique. If we think about playing chess, when we make a move we think about the consequences of the move in future states, but in case of playing cricket or tennis, we consider immediate states rather considering any future consequences. This means in some cases we make decisions which seems to be correct at that moment and in some cases we make a decision based on the following consequences or future cases.

让我们从一个有助于理解贪婪技巧的例子开始讨论。 如果我们考虑下棋,那么当我们做出举动时,我们会考虑这一举动在未来状态下的后果,但是在打板球或打网球的情况下,我们考虑的是即时状态,而不是考虑任何未来的后果 。 这意味着在某些情况下,我们做出当时似乎正确的决定,并且在某些情况下,我们基于以下后果或未来情况做出决定。

The idea of local and global can take place here. Local means the immediate case where global means considering the future situation.

本地和全球的想法可以在这里进行。 本地意味着眼前的情况,而全球意味着考虑未来的情况。

The greedy technique is all about making a local decision, based n that immediate case, on based on future consequences and that's why the strategy is known as greedy.

贪婪的技巧全在于根据紧急情况基于未来的后果做出本地决策,这就是为什么该策略被称为贪婪的原因

贪婪策略 (Greedy strategy)

Greedy strategy means to make a decision at e

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值