前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Greedy Analysis Strategies

Greedy Analysis Strategies

作者头像
Steve Wang
发布2019-05-28 17:57:39
5110
发布2019-05-28 17:57:39
举报
文章被收录于专栏:从流域到海域

Greedy Analysis Strategies

  • Greedy algorithm stays ahead. Show that after each step of the greedy algorithm, its solution is at least as good as other algorithm’s. Ex.Interval scheduling
  • Structural. Discover a simple “structural” bound asserting that every possible solution must have a certain value. Then show that your algorithm always achieves this bound. Ex.Interval partitioning
  • Exchange argument Gradually transform any solution to the one found by the greedy algorithm without hurting its quality. Ex.Minimizing lateness

Remark. Greedy algorithm do not always give an optimal solution but can produce a solution that is guaranteed to be close to optimal.

Basic Elements of Greedy Algorithm

Usually, if the given problem has the following ingredients(hallmark in other teaching material, Steve add this note), then it is more likely to develop a greedy algorithm for it.

  • Greedy-choice property. A locally optimal choice is globally optimal。

We can assemble a globally optimal solution by making locally optimal(greedy) choices. That is, when we make the choice that looks best in the current problem, without considering results from subproblems.

  • Optimal substructure. A problem exhibits optimal substructure if an optimal solution to the problem contain within it optimal solutions to subproblems.

注意,这里的最优子结构和动态规划的hallmark 1是一样的。事实上,贪心法解决不了的问题,可以尝试使用动态规划来解决。

0-1背包问题,有最优子结构,但使用贪心法无法解决,需要使用动态规划。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019年01月10日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Greedy Analysis Strategies
  • Basic Elements of Greedy Algorithm
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档