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背包问题,有最优子结构,但使用贪心法无法解决,需要使用动态规划。

Greedy Analysis Strategies相关推荐

  1. 贪心算法及Jump Game系列题详解

    本博文所有的代码均可在 https://github.com/Hongze-Wang/LeetCode_Java https://github.com/Hongze-Wang/LeetCode_Pyt ...

  2. What every computer science major should know 每一个计算机专业的学生应该知道什么

    Given the expansive growth in the field, it's become challenging to discern what belongs in a modern ...

  3. RNA-seq中的生物学重复

    生物学重复:经过相同方式处理相同样品(不是同一个体).指样本重复,比如3只小鼠,同时做一种处理,就是三个生物学重复. 消除组内误差:生物学重复可以测量变异程度. 增强结果可靠性:测序的样本数越多,越能 ...

  4. 深度解密Go语言之pprof

    相信很多人都听过"雷神 3"关于性能优化的故事.在一个 3D 游戏引擎的源码里,John Carmack 将 1/sqrt(x) 这个函数的执行效率优化到了极致. 一般我们使用二分 ...

  5. 程序崩溃 分析工具_程序分析工具| 软件工程

    程序崩溃 分析工具 A program analysis tool implies an automatic tool that takes the source code or the execut ...

  6. mcq 队列_MCQ | 软件程序分析工具和组件分类| 免费和开源软件

    mcq 队列 Q1. Which of the following analysis methods come under Static Analysis Tools? Q1. 静态分析工具包含以下哪 ...

  7. R语言处理缺失数据的5个常用包

    R语言处理缺失数据的5个常用包 1.常用缺失数据处理包 2. MICE 包 2.1基本介绍 2.2 实例展示 3.Amelia包 3.1基本介绍 3.2实例展示 4.missForest包 4.1基本 ...

  8. CDISC的ADaMIG (V1.2) 中英文对照【5】_第五章 附录

    本AdaMIG (v1.2)来自CDISC官网以下链接: https://www.cdisc.org/standards/foundational/adam/adam-implementation-g ...

  9. Go性能分析工具pprof详解

    文章目录 一.什么是pprof 二.怎么使用pprof 1. 工具型应用 2. 服务型应用 三.`pprof`数据分析 CPU Profiling top指令排序展示 web指令生成图示 list指令 ...

  10. Hi-C data analysis tools and papers

    Hi-C data analysis tools and papers 全文链接如下: https://github.com/mdozmorov/HiC_tools Tools are sorted ...

最新文章

  1. 23. 进程并发控制之Semaphore
  2. 前端学python有什么用-杭州前端需要学习python
  3. java修饰符重新学习日记一
  4. 手机上图片信息怎么拉一个矩形框_跟着黑鲨手机发布会学习PPT制作
  5. 您的数据中心UPS电池开关不能再选错和接错了
  6. Spring 注入集合的成员变量属性
  7. 算法 --- 回溯法
  8. ASP.NET Core 中的静态文件
  9. Linux: Shell编程基础
  10. D3中数据与DOM element绑定之data() enter() exit()浅析
  11. hdu 1698 Just a Hook 线段树区间更新
  12. 旷视COCO获奖团队亲述:我们是如何两年拿下7个冠军的
  13. [原创]三维建模软件的尝试
  14. mysql的预准备语句_MySQLi:使用一个预准备语句插入多行
  15. 深度学习行人检测简介_深度学习简介
  16. 110 redis的哨兵集群 redis-cluster docker安装
  17. 电脑一直自动输入一个字符
  18. fastboot刷机操作
  19. python写的ROS激光雷达扇形滤波
  20. ps水彩效果教程-庞姿姿

热门文章

  1. 大学十年(一个程序员的路程)(林锐博士)《1----9》【林锐的大学10年】
  2. IDEA统计代码量Statistic插件
  3. 2021-3-18大学化学无机原理(3)热力学能与热力学第一定律
  4. Reincarnation
  5. Java实现经纬度格式转化
  6. 中小型局域网上网管理组网方案
  7. 无线基础知识学习(一)
  8. 阿里云数据库(RDS)是什么,与传统数据库有什么区别?
  9. python redis decode_responses
  10. 基于单片机的水壶自动加热系统_一种基于单片机的电热水壶控制系统的制作方法...