*本文主要记录和分享学习到的知识,算不上原创

*参考文献见链接

本文主要讲述启发式算法中的遗传算法。遗传算法也是以local search为核心框架,但在表现形式上和hill climbing, tabu search, Variable neighborhood search等以一个初始解出发的算法会有些许不同。这种以若干个初始解出发的启发式算法在diversification方面表现得会比较好。

http://www.theprojectspot.com/tutorial-post/creating-a-genetic-algorithm-for-beginners/3

目录

  GA的过程

  GA的伪代码

  Example

GA的思想

  模仿生物界进化的过程:适者生存

GA的过程

(1)Initialization

Create an initial population. This population is usually randomly generated and can be any desired size, from only a few individuals to thousands.

(2)Evaluation

Each member of the population is then evaluated and we calculate a 'fitness' for that individual. The fitness value is calculated by how well it fits with our desired requirements. These requirements could be simple, 'faster algorithms are better', or more complex, 'stronger materials are better but they shouldn't be too heavy'.

(3)Selection

We want to be constantly improving our populations overall fitness. Selection helps us to do this by discarding the bad designs and only keeping the best individuals in the population.  There are a few different selection methods but the basic idea is the same, make it more likely that fitter individuals will be selected for our next generation.

(4)Crossover

During crossover we create new individuals by combining aspects of our selected individuals. We can think of this as mimicking how sex works in nature. The hope is that by combining certain traits from two or more individuals we will create an even 'fitter' offspring which will inherit the best traits from each of it's parents.

(5)Mutation

We need to add a little bit randomness into our populations' genetics otherwise every combination of solutions we can create would be in our initial population. Mutation typically works by making very small changes at random to an individuals genome.

(6)And repeat!

Now we have our next generation we can start again from step two until we reach a termination condition.

GA的关键:
(1)如何表示解?

(2)如何进行crossover和mutation?

(3)如何进行优胜劣汰?

GA的伪代码

Example: GA for TSP

https://github.com/xiaolou023/Algorithms/tree/master/TSP/src/simpleGA2

MIP启发式算法:遗传算法 (Genetic algorithm)的更多相关文章

  1. 基于遗传算法(Genetic Algorithm)的TSP问题求解(C)

    基于遗传算法的TSP问题求解(C) TSP问题: TSP(Travelling salesman problem): 译作“旅行商问题”, 一个商人由于业务的需要,要到n个城市,每个城市之间都有一条路 ...

  2. 遗传算法Genetic Algorithm

    遗传算法Genetic Algorithm 好家伙,回回都是这个点,再这样下去人估计没了,换个bgm<夜泊秦淮>,要是经典咏流传能投票选诗词,投票选歌,俺一定选这个 开始瞎叨叨 遗传算法的 ...

  3. 超详细的遗传算法(Genetic Algorithm)解析

    https://blog.csdn.net/u010451580/article/details/51178225 https://www.jianshu.com/p/c82f09adee8f 00 ...

  4. 遗传算法 Genetic Algorithm

    2017-12-17 19:12:10 一.Evolutionary Algorithm 进化算法,也被成为是演化算法(evolutionary algorithms,简称EAs),它不是一个具体的算 ...

  5. 【智能算法】超详细的遗传算法(Genetic Algorithm)解析和TSP求解代码详解

    喜欢的话可以扫码关注我们的公众号哦,更多精彩尽在微信公众号[程序猿声] 文章声明 此文章部分资料和代码整合自网上,来源太多已经无法查明出处,如侵犯您的权利,请联系我删除. 00 目录 遗传算法定义 生 ...

  6. 遗传算法(Genetic Algorithm)——基于Java实现

    一.遗传算法原理介绍 遗传算法(Genetic Algorithm)是模拟达尔文生物进化论的自然选择和遗传学机理的生物进化过程的计算模型,是一种通过模拟自然进化过程搜索最优解的方法.遗传算法是从代表问 ...

  7. 遗传算法(Genetic Algorithm, GA)及MATLAB实现

    遗传算法概述: • 遗传算法(Genetic Algorithm,GA)是一种进化算法,其基本原理是仿效生物界中的“物竞天择.适者生存”的演化法则,它最初由美国Michigan大学的J. Hollan ...

  8. 启发式算法(Heuristic Algorithm)

    背景: 李航的<统计学习方法>一书中提到:决策树算法通常采用启发式算法,故了解之 问题解答: 时间有限,这里也只是将算法和启发式算法的区别和简单发展摘录如下: 一.算法和启发式方法之间的差 ...

  9. Evolutionary Computing: 2. Genetic Algorithm(1)

    本篇博文讲述基因算法(Genetic Algorithm),基因算法是最著名的进化算法. 内容依然来自博主的听课记录和教授的PPT. Outline 简单基因算法 个体表达 变异 重组 选择重组还是变 ...

随机推荐

  1. RTC-IC-PCF2129

    一特点: -20~70度,SPI/I2C接口,1.2 V to 4.2 V ,可编程看门狗,时钟输出以便校准,闹钟输出,时间戳输出.低功耗高精度,电源切换,中断输出. SPI接口和I2C接口硬件接法: ...

  2. 使用js获取复选框的值,并把数组传回后台处理,过程使用的是Ajax异步查询

    这是界面代码: ​ function shua(){             var id_array=new Array();         $('input[id="checkAll& ...

  3. oo第三单元总结

    JML梳理 1. JM语法一般结构 public instance //jml中操作数据,并不要求实现 public invariant //不变式 public constraint //约束 no ...

  4. 适配器模式和php实现

    1. 概述 将一个类的接口转换成客户希望的另外一个接口.Adapter模式使得原本由于接口不兼容而不能一起工作的那些类可以在一起工作. 2. 解决的问题 即Adapter模式使得原本由于接口不兼容而不 ...

  5. js黑科技,使用offsetParent检测元素是否隐藏

    var isHidden = function (element) { return (element.offsetParent === null);}; eg:

  6. swift基础-2

    一.基本运算符 let a = 5 var b = 10 b = a if a = b{ swift 中赋值运算符,并不将自身作为一个值进行返回,所以编译不合法,帮开发者避免错误,很人性化的语言 } ...

  7. 【Unity3D】射箭打靶游戏(简单工厂+物理引擎编程)

    打靶游戏:     1.靶对象为 5 环,按环计分:    2.箭对象,射中后要插在靶上:    3.游戏仅一轮,无限 trials: 增强要求:  添加一个风向和强度标志,提高难度 游戏成品图: U ...

  8. Android笔记--View绘制流程源码分析(一)

    Android笔记--View绘制流程源码分析 View绘制之前框架流程分析 View绘制的分析始终是离不开Activity及其内部的Window的.在Activity的源码启动流程中,一并包含 着A ...

  9. (四)我的JavaScript系列:原型链

    夜深风竹敲秋韵,万叶千声皆是恨. 原型链对于JavaScript来说是个很核心的概念.JavaScript不是基于类模板的面向对象语言:反而,它的面向对象机制是基于原型的.我们不可能说某个对象属于什么 ...

  10. Android(java)学习笔记117:SharedPreferences(轻量级存储类)

    1.SharedPreferences是Android平台上一个轻量级的存储类,简单的说就是可以存储一些我们需要的变量信息.2个activity 之间的数据传递除了可以他通过intent来传递数据,还 ...