{"id":1360,"date":"2023-03-25T10:23:29","date_gmt":"2023-03-25T02:23:29","guid":{"rendered":""},"modified":"2023-03-25T10:23:29","modified_gmt":"2023-03-25T02:23:29","slug":"AI Mini-Max\u7b97\u6cd5","status":"publish","type":"post","link":"https:\/\/bianchenghao6.com\/1360.html","title":{"rendered":"AI Mini-Max\u7b97\u6cd5"},"content":{"rendered":"


\n <\/head>
\n <\/p>\n

\n

AI Mini-Max\u7b97\u6cd5<\/h1>\n<\/p><\/div>\n

Mini-max\u7b97\u6cd5\u662f\u4e00\u79cd\u9012\u5f52\u6216\u56de\u6eaf\u7b97\u6cd5\uff0c\u7528\u4e8e\u51b3\u7b56\u548c\u535a\u5f08\u8bba\u4e2d\u3002\u5047\u8bbe\u5bf9\u624b\u4e5f\u5728\u6700\u4f73\u72b6\u6001\u4e0b\u73a9\u800d\uff0c\u5b83\u53ef\u4ee5\u4e3a\u73a9\u5bb6\u63d0\u4f9b\u6700\u4f73\u79fb\u52a8\u65b9\u5f0f\u3002<\/span>
\n Mini-Max\u7b97\u6cd5\u4f7f\u7528\u9012\u5f52\u6765\u641c\u7d22\u6e38\u620f\u6811\u3002<\/span>
\n Min-Max\u7b97\u6cd5\u4e3b\u8981\u7528\u4e8eAI\u4e2d\u7684\u6e38\u620f\u3002\u4f8b\u5982\u56fd\u9645\u8c61\u68cb\uff0c\u897f\u6d0b\u8df3\u68cb\uff0c\u4e95\u5b57\u6e38\u620f\uff0c\u56f4\u68cb\u4ee5\u53ca\u5404\u79cd\u62d6\u8f66\u6e38\u620f\u3002\u8be5\u7b97\u6cd5\u8ba1\u7b97\u5f53\u524d\u72b6\u6001\u7684\u6781\u5927\u6781\u5c0f\u51b3\u7b56\u3002<\/span>
\n \u5728\u8fd9\u79cd\u7b97\u6cd5\u4e2d\uff0c\u4e24\u4e2a\u73a9\u5bb6\u73a9\u6e38\u620f\uff0c\u4e00\u4e2a\u53eb\u505aMAX\uff0c\u53e6\u4e00\u4e2a\u53eb\u505aMIN\u3002<\/span>
\n \u8fd9\u4e24\u4e2a\u73a9\u5bb6\u90fd\u5728\u4e0e\u4e4b\u6218\u6597\uff0c\u56e0\u4e3a\u5bf9\u624b\u7684\u73a9\u5bb6\u83b7\u5f97\u7684\u5229\u76ca\u6700\u5c0f\uff0c\u800c\u4ed6\u4eec\u5374\u83b7\u5f97\u4e86\u6700\u5927\u7684\u5229\u76ca\u3002<\/span>
\n \u6e38\u620f\u7684\u4e24\u4e2a\u73a9\u5bb6\u90fd\u662f\u5f7c\u6b64\u7684\u5bf9\u624b\uff0c\u5176\u4e2dMAX\u5c06\u9009\u62e9\u6700\u5927\u503c\uff0c\u800cMIN\u5c06\u9009\u62e9\u6700\u5c0f\u503c\u3002<\/span>
\n minimax\u7b97\u6cd5\u6267\u884c\u6df1\u5ea6\u4f18\u5148\u641c\u7d22\u7b97\u6cd5\u6765\u63a2\u7d22\u5b8c\u6574\u7684\u6e38\u620f\u6811\u3002<\/span>
\n minimax\u7b97\u6cd5\u4e00\u76f4\u8fdb\u884c\u5230\u6811\u7684\u7ec8\u7aef\u8282\u70b9\uff0c\u7136\u540e\u4f5c\u4e3a\u9012\u5f52\u56de\u6eaf\u6811\u3002 <\/span> <\/p>\n

MinMax\u7b97\u6cd5\u7684\u4f2a\u4ee3\u7801: <\/h2>\n
\n
\nfunction minimax(node, depth, maximizingPlayer) is\nif <\/span>depth ==0 or node is a terminal node then\nreturn <\/span>static <\/span>evaluation of node\nif <\/span>MaximizingPlayer then      \/\/ for <\/span>Maximizer Player\nmaxEva=-infinity          \n for <\/span>each child of node do\n eva= minimax(child, depth-1, false<\/span>)\nmaxEva= max(maxEva,eva)        \/\/gives Maximum of the values\nreturn <\/span>maxEva\nelse <\/span>                        \/\/ for <\/span>Minimizer player\n minEva= +infinity \n for <\/span>each child of node do\n eva= minimax(child, depth-1, true<\/span><\/span>)\n minEva= min(minEva, eva)         \/\/gives minimum of the values\n return <\/span>minEva\n    <\/pre>\n

<\/code>\n <\/div>\n

\n \u521d\u59cb\u547c\u53eb: <\/strong>\n <\/div>\n
\n Minimax(node\uff0c3\uff0ctrue)<\/strong>\n <\/div>\n

\u6700\u5c0f-\u6700\u5927\u7b97\u6cd5: <\/h2>\n

\u53ef\u4ee5\u4f7f\u7528\u793a\u4f8b\u8f7b\u677e\u63cf\u8ff0minimax\u7b97\u6cd5\u7684\u5de5\u4f5c\u3002\u4e0b\u9762\u6211\u4eec\u4ee5\u4ee3\u8868\u4e24\u4eba\u6e38\u620f\u7684\u6e38\u620f\u6811\u4e3a\u4f8b\u3002<\/span>
\n \u5728\u6b64\u793a\u4f8b\u4e2d\uff0c\u6709\u4e24\u4e2a\u53c2\u4e0e\u8005\uff0c\u4e00\u4e2a\u88ab\u79f0\u4e3aMaximizer\uff0c\u53e6\u4e00\u4e2a\u88ab\u79f0\u4e3aMinimizer\u3002<\/span>
\n Maximizer\u5c06\u5c1d\u8bd5\u83b7\u5f97\u6700\u5927\u53ef\u80fd\u7684\u5f97\u5206\uff0c\u800cMinimizer\u5c06\u5c1d\u8bd5\u83b7\u5f97\u6700\u5c0f\u53ef\u80fd\u7684\u5f97\u5206\u3002<\/span>
\n \u6b64\u7b97\u6cd5\u5e94\u7528DFS\uff0c\u56e0\u6b64\u5728\u6b64\u6e38\u620f\u6811\u4e2d\uff0c\u6211\u4eec\u5fc5\u987b\u4e00\u76f4\u7a7f\u8fc7\u6811\u53f6\u5230\u8fbe\u7ec8\u7aef\u8282\u70b9\u3002 <\/span>
\n \u5728\u7ec8\u7aef\u8282\u70b9\u5904\uff0c\u7ed9\u51fa\u4e86\u7ec8\u7aef\u503c\uff0c\u56e0\u6b64\u6211\u4eec\u5c06\u6bd4\u8f83\u8fd9\u4e9b\u503c\u5e76\u56de\u6eaf\u6811\u76f4\u5230\u51fa\u73b0\u521d\u59cb\u72b6\u6001\u3002\u4ee5\u4e0b\u662f\u89e3\u51b3\u4e24\u4eba\u6e38\u620f\u6811\u6240\u6d89\u53ca\u7684\u4e3b\u8981\u6b65\u9aa4: <\/span> <\/p>\n

\n \u6b65\u9aa41: <\/strong>: \u7b2c\u4e00\u6b65\uff0c\u7b97\u6cd5\u5c06\u751f\u6210\u6574\u4e2a\u6e38\u620f\u6811\uff0c\u5e76\u5e94\u7528\u6548\u7528\u51fd\u6570\u4ee5\u83b7\u53d6\u7ec8\u7aef\u72b6\u6001\u7684\u6548\u7528\u503c\u3002\u5728\u4e0b\u9762\u7684\u6811\u56fe\u4e2d\uff0c\u8ba9\u6211\u4eec\u4ee5A\u4e3a\u6811\u7684\u521d\u59cb\u72b6\u6001\u3002\u5047\u8bbe\u6700\u5927\u5316\u5668\u9996\u5148\u65cb\u8f6c\uff0c\u5176\u521d\u59cb\u503c\u6700\u5dee=-infinity\uff0c\u800c\u6700\u5c0f\u5316\u5668\u63a5\u4e0b\u6765\u65cb\u8f6c\uff0c\u5176\u521d\u59cb\u503c\u6700\u5dee= + infinity\u3002\n <\/div>\n

AI Mini-Max\u7b97\u6cd5_https:\/\/bianchenghao6.com_\u3010ai \u6559\u7a0b\u3011_\u7b2c1\u5f20 <\/p>\n

\n \u6b65\u9aa42: <\/strong>\u73b0\u5728\uff0c\u6211\u4eec\u9996\u5148\u627e\u5230Maximizer\u7684\u6548\u7528\u503c\u521d\u59cb\u503c\u4e3a-\u221e\uff0c\u56e0\u6b64\u6211\u4eec\u5c06\u7ec8\u7aef\u72b6\u6001\u4e0b\u7684\u6bcf\u4e2a\u503c\u4e0eMaximizer\u7684\u521d\u59cb\u503c\u8fdb\u884c\u6bd4\u8f83\uff0c\u5e76\u786e\u5b9a\u8f83\u9ad8\u7684\u8282\u70b9\u503c\u3002\u5b83\u5c06\u5728\u6240\u6709\u4e4b\u95f4\u627e\u5230\u6700\u5927\u503c\u3002\n <\/div>\n

\u5bf9\u4e8e\u8282\u70b9D max(-1\uff0c--\u221e)=> max(-1,4)= 4 <\/span>
\n \u5bf9\u4e8e\u8282\u70b9E max(2\uff0c-\u221e)=> max(2\uff0c6)= 6 <\/span>
\n \u5bf9\u4e8e\u8282\u70b9F max(-3\uff0c-\u221e)=> max(-3\uff0c-5)=-3 <\/span>
\n \u5bf9\u4e8e\u8282\u70b9G max(0\uff0c-\u221e)= max(0\uff0c7)= 7 <\/span>
\n AI Mini-Max\u7b97\u6cd5_https:\/\/bianchenghao6.com_\u3010ai \u6559\u7a0b\u3011_\u7b2c2\u5f20 <\/p>\n

\n \u6b65\u9aa43: <\/strong>\u4e0b\u4e00\u6b65\uff0c\u8f6e\u5230\u6700\u5c0f\u5316\u5668\u4e86\uff0c\u56e0\u6b64\u5b83\u5c06\u6240\u6709\u8282\u70b9\u503c\u4e0e+\u221e\u8fdb\u884c\u6bd4\u8f83\uff0c\u5e76\u627e\u52303
\n rd <\/sup>\u5c42\u8282\u70b9\u503c\u3002\n <\/div>\n

\u5bf9\u4e8e\u8282\u70b9B = min(4,6)= 4 <\/span>
\n \u5bf9\u4e8e\u8282\u70b9C = min(-3\uff0c7)=-3 <\/span>
\n AI Mini-Max\u7b97\u6cd5_https:\/\/bianchenghao6.com_\u3010ai \u6559\u7a0b\u3011_\u7b2c3\u5f20 <\/p>\n

\n \u6b65\u9aa43: <\/strong>\u73b0\u5728\u8f6e\u5230Maximizer\u4e86\uff0c\u5b83\u5c06\u518d\u6b21\u9009\u62e9\u6240\u6709\u8282\u70b9\u7684\u6700\u5927\u503c\uff0c\u5e76\u627e\u5230\u6839\u8282\u70b9\u7684\u6700\u5927\u503c\u3002\u5728\u6b64\u6e38\u620f\u6811\u4e2d\uff0c\u53ea\u67094\u5c42\uff0c\u56e0\u6b64\u6211\u4eec\u53ef\u4ee5\u7acb\u5373\u5230\u8fbe\u6839\u8282\u70b9\uff0c\u4f46\u5728\u5b9e\u9645\u6e38\u620f\u4e2d\uff0c\u5c06\u8d85\u8fc74\u5c42\u3002\n <\/div>\n

\u5bf9\u4e8e\u8282\u70b9A max(4\uff0c-3)= 4 <\/span>
\n AI Mini-Max\u7b97\u6cd5_https:\/\/bianchenghao6.com_\u3010ai \u6559\u7a0b\u3011_\u7b2c4\u5f20 <\/p>\n

\n minimax\u4e24\u4eba\u6e38\u620f\u3002\n <\/div>\n

Mini-Max\u7b97\u6cd5\u7684\u5c5e\u6027: <\/h2>\n

\u5b8c\u6210-<\/strong>\u6700\u5c0f-\u6700\u5927\u7b97\u6cd5\u5df2\u5b8c\u6210\u3002\u80af\u5b9a\u4f1a\u5728\u6709\u9650\u641c\u7d22\u6811\u4e2d\u627e\u5230\u4e00\u4e2a\u89e3\u51b3\u65b9\u6848(\u5982\u679c\u5b58\u5728)\u3002<\/span>
\n \u6700\u4f73-<\/strong>\u5982\u679c\u4e24\u4e2a\u5bf9\u624b\u7684\u6bd4\u8d5b\u90fd\u8fbe\u5230\u6700\u4f73\uff0c\u5219\"\u6700\u5c0f-\u6700\u5927\"\u7b97\u6cd5\u662f\u6700\u4f73\u7684\u3002<\/span>
\n \u65f6\u95f4\u590d\u6742\u5ea6-<\/strong>\uff0c\u56e0\u4e3a\u5b83\u4e3a\u6e38\u620f\u6811\u6267\u884c\u4e86DFS\uff0c\u6240\u4ee5Min-Max\u7b97\u6cd5\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u4e3a O(b m <\/sup>)<\/strong>\uff0c\u5176\u4e2db\u662f\u6e38\u620f\u6811\u7684\u5206\u652f\u56e0\u5b50\uff0cm\u662f\u6811\u7684\u6700\u5927\u6df1\u5ea6\u3002<\/span>
\n \u7a7a\u95f4\u590d\u6742\u5ea6-<\/strong> Mini-max\u7b97\u6cd5\u7684\u7a7a\u95f4\u590d\u6742\u5ea6\u4e5f\u4e0eDFS\u7c7b\u4f3c\uff0c\u5373Dstrong
\n
\n (bm)\u3002
\n <\/o><\/span> <\/p>\n

minimax\u7b97\u6cd5\u7684\u5c40\u9650\u6027: <\/h2>\n
\n minimax\u7b97\u6cd5\u7684\u4e3b\u8981\u7f3a\u70b9\u662f\uff0c\u5bf9\u4e8e\u590d\u6742\u7684\u6e38\u620f(\u4f8b\u5982\u56fd\u9645\u8c61\u68cb\uff0c\u56f4\u68cb\u7b49)\uff0c\u5b83\u7684\u8fd0\u884c\u901f\u5ea6\u975e\u5e38\u6162\u3002\u6e38\u620f\u7c7b\u578b\u5177\u6709\u5de8\u5927\u7684\u5206\u652f\u56e0\u7d20\uff0c\u73a9\u5bb6\u53ef\u4ee5\u9009\u62e9\u5f88\u591a\u9009\u62e9\u3002\u6211\u4eec\u53ef\u4ee5\u5728\u4e0b\u4e00\u4e2a\u4e3b\u9898\u4e2d\u8ba8\u8bba\u7684
\n alpha-beta\u4fee\u526a<\/strong>\u6765\u6539\u5584minimax\u7b97\u6cd5\u7684\u8fd9\u4e00\u5c40\u9650\u6027\u3002\n <\/div>\n
\n

<\/body>
\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"AI Mini-Max\u7b97\u6cd5zh-cn","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[139],"tags":[],"class_list":["post-1360","post","type-post","status-publish","format-standard","hentry","category-aijc"],"_links":{"self":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/1360"}],"collection":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/comments?post=1360"}],"version-history":[{"count":0,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/1360\/revisions"}],"wp:attachment":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/media?parent=1360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/categories?post=1360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/tags?post=1360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}