Greedy Analysis Strategies
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 schedulingStructural.
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 partitioningExchange 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相关推荐
- 贪心算法及Jump Game系列题详解
本博文所有的代码均可在 https://github.com/Hongze-Wang/LeetCode_Java https://github.com/Hongze-Wang/LeetCode_Pyt ...
- 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 ...
- RNA-seq中的生物学重复
生物学重复:经过相同方式处理相同样品(不是同一个体).指样本重复,比如3只小鼠,同时做一种处理,就是三个生物学重复. 消除组内误差:生物学重复可以测量变异程度. 增强结果可靠性:测序的样本数越多,越能 ...
- 深度解密Go语言之pprof
相信很多人都听过"雷神 3"关于性能优化的故事.在一个 3D 游戏引擎的源码里,John Carmack 将 1/sqrt(x) 这个函数的执行效率优化到了极致. 一般我们使用二分 ...
- 程序崩溃 分析工具_程序分析工具| 软件工程
程序崩溃 分析工具 A program analysis tool implies an automatic tool that takes the source code or the execut ...
- mcq 队列_MCQ | 软件程序分析工具和组件分类| 免费和开源软件
mcq 队列 Q1. Which of the following analysis methods come under Static Analysis Tools? Q1. 静态分析工具包含以下哪 ...
- R语言处理缺失数据的5个常用包
R语言处理缺失数据的5个常用包 1.常用缺失数据处理包 2. MICE 包 2.1基本介绍 2.2 实例展示 3.Amelia包 3.1基本介绍 3.2实例展示 4.missForest包 4.1基本 ...
- CDISC的ADaMIG (V1.2) 中英文对照【5】_第五章 附录
本AdaMIG (v1.2)来自CDISC官网以下链接: https://www.cdisc.org/standards/foundational/adam/adam-implementation-g ...
- Go性能分析工具pprof详解
文章目录 一.什么是pprof 二.怎么使用pprof 1. 工具型应用 2. 服务型应用 三.`pprof`数据分析 CPU Profiling top指令排序展示 web指令生成图示 list指令 ...
- Hi-C data analysis tools and papers
Hi-C data analysis tools and papers 全文链接如下: https://github.com/mdozmorov/HiC_tools Tools are sorted ...
最新文章
- 23. 进程并发控制之Semaphore
- 前端学python有什么用-杭州前端需要学习python
- java修饰符重新学习日记一
- 手机上图片信息怎么拉一个矩形框_跟着黑鲨手机发布会学习PPT制作
- 您的数据中心UPS电池开关不能再选错和接错了
- Spring 注入集合的成员变量属性
- 算法 --- 回溯法
- ASP.NET Core 中的静态文件
- Linux: Shell编程基础
- D3中数据与DOM element绑定之data() enter() exit()浅析
- hdu 1698 Just a Hook 线段树区间更新
- 旷视COCO获奖团队亲述:我们是如何两年拿下7个冠军的
- [原创]三维建模软件的尝试
- mysql的预准备语句_MySQLi:使用一个预准备语句插入多行
- 深度学习行人检测简介_深度学习简介
- 110 redis的哨兵集群 redis-cluster docker安装
- 电脑一直自动输入一个字符
- fastboot刷机操作
- python写的ROS激光雷达扇形滤波
- ps水彩效果教程-庞姿姿