{"id":9312,"date":"2024-05-15T00:18:15","date_gmt":"2024-05-14T16:18:15","guid":{"rendered":"\/?p=9312"},"modified":"2024-05-15T00:18:15","modified_gmt":"2024-05-14T16:18:15","slug":"%e9%81%97%e4%bc%a0%e7%ae%97%e6%b3%95%e4%b9%8bnsga-%e2%85%a1%e5%8e%9f%e7%90%86%e5%88%86%e6%9e%90%e5%92%8c%e4%bb%a3%e7%a0%81%e8%a7%a3%e8%af%bb","status":"publish","type":"post","link":"\/?p=9312","title":{"rendered":"\u9057\u4f20\u7b97\u6cd5\u4e4bNSGA-\u2161\u539f\u7406\u5206\u6790\u548c\u4ee3\u7801\u89e3\u8bfb"},"content":{"rendered":"<p><strong>Greedy-NAS<\/strong>\u7528\u5230\u4e86\u8fd9\u4e2a\u7b97\u6cd5\uff0c\u770b\u4e862\u5929\u624d\u6574\u660e\u767d\uff0c\u6240\u4ee5\u6765\u603b\u7ed3\u4e00\u4e0b\uff1a<\/p>\n<p>\u4ee5\u4e0b\u4e3a<strong>\u6e90\u7801<\/strong>\u7684\u94fe\u63a5\uff0c\u4e0b\u8f7d\u9700\u8981<strong>\u8f6f\u59b9\u5e01<\/strong>\u54e6\uff1a<\/p>\n<p><a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/download.csdn.net\/download\/joekepler\/10590751\">MTALAB NSGA2\u7b97\u6cd5_https:\/\/download.csdn.net\/download\/joekepler\/10590751-\u5176\u5b83\u4ee3\u7801\u7c7b\u8d44\u6e90-CSDN\u4e0b\u8f7ddownload.csdn.net\/download\/joekepler\/10590751<\/a><\/p>\n<h2>\u4e00.\u539f\u7406\u8bb2\u89e3\uff1a<\/h2>\n<p><strong>Pareto\u652f\u914d\uff08Pareto Dominate\uff09<\/strong><br \/>\nPareto\u652f\u914d\u5728MOP\u95ee\u9898\u4e2d\u652f\u914d\u662f\u4e00\u4e2a\u91cd\u8981\u7684\u6982\u5ff5\uff0c\u4ee5\u4e0b\u7b80\u79f0\u4e3a\u652f\u914d\u3002<br \/>\n\u652f\u914d\u7684\u63cf\u8ff0\u4e3a\uff1a\u6709\u4e24\u4e2a\u89e3x1\u548cx2\uff0cx1\u652f\u914dx2\u7684\u5145\u8981\u6761\u4ef6\u662f\u5bf9\u4e8e\u4efb\u610f\u7684i(i=1,2, 3...m)\uff0c\u5747\u6709fi(x1)&lt;=fi(x2)\uff0c\u4e14\u5bf9\u4e8e\u4efb\u610f\u7684i(i=1, 2, 3...m)\uff0c\u5b58\u5728fi(x1)&lt;fi(x2)\u3002\u8bb0\u4e3ax1\u227ax2\u3002\uff08\u548c\u79bb\u6563\u6570\u5b66\u91cc\u7684\u504f\u5e8f\u5173\u7cfb\u76f8\u4f3c\uff09<br \/>\n\u8fd9\u4e2a\u6982\u5ff5\u770b\u8d77\u6765\u4e0d\u597d\u61c2\uff1f\u5176\u5b9e\u5c31\u7c7b\u4f3c\u4e8e\u5c0f\u4e8e\u5173\u7cfb\uff0c\u6211\u7684\u8bb0\u6cd5\u5f88\u7b80\u5355\uff1a<strong>\u5168\u90e8\u5c0f\u4e8e\u7b49\u4e8e\uff0c\u81f3\u5c111\u4e2a\u5c0f\u4e8e<\/strong>\u3002<\/p>\n<p><strong>Pareto\u6700\u4f18\u89e3\uff08Pareto Optimal Solution\uff09<\/strong><br \/>\n\u67d0\u4e2a\u89e3x'\u662f\u6700\u4f18\u89e3\uff0c\u5f53\u4e14\u4ec5\u5f53x'\u4e0d\u88ab\u4efb\u4f55\u5176\u4ed6\u89e3\u652f\u914d\u3002<br \/>\n\u5927\u5bb6\u662f\u5426\u53d1\u73b0\uff0c<strong>x'\u53ea\u662f\u4e0d\u88ab\u5176\u4ed6\u89e3\u652f\u914d\uff0c\u800c\u4e0d\u662f\u652f\u914d\u4e86\u5176\u4ed6\u6240\u6709\u89e3<\/strong>\uff0c\u5c31\u80fd\u79f0\u4e3a\u6700\u4f18\u89e3\u4e86\u3002\u524d\u9762\u8bf4\u8fc7\uff0cMOP\u95ee\u9898\u5f80\u5f80\u6c42\u51fa\u5f88\u591a\u4e2a\u89e3\uff0c\u8fd9\u4e9b\u89e3\u7684\u4f18\u52a3\u5173\u7cfb\u662f\u65e0\u6cd5\u786e\u5b9a\u7684\u3002<br \/>\n\u53ea\u8981\u67d0\u4e2a\u89e3\u4e0d\u88ab\u5176\u4ed6\u89e3\u652f\u914d\uff0c\u5c31\u8bf4\u660e\u8fd9\u4e2a\u89e3\u4e0d\u6bd4\u5176\u4ed6\u89e3\u5dee\uff0c\u5c31\u80fd\u79f0\u5176\u4e3a\u6700\u4f18\u89e3\u4e86\u3002<\/p>\n<p><strong>Pareto\u96c6\uff08Pareto Set\uff09<\/strong><br \/>\n\u5982\u679c\u4e00\u7ec4\u89e3\u96c6\uff08\u4e5f\u5c31\u662f\u591a\u4e2ax\uff09\u4e2d\u7684\u4efb\u610f\u4e24\u4e2a\u89e3\u90fd\u4e0d\u80fd\u652f\u914d\u5bf9\u65b9\uff0c\u90a3\u4e48\u8fd9\u4e2a\u96c6\u5408\u79f0\u4e3aPareto\u96c6\uff0c\u7b80\u79f0PS\u3002<\/p>\n<p><strong>Pareto\u524d\u6cbf\uff08Pareto Front\uff09<\/strong><br \/>\nPS\u4e2d\uff0c\u6bcf\u4e2a\u89e3\u5bf9\u5e94\u7684\u76ee\u6807\u51fd\u6570\u503c\u7ec4\u6210\u7684\u96c6\u5408\u79f0\u4e3apareto\u524d\u6cbf\uff0c\u7b80\u79f0PF\u3002<\/p>\n<p><strong>\u8fdb\u5316\u7b97\u6cd5<\/strong>\u662f\u5982\u4f55\u89e3\u51b3MOP\u95ee\u9898\u7684\u5462\uff1f<\/p>\n<p>\u4e3b\u8981\u662f3\u4e2a\u5e94\u7528\uff1a\u53d8\u5f02\u3001\u4ea4\u53c9\u3001\u591a\u6837\u6027\u3002<\/p>\n<ol>\n<li><strong>\u53d8\u5f02<\/strong><br \/>\n\u6211\u5c31\u76f4\u63a5\u89e3\u91ca\u4e86\uff1a\u53d6\u67d0\u4e00\u4e2a\u89e3x0\uff0c\u8ba9x0\u968f\u673a\u5730\u53d8\u5316\uff0c\u6bd4\u5982\u589e\u52a00.1\u5f97x1\uff0c\u51cf\u5c110.1\u5f97x2\u4e4b\u7c7b\uff0c\u770b\u770b\u53d8\u5316\u4e4b\u540e\u548c\u539f\u6765\u6709\u4ec0\u4e48\u4e0d\u540c\u3002<br \/>\n\u8981\u662f\u53d8\u5316\u4e4b\u540e\uff0c\u53d1\u73b0\u4e86\u66f4\u5de6\u4e0b\u7684\u70b9\uff1f\u662f\u4e0d\u662f\u5c31\u8bf4\u660e\u53d1\u73b0\u4e86\u66f4\u4f18\u7684\u89e3\uff1f\u8fd9\u65f6\u6211\u4eec\u53ef\u4ee5\u4fdd\u7559\u5de6\u4e0b\u7684\u70b9\u3001\u6dd8\u6c70\u53f3\u4e0a\u7684\u70b9\u3002\u8fd9\u662f\u4e0d\u662f\u548c\u751f\u7269\u7684\u53d8\u5f02\u3001\u4f18\u80dc\u52a3\u6c70\u975e\u5e38\u76f8\u4f3c\uff1f<br \/>\n\u9700\u8981\u6ce8\u610f\u7684\u662f\uff1a\u53d8\u5f02\u4e0d\u662f\u4e00\u5b9a\u80fd\u591f\u4ea7\u751f\u66f4\u5de6\u4e0b\u7684\u70b9\u7684\uff0c\u4f46\u662f\u53ea\u8981\u51fa\u73b0\u4e86\uff0c\u6211\u4eec\u5c31\u80fd\u628a\u5b83\u4fdd\u7559\u4e0b\u6765\uff01<\/li>\n<\/ol>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-e36d9158f6d13ac9571bb9e7c814c3a0_1440w.webp\" alt=\"img\" \/><\/p>\n<p>\u5982\u56fe\uff0cp\u70b9\u53ef\u4ee5\u53d8\u5f02\u5f62\u6210\u53e6\u5916\u56db\u4e2a\u70b9\uff0c\u6211\u4eec\u53ef\u4ee5\u4fdd\u7559\u66f4\u5de6\u4e0b\u7684\u70b9\u3002<\/p>\n<ol>\n<li><strong>\u4ea4\u53c9<\/strong><br \/>\n\u53eb\u505a\u4ea4\u914d\u66f4\u597d\u7406\u89e3\u3002\u76f4\u63a5\u4e0a\u89e3\u91ca\uff1a\u5047\u5982\u6709\u4e24\u4e2a\u89e3x1\u548cx2\uff0c\u5206\u522b\u5bf9\u5e94\u5de6\u4e0a\u7684p1\u548c\u53f3\u4e0b\u7684p2\uff0c\u90a3\u4e48\u6211\u4eec\u53ef\u4ee5\u60f3\u529e\u6cd5\u878d\u5408x1\u548cx2\u7684\u4f18\u826f\u6027\u72b6\uff0c\u8fd9\u5c31\u662f\u4ea4\u53c9\u3002<br \/>\n\u6bd4\u5982\uff0c\u6211\u4eec\u53ef\u4ee5\u53d6x3=(x1+x2)\/2\uff0c\u770b\u770bx3\u76f8\u5bf9\u4e8ex1\u548cx2\u7684\u4f4d\u7f6e\uff0c\u8981\u662fx3\u662f\u66f4\u4f18\u7684\u89e3\uff0c\u540c\u6837\u53ef\u4ee5\u4fdd\u7559x3\u3002<br \/>\n\u548c\u53d8\u5f02\u76f8\u540c\uff0c\u4ea4\u53c9\u4e5f\u4e0d\u662f\u4e00\u5b9a\u80fd\u4ea7\u751f\u66f4\u5de6\u4e0b\u7684\u70b9\u7684\u3002<\/li>\n<li><strong>\u591a\u6837\u6027<\/strong><br \/>\n\u591a\u6837\u6027\u8fd9\u4e2a\u6982\u5ff5\u4e0d\u662f\u5f88\u597d\u7406\u89e3\uff0c\u8fd9\u91cc\u518d\u6b21\u796d\u51fa\u771f\u5b9e\u7684\u6c42\u89e3\u7ed3\u679c\u3002<\/li>\n<\/ol>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-6885311399ce495e166c5817d1b3e93b_1440w.webp\" alt=\"img\" \/><\/p>\n<p>\u5ffd\u7565\u6700\u5de6\u8fb9\u7684\u70b9\uff0c\u53ef\u4ee5\u53d1\u73b0\u6709\u4e09\u6761\u7ebf\u3002<br \/>\n\u6240\u8c13\u591a\u6837\u6027\u5c31\u662f\uff1a\u4fdd\u6301 \u627e\u5230\u5c3d\u53ef\u80fd\u591a\u7684\u89e3\u7684 \u53ef\u80fd\u6027\u3002\u4ece\u4e0a\u5f80\u4e0b\uff0c\u5206\u522b\u4e3a\u79cd\u7fa41\uff0c2\uff0c3\u3002<br \/>\n\u5728\u53d8\u5f02\u548c\u4ea4\u53c9\u91cc\u6211\u4eec\u63d0\u5230\u4e86\u6dd8\u6c70\u548c\u4fdd\u7559\u3002\u8981\u662f\u7a0d\u5fae\u5f80\u53f3\u6216\u8005\u5f80\u4e0a\u7684\u70b9\u90fd\u88ab\u6dd8\u6c70\u4e86\uff0c\u7559\u4e0b\u7684\u5168\u662f\u5f80\u5de6\u4e0b\u7684\u70b9\uff0c\u5c31\u53ef\u80fd\u5bfc\u81f4\u6700\u540e\u53ea\u53d1\u5c55\u6210\u4e86\u79cd\u7fa42\uff0c\u79cd\u7fa41\u548c3\u90fd\u6ca1\u6709\u51fa\u73b0\uff01\u56e0\u4e3a\u6709\u53ef\u80fd\u53d1\u5c55\u51fa\u79cd\u7fa41\u548c3\u7684\u4e2a\u4f53\u56e0\u4e3a<strong>\u8fc7\u4e8e\u4e25\u683c<\/strong>\u7684\u9009\u62e9\u65b9\u6cd5\uff0c\u65e9\u65e9\u5c31\u88ab\u6dd8\u6c70\u6389\u4e86\uff0c\u6839\u672c\u6ca1\u6709\u53d1\u5c55\u7684\u673a\u4f1a\u3002<br \/>\n\u53ef\u89c1\uff0c\u5982\u4f55\u6dd8\u6c70\u548c\u4fdd\u7559\u4e5f\u662f\u6709\u6280\u5de7\u7684\u3002<\/p>\n<ol>\n<li><strong>\u603b\u80fd\u627e\u5230\u6700\u4f18\u89e3<\/strong><br \/>\n\u8fdb\u5316\u7b97\u6cd5\u7684\u601d\u60f3\u867d\u7136\u6709\u70b9\u975e\u4e3b\u6d41\uff0c\u4f46\u662f<strong>\u7ed9\u5b83\u8db3\u591f\u7684\u65f6\u95f4\uff0c\u5b83\u603b\u662f\u80fd\u8ba9\u4f60\u5f97\u5230\u6ee1\u610f\u7684\u7ed3\u679c<\/strong>\uff01<br \/>\n\u8fdb\u5316\u7b97\u6cd5\u7684\u6b65\u9aa4\u5c31\u662f\uff1a<br \/>\n<strong>\u4efb\u610f<\/strong>\u521d\u59cb\u5316\u4e00\u4e2a\u79cd\u7fa4\uff0c\u4e00\u4e2a\u79cd\u7fa4\u5c31\u662f\u5f88\u591a\u4e2a\u4e2a\u4f53\u7684\u96c6\u5408\uff0c1\u4e2a\u4e2a\u4f53\u5c31\u662f1\u4e2a\u89e3\uff08\u4e00\u5f00\u59cb\u6211\u8fd8\u4e0d\u7406\u89e3\u771f\u7684\u662f\u4efb\u610f\u5417\uff1f\u540e\u6765\u53bb\u770b\u4e86\u7b97\u6cd5\u7684\u6e90\u4ee3\u7801\u53d1\u73b0\u8fd8\u771f\u662f\u7528\u7684\u4efb\u610f\u6570\uff01\u53ef\u80fd\u4e5f\u4fdd\u8bc1\u4e86\u79cd\u7fa4\u7684\u591a\u6837\u6027\uff09\u3002<br \/>\n\u8ba9\u8fd9\u4e9b\u4e2a\u4f53\u53d8\u5f02\u3001\u4ea4\u53c9\uff08\u968f\u673a\u5730\u53d8\u5316\u3001\u76f8\u4e92\u7ed3\u5408\u4ea7\u751f\u65b0\u7684\u89e3\uff09\uff0c\u7136\u540e\u770b\u4fdd\u7559\u4f18\u826f\u7684\u4e2a\u4f53\uff08\u5f80\u5de6\u4e0b\u7684\u70b9\uff09\uff0c\u540c\u65f6\u8981\u4fdd\u6301\u79cd\u7fa4\u591a\u6837\u6027\uff0c\u4ee5\u4fdd\u7559\u53d1\u5c55\u51fa\u65b0\u79cd\u7fa4\u7684\u53ef\u80fd\u6027\uff08\u8ba9\u53f3\u4e0b\u548c\u5de6\u4e0a\u7684\u70b9\u4e5f\u6709\u51e0\u7387\u7559\u4e0b\u6765\uff09\u3002<br \/>\n\u7ecf\u8fc7\u82e5\u5e72\u4ee3\uff0c\u79cd\u7fa4\u5c31\u4f1a\u8d8b\u4e8e\u7a33\u5b9a\uff08\u89e3\u5df2\u7ecf\u5f88\u63a5\u8fd1\u771f\u5b9e\u7684\u6700\u4f18\u89e3\u4e86\uff09\u3002\u8fdb\u5316\u5230\u4e00\u5b9a\u6b21\u6570\u5c31\u505c\u6b62\u7b97\u6cd5\u3002<\/li>\n<\/ol>\n<h2>NSGA-\u2161\u7b97\u6cd5<\/h2>\n<p>\u65e2\u7136\u6709\u2161\u81ea\u7136\u662f\u6709\u2160\u7684\uff0c\u8fd9\u91cc\u4e0d\u8bf4\u2160\uff0c\u53ea\u8bf4\u2161\u3002\u4e3a\u4ec0\u4e48\u4e0d\u8bf4\u2160\uff0c\u5f88\u7b80\u5355\uff0c\u56e0\u4e3a\u6211\u4e0d\u4f1a\u3002<\/p>\n<p>MSGA-\u2161\u7684\u601d\u60f3\u4e5f\u662f\u8fdb\u5316\u7b97\u6cd5\u7684\u601d\u60f3\u3002\u4f60\u5982\u679c\u61c2\u4e86\u8fdb\u5316\u7b97\u6cd5\u7684\u601d\u60f3\uff0c\u4e5f\u4f1a\u5f88\u5bb9\u6613\u61c2NSGA-\u2161\u3002<\/p>\n<p>NSGA-\u2161\u4e2d\u8fd8\u5305\u542b\u4e86\u4e00\u4e2a\u9009\u62e9\u4e2a\u4f53\u7684\u65b9\u6cd5\uff1a\u62e5\u6324\u5ea6\u6bd4\u8f83<\/p>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-b21f6709d52fa069cf2fd8f9f43b7e14_1440w.webp\" alt=\"img\" \/><\/p>\n<p>i\u7684\u62e5\u6324\u5ea6\u548ci-1\u70b9\u548ci+1\u70b9\u7684\u4f4d\u7f6e\u6709\u5173\uff0c\u4e0a\u56fei\u70b9\u7684\u62e5\u6324\u5ea6\u5c31\u662f\u65b9\u5f62\u7684\u5468\u957f\uff08\u4e5f\u5c31\u662f\u865a\u7ebf\u7684\u603b\u957f\u5ea6\uff09\u3002\u6700\u5de6\u8fb9\u548c\u6700\u53f3\u8fb9\u7684\u70b9\u7684\u62e5\u6324\u5ea6\u8bbe\u7f6e\u4e3a\u65e0\u9650\u5927\u3002<\/p>\n<p>\u6211\u4eec\u559c\u6b22\u62e5\u6324\u5ea6\u5927\u7684\u70b9\uff08<strong>\u62e5\u6324\u5ea6\u5927\u5b9e\u9645\u4e0a\u662f\u548c\u5468\u56f4\u7684\u70b9\u76f8\u9694\u8fdc<\/strong>\uff09\uff0c\u56e0\u4e3a\u5b83\u4eec\u66f4\u80fd\u4fdd\u6301\u79cd\u7fa4\u591a\u6837\u6027\uff0c\u66f4\u5bb9\u6613\u53d1\u5c55\u51fa\u65b0\u79cd\u7fa4\u3002<\/p>\n<p>\u524d\u9762\u8bf4\u4e86\uff0c\u5de6\u4e0a\u548c\u53f3\u4e0b\u7684\u70b9\u662f\u65e0\u6cd5\u6bd4\u8f83\u7684\uff0c\u4f46\u662f\u62e5\u6324\u5ea6\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6bd4\u8f83\u7684\u601d\u8def\u3002<\/p>\n<p>\u4e0b\u9762\u4e3e\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\u6f14\u793aNSGA-\u2161\u7b97\u6cd5\u7684\u6d41\u7a0b\u3002\u8bbe\u79cd\u7fa4\u5927\u5c0f\u4e3a5\uff0c\u76ee\u6807\u51fd\u65702\u4e2a\uff0cf1\u548cf2\u6211\u60f3\u4e0d\u5230\u5408\u9002\u7684\uff0c\u5c31\u4e0d\u7ba1\u4e86\u3002<\/p>\n<ol>\n<li><strong>\u521d\u59cb\u5316<\/strong><br \/>\n\u521d\u59cb\u53165\u4e2a\u4e2a\u4f53\u4e3a\u521d\u4ee3\u3002<\/li>\n<\/ol>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-dcd1506d0cd84e50d809a144188c33d7_1440w.webp\" alt=\"img\" \/><\/p>\n<ol>\n<li><strong>\u4ea4\u53c9\u3001\u53d8\u5f02<\/strong><br \/>\n\u539f\u5148\u76845\u4e2a\u4e2a\u4f53\u53d8\u5f02\uff0c\u518d\u4efb\u9009\u4e24\u4e2a\u8fdb\u884c\u4ea4\u53c9\uff0c\u4ea4\u53c9\u53c8\u4ea7\u751f5\u4e2a\u4e2a\u4f53\uff0c\u73b0\u5728\u603b\u5171\u670910\u4e2a\u4e2a\u4f53\u4e86\u3002<\/li>\n<li><strong>\u975e\u652f\u914d\u6392\u5e8f<\/strong><br \/>\n\u628a\u79cd\u7fa4\u5206\u6210\u51e0\u4e2aPS\u5e76\u8d4b\u4e88\u7b49\u7ea7\uff0c\u8d8a\u5f80\u5de6\u4e0b\u7684PS\u7b49\u7ea7\u8d8a\u9ad8\uff08\u56e0\u4e3a\u8d8a\u4f18\uff09\u3002rank\u8d8a\u5c0f\uff0c\u7b49\u7ea7\u8d8a\u9ad8\u3002<\/li>\n<\/ol>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-247d78efb6358c508d826177143e7760_1440w.webp\" alt=\"img\" \/><\/p>\n<ol>\n<li><strong>\u9009\u62e9<\/strong><br \/>\n\u6211\u4eec\u81ea\u7136\u662f\u9009\u62e9rank\u9ad8\u7684\u4e2a\u4f53\u4e86\uff0crank=1\u548crank=2\u7684\u4e2a\u4f53\uff0c\u603b\u51713\u4e2a\u88ab\u4fdd\u7559\u3002<br \/>\n\u6211\u4eec\u8981\u518d\u6b21\u51d1\u62105\u4e2a\u4e2a\u4f53\u7684\u79cd\u7fa4\u3002\u6211\u4eec\u5c31\u5728rank=3\u7684\u4e2a\u4f53\u4e2d\u9009\uff0c\u4f46\u662f\u4e5f\u4e0d\u80fd\u5168\u8981\uff0c\u56e0\u4e3a\u4f1a\u8d85\u8fc75\u4e2a\uff01<br \/>\n\u90a3\u548b\u529e\u561b\uff1f\u8fd9\u5c31\u7528\u5230\u62e5\u6324\u5ea6\u4e86\uff0c\u9009\u62e9\u62e5\u6324\u5ea6\u5927\u7684\uff0c\u90a3\u4e48\u5c31\u662f\u6700\u5de6\u8fb9\u548c\u6700\u53f3\u8fb9\u7684\u4e24\u4e2a\uff0c\u56e0\u4e3a\u6211\u4eec\u5b9a\u4e49\u4e86\u8fd9\u4e24\u4e2a\u7684\u62e5\u6324\u5ea6\u662f\u65e0\u9650\u5927\u3002<\/li>\n<li><strong>\u8fed\u4ee3<\/strong><br \/>\n\u9009\u62e9\u5b8c\u4e86\u53c8\u56de\u5230\u7b2c2\u6b65\uff0c\u76f4\u5230\u8fdb\u5316\u5230\u4e86\u4e00\u5b9a\u7684\u6b21\u6570\uff0c\u7ed3\u675f\u7b97\u6cd5\u3002<\/li>\n<\/ol>\n<hr \/>\n<h2>\u4e8c.\u5177\u4f53\u65b9\u6cd5\u8bba\uff1a<\/h2>\n<h2>1.1 Pareto\u652f\u914d\u5173\u7cfb\u4ee5\u53caPareto\u7b49\u7ea7<\/h2>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-0b7c0887c4d5c037cd8cf35fc7f0e6a7_1440w.webp\" alt=\"img\" \/><\/p>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-e269554e2582a0f1d4759cbfa58b009d_1440w.webp\" alt=\"img\" \/><\/p>\n<h2>1.2 \u5feb\u901f\u975e\u652f\u914d\u6392\u5e8f<\/h2>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-7defd5ad73ddfdc0128a897c92d052b8_1440w.webp\" alt=\"img\" \/><\/p>\n<h2>1.3 \u62e5\u6324\u5ea6<\/h2>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-0bc6e81de834d5d4562853539153703f_1440w.webp\" alt=\"img\" \/><\/p>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-1296130a3b7b3d7cdf12fce9fba82578_1440w.webp\" alt=\"img\" \/><\/p>\n<h2>1.4 \u7cbe\u82f1\u4fdd\u7559\u7b56\u7565<\/h2>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-52f779b7be295b3bb40f0960abf50f49_1440w.webp\" alt=\"img\" \/><\/p>\n<h2>1.5 \u5b9e\u6570\u7f16\u7801\u7684\u4ea4\u53c9\u64cd\u4f5c\uff08SBX\uff09<\/h2>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-97bf41a413e45e45a424b61f2176d316_1440w.webp\" alt=\"img\" \/><\/p>\n<h2>1.6 \u591a\u9879\u5f0f\u53d8\u5f02\uff08polynomial mutation\uff09<\/h2>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-9e64a77c6c8fd480231b4df0afda383c_1440w.webp\" alt=\"img\" \/><\/p>\n<h2>1.7 \u7ade\u6807\u8d5b\u9009\u62e9\uff08tournament selection\uff09<\/h2>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-3e9cf8f6318daf0a9aca9e17017d8521_1440w.webp\" alt=\"img\" \/><\/p>\n<h2>2. \u7b97\u6cd5\u5b9e\u73b0\u6846\u56fe<\/h2>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-2117cc5f58375adc08feff00f5e6f26d_1440w.webp\" alt=\"img\" \/><\/p>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-dca4caac82554b232fc7e6dd4656a178_1440w.webp\" alt=\"img\" \/><\/p>\n<hr \/>\n<h2>\u4e09.\u4ee3\u7801\uff1a<\/h2>\n<p><strong>\u9996\u5148\u8d34\u51fa\u4e3b\u51fd\u6570\u4ee3\u7801\uff0c\u5bf9\u5e94\u6574\u4e2a\u6d41\u7a0b\u56fe\uff1a<\/strong><\/p>\n<pre><code class=\"language-matlab\">function nsga_2_optimization\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%\u6b64\u5904\u53ef\u4ee5\u66f4\u6539\n%\u66f4\u591a\u673a\u5668\u5b66\u4e60\u5185\u5bb9\u8bf7\u8bbf\u95eeomegaxyz.com\npop = 200; %\u79cd\u7fa4\u6570\u91cf\ngen = 500; %\u8fed\u4ee3\u6b21\u6570\nM = 2; %\u76ee\u6807\u51fd\u6570\u6570\u91cf\nV = 30; %\u7ef4\u5ea6\uff08\u51b3\u7b56\u53d8\u91cf\u7684\u4e2a\u6570\uff09\nmin_range = zeros(1, V); %\u4e0b\u754c \u751f\u62101*30\u7684\u4e2a\u4f53\u5411\u91cf \u5168\u4e3a0\nmax_range = ones(1,V); %\u4e0a\u754c \u751f\u62101*30\u7684\u4e2a\u4f53\u5411\u91cf \u5168\u4e3a1\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\nchromosome = initialize_variables(pop, M, V, min_range, max_range);%\u521d\u59cb\u5316\u79cd\u7fa4\nchromosome = non_domination_sort_mod(chromosome, M, V);%\u5bf9\u521d\u59cb\u5316\u79cd\u7fa4\u8fdb\u884c\u975e\u652f\u914d\u5feb\u901f\u6392\u5e8f\u548c\u62e5\u6324\u5ea6\u8ba1\u7b97\n\nfor i = 1 : gen\n    pool = round(pop\/2);%round() \u56db\u820d\u4e94\u5165\u53d6\u6574 \u4ea4\u914d\u6c60\u5927\u5c0f\n    tour = 2;%\u7ade\u6807\u8d5b  \u53c2\u8d5b\u9009\u624b\u4e2a\u6570\n    parent_chromosome = tournament_selection(chromosome, pool, tour);%\u7ade\u6807\u8d5b\u9009\u62e9\u9002\u5408\u7e41\u6b96\u7684\u7236\u4ee3\n    mu = 20;%\u4ea4\u53c9\u548c\u53d8\u5f02\u7b97\u6cd5\u7684\u5206\u5e03\u6307\u6570\n    mum = 20;\n    offspring_chromosome = genetic_operator(parent_chromosome,M, V, mu, mum, min_range, max_range);%\u8fdb\u884c\u4ea4\u53c9\u53d8\u5f02\u4ea7\u751f\u5b50\u4ee3 \u8be5\u4ee3\u7801\u4e2d\u4f7f\u7528\u6a21\u62df\u4e8c\u8fdb\u5236\u4ea4\u53c9\u548c\u591a\u9879\u5f0f\u53d8\u5f02 \u91c7\u7528\u5b9e\u6570\u7f16\u7801\n    [main_pop,~] = size(chromosome);%\u7236\u4ee3\u79cd\u7fa4\u7684\u5927\u5c0f\n    [offspring_pop,~] = size(offspring_chromosome);%\u5b50\u4ee3\u79cd\u7fa4\u7684\u5927\u5c0f\n\n    clear temp\n    intermediate_chromosome(1:main_pop,:) = chromosome;\n    intermediate_chromosome(main_pop + 1 : main_pop + offspring_pop,1 : M+V) = offspring_chromosome;%\u5408\u5e76\u7236\u4ee3\u79cd\u7fa4\u548c\u5b50\u4ee3\u79cd\u7fa4\n    intermediate_chromosome = non_domination_sort_mod(intermediate_chromosome, M, V);%\u5bf9\u65b0\u7684\u79cd\u7fa4\u8fdb\u884c\u5feb\u901f\u975e\u652f\u914d\u6392\u5e8f\n    chromosome = replace_chromosome(intermediate_chromosome, M, V, pop);%\u9009\u62e9\u5408\u5e76\u79cd\u7fa4\u4e2d\u524dN\u4e2a\u4f18\u5148\u7684\u4e2a\u4f53\u7ec4\u6210\u65b0\u79cd\u7fa4\n    if ~mod(i,100)\n        clc;\n        fprintf(&#039;%d generations completed\\n&#039;,i);\n    end\nend\n\nif M == 2\n    plot(chromosome(:,V + 1),chromosome(:,V + 2),&#039;*&#039;);\n    xlabel(&#039;f_1&#039;); ylabel(&#039;f_2&#039;);\n    title(&#039;Pareto Optimal Front&#039;);\nelseif M == 3\n    plot3(chromosome(:,V + 1),chromosome(:,V + 2),chromosome(:,V + 3),&#039;*&#039;);\n    xlabel(&#039;f_1&#039;); ylabel(&#039;f_2&#039;); zlabel(&#039;f_3&#039;);\n    title(&#039;Pareto Optimal Surface&#039;);\nend<\/code><\/pre>\n<hr \/>\n<p><strong>1 \u521d\u59cb\u5316\u4ee3\u7801<\/strong><\/p>\n<p>\u5bf9\u4e8e<strong>f(i)<\/strong>\u6765\u8bf4\uff0c\u524d<strong>V<\/strong>\u4e2a\u5143\u7d20\u4e3a\u51b3\u7b56\u53d8\u91cf\uff0c<strong>V+1\u5230V+M<\/strong>\u4e2a\u5143\u7d20\u4e3aM\u4e2a\u76ee\u6807\u51fd\u6570\u7684\u503c\uff0c\u7b2c<strong>V+M+1<\/strong>\u4e2a\u5143\u7d20\u4e3a<strong>pareto\u7b49\u7ea7<\/strong>\u3002\u7b2c<strong>V+M+2<\/strong>\u4e2a\u5143\u7d20\u4e3a\u62e5\u6324\u5ea6\u3002\u51b3\u7b56\u53d8\u91cf\u5c31\u662f\u76f8\u5f53\u4e8e<strong>DNA<\/strong>\u4e00\u6837\uff0c\u7528\u4e8e<strong>\u6742\u4ea4\u548c\u53d8\u5f02<\/strong>\u3002<\/p>\n<pre><code class=\"language-matlab\">function f = initialize_variables(N, M, V, min_range, max_range)%f\u662f\u4e00\u4e2a\u7531\u79cd\u7fa4\u4e2a\u4f53\u7ec4\u6210\u7684\u77e9\u9635\nmin = min_range;\nmax = max_range;\nK = M + V;%%K\u662f\u6570\u7ec4\u7684\u603b\u5143\u7d20\u4e2a\u6570\u3002\u4e3a\u4e86\u4fbf\u4e8e\u8ba1\u7b97\uff0c\u51b3\u7b56\u53d8\u91cf\u548c\u76ee\u6807\u51fd\u6570\u4e32\u5728\u4e00\u8d77\u5f62\u6210\u4e00\u4e2a\u6570\u7ec4\u3002  \n%\u5bf9\u4e8e\u4ea4\u53c9\u548c\u53d8\u5f02\uff0c\u5229\u7528\u76ee\u6807\u53d8\u91cf\u5bf9\u51b3\u7b56\u53d8\u91cf\u8fdb\u884c\u9009\u62e9\nfor i = 1 : N\n    for j = 1 : V\n        f(i,j) = min(j) + (max(j) - min(j))*rand(1);%f(i j)\u8868\u793a\u7684\u662f\u79cd\u7fa4\u4e2d\u7b2ci\u4e2a\u4e2a\u4f53\u4e2d\u7684\u7b2cj\u4e2a\u51b3\u7b56\u53d8\u91cf\uff0c\n                                                    %\u8fd9\u884c\u4ee3\u7801\u4e3a\u6bcf\u4e2a\u4e2a\u4f53\u7684\u6240\u6709\u51b3\u7b56\u53d8\u91cf\u5728\u7ea6\u675f\u6761\u4ef6\u5185\u968f\u673a\u53d6\u503c\n    end\n    f(i,V + 1: K) = evaluate_objective(f(i,:), M, V); % M\u662f\u76ee\u6807\u51fd\u6570\u6570\u91cf V\u662f\u51b3\u7b56\u53d8\u91cf\u4e2a\u6570\n                                                    %\u4e3a\u4e86\u7b80\u5316\u8ba1\u7b97\u5c06\u5bf9\u5e94\u7684\u76ee\u6807\u51fd\u6570\u503c\u50a8\u5b58\u5728\u67d3\u8272\u4f53\u7684V + 1 \u5230 K\u7684\u4f4d\u7f6e\u3002\nend<\/code><\/pre>\n<p><strong>2 \u5feb\u901f\u975e\u652f\u914d\u6392\u5e8f\u548c\u62e5\u6324\u5ea6\u8ba1\u7b97\u4ee3\u7801<\/strong><\/p>\n<p>individual(i).n\u662f\u80fd\u652f\u914d\u4e2a\u4f53i\u7684\u4e2a\u4f53\u6570\u91cf\u3002<\/p>\n<p>individual(i).p =[]\u662f\u88ab\u4e2a\u4f53i\u652f\u914d\u7684\u4e2a\u4f53\u96c6\u5408\u3002<\/p>\n<p>sorted_based_on_front\u4e2d\u5b58\u653e\u7684\u662f<strong>x\u77e9\u9635\u6309\u7167\u6392\u5e8f\u7b49\u7ea7\u5347\u5e8f\u6392\u5e8f<\/strong>\u540e\u7684\u77e9\u9635\u3002<\/p>\n<p>y\u4e2d\u5b58\u653e\u7684\u662f\u6392\u5e8f\u7b49\u7ea7\u4e3afront\u7684\u96c6\u5408\u77e9\u9635\u3002<\/p>\n<p>sorted_based_on_objective\u5b58\u653e<strong>\u6309\u7167\u76ee\u6807\u51fd\u6570\u503c\u6392\u5e8f\u540e\u7684x\u77e9\u9635<\/strong>\u3002<\/p>\n<p>\u8fd4\u56de\u6bcf\u4e2a\u4e2a\u4f53\u5bf9\u5e94\u7684<strong>Rank\u503c\u548c\u62e5\u6324\u8ddd\u79bb<\/strong>\uff0c\u662f\u4e00\u4e2a\u4e24\u5217\u7684\u77e9\u9635\u3002<\/p>\n<pre><code class=\"language-matlab\">%% \u5bf9\u521d\u59cb\u79cd\u7fa4\u5f00\u59cb\u6392\u5e8f \u5feb\u901f\u975e\u652f\u914d\u6392\u5e8f\n% \u4f7f\u7528\u975e\u652f\u914d\u6392\u5e8f\u5bf9\u79cd\u7fa4\u8fdb\u884c\u6392\u5e8f\u3002\u8be5\u51fd\u6570\u8fd4\u56de\u6bcf\u4e2a\u4e2a\u4f53\u5bf9\u5e94\u7684\u6392\u5e8f\u503c\u548c\u62e5\u6324\u8ddd\u79bb\uff0c\u662f\u4e00\u4e2a\u4e24\u5217\u7684\u77e9\u9635\u3002  \n% \u5e76\u5c06\u6392\u5e8f\u503c\u548c\u62e5\u6324\u8ddd\u79bb\u6dfb\u52a0\u5230\u67d3\u8272\u4f53\u77e9\u9635\u4e2d \nfunction f = non_domination_sort_mod(x, M, V)\n[N, ~] = size(x);% N\u4e3a\u77e9\u9635x\u7684\u884c\u6570\uff0c\u4e5f\u662f\u79cd\u7fa4\u7684\u6570\u91cf\nclear m\nfront = 1;\nF(front).f = [];\nindividual = [];\n\nfor i = 1 : N\n    individual(i).n = 0;%n\u662f\u4e2a\u4f53i\u88ab\u652f\u914d\u7684\u4e2a\u4f53\u6570\u91cf\n    individual(i).p = [];%p\u662f\u88ab\u4e2a\u4f53i\u652f\u914d\u7684\u4e2a\u4f53\u96c6\u5408\n    for j = 1 : N\n        dom_less = 0;\n        dom_equal = 0;\n        dom_more = 0;\n        for k = 1 : M        %\u5224\u65ad\u4e2a\u4f53i\u548c\u4e2a\u4f53j\u7684\u652f\u914d\u5173\u7cfb\n            if (x(i,V + k) &lt; x(j,V + k))  \n                dom_less = dom_less + 1;\n            elseif (x(i,V + k) == x(j,V + k))\n                dom_equal = dom_equal + 1;\n            else\n                dom_more = dom_more + 1;\n            end\n        end\n        if dom_less == 0 &amp;&amp; dom_equal ~= M % \u8bf4\u660ei\u53d7j\u652f\u914d\uff0c\u76f8\u5e94\u7684n\u52a01\n            individual(i).n = individual(i).n + 1;\n        elseif dom_more == 0 &amp;&amp; dom_equal ~= M % \u8bf4\u660ei\u652f\u914dj,\u628aj\u52a0\u5165i\u7684\u652f\u914d\u5408\u96c6\u4e2d\n            individual(i).p = [individual(i).p j];\n        end\n    end   \n    if individual(i).n == 0 %\u4e2a\u4f53i\u975e\u652f\u914d\u7b49\u7ea7\u6392\u5e8f\u6700\u9ad8\uff0c\u5c5e\u4e8e\u5f53\u524d\u6700\u4f18\u89e3\u96c6\uff0c\u76f8\u5e94\u7684\u67d3\u8272\u4f53\u4e2d\u643a\u5e26\u4ee3\u8868\u6392\u5e8f\u6570\u7684\u4fe1\u606f\n        x(i,M + V + 1) = 1;\n        F(front).f = [F(front).f i];%\u7b49\u7ea7\u4e3a1\u7684\u975e\u652f\u914d\u89e3\u96c6\n    end\nend\n%\u4e0a\u9762\u7684\u4ee3\u7801\u662f\u4e3a\u4e86\u627e\u51fa\u7b49\u7ea7\u6700\u9ad8\u7684\u975e\u652f\u914d\u89e3\u96c6\n%\u4e0b\u9762\u7684\u4ee3\u7801\u662f\u4e3a\u4e86\u7ed9\u5176\u4ed6\u4e2a\u4f53\u8fdb\u884c\u5206\u7ea7\nwhile ~isempty(F(front).f)\n   Q = []; %\u5b58\u653e\u4e0b\u4e00\u4e2afront\u96c6\u5408\n   for i = 1 : length(F(front).f)%\u5faa\u73af\u5f53\u524d\u652f\u914d\u89e3\u96c6\u4e2d\u7684\u4e2a\u4f53\n       if ~isempty(individual(F(front).f(i)).p)%\u4e2a\u4f53i\u6709\u81ea\u5df1\u6240\u652f\u914d\u7684\u89e3\u96c6\n            for j = 1 : length(individual(F(front).f(i)).p)%\u5faa\u73af\u4e2a\u4f53i\u6240\u652f\u914d\u89e3\u96c6\u4e2d\u7684\u4e2a\u4f53\n                individual(individual(F(front).f(i)).p(j)).n = ...%...\u8868\u793a\u7684\u662f\u4e0e\u4e0b\u4e00\u884c\u4ee3\u7801\u662f\u76f8\u8fde\u7684\uff0c \u8fd9\u91cc\u8868\u793a\u4e2a\u4f53j\u7684\u88ab\u652f\u914d\u4e2a\u6570\u51cf1\n                    individual(individual(F(front).f(i)).p(j)).n - 1;\n                 if individual(individual(F(front).f(i)).p(j)).n == 0% \u5982\u679cq\u662f\u975e\u652f\u914d\u89e3\u96c6\uff0c\u5219\u653e\u5165\u96c6\u5408Q\u4e2d\n                    x(individual(F(front).f(i)).p(j),M + V + 1) = ...%\u4e2a\u4f53\u67d3\u8272\u4f53\u4e2d\u52a0\u5165\u5206\u7ea7\u4fe1\u606f\n                        front + 1;\n                    Q = [Q individual(F(front).f(i)).p(j)];\n                end\n            end\n       end\n   end\n   front =  front + 1;\n   F(front).f = Q;\nend\n\n[temp,index_of_fronts] = sort(x(:,M + V + 1));%\u5bf9\u4e2a\u4f53\u7684\u4ee3\u8868\u6392\u5e8f\u7b49\u7ea7\u7684\u5217\u5411\u91cf\u8fdb\u884c\u5347\u5e8f\u6392\u5e8f index_of_fronts\u8868\u793a\u6392\u5e8f\u540e\u7684\u503c\u5bf9\u5e94\u539f\u6765\u7684\u7d22\u5f15\nfor i = 1 : length(index_of_fronts)\n    sorted_based_on_front(i,:) = x(index_of_fronts(i),:);%sorted_based_on_front\u4e2d\u5b58\u653e\u7684\u662fx\u77e9\u9635\u6309\u7167\u6392\u5e8f\u7b49\u7ea7\u5347\u5e8f\u6392\u5e8f\u540e\u7684\u77e9\u9635\nend\ncurrent_index = 0;\n\n%% Crowding distance \u8ba1\u7b97\u6bcf\u4e2a\u4e2a\u4f53\u7684\u62e5\u6324\u5ea6\n\nfor front = 1 : (length(F) - 1)%\u8fd9\u91cc\u51cf1\u662f\u56e0\u4e3a\u4ee3\u780155\u884c\u8fd9\u91cc\uff0cF\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u4e3a\u7a7a\uff0c\u8fd9\u6837\u624d\u80fd\u8df3\u51fa\u5faa\u73af\u3002\u6240\u4ee5\u4e00\u5171\u6709length-1\u4e2a\u6392\u5e8f\u7b49\u7ea7\n    distance = 0;\n    y = [];\n    previous_index = current_index + 1;\n    for i = 1 : length(F(front).f)\n        y(i,:) = sorted_based_on_front(current_index + i,:);%y\u4e2d\u5b58\u653e\u7684\u662f\u6392\u5e8f\u7b49\u7ea7\u4e3afront\u7684\u96c6\u5408\u77e9\u9635\n    end\n    current_index = current_index + i;%current_index =i\n    sorted_based_on_objective = [];%\u5b58\u653e\u57fa\u4e8e\u62e5\u6324\u8ddd\u79bb\u6392\u5e8f\u7684\u77e9\u9635\n    for i = 1 : M\n        [sorted_based_on_objective, index_of_objectives] = ...\n            sort(y(:,V + i));%\u6309\u7167\u76ee\u6807\u51fd\u6570\u503c\u6392\u5e8f\n        sorted_based_on_objective = [];\n        for j = 1 : length(index_of_objectives)\n            sorted_based_on_objective(j,:) = y(index_of_objectives(j),:);% sorted_based_on_objective\u5b58\u653e\u6309\u7167\u76ee\u6807\u51fd\u6570\u503c\u6392\u5e8f\u540e\u7684x\u77e9\u9635\n        end\n        f_max = ...\n            sorted_based_on_objective(length(index_of_objectives), V + i);%fmax\u4e3a\u76ee\u6807\u51fd\u6570\u6700\u5927\u503c fmin\u4e3a\u76ee\u6807\u51fd\u6570\u6700\u5c0f\u503c\n        f_min = sorted_based_on_objective(1, V + i);\n        y(index_of_objectives(length(index_of_objectives)),M + V + 1 + i)...%\u5bf9\u6392\u5e8f\u540e\u7684\u7b2c\u4e00\u4e2a\u4e2a\u4f53\u548c\u6700\u540e\u4e00\u4e2a\u4e2a\u4f53\u7684\u8ddd\u79bb\u8bbe\u4e3a\u65e0\u7a77\u5927\n            = Inf;\n        y(index_of_objectives(1),M + V + 1 + i) = Inf;\n         for j = 2 : length(index_of_objectives) - 1%\u5faa\u73af\u96c6\u5408\u4e2d\u9664\u4e86\u7b2c\u4e00\u4e2a\u548c\u6700\u540e\u4e00\u4e2a\u7684\u4e2a\u4f53\n            next_obj  = sorted_based_on_objective(j + 1,V + i);\n            previous_obj  = sorted_based_on_objective(j - 1,V + i);\n            if (f_max - f_min == 0)\n                y(index_of_objectives(j),M + V + 1 + i) = Inf;\n            else\n                y(index_of_objectives(j),M + V + 1 + i) = ...\n                     (next_obj - previous_obj)\/(f_max - f_min);\n            end\n         end\n    end\n    distance = [];\n    distance(:,1) = zeros(length(F(front).f),1);\n    for i = 1 : M\n        distance(:,1) = distance(:,1) + y(:,M + V + 1 + i);\n    end\n    y(:,M + V + 2) = distance;\n    y = y(:,1 : M + V + 2);\n    z(previous_index:current_index,:) = y;\nend\nf = z();%\u5f97\u5230\u7684\u662f\u5df2\u7ecf\u5305\u542b\u7b49\u7ea7\u548c\u62e5\u6324\u5ea6\u7684\u79cd\u7fa4\u77e9\u9635 \u5e76\u4e14\u5df2\u7ecf\u6309\u7b49\u7ea7\u6392\u5e8f\u6392\u5e8f\n<\/code><\/pre>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-a85c0e13b193e6388647a213cbf68bd4_1440w.webp\" alt=\"img\" \/><\/p>\n<hr \/>\n<p><strong>3 \u7ade\u6807\u8d5b\u9009\u62e9\u4ee3\u7801<\/strong><\/p>\n<p>pool = round(pop\/2)\uff1a<strong>\u4ea4\u914d\u6c60\u5927\u5c0f<\/strong><\/p>\n<p>tour = 2\uff1a\u7ade\u6807\u8d5b <strong>\u53c2\u8d5b\u9009\u624b\u4e2a\u6570<\/strong><\/p>\n<p><strong>\u4ecepop\u4e2a\u91cc\u9762\u7ade\u6807\u51fapop\/2\u4e2a\u725b\u903c\u4e00\u70b9\u7684\u3002<\/strong><\/p>\n<p>chromosome\u662f\u4e00\u4e2a\u77e9\u9635\uff0c<strong>\u884c\u6570\u662fpop\u7684\u4e2a\u6570<\/strong>\uff0c<strong>\u5217\u6570\u662f(V+M+2=\u51b3\u7b56\u53d8\u91cf\u6570+\u76ee\u6807\u51fd\u6570\u7ef4\u6570+\u7b49\u7ea7+\u62e5\u6324\u5ea6)<\/strong>\u3002<\/p>\n<pre><code class=\"language-matlab\">function f = tournament_selection(chromosome, pool_size, tour_size)\n[pop, variables] = size(chromosome);%\u83b7\u5f97\u79cd\u7fa4\u7684\u4e2a\u4f53\u6570\u91cf\u548c\u51b3\u7b56\u53d8\u91cf\u6570\u91cf\nrank = variables - 1;%\u4e2a\u4f53\u5411\u91cf\u4e2d\u6392\u5e8f\u503c\u6240\u5728\u4f4d\u7f6e\ndistance = variables;%\u4e2a\u4f53\u5411\u91cf\u4e2d\u62e5\u6324\u5ea6\u6240\u5728\u4f4d\u7f6e\n%\u7ade\u6807\u8d5b\u9009\u62e9\u6cd5\uff0c\u6bcf\u6b21\u968f\u673a\u9009\u62e9\u4e24\u4e2a\u4e2a\u4f53\uff0c\u4f18\u5148\u9009\u62e9\u6392\u5e8f\u7b49\u7ea7\u9ad8\u7684\u4e2a\u4f53\uff0c\u5982\u679c\u6392\u5e8f\u7b49\u7ea7\u4e00\u6837\uff0c\u4f18\u9009\u9009\u62e9\u62e5\u6324\u5ea6\u5927\u7684\u4e2a\u4f53\nfor i = 1 : pool_size\n    for j = 1 : tour_size\n        candidate(j) = round(pop*rand(1));%\u968f\u673a\u9009\u62e9\u53c2\u8d5b\u4e2a\u4f53\n        if candidate(j) == 0\n            candidate(j) = 1;\n        end\n        if j &gt; 1\n            while ~isempty(find(candidate(1 : j - 1) == candidate(j)))%\u9632\u6b62\u4e24\u4e2a\u53c2\u8d5b\u4e2a\u4f53\u662f\u540c\u4e00\u4e2a\n                candidate(j) = round(pop*rand(1));\n                if candidate(j) == 0\n                    candidate(j) = 1;\n                end\n            end\n        end\n    end\n    for j = 1 : tour_size% \u8bb0\u5f55\u6bcf\u4e2a\u53c2\u8d5b\u8005\u7684\u6392\u5e8f\u7b49\u7ea7 \u62e5\u6324\u5ea6\n        c_obj_rank(j) = chromosome(candidate(j),rank);\n        c_obj_distance(j) = chromosome(candidate(j),distance);\n    end\n    min_candidate = ...\n        find(c_obj_rank == min(c_obj_rank));%\u9009\u62e9\u6392\u5e8f\u7b49\u7ea7\u8f83\u5c0f\u7684\u53c2\u8d5b\u8005\uff0cfind\u8fd4\u56de\u8be5\u53c2\u8d5b\u8005\u7684\u7d22\u5f15\n    if length(min_candidate) ~= 1%\u5982\u679c\u4e24\u4e2a\u53c2\u8d5b\u8005\u7684\u6392\u5e8f\u7b49\u7ea7\u76f8\u7b49 \u5219\u7ee7\u7eed\u6bd4\u8f83\u62e5\u6324\u5ea6 \u4f18\u5148\u9009\u62e9\u62e5\u6324\u5ea6\u5927\u7684\u4e2a\u4f53\n        max_candidate = ...\n        find(c_obj_distance(min_candidate) == max(c_obj_distance(min_candidate)));\n        if length(max_candidate) ~= 1\n            max_candidate = max_candidate(1);\n        end\n        f(i,:) = chromosome(candidate(min_candidate(max_candidate)),:);\n    else\n        f(i,:) = chromosome(candidate(min_candidate(1)),:);\n    end\nend<\/code><\/pre>\n<p><strong>4\u30015 \u4ea4\u53c9 \u53d8\u5f02\u4ee3\u7801<\/strong><\/p>\n<p><strong>\u628a\u8fd9pop\/2\u4e2a\u725b\u903c\u7684 \u6742\u4ea4\u53d8\u5f02 \u5f97\u5230pop\u4e2a\u5b50\u4ee3\u3002<\/strong><\/p>\n<p><strong>\u8fd9\u91cc\u9762N=pop\/2\uff0c\u4ea4\u53c9\u7684\u53cc\u4eb2\u5206\u522b\u662fparent_1\u548cparent_2\u3002<\/strong><\/p>\n<p><strong>child_1(j)\u662f30\u7ef4\u7684\u3002<\/strong><\/p>\n<pre><code class=\"language-matlab\">function f  = genetic_operator(parent_chromosome, M, V, mu, mum, l_limit, u_limit)\n[N,m] = size(parent_chromosome);%N\u662f\u4ea4\u914d\u6c60\u4e2d\u7684\u4e2a\u4f53\u6570\u91cf\n\nclear m\np = 1;\nwas_crossover = 0;%\u662f\u5426\u4ea4\u53c9\u6807\u5fd7\u4f4d\nwas_mutation = 0;%\u662f\u5426\u53d8\u5f02\u6807\u5fd7\u4f4d\n\nfor i = 1 : N%\u8fd9\u91cc\u867d\u7136\u5faa\u73afN\u6b21\uff0c\u4f46\u662f\u6bcf\u6b21\u5faa\u73af\u90fd\u4f1a\u6709\u6982\u7387\u4ea7\u751f2\u4e2a\u6216\u80051\u4e2a\u5b50\u4ee3\uff0c\u6240\u4ee5\u6700\u7ec8\u4ea7\u751f\u7684\u5b50\u4ee3\u4e2a\u4f53\u6570\u91cf\u5927\u7ea6\u662f2N\u4e2a\n    if rand(1) &lt; 0.9%\u4ea4\u53c9\u6982\u73870.9\n        child_1 = [];\n        child_2 = [];\n        parent_1 = round(N*rand(1));\n        if parent_1 &lt; 1\n            parent_1 = 1;\n        end\n        parent_2 = round(N*rand(1));\n        if parent_2 &lt; 1\n            parent_2 = 1;\n        end\n        while isequal(parent_chromosome(parent_1,:),parent_chromosome(parent_2,:))\n            parent_2 = round(N*rand(1));\n            if parent_2 &lt; 1\n                parent_2 = 1;\n            end\n        end\n        parent_1 = parent_chromosome(parent_1,:);\n        parent_2 = parent_chromosome(parent_2,:);\n        for j = 1 : V\n            u(j) = rand(1);\n            if u(j) &lt;= 0.5\n                bq(j) = (2*u(j))^(1\/(mu+1));\n            else\n                bq(j) = (1\/(2*(1 - u(j))))^(1\/(mu+1));\n            end\n            child_1(j) = ...\n                0.5*(((1 + bq(j))*parent_1(j)) + (1 - bq(j))*parent_2(j));\n            child_2(j) = ...\n                0.5*(((1 - bq(j))*parent_1(j)) + (1 + bq(j))*parent_2(j));\n            if child_1(j) &gt; u_limit(j)\n                child_1(j) = u_limit(j);\n            elseif child_1(j) &lt; l_limit(j)\n                child_1(j) = l_limit(j);\n            end\n            if child_2(j) &gt; u_limit(j)\n                child_2(j) = u_limit(j);\n            elseif child_2(j) &lt; l_limit(j)\n                child_2(j) = l_limit(j);\n            end\n        end\n        child_1(:,V + 1: M + V) = evaluate_objective(child_1, M, V);\n        child_2(:,V + 1: M + V) = evaluate_objective(child_2, M, V);\n        was_crossover = 1;\n        was_mutation = 0;\n    else%if &gt;0.9\n        parent_3 = round(N*rand(1));\n        if parent_3 &lt; 1\n            parent_3 = 1;\n        end\n        child_3 = parent_chromosome(parent_3,:);\n        for j = 1 : V\n           r(j) = rand(1);\n           if r(j) &lt; 0.5\n               delta(j) = (2*r(j))^(1\/(mum+1)) - 1;\n           else\n               delta(j) = 1 - (2*(1 - r(j)))^(1\/(mum+1));\n           end\n           child_3(j) = child_3(j) + delta(j);\n           if child_3(j) &gt; u_limit(j) % \u6761\u4ef6\u7ea6\u675f\n               child_3(j) = u_limit(j);\n           elseif child_3(j) &lt; l_limit(j)\n               child_3(j) = l_limit(j);\n           end\n        end \n        child_3(:,V + 1: M + V) = evaluate_objective(child_3, M, V);\n        was_mutation = 1;\n        was_crossover = 0;\n    end% if &lt;0.9\n    if was_crossover\n        child(p,:) = child_1;\n        child(p+1,:) = child_2;\n        was_cossover = 0;\n        p = p + 2;\n    elseif was_mutation\n        child(p,:) = child_3(1,1 : M + V);\n        was_mutation = 0;\n        p = p + 1;\n    end\nend\n\nf = child;<\/code><\/pre>\n<p>\u4ea4\u53c9\u7b97\u6cd5\u9009\u62e9\u7684\u662f\u6a21\u62df\u4e8c\u8fdb\u5236\u4ea4\u53c9\uff0c\u53d8\u5f02\u7b97\u6cd5\u9009\u62e9\u7684\u662f\u591a\u9879\u5f0f\u53d8\u5f02\uff0c\u4e0a\u9762\u7684\u539f\u7406\u90e8\u5206\u6709\u8bb2\u5230\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-97bf41a413e45e45a424b61f2176d316_1440w.webp\" alt=\"img\" \/><\/p>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-9e64a77c6c8fd480231b4df0afda383c_1440w.webp\" alt=\"img\" \/><\/p>\n<p><strong>8 \u751f\u6210\u65b0\u7684\u79cd\u7fa4\uff08\u7cbe\u82f1\u7b56\u7565\uff09<\/strong><\/p>\n<p>sorted_chromosome\u5c31\u662f\u6392\u5b8c\u987a\u5e8f\u7684intermediate_chromosome\u3002<\/p>\n<pre><code class=\"language-matlab\">function f  = replace_chromosome(intermediate_chromosome, M, V,pop)%\u7cbe\u82f1\u9009\u62e9\u7b56\u7565\n\n[N, m] = size(intermediate_chromosome);\n[temp,index] = sort(intermediate_chromosome(:,M + V + 1));\n\nclear temp m\nfor i = 1 : N\n    sorted_chromosome(i,:) = intermediate_chromosome(index(i),:);\nend\n\nmax_rank = max(intermediate_chromosome(:,M + V + 1));\n\nprevious_index = 0;\nfor i = 1 : max_rank\n    current_index = max(find(sorted_chromosome(:,M + V + 1) == i));\n    if current_index &gt; pop\n        remaining = pop - previous_index;\n        temp_pop = ...\n            sorted_chromosome(previous_index + 1 : current_index, :);\n        [temp_sort,temp_sort_index] = ...\n            sort(temp_pop(:, M + V + 2),&#039;descend&#039;);\n        for j = 1 : remaining\n            f(previous_index + j,:) = temp_pop(temp_sort_index(j),:);\n        end\n        return;\n    elseif current_index &lt; pop\n        f(previous_index + 1 : current_index, :) = ...\n            sorted_chromosome(previous_index + 1 : current_index, :);\n    else\n        f(previous_index + 1 : current_index, :) = ...\n            sorted_chromosome(previous_index + 1 : current_index, :);\n        return;\n    end\n    previous_index = current_index;\nend<\/code><\/pre>\n<p>\u672c\u4f8b\u5b50\u9009\u62e9\u7684\u6d4b\u8bd5\u51fd\u6570\u662fZDT1\uff0c \u76ee\u6807\u8bc4\u4ef7\u51fd\u6570\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-matlab\">function f = evaluate_objective(x, M, V)%%\u8ba1\u7b97\u6bcf\u4e2a\u4e2a\u4f53\u7684M\u4e2a\u76ee\u6807\u51fd\u6570\u503c\nf = [];\nf(1) = x(1);\ng = 1;\nsum = 0;\nfor i = 2:V\n    sum = sum + x(i);\nend\nsum = 9*(sum \/ (V-1));\ng = g + sum;\nf(2) = g * (1 - sqrt(x(1) \/ g));\nend<\/code><\/pre>\n<p>\u7ecf\u5386500\u6b21\u8fed\u4ee3\u540e\u7684pareto\u6700\u4f18\u89e3\u96c6\uff1a<\/p>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-59737d0743f1e58ca9481a27822a69b3_1440w.webp\" alt=\"img\" \/><\/p>\n<p>\u539f\u7406\u90e8\u5206\u53c2\u8003\u4e86\u4ee5\u4e0b\u8fd9\u7bc7\u6587\u7ae0\uff1a<\/p>\n<p><a href=\"https:\/\/zhuanlan.zhihu.com\/p\/131529679\">splintered myth\uff1a\u6d45\u8c08MOP\u548cNSGA-\u2161\u7b97\u6cd562 \u8d5e\u540c \u00b7 17 \u8bc4\u8bba\u6587\u7ae0<img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/v2-21599a5919efe9439f8ea4a479def388_ipico.jpg\" alt=\"img\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Greedy-NAS\u7528\u5230\u4e86\u8fd9\u4e2a\u7b97\u6cd5\uff0c\u770b\u4e862\u5929\u624d\u6574\u660e\u767d\uff0c\u6240\u4ee5\u6765\u603b\u7ed3\u4e00\u4e0b\uff1a \u4ee5\u4e0b\u4e3a\u6e90\u7801\u7684\u94fe\u63a5\uff0c\u4e0b\u8f7d\u9700\u8981\u8f6f\u59b9\u5e01\u54e6\uff1a MTALAB NSGA2\u7b97   \u2026 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0},"categories":[260],"tags":[],"_links":{"self":[{"href":"\/index.php?rest_route=\/wp\/v2\/posts\/9312"}],"collection":[{"href":"\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9312"}],"version-history":[{"count":1,"href":"\/index.php?rest_route=\/wp\/v2\/posts\/9312\/revisions"}],"predecessor-version":[{"id":9313,"href":"\/index.php?rest_route=\/wp\/v2\/posts\/9312\/revisions\/9313"}],"wp:attachment":[{"href":"\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9312"},{"taxonomy":"post_tag","embeddable":true,"href":"\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}