退火算法 贪婪算法

介绍 (Introduction)

The solution is determined by a sequence of steps each step has given a particular solution and later a complete solution to given the problem can be achieved. In short, while making a choice there should be a greed for the optimum solution. Some points about Greedy strategy:

该解决方案由一系列步骤确定,每个步骤都给出了特定的解决方案,随后可以实现针对给定问题的完整解决方案。 简而言之,在做出选择时,应该有一个贪婪的最佳解决方案。 有关贪婪策略的一些要点

  • Look for the optimal solution and assumes it as best.

    寻找最佳解决方案,并假定它是最佳解决方案。

  • Solves the sub-problems in Top-down manner.

    以自上而下的方式解决子问题。

  • This approach is less powerful programming techniques.

    这种方法是功能较弱的编程技术。

  • It is not applicable to a wider area like dynamic programming approach.

    它不适用于动态编程方法等更广泛的领域。

  • It is useful for solving optimization problems.

    这对于解决优化问题很有用。

  • It generates only one solution sequences.

    它仅生成一个解决方案序列。

In greedy Strategy following activities are performed,

在贪婪策略中,执行以下活动,

  1. First, select some solutions from input domain.

    首先,从输入域中选择一些解决方案。

  2. Then check whether the solution is feasible or not.

    然后检查该解决方案是否可行。

  3. In this, we find an optimum solution which satisfies the objective of the function and it can be obtained from a particular solution out of the set of feasible solution.

    在此,我们找到了一个满足函数目标的最优解,并且可以从可行解集中的特定解中获得。

  4. As greedy method works in stages only one stage is considered at a time. Based on this input it is decided whether a particular input is given the optimal solution or not.

    由于贪婪方法分阶段进行,因此一次只考虑一个阶段。 基于此输入,确定是否为特定输入提供了最佳解决方案。

贪婪策略算法 (Algorithm for Greedy Strategy)

In greedy approach D is domain, from which solution is to be obtained of size n...

在贪婪方法中, D是域,将从中获得大小为n的解 。

    Initially assume
Solution  ← 0
For i ← 1 to n do
{
S ← select(D) // section of solution from D
If (Feasible (solution) then
Solution ← Union (solution, s);
}
Return solution

贪婪策略的要素 (Elements of Greedy Strategy)

Greedy Choice property

贪婪选择酒店

  • A global optimal solution can be arrived by local optimal choice.

    全局最优解可以通过局部最优选择来获得。

  • For finding the solutions to the problem the subproblems are solved and best from these sub-problems is considered.

    为了找到问题的解决方案,解决了子问题,并考虑了这些子问题中的最佳问题。

  • This choice may depend upon the previously made choices but it does not depend on any future choice.

    该选择可能取决于先前做出的选择,但并不取决于任何将来的选择。

  • Thus in the greedy method, greedy choices are made one after the another, reducing each given problem instances to smaller one.

    因此,在贪婪方法中,贪婪的选择是一个接一个地做出的,从而将每个给定的问题实例减少为较小的一个。

Optimal sub-structure

最佳子结构

  • If an optimal solution to the problem containing the optimal solution to the subproblem then the problem shows an optimal substructure.

    如果问题的最优解包含子问题的最优解,那么问题将显示最优子结构。

  • A problem has optimal substructure if has been next choices always leads to an optimal solution.

    如果问题一直存在,则问题具有最佳的子结构,这通常会导致最佳解决方案。

贪心法的应用 (Applications of greedy method)

Problems that can be solved by greedy approach,

贪婪方法可以解决的问题,

  1. Knapsack problem

    背包问题

  2. Prim’s algorithm for minimum spanning tree.

    Prim的最小生成树算法。

  3. Kruskal’s algorithm for minimum spanning tree.

    最小生成树的Kruskal算法。

  4. Finding shortest job

    寻找最短的工作

  5. Job sequencing with deadlines

    有期限的工作排序

  6. Optimal storage on taps

    水龙头的最佳存储

  7. Huffman coding

    霍夫曼编码

Feasible solution

可行的解决方案

The set of values for the decision problem which satisfies all of the constraints of an optimization problem then the solution is called feasible solution. Feasible solution satisfy all linear and non-linear constraints. The set of all feasible solution defines the feasible region of the problem. To solve a problem first find anyone feasible solution and then try to find another feasible solution which satisfies the values of the objective functions. The whole process is repeated until when no further improvement is achieved or other criteria are met.

满足优化问题所有约束的决策问题的值集,然后将该解决方案称为可行解。 可行的解决方案满足所有线性和非线性约束。 所有可行解的集合定义了问题的可行区域。 为了解决问题,首先找到任何可行的解决方案,然后尝试找到另一种满足目标函数值的可行解决方案。 重复整个过程,直到没有进一步的改善或满足其他标准为止。

翻译自: https://www.includehelp.com/algorithms/introduction-to-greedy-strategy-in-algorithms.aspx

退火算法 贪婪算法

退火算法 贪婪算法_算法贪婪策略简介相关推荐

  1. python快速排序算法循环_算法:快速排序的Python实现

    一.概述 快速排序(quick sort)是一种分治排序算法.该算法首先 选取 一个划分元素(partition element,有时又称为pivot):接着重排列表将其 划分 为三个部分:left( ...

  2. python枚举算法流程图_算法-枚举

    本章我们进入算法的学习,我们会通过比较经典的例题去讲解一些常用的算法思想,常用的算法思想包括:枚举.递归.分治.贪心.试探.动态迭代和模拟等,本节我们来学习一下枚举算法. 1. 枚举思想 枚举算法我们 ...

  3. 雪花算法原理_算法越来越强,我们的判断力却越来越弱

    我们每天在网络平台上看到的信息,很大程度上是由运营平台的商业公司所编写的算法决定的.但在工具理性的背后,确实存在着网络用户对新闻平台的不满与抱怨:点开全文毫无意义的标题党.缺少"石锤&quo ...

  4. 回溯 皇后 算法笔记_算法笔记_04_回溯

    设计思想: (1)适用:求解搜索问题和优化问题. (2)搜索空间:数,节点对应部分解向量,可行解在树叶上. (3)搜索过程:采用系统的方法隐含遍历搜索树. (4)搜索策略:深度优先,宽度优先,函数优先 ...

  5. 排序中减治法算法伪代码_算法浅谈——分治算法与归并、快速排序(附代码和动图演示)...

    在之前的文章当中,我们通过海盗分金币问题详细讲解了递归方法. 我们可以认为在递归的过程当中,我们通过函数自己调用自己,将大问题转化成了小问题,因此简化了编码以及建模.今天这篇文章呢,就正式和大家聊一聊 ...

  6. 求n的阶乘的算法框图_算法|从阶乘计算看递归算法

    欢迎点击「算法与编程之美」↑关注我们! 本文首发于微信公众号:"算法与编程之美",欢迎关注,及时了解更多此系列文章. 1 理解递归 "程序设计是实践计算机思维的重要手段& ...

  7. 连通域最小外接矩形算法原理_算法|图论 2W字知识点整理(超全面)

    作者:SovietPower✨ 链接:https://ac.nowcoder.com/discuss/186584 来源:牛客网 度数序列 对于无向图, 为每个点的度数.有 (每条边被计算两次).有偶 ...

  8. 求n的阶乘的算法框图_算法——递归问题

    要理解递归,首先要理解递归. 从前有座山,山里有座庙,庙里有个老和尚和小和尚,老和尚对小和尚说,从前有座山,山里有座庙,庙里有个老和尚和小和尚,老和尚对小和尚说,从前有座山...... 上面这些梗在递 ...

  9. 回溯 皇后 算法笔记_算法笔记-回溯法

    (1)0-1背包问题 思路:构造一个二叉树,每个商品都有两种状态,要或者不要.如果要就在这个节点的左枝挂子节点,如果不要就在右节点挂子节点.如果全部商品都分配完状态之后就回溯,回溯到一个还有其他选择的 ...

最新文章

  1. 前端开发常见问题精选(五)
  2. 全球最大的公开人脸数据集 | 清华大学芯翌科技联合发布
  3. Hibernate基础小案例
  4. DFiddler:A HTTP Packets Listener一个简易版的手机端的Fiddler。
  5. optional判断是否为空_乐字节Java8核心特性之Optional
  6. JavaScript splice() 方法使用
  7. mysql教程清华课后答案_mysql学习之路_sql
  8. Hash表——省市(洛谷 P3405)
  9. mysql 优化实例之索引创建
  10. 软件项目风险管理(Project Risk Management)
  11. wine android模拟器,Mac  下运行window 软件,(wine 模拟器)
  12. 软件工程网络工程第二次训练(AC代码和详细解释)(C语言描述)
  13. mysql条件关键字查询有limt_MySQL使用Limit关键字限制查询结果的数量-Go语言中文社区...
  14. 机器学习实战教程(九):模型泛化
  15. linux下tshark安装及应用
  16. n9006 android6,三星N9006怎么用 三星N9006使用方法【详解】
  17. python继续教育_济宁市专业技术人员继续教育自动化观看课程工具
  18. Python——图片与视频互转(亲测有效)
  19. 逝世一周,追忆乔布斯
  20. 武汉工程大学计算机考研,武汉工程大学2021考研初试:计算机综合II考试大纲

热门文章

  1. java多线程队列_java多线程消费者生产者模式(BlockingQueue 通过阻塞队列实现)
  2. nvidia-smi 命令详解
  3. unity 是厘米还是米_乔丹19岁才1.75米,2年增高近20公分,这个长高方法你能坚持多久...
  4. ironpython2.7.9_IronPython下载
  5. stm32外部中断_STM32学习笔记 | 电源管理及低功耗设计要点
  6. hystrix threadpool coresize_Hystrix断路器 - 求知若渴的蜗牛
  7. cad应用程序的组件中发生了未经处理的异常_什么是CAD/CAM?
  8. Netweaver里某个software component和C4C的版本
  9. spring cloud eureka服务注册和调用
  10. haproxy+keepalived实现负载均衡及高可用