![](/assets/blank.gif)
前言
CSDN好迷啊,前一段时间的粘贴图片自动居中已经取消了,现在还得手动居中QAQ。不过冲就完事了。
PS:此章节的考察内容比较迷惑,记得在网上找些习题帮助复习!
![](/assets/blank.gif)
“你可以吗!”
“可以”
冲鸭!
0. 智能计算概述
进化算法与群智能算法是智能优化方法的两大类,下面这张图整挺好。
![](/assets/blank.gif)
其中,我们所熟知的遗传、模拟退火、人工神经忘了都属于进化算法;蚁群、粒子群算法则属于群智能算法。
进化算法:主要通过选择、重组、变异(模拟生物进化过程)实现优化问题的求解。
群智能算法:受动物群体智能启发的算法
1. 遗传算法(GA)
GA:求解问题时,从多个解开始,通过一定的法则迭代产生新的解。
遗传算法要经过如下步骤:
#mermaid-svg-RuqvXwHBkK7SDBV9 .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-RuqvXwHBkK7SDBV9 .label text{fill:#333}#mermaid-svg-RuqvXwHBkK7SDBV9 .node rect,#mermaid-svg-RuqvXwHBkK7SDBV9 .node circle,#mermaid-svg-RuqvXwHBkK7SDBV9 .node ellipse,#mermaid-svg-RuqvXwHBkK7SDBV9 .node polygon,#mermaid-svg-RuqvXwHBkK7SDBV9 .node path{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-RuqvXwHBkK7SDBV9 .node .label{text-align:center;fill:#333}#mermaid-svg-RuqvXwHBkK7SDBV9 .node.clickable{cursor:pointer}#mermaid-svg-RuqvXwHBkK7SDBV9 .arrowheadPath{fill:#333}#mermaid-svg-RuqvXwHBkK7SDBV9 .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-svg-RuqvXwHBkK7SDBV9 .flowchart-link{stroke:#333;fill:none}#mermaid-svg-RuqvXwHBkK7SDBV9 .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-svg-RuqvXwHBkK7SDBV9 .edgeLabel rect{opacity:0.9}#mermaid-svg-RuqvXwHBkK7SDBV9 .edgeLabel span{color:#333}#mermaid-svg-RuqvXwHBkK7SDBV9 .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-svg-RuqvXwHBkK7SDBV9 .cluster text{fill:#333}#mermaid-svg-RuqvXwHBkK7SDBV9 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-svg-RuqvXwHBkK7SDBV9 .actor{stroke:#ccf;fill:#ECECFF}#mermaid-svg-RuqvXwHBkK7SDBV9 text.actor>tspan{fill:#000;stroke:none}#mermaid-svg-RuqvXwHBkK7SDBV9 .actor-line{stroke:grey}#mermaid-svg-RuqvXwHBkK7SDBV9 .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333}#mermaid-svg-RuqvXwHBkK7SDBV9 .messageLine1{stroke-width:1.5;stroke-dasharray:2, 2;stroke:#333}#mermaid-svg-RuqvXwHBkK7SDBV9 #arrowhead path{fill:#333;stroke:#333}#mermaid-svg-RuqvXwHBkK7SDBV9 .sequenceNumber{fill:#fff}#mermaid-svg-RuqvXwHBkK7SDBV9 #sequencenumber{fill:#333}#mermaid-svg-RuqvXwHBkK7SDBV9 #crosshead path{fill:#333;stroke:#333}#mermaid-svg-RuqvXwHBkK7SDBV9 .messageText{fill:#333;stroke:#333}#mermaid-svg-RuqvXwHBkK7SDBV9 .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-svg-RuqvXwHBkK7SDBV9 .labelText,#mermaid-svg-RuqvXwHBkK7SDBV9 .labelText>tspan{fill:#000;stroke:none}#mermaid-svg-RuqvXwHBkK7SDBV9 .loopText,#mermaid-svg-RuqvXwHBkK7SDBV9 .loopText>tspan{fill:#000;stroke:none}#mermaid-svg-RuqvXwHBkK7SDBV9 .loopLine{stroke-width:2px;stroke-dasharray:2, 2;stroke:#ccf;fill:#ccf}#mermaid-svg-RuqvXwHBkK7SDBV9 .note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-RuqvXwHBkK7SDBV9 .noteText,#mermaid-svg-RuqvXwHBkK7SDBV9 .noteText>tspan{fill:#000;stroke:none}#mermaid-svg-RuqvXwHBkK7SDBV9 .activation0{fill:#f4f4f4;stroke:#666}#mermaid-svg-RuqvXwHBkK7SDBV9 .activation1{fill:#f4f4f4;stroke:#666}#mermaid-svg-RuqvXwHBkK7SDBV9 .activation2{fill:#f4f4f4;stroke:#666}#mermaid-svg-RuqvXwHBkK7SDBV9 .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-RuqvXwHBkK7SDBV9 .section{stroke:none;opacity:0.2}#mermaid-svg-RuqvXwHBkK7SDBV9 .section0{fill:rgba(102,102,255,0.49)}#mermaid-svg-RuqvXwHBkK7SDBV9 .section2{fill:#fff400}#mermaid-svg-RuqvXwHBkK7SDBV9 .section1,#mermaid-svg-RuqvXwHBkK7SDBV9 .section3{fill:#fff;opacity:0.2}#mermaid-svg-RuqvXwHBkK7SDBV9 .sectionTitle0{fill:#333}#mermaid-svg-RuqvXwHBkK7SDBV9 .sectionTitle1{fill:#333}#mermaid-svg-RuqvXwHBkK7SDBV9 .sectionTitle2{fill:#333}#mermaid-svg-RuqvXwHBkK7SDBV9 .sectionTitle3{fill:#333}#mermaid-svg-RuqvXwHBkK7SDBV9 .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-RuqvXwHBkK7SDBV9 .grid .tick{stroke:#d3d3d3;opacity:0.8;shape-rendering:crispEdges}#mermaid-svg-RuqvXwHBkK7SDBV9 .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-RuqvXwHBkK7SDBV9 .grid path{stroke-width:0}#mermaid-svg-RuqvXwHBkK7SDBV9 .today{fill:none;stroke:red;stroke-width:2px}#mermaid-svg-RuqvXwHBkK7SDBV9 .task{stroke-width:2}#mermaid-svg-RuqvXwHBkK7SDBV9 .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-RuqvXwHBkK7SDBV9 .taskText:not([font-size]){font-size:11px}#mermaid-svg-RuqvXwHBkK7SDBV9 .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-RuqvXwHBkK7SDBV9 .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-svg-RuqvXwHBkK7SDBV9 .task.clickable{cursor:pointer}#mermaid-svg-RuqvXwHBkK7SDBV9 .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-RuqvXwHBkK7SDBV9 .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-RuqvXwHBkK7SDBV9 .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-RuqvXwHBkK7SDBV9 .taskText0,#mermaid-svg-RuqvXwHBkK7SDBV9 .taskText1,#mermaid-svg-RuqvXwHBkK7SDBV9 .taskText2,#mermaid-svg-RuqvXwHBkK7SDBV9 .taskText3{fill:#fff}#mermaid-svg-RuqvXwHBkK7SDBV9 .task0,#mermaid-svg-RuqvXwHBkK7SDBV9 .task1,#mermaid-svg-RuqvXwHBkK7SDBV9 .task2,#mermaid-svg-RuqvXwHBkK7SDBV9 .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-svg-RuqvXwHBkK7SDBV9 .taskTextOutside0,#mermaid-svg-RuqvXwHBkK7SDBV9 .taskTextOutside2{fill:#000}#mermaid-svg-RuqvXwHBkK7SDBV9 .taskTextOutside1,#mermaid-svg-RuqvXwHBkK7SDBV9 .taskTextOutside3{fill:#000}#mermaid-svg-RuqvXwHBkK7SDBV9 .active0,#mermaid-svg-RuqvXwHBkK7SDBV9 .active1,#mermaid-svg-RuqvXwHBkK7SDBV9 .active2,#mermaid-svg-RuqvXwHBkK7SDBV9 .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-svg-RuqvXwHBkK7SDBV9 .activeText0,#mermaid-svg-RuqvXwHBkK7SDBV9 .activeText1,#mermaid-svg-RuqvXwHBkK7SDBV9 .activeText2,#mermaid-svg-RuqvXwHBkK7SDBV9 .activeText3{fill:#000 !important}#mermaid-svg-RuqvXwHBkK7SDBV9 .done0,#mermaid-svg-RuqvXwHBkK7SDBV9 .done1,#mermaid-svg-RuqvXwHBkK7SDBV9 .done2,#mermaid-svg-RuqvXwHBkK7SDBV9 .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-svg-RuqvXwHBkK7SDBV9 .doneText0,#mermaid-svg-RuqvXwHBkK7SDBV9 .doneText1,#mermaid-svg-RuqvXwHBkK7SDBV9 .doneText2,#mermaid-svg-RuqvXwHBkK7SDBV9 .doneText3{fill:#000 !important}#mermaid-svg-RuqvXwHBkK7SDBV9 .crit0,#mermaid-svg-RuqvXwHBkK7SDBV9 .crit1,#mermaid-svg-RuqvXwHBkK7SDBV9 .crit2,#mermaid-svg-RuqvXwHBkK7SDBV9 .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-svg-RuqvXwHBkK7SDBV9 .activeCrit0,#mermaid-svg-RuqvXwHBkK7SDBV9 .activeCrit1,#mermaid-svg-RuqvXwHBkK7SDBV9 .activeCrit2,#mermaid-svg-RuqvXwHBkK7SDBV9 .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-svg-RuqvXwHBkK7SDBV9 .doneCrit0,#mermaid-svg-RuqvXwHBkK7SDBV9 .doneCrit1,#mermaid-svg-RuqvXwHBkK7SDBV9 .doneCrit2,#mermaid-svg-RuqvXwHBkK7SDBV9 .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-svg-RuqvXwHBkK7SDBV9 .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-svg-RuqvXwHBkK7SDBV9 .milestoneText{font-style:italic}#mermaid-svg-RuqvXwHBkK7SDBV9 .doneCritText0,#mermaid-svg-RuqvXwHBkK7SDBV9 .doneCritText1,#mermaid-svg-RuqvXwHBkK7SDBV9 .doneCritText2,#mermaid-svg-RuqvXwHBkK7SDBV9 .doneCritText3{fill:#000 !important}#mermaid-svg-RuqvXwHBkK7SDBV9 .activeCritText0,#mermaid-svg-RuqvXwHBkK7SDBV9 .activeCritText1,#mermaid-svg-RuqvXwHBkK7SDBV9 .activeCritText2,#mermaid-svg-RuqvXwHBkK7SDBV9 .activeCritText3{fill:#000 !important}#mermaid-svg-RuqvXwHBkK7SDBV9 .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-RuqvXwHBkK7SDBV9 g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-svg-RuqvXwHBkK7SDBV9 g.classGroup text .title{font-weight:bolder}#mermaid-svg-RuqvXwHBkK7SDBV9 g.clickable{cursor:pointer}#mermaid-svg-RuqvXwHBkK7SDBV9 g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-RuqvXwHBkK7SDBV9 g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-RuqvXwHBkK7SDBV9 .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-svg-RuqvXwHBkK7SDBV9 .classLabel .label{fill:#9370db;font-size:10px}#mermaid-svg-RuqvXwHBkK7SDBV9 .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-RuqvXwHBkK7SDBV9 .dashed-line{stroke-dasharray:3}#mermaid-svg-RuqvXwHBkK7SDBV9 #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-RuqvXwHBkK7SDBV9 #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-RuqvXwHBkK7SDBV9 #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-RuqvXwHBkK7SDBV9 #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-RuqvXwHBkK7SDBV9 #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-RuqvXwHBkK7SDBV9 #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-RuqvXwHBkK7SDBV9 #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-RuqvXwHBkK7SDBV9 #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-RuqvXwHBkK7SDBV9 .commit-id,#mermaid-svg-RuqvXwHBkK7SDBV9 .commit-msg,#mermaid-svg-RuqvXwHBkK7SDBV9 .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-RuqvXwHBkK7SDBV9 .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-RuqvXwHBkK7SDBV9 .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-RuqvXwHBkK7SDBV9 g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-RuqvXwHBkK7SDBV9 g.stateGroup text{fill:#9370db;fill:#333;stroke:none;font-size:10px}#mermaid-svg-RuqvXwHBkK7SDBV9 g.statediagram-cluster .cluster-label text{fill:#333}#mermaid-svg-RuqvXwHBkK7SDBV9 g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-svg-RuqvXwHBkK7SDBV9 g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-RuqvXwHBkK7SDBV9 g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-RuqvXwHBkK7SDBV9 .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-RuqvXwHBkK7SDBV9 .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-svg-RuqvXwHBkK7SDBV9 .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px}#mermaid-svg-RuqvXwHBkK7SDBV9 .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-RuqvXwHBkK7SDBV9 .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-svg-RuqvXwHBkK7SDBV9 .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.7}#mermaid-svg-RuqvXwHBkK7SDBV9 .edgeLabel text{fill:#333}#mermaid-svg-RuqvXwHBkK7SDBV9 .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-RuqvXwHBkK7SDBV9 .node circle.state-start{fill:black;stroke:black}#mermaid-svg-RuqvXwHBkK7SDBV9 .node circle.state-end{fill:black;stroke:white;stroke-width:1.5}#mermaid-svg-RuqvXwHBkK7SDBV9 #statediagram-barbEnd{fill:#9370db}#mermaid-svg-RuqvXwHBkK7SDBV9 .statediagram-cluster rect{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-RuqvXwHBkK7SDBV9 .statediagram-cluster rect.outer{rx:5px;ry:5px}#mermaid-svg-RuqvXwHBkK7SDBV9 .statediagram-state .divider{stroke:#9370db}#mermaid-svg-RuqvXwHBkK7SDBV9 .statediagram-state .title-state{rx:5px;ry:5px}#mermaid-svg-RuqvXwHBkK7SDBV9 .statediagram-cluster.statediagram-cluster .inner{fill:white}#mermaid-svg-RuqvXwHBkK7SDBV9 .statediagram-cluster.statediagram-cluster-alt .inner{fill:#e0e0e0}#mermaid-svg-RuqvXwHBkK7SDBV9 .statediagram-cluster .inner{rx:0;ry:0}#mermaid-svg-RuqvXwHBkK7SDBV9 .statediagram-state rect.basic{rx:5px;ry:5px}#mermaid-svg-RuqvXwHBkK7SDBV9 .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#efefef}#mermaid-svg-RuqvXwHBkK7SDBV9 .note-edge{stroke-dasharray:5}#mermaid-svg-RuqvXwHBkK7SDBV9 .statediagram-note rect{fill:#fff5ad;stroke:#aa3;stroke-width:1px;rx:0;ry:0}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}#mermaid-svg-RuqvXwHBkK7SDBV9 .error-icon{fill:#522}#mermaid-svg-RuqvXwHBkK7SDBV9 .error-text{fill:#522;stroke:#522}#mermaid-svg-RuqvXwHBkK7SDBV9 .edge-thickness-normal{stroke-width:2px}#mermaid-svg-RuqvXwHBkK7SDBV9 .edge-thickness-thick{stroke-width:3.5px}#mermaid-svg-RuqvXwHBkK7SDBV9 .edge-pattern-solid{stroke-dasharray:0}#mermaid-svg-RuqvXwHBkK7SDBV9 .edge-pattern-dashed{stroke-dasharray:3}#mermaid-svg-RuqvXwHBkK7SDBV9 .edge-pattern-dotted{stroke-dasharray:2}#mermaid-svg-RuqvXwHBkK7SDBV9 .marker{fill:#333}#mermaid-svg-RuqvXwHBkK7SDBV9 .marker.cross{stroke:#333}:root { --mermaid-font-family: "trebuchet ms", verdana, arial;}#mermaid-svg-RuqvXwHBkK7SDBV9 {color: rgba(0, 0, 0, 0.75);font: ;}
编码
群体设定
适应度函数
选择
交叉
变异
满足终止条件输出
遗传算法具有如下优点:
- 没有太多数学要求
- 高效率搜索
- 易于并行
- 个体间进行信息交换
人工生命:具有生命特征的人造系统。
2. 粒子群优化算法
粒子群优化算法流程如下:
#mermaid-svg-aqNU528NBJ0gKVfE .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-aqNU528NBJ0gKVfE .label text{fill:#333}#mermaid-svg-aqNU528NBJ0gKVfE .node rect,#mermaid-svg-aqNU528NBJ0gKVfE .node circle,#mermaid-svg-aqNU528NBJ0gKVfE .node ellipse,#mermaid-svg-aqNU528NBJ0gKVfE .node polygon,#mermaid-svg-aqNU528NBJ0gKVfE .node path{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-aqNU528NBJ0gKVfE .node .label{text-align:center;fill:#333}#mermaid-svg-aqNU528NBJ0gKVfE .node.clickable{cursor:pointer}#mermaid-svg-aqNU528NBJ0gKVfE .arrowheadPath{fill:#333}#mermaid-svg-aqNU528NBJ0gKVfE .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-svg-aqNU528NBJ0gKVfE .flowchart-link{stroke:#333;fill:none}#mermaid-svg-aqNU528NBJ0gKVfE .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-svg-aqNU528NBJ0gKVfE .edgeLabel rect{opacity:0.9}#mermaid-svg-aqNU528NBJ0gKVfE .edgeLabel span{color:#333}#mermaid-svg-aqNU528NBJ0gKVfE .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-svg-aqNU528NBJ0gKVfE .cluster text{fill:#333}#mermaid-svg-aqNU528NBJ0gKVfE div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-svg-aqNU528NBJ0gKVfE .actor{stroke:#ccf;fill:#ECECFF}#mermaid-svg-aqNU528NBJ0gKVfE text.actor>tspan{fill:#000;stroke:none}#mermaid-svg-aqNU528NBJ0gKVfE .actor-line{stroke:grey}#mermaid-svg-aqNU528NBJ0gKVfE .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333}#mermaid-svg-aqNU528NBJ0gKVfE .messageLine1{stroke-width:1.5;stroke-dasharray:2, 2;stroke:#333}#mermaid-svg-aqNU528NBJ0gKVfE #arrowhead path{fill:#333;stroke:#333}#mermaid-svg-aqNU528NBJ0gKVfE .sequenceNumber{fill:#fff}#mermaid-svg-aqNU528NBJ0gKVfE #sequencenumber{fill:#333}#mermaid-svg-aqNU528NBJ0gKVfE #crosshead path{fill:#333;stroke:#333}#mermaid-svg-aqNU528NBJ0gKVfE .messageText{fill:#333;stroke:#333}#mermaid-svg-aqNU528NBJ0gKVfE .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-svg-aqNU528NBJ0gKVfE .labelText,#mermaid-svg-aqNU528NBJ0gKVfE .labelText>tspan{fill:#000;stroke:none}#mermaid-svg-aqNU528NBJ0gKVfE .loopText,#mermaid-svg-aqNU528NBJ0gKVfE .loopText>tspan{fill:#000;stroke:none}#mermaid-svg-aqNU528NBJ0gKVfE .loopLine{stroke-width:2px;stroke-dasharray:2, 2;stroke:#ccf;fill:#ccf}#mermaid-svg-aqNU528NBJ0gKVfE .note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-aqNU528NBJ0gKVfE .noteText,#mermaid-svg-aqNU528NBJ0gKVfE .noteText>tspan{fill:#000;stroke:none}#mermaid-svg-aqNU528NBJ0gKVfE .activation0{fill:#f4f4f4;stroke:#666}#mermaid-svg-aqNU528NBJ0gKVfE .activation1{fill:#f4f4f4;stroke:#666}#mermaid-svg-aqNU528NBJ0gKVfE .activation2{fill:#f4f4f4;stroke:#666}#mermaid-svg-aqNU528NBJ0gKVfE .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-aqNU528NBJ0gKVfE .section{stroke:none;opacity:0.2}#mermaid-svg-aqNU528NBJ0gKVfE .section0{fill:rgba(102,102,255,0.49)}#mermaid-svg-aqNU528NBJ0gKVfE .section2{fill:#fff400}#mermaid-svg-aqNU528NBJ0gKVfE .section1,#mermaid-svg-aqNU528NBJ0gKVfE .section3{fill:#fff;opacity:0.2}#mermaid-svg-aqNU528NBJ0gKVfE .sectionTitle0{fill:#333}#mermaid-svg-aqNU528NBJ0gKVfE .sectionTitle1{fill:#333}#mermaid-svg-aqNU528NBJ0gKVfE .sectionTitle2{fill:#333}#mermaid-svg-aqNU528NBJ0gKVfE .sectionTitle3{fill:#333}#mermaid-svg-aqNU528NBJ0gKVfE .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-aqNU528NBJ0gKVfE .grid .tick{stroke:#d3d3d3;opacity:0.8;shape-rendering:crispEdges}#mermaid-svg-aqNU528NBJ0gKVfE .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-aqNU528NBJ0gKVfE .grid path{stroke-width:0}#mermaid-svg-aqNU528NBJ0gKVfE .today{fill:none;stroke:red;stroke-width:2px}#mermaid-svg-aqNU528NBJ0gKVfE .task{stroke-width:2}#mermaid-svg-aqNU528NBJ0gKVfE .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-aqNU528NBJ0gKVfE .taskText:not([font-size]){font-size:11px}#mermaid-svg-aqNU528NBJ0gKVfE .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-aqNU528NBJ0gKVfE .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-svg-aqNU528NBJ0gKVfE .task.clickable{cursor:pointer}#mermaid-svg-aqNU528NBJ0gKVfE .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-aqNU528NBJ0gKVfE .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-aqNU528NBJ0gKVfE .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-aqNU528NBJ0gKVfE .taskText0,#mermaid-svg-aqNU528NBJ0gKVfE .taskText1,#mermaid-svg-aqNU528NBJ0gKVfE .taskText2,#mermaid-svg-aqNU528NBJ0gKVfE .taskText3{fill:#fff}#mermaid-svg-aqNU528NBJ0gKVfE .task0,#mermaid-svg-aqNU528NBJ0gKVfE .task1,#mermaid-svg-aqNU528NBJ0gKVfE .task2,#mermaid-svg-aqNU528NBJ0gKVfE .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-svg-aqNU528NBJ0gKVfE .taskTextOutside0,#mermaid-svg-aqNU528NBJ0gKVfE .taskTextOutside2{fill:#000}#mermaid-svg-aqNU528NBJ0gKVfE .taskTextOutside1,#mermaid-svg-aqNU528NBJ0gKVfE .taskTextOutside3{fill:#000}#mermaid-svg-aqNU528NBJ0gKVfE .active0,#mermaid-svg-aqNU528NBJ0gKVfE .active1,#mermaid-svg-aqNU528NBJ0gKVfE .active2,#mermaid-svg-aqNU528NBJ0gKVfE .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-svg-aqNU528NBJ0gKVfE .activeText0,#mermaid-svg-aqNU528NBJ0gKVfE .activeText1,#mermaid-svg-aqNU528NBJ0gKVfE .activeText2,#mermaid-svg-aqNU528NBJ0gKVfE .activeText3{fill:#000 !important}#mermaid-svg-aqNU528NBJ0gKVfE .done0,#mermaid-svg-aqNU528NBJ0gKVfE .done1,#mermaid-svg-aqNU528NBJ0gKVfE .done2,#mermaid-svg-aqNU528NBJ0gKVfE .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-svg-aqNU528NBJ0gKVfE .doneText0,#mermaid-svg-aqNU528NBJ0gKVfE .doneText1,#mermaid-svg-aqNU528NBJ0gKVfE .doneText2,#mermaid-svg-aqNU528NBJ0gKVfE .doneText3{fill:#000 !important}#mermaid-svg-aqNU528NBJ0gKVfE .crit0,#mermaid-svg-aqNU528NBJ0gKVfE .crit1,#mermaid-svg-aqNU528NBJ0gKVfE .crit2,#mermaid-svg-aqNU528NBJ0gKVfE .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-svg-aqNU528NBJ0gKVfE .activeCrit0,#mermaid-svg-aqNU528NBJ0gKVfE .activeCrit1,#mermaid-svg-aqNU528NBJ0gKVfE .activeCrit2,#mermaid-svg-aqNU528NBJ0gKVfE .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-svg-aqNU528NBJ0gKVfE .doneCrit0,#mermaid-svg-aqNU528NBJ0gKVfE .doneCrit1,#mermaid-svg-aqNU528NBJ0gKVfE .doneCrit2,#mermaid-svg-aqNU528NBJ0gKVfE .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-svg-aqNU528NBJ0gKVfE .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-svg-aqNU528NBJ0gKVfE .milestoneText{font-style:italic}#mermaid-svg-aqNU528NBJ0gKVfE .doneCritText0,#mermaid-svg-aqNU528NBJ0gKVfE .doneCritText1,#mermaid-svg-aqNU528NBJ0gKVfE .doneCritText2,#mermaid-svg-aqNU528NBJ0gKVfE .doneCritText3{fill:#000 !important}#mermaid-svg-aqNU528NBJ0gKVfE .activeCritText0,#mermaid-svg-aqNU528NBJ0gKVfE .activeCritText1,#mermaid-svg-aqNU528NBJ0gKVfE .activeCritText2,#mermaid-svg-aqNU528NBJ0gKVfE .activeCritText3{fill:#000 !important}#mermaid-svg-aqNU528NBJ0gKVfE .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-aqNU528NBJ0gKVfE g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-svg-aqNU528NBJ0gKVfE g.classGroup text .title{font-weight:bolder}#mermaid-svg-aqNU528NBJ0gKVfE g.clickable{cursor:pointer}#mermaid-svg-aqNU528NBJ0gKVfE g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-aqNU528NBJ0gKVfE g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-aqNU528NBJ0gKVfE .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-svg-aqNU528NBJ0gKVfE .classLabel .label{fill:#9370db;font-size:10px}#mermaid-svg-aqNU528NBJ0gKVfE .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-aqNU528NBJ0gKVfE .dashed-line{stroke-dasharray:3}#mermaid-svg-aqNU528NBJ0gKVfE #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-aqNU528NBJ0gKVfE #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-aqNU528NBJ0gKVfE #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-aqNU528NBJ0gKVfE #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-aqNU528NBJ0gKVfE #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-aqNU528NBJ0gKVfE #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-aqNU528NBJ0gKVfE #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-aqNU528NBJ0gKVfE #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-aqNU528NBJ0gKVfE .commit-id,#mermaid-svg-aqNU528NBJ0gKVfE .commit-msg,#mermaid-svg-aqNU528NBJ0gKVfE .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-aqNU528NBJ0gKVfE .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-aqNU528NBJ0gKVfE .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-aqNU528NBJ0gKVfE g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-aqNU528NBJ0gKVfE g.stateGroup text{fill:#9370db;fill:#333;stroke:none;font-size:10px}#mermaid-svg-aqNU528NBJ0gKVfE g.statediagram-cluster .cluster-label text{fill:#333}#mermaid-svg-aqNU528NBJ0gKVfE g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-svg-aqNU528NBJ0gKVfE g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-aqNU528NBJ0gKVfE g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-aqNU528NBJ0gKVfE .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-aqNU528NBJ0gKVfE .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-svg-aqNU528NBJ0gKVfE .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px}#mermaid-svg-aqNU528NBJ0gKVfE .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-aqNU528NBJ0gKVfE .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-svg-aqNU528NBJ0gKVfE .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.7}#mermaid-svg-aqNU528NBJ0gKVfE .edgeLabel text{fill:#333}#mermaid-svg-aqNU528NBJ0gKVfE .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-aqNU528NBJ0gKVfE .node circle.state-start{fill:black;stroke:black}#mermaid-svg-aqNU528NBJ0gKVfE .node circle.state-end{fill:black;stroke:white;stroke-width:1.5}#mermaid-svg-aqNU528NBJ0gKVfE #statediagram-barbEnd{fill:#9370db}#mermaid-svg-aqNU528NBJ0gKVfE .statediagram-cluster rect{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-aqNU528NBJ0gKVfE .statediagram-cluster rect.outer{rx:5px;ry:5px}#mermaid-svg-aqNU528NBJ0gKVfE .statediagram-state .divider{stroke:#9370db}#mermaid-svg-aqNU528NBJ0gKVfE .statediagram-state .title-state{rx:5px;ry:5px}#mermaid-svg-aqNU528NBJ0gKVfE .statediagram-cluster.statediagram-cluster .inner{fill:white}#mermaid-svg-aqNU528NBJ0gKVfE .statediagram-cluster.statediagram-cluster-alt .inner{fill:#e0e0e0}#mermaid-svg-aqNU528NBJ0gKVfE .statediagram-cluster .inner{rx:0;ry:0}#mermaid-svg-aqNU528NBJ0gKVfE .statediagram-state rect.basic{rx:5px;ry:5px}#mermaid-svg-aqNU528NBJ0gKVfE .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#efefef}#mermaid-svg-aqNU528NBJ0gKVfE .note-edge{stroke-dasharray:5}#mermaid-svg-aqNU528NBJ0gKVfE .statediagram-note rect{fill:#fff5ad;stroke:#aa3;stroke-width:1px;rx:0;ry:0}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}#mermaid-svg-aqNU528NBJ0gKVfE .error-icon{fill:#522}#mermaid-svg-aqNU528NBJ0gKVfE .error-text{fill:#522;stroke:#522}#mermaid-svg-aqNU528NBJ0gKVfE .edge-thickness-normal{stroke-width:2px}#mermaid-svg-aqNU528NBJ0gKVfE .edge-thickness-thick{stroke-width:3.5px}#mermaid-svg-aqNU528NBJ0gKVfE .edge-pattern-solid{stroke-dasharray:0}#mermaid-svg-aqNU528NBJ0gKVfE .edge-pattern-dashed{stroke-dasharray:3}#mermaid-svg-aqNU528NBJ0gKVfE .edge-pattern-dotted{stroke-dasharray:2}#mermaid-svg-aqNU528NBJ0gKVfE .marker{fill:#333}#mermaid-svg-aqNU528NBJ0gKVfE .marker.cross{stroke:#333}:root { --mermaid-font-family: "trebuchet ms", verdana, arial;}#mermaid-svg-aqNU528NBJ0gKVfE {color: rgba(0, 0, 0, 0.75);font: ;}
初始化粒子群设置参数
计算粒子适应度
个体最优群体最优
状态更新
是否满足条件
输出
3. 蚁群算法
蚁群算法在解决离散组合优化方面具有良好性能。在学习之前,需要掌握如下概念:
- 信息素跟踪:按照一定概率沿着信息素较强的路径觅食
- 信息素遗留:在走过的路上释放信息素。
- 信息素启发因子α:反映蚁群在路径搜索中随机性因素作用强度。α过大可能陷入局部最优。
- 期望值启发式因子β:反映先验性、确定性因素作用强度。搜索速度加快,过大陷入局部最优
根据蚁群信息素浓度的更新规则,可分为三种不同的模型:
- 蚂蚁圈系统:利用全局信息,蚂蚁完成一个循环后,更新所有路径上信息。效果最好
- 蚂蚁数量系统:利用局部信息,蚂蚁每走一步都更新
- 蚂蚁密度系统:同上
4. 问题解析
- 问题1
![](/assets/blank.gif)
错,当适应度函数选择不当时,遗传算法确实可能陷入局部最优值,但遗传算法个体之间可以共享信息,不容易陷入局部最优值。相应的,如果粒子群间没有共享信息,就容易陷入局部最优解。
计算结构收敛到最优解或者算法达到了规定的迭代次数。
对于问题的解决没有现成算法或现成算法复杂度太高时,使用进化算法。
人工智能导论——智能计算(进化算法+群智能优化)相关推荐
- 多智能体进化算法求解带时间窗的VRP问题(python)
作者:Logintern09 发布时间:2022年8月19日12时 出处:CSDN博客 专栏:<智能优化算法> 前言:研究学习文献<带时间窗VRP问题的多智能体进化算法>,掌握 ...
- 基于python编码实现多智能体进化算法求解带硬时间窗约束的VRP问题(适配版)
作者:Logintern09 发布时间:2022年10月23日16时 出处:CSDN博客 专栏:<智能优化算法> 书接上回:多智能体进化算法求解带硬时间窗约束的VRP问题(附完整pytho ...
- 数据 + 进化算法 = 数据驱动的进化优化?进化算法 PK 数学优化
数据 + 进化算法 = 数据驱动的进化优化?进化算法 PK 数学优化 https://baijiahao.baidu.com/s?id=1600164518587031730&wfr=spid ...
- 模糊数学 计算机智能,《常用算法之智能计算 (五) 》:模糊计算
原标题:<常用算法之智能计算 (五) >:模糊计算 人们常用"模糊计算"(FuzzyComputing)笼统地代表诸如模糊系统.模糊语言.模糊推理.模糊逻辑.模糊控制. ...
- 华为智能计算发布FusionServer Pro智能服务器
[中国,北京,2019年4月3日]华为智能计算业务部在北京召开了主题为"+智能,计算进化"的发布会,正式发布FusionServer Pro智能服务器.将从"智能加速.智 ...
- (AI)人工智能导论实验【A* 算法】
人工智能导论实验 文章目录 人工智能导论实验 A-star algorithm A-star algorithm 传送:看懂A*的网站 源码 """ 实验内容:假设在一个 ...
- 进化算法——多目标优化
所有的实际优化问题都是多目标的,如果不是显式的至少也是隐式的.接下来讨论多目标优化问题(MOP)如何修改进化算法.实际的优化问题包含多个目标,那些目标常常互相冲突.例如: 在购买汽车时,我们可能想要车 ...
- 进化算法EA——多对象优化遗传(MOO),差分进化法(DE),遗传编程(GP)
目录 单对象优化(SOO)vs多对象优化(MOO) 多对象优化(MOO) NSGA-II 差分进化法(DE) 遗传编程(GP) EA problem 单对象优化(SOO)vs多对象优化(MOO) 1. ...
- 进化计算/进化算法×传统数学优化方法×机器学习
进化算法VS传统数学优化方法 进化算法是基于种群的搜索 进化算法是随机的搜索算法,不需要梯度,不需要解析的目标函数 进化算法优势 适用于没有解析目标函数和无法得到目标函数梯度信息的优化问题 基于种群, ...
- 差分进化算法原理及优化应用
目录 一.差分进化(differential evolution)算法的起源 二.差分进化算法的原理 (一)初始化参数
最新文章
- python实现卡方(Chi-Squared Test)相关性检验
- iOS开发资源(持续更新)
- java servlet filter_Java Servlet Filter
- UML中类之间的几种关系
- android 工程中引入第三方JAR包后安装APK时老是提示找不到库文件?
- 小米手环五怎么和微信连接不上服务器,小米手环怎么连接手机微信
- python关于七巧板的代码_Css打造一个简单的静态七巧板
- python语言程序设计王恺答案在哪找_Python语言程序设计
- mac安装了多版本php 卸载,mac 安装多版本PHP
- 联轴器选型_联轴器| 软件工程
- git 常用commands(转)
- 血泪教训!拖垮公司的技术团队常用的 7 个操作
- html5圆形头像滚动效果,基于jQuery实现响应式圆形图片轮播特效
- MySQL 百万级数据,怎么做分页查询?
- eclipse 大小写快捷键_idea中的一些常用快捷键
- 不干胶标贴打印模板下载_使用Word制作不干胶标签的方法
- 什么是用户故事 (User Story)?
- linux recv函数 参数,linux send recv函数详解
- sam格式的结构和意义_SAM文件是什么
- Java 学生名单排序 comparable接口
热门文章
- 【二分答案】SDUT-4072 小绿的脱单梦
- 疯狂填词 mad_libs 第9章9.9.2
- 公链、私链、联盟链优缺点
- 《私募股权基金投资基础知识》---第四章
- linux系统触摸板双击,在Ubuntu 18.04系统中搞定触摸板多点触控
- 关于boa+cgi上传文件大小的问题
- 模拟信号的采样定理MATLAB实现
- 计算机如何安装无线网络适配器,小编教你电脑无线网卡驱动怎么安装
- 职场感悟.Video.人生各自精彩,谁说人生是一场马拉松的?
- python不解压直接提取文件_不解压直接读取压缩包中的文件