{"id":1361,"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 Alpha-Beta\u526a\u679d","status":"publish","type":"post","link":"https:\/\/bianchenghao6.com\/1361.html","title":{"rendered":"AI Alpha-Beta\u526a\u679d"},"content":{"rendered":"


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

\n

AI Alpha-Beta\u526a\u679d<\/h1>\n<\/p><\/div>\n

Alpha-beta\u526a\u679d\u662fminimax\u7b97\u6cd5\u7684\u4fee\u6539\u7248\u672c\u3002\u5b83\u662fminimax\u7b97\u6cd5\u7684\u4e00\u79cd\u4f18\u5316\u6280\u672f\u3002 <\/span>
\n \u6b63\u5982\u6211\u4eec\u5728minimax\u641c\u7d22\u7b97\u6cd5\u4e2d\u770b\u5230\u7684\u90a3\u6837\uff0c\u5fc5\u987b\u68c0\u67e5\u7684\u6e38\u620f\u72b6\u6001\u6570\u91cf\u5728\u6811\u7684\u6df1\u5ea6\u4e0a\u5448\u6307\u6570\u7ea7\u3002\u7531\u4e8e\u6211\u4eec\u65e0\u6cd5\u6d88\u9664\u6307\u6570\uff0c\u56e0\u6b64\u53ef\u4ee5\u5c06\u5176\u51cf\u534a\u3002\u56e0\u6b64\uff0c\u5b58\u5728\u4e00\u79cd\u65e0\u9700\u68c0\u67e5\u6e38\u620f\u6811\u7684\u6bcf\u4e2a\u8282\u70b9\u5c31\u53ef\u4ee5\u8ba1\u7b97\u51fa\u6b63\u786e\u7684minimax\u51b3\u7b56\u7684\u6280\u672f\uff0c\u8be5\u6280\u672f\u79f0\u4e3a\u526a\u679d<\/strong>\u3002\u8fd9\u6d89\u53ca\u4e24\u4e2a\u9608\u503c\u53c2\u6570Alpha\u548cBeta\u7528\u4e8e\u5c06\u6765\u6269\u5c55\uff0c\u56e0\u6b64\u79f0\u4e3a alpha-beta\u526a\u679d<\/strong>\u3002\u4e5f\u79f0\u4e3a Alpha-Beta\u7b97\u6cd5<\/strong>\u3002<\/span>
\n Alpha-beta\u526a\u679d\u53ef\u4ee5\u5e94\u7528\u4e8e\u6811\u7684\u4efb\u4f55\u6df1\u5ea6\uff0c\u6709\u65f6\u5b83\u4e0d\u4ec5\u53ef\u4ee5\u526a\u679d\u6811\u53f6\uff0c\u8fd8\u53ef\u4ee5\u526a\u679d\u6574\u4e2a\u5b50\u6811\u3002<\/span>
\n \u4e24\u4e2a\u53c2\u6570\u53ef\u4ee5\u5b9a\u4e49\u4e3a: Alpha: <\/strong>: \u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u6211\u4eec\u5728Maximizer\u8def\u5f84\u4e0a\u7684\u4efb\u4f55\u4f4d\u7f6e\u90fd\u627e\u5230\u4e86\u6700\u4f73(\u6700\u9ad8\u4ef7\u503c)\u9009\u62e9\u3002 alpha\u7684\u521d\u59cb\u503c\u4e3a-\u221e<\/strong>\u3002 <\/span> \u6d4b\u8bd5\u7248<\/strong>: \u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u6211\u4eec\u5728\"\u6700\u5c0f\u5316\u5668\"\u8def\u5f84\u4e0a\u7684\u4efb\u4f55\u4f4d\u7f6e\u90fd\u627e\u5230\u4e86\u6700\u4f73(\u6700\u4f4e\u4ef7\u503c)\u9009\u62e9\u3002 beta\u7684\u521d\u59cb\u503c\u4e3a +\u221e<\/strong>\u3002<\/span> <\/span>
\n \u5c06Alpha-beta\u526a\u679d\u4e3a\u6807\u51c6minimax\u7b97\u6cd5\u4f1a\u8fd4\u56de\u4e0e\u6807\u51c6\u7b97\u6cd5\u76f8\u540c\u7684\u52a8\u4f5c\uff0c\u4f46\u4f1a\u5220\u9664\u6240\u6709\u4e0d\u4f1a\u771f\u6b63\u5f71\u54cd\u6700\u7ec8\u51b3\u7b56\u4f46\u4f1a\u4f7f\u7b97\u6cd5\u53d8\u6162\u7684\u8282\u70b9\u3002\u56e0\u6b64\uff0c\u901a\u8fc7\u526a\u679d\u8fd9\u4e9b\u8282\u70b9\uff0c\u53ef\u4ee5\u4f7f\u7b97\u6cd5\u66f4\u5feb\u3002 <\/span> <\/p>\n

\n \u6ce8\u610f: <\/span>\u4e3a\u66f4\u597d\u5730\u7406\u89e3\u8be5\u4e3b\u9898\uff0c\u8bf7\u7814\u7a76minimax\u7b97\u6cd5\u3002\n <\/div>\n

Alpha-beta\u526a\u679d\u7684\u6761\u4ef6: <\/h2>\n
\n alpha-beta\u526a\u679d\u6240\u9700\u7684\u4e3b\u8981\u6761\u4ef6\u662f:\n <\/div>\n
\n
\n&#x3b1;>=\u03b2<\/span>\n    <\/pre>\n

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

\u6709\u5173alpha-beta\u526a\u679d\u7684\u8981\u70b9: <\/h2>\n

Max\u64ad\u653e\u5668\u53ea\u4f1a\u66f4\u65b0alpha\u7684\u503c\u3002<\/span>
\n Min\u64ad\u653e\u5668\u53ea\u4f1a\u66f4\u65b0beta\u7684\u503c\u3002<\/span>
\n \u56de\u6eaf\u6811\u65f6\uff0c\u8282\u70b9\u503c\u5c06\u4f20\u9012\u5230\u4e0a\u5c42\u8282\u70b9\uff0c\u800c\u4e0d\u662falpha\u548cbeta\u503c\u3002<\/span>
\n \u6211\u4eec\u53ea\u4f1a\u5c06alpha\uff0cbeta\u503c\u4f20\u9012\u7ed9\u5b50\u8282\u70b9\u3002<\/span> <\/p>\n

Alpha-beta\u526a\u679d\u7684\u4f2a\u4ee3\u7801: <\/h2>\n
\n
\nfunction minimax(node, depth, alpha, beta, 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\n   maxEva=-infinity          \n   for <\/span>each child of node do\n   eva= minimax(child, depth-1, alpha, beta, false<\/span>)\n  maxEva= max(maxEva, eva) \n  alpha= max(alpha, maxEva)    \n   if <\/span>beta<=alpha\n break<\/span>\n return <\/span>maxEva\n  \nelse <\/span>                        \/\/ for <\/span>Minimizer player\n   minEva= +infinity \n   for <\/span>each child of node do\n   eva= minimax(child, depth-1, alpha, beta, true<\/span><\/span>)\n   minEva= min(minEva, eva) \n   beta= min(beta, eva)\n    if <\/span>beta<=alpha\n  break<\/span>        \n return <\/span>minEva\n    <\/pre>\n

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

Alpha-Beta\u526a\u679d\u7684\u5de5\u4f5c\u65b9\u5f0f: <\/h2>\n
\n \u8ba9\u6211\u4eec\u4ee5\u4e24\u4eba\u641c\u7d22\u6811\u4e3a\u4f8b\uff0c\u4e86\u89e3Alpha-beta\u526a\u679d\u7684\u5de5\u4f5c\u65b9\u5f0f\n <\/div>\n
\n \u6b65\u9aa41: <\/strong>\u5728\u7b2c\u4e00\u6b65\u4e2d\uff0cMax\u73a9\u5bb6\u5c06\u9996\u5148\u4ece\u8282\u70b9A\u5f00\u59cb\u79fb\u52a8\uff0c\u5176\u4e2d\u8282\u70b9\u03b1=-\u221e\u548c\u03b2= +\u221e\uff0c\u8fd9\u4e9balpha\u548cbeta\u503c\u5411\u4e0b\u4f20\u9012\u5230\u8282\u70b9B\uff0c\u6b64\u5904\u03b1=-\u221e\u548c\u03b2= +\u221e\uff0c\u5e76\u4e14\u8282\u70b9B\u5c06\u76f8\u540c\u7684\u503c\u4f20\u9012\u7ed9\u5176\u5b50D\u3002\n <\/div>\n

AI Alpha-Beta\u526a\u679d_https:\/\/bianchenghao6.com_\u3010ai \u6559\u7a0b\u3011_\u7b2c1\u5f20 <\/p>\n

\n \u6b65\u9aa42: <\/strong>: \u5728\u8282\u70b9D\u5904\uff0c\u5c06\u8ba1\u7b97\u03b1\u7684\u503c\u4f5c\u4e3a\u5176\u5bf9Max\u7684\u8f6c\u5411\u3002\u9996\u5148\u5c06\u03b1\u7684\u503c\u4e0e2\u8fdb\u884c\u6bd4\u8f83\uff0c\u7136\u540e\u4e0e3\u8fdb\u884c\u6bd4\u8f83\uff0cmax(2\uff0c3)= 3\u5c06\u662f\u8282\u70b9D\u5904\u7684\u03b1\u503c\uff0c\u8282\u70b9\u503c\u4e5f\u5c06\u662f3\u3001\n <\/div>\n
\n \u6b65\u9aa43: <\/strong>\u73b0\u5728\u7b97\u6cd5\u56de\u6eaf\u5230\u8282\u70b9B\uff0c\u56e0\u4e3a\u8fd9\u662fMin\u7684\u8f6c\u5f2f\uff0c\u56e0\u6b64\u03b2\u7684\u503c\u5c06\u53d1\u751f\u53d8\u5316\uff0c\u73b0\u5728\u03b2= +\u221e\u5c06\u4e0e\u53ef\u7528\u7684\u540e\u7eed\u8282\u70b9\u503c\u8fdb\u884c\u6bd4\u8f83\uff0c\u5373min(\u221e\uff0c3) = 3\uff0c\u56e0\u6b64\u5728\u8282\u70b9B\u5904\u73b0\u5728\u03b1=-\u221e\uff0c\u03b2= 3\u3001\n <\/div>\n

AI Alpha-Beta\u526a\u679d_https:\/\/bianchenghao6.com_\u3010ai \u6559\u7a0b\u3011_\u7b2c2\u5f20 <\/p>\n

\n \u4e0b\u4e00\u6b65\uff0c\u7b97\u6cd5\u904d\u5386\u8282\u70b9B\u7684\u4e0b\u4e00\u4e2a\u540e\u7ee7\u8282\u70b9\uff0c\u5373\u8282\u70b9E\uff0c\u5e76\u4e14\u8fd8\u5c06\u4f20\u9012\u03b1=-\u221e\u548c\u03b2= 3\u7684\u503c\u3002\n <\/div>\n
\n \u7b2c4\u6b65: <\/strong>\u5728\u8282\u70b9E\u5904\uff0cMax\u65cb\u8f6c\uff0c\u5e76\u4e14alpha\u503c\u5c06\u66f4\u6539\u3002 alpha\u7684\u5f53\u524d\u503c\u5c06\u4e0e5\u8fdb\u884c\u6bd4\u8f83\uff0c\u56e0\u6b64max(-\u221e\uff0c5)= 5\uff0c\u56e0\u6b64\u5728\u8282\u70b9E\u03b1= 5\u548c\u03b2= 3\u5904\uff0c\u5176\u4e2d\u03b1> =\u03b2\uff0c\u56e0\u6b64\u5c06\u526a\u679dE\u7684\u53f3\u540e\u7ee7\uff0c\u5e76\u4e14\u7b97\u6cd5\u5c06\u4e0d\u4f1a\u904d\u5386\u5b83\uff0c\u5e76\u4e14\u8282\u70b9E\u5904\u7684\u503c\u5c06\u4e3a5\u3001\n <\/div>\n

AI Alpha-Beta\u526a\u679d_https:\/\/bianchenghao6.com_\u3010ai \u6559\u7a0b\u3011_\u7b2c3\u5f20 <\/p>\n

\n \u7b2c5\u6b65: <\/strong>: \u4e0b\u4e00\u6b65\uff0c\u7b97\u6cd5\u518d\u6b21\u5c06\u6811\u4ece\u8282\u70b9B\u79fb\u56de\u8282\u70b9A\u3002\u5728\u8282\u70b9A\u5904\uff0calpha\u7684\u503c\u5c06\u88ab\u66f4\u6539\uff0c\u6700\u5927\u53ef\u7528\u503c\u4e3a3\uff0c\u56e0\u4e3amax(-\u221e\uff0c3)= 3\uff0c\u03b2= +\u221e\uff0c\u8fd9\u4e24\u4e2a\u503c\u73b0\u5728\u4f20\u9012\u7ed9A\u7684\u53f3\u540e\u7ee7\u8282\u70b9\uff0c\u5373\u8282\u70b9C\u3002\n <\/div>\n
\n \u5728\u8282\u70b9C\u5904\uff0c\u03b1= 3\u548c\u03b2= +\u221e \uff0c\u5e76\u5c06\u76f8\u540c\u7684\u503c\u4f20\u9012\u5230\u8282\u70b9F\u3002\n <\/div>\n
\n \u6b65\u9aa46: <\/strong>: \u5728\u8282\u70b9F\u5904\uff0c\u5c06\u518d\u6b21\u5c06\u03b1\u7684\u503c\u4e0e\u5de6\u5b50\u7ea70\u8fdb\u884c\u6bd4\u8f83\uff0c\u7136\u540emax(3,0)= 3\uff0c\u7136\u540e\u4e0e\u53f3\u5b50\u5143\u7d201\u6bd4\u8f83\uff0cmax(3,1)= 3\u4ecd\u7136\u4fdd\u63013\uff0c\u4f46F\u7684\u8282\u70b9\u503c\u5c06\u53d8\u4e3a1\u3001\n <\/div>\n

AI Alpha-Beta\u526a\u679d_https:\/\/bianchenghao6.com_\u3010ai \u6559\u7a0b\u3011_\u7b2c4\u5f20 <\/p>\n

\n \u6b65\u9aa47: <\/strong>: \u8282\u70b9F\u5c06\u8282\u70b9\u503c1\u8fd4\u56de\u5230\u8282\u70b9C\uff0c\u5728C\u03b1= 3\u548c\u03b2= +\u221e\u7684\u60c5\u51b5\u4e0b\uff0c\u03b2\u7684\u503c\u5c06\u88ab\u66f4\u6539\uff0c\u5b83\u5c06\u8fdb\u884c\u6bd4\u8f831 min(\u221e\uff0c1)=1\u3001\u73b0\u5728\u5728C\u5904\uff0c\u03b1= 3\u548c\u03b2= 1\uff0c\u5b83\u53c8\u6ee1\u8db3\u6761\u4ef6\u03b1> =\u03b2\uff0c\u56e0\u6b64\u5c06\u526a\u679d\u6389C\u7684\u4e0b\u4e00\u4e2a\u5b69\u5b50\uff0c\u5373G\uff0c\u7b97\u6cd5\u4e0d\u4f1a\u8ba1\u7b97\u6574\u4e2a\u5b50\u6811G\u3002\n <\/div>\n

AI Alpha-Beta\u526a\u679d_https:\/\/bianchenghao6.com_\u3010ai \u6559\u7a0b\u3011_\u7b2c5\u5f20 <\/p>\n

\n \u6b65\u9aa48: <\/strong> C\u73b0\u5728\u5c06\u503c1\u8fd4\u56de\u7ed9A\uff0c\u8fd9\u91ccA\u7684\u6700\u4f73\u503c\u662fmax(3\uff0c1)=3\u3001\u4e0b\u9762\u662f\u6700\u7ec8\u7684\u6e38\u620f\u6811\uff0c\u5b83\u663e\u793a\u4e86\u8ba1\u7b97\u51fa\u7684\u8282\u70b9\u548c\u4ece\u672a\u8ba1\u7b97\u8fc7\u7684\u8282\u70b9\u3002\u56e0\u6b64\uff0c\u5728\u6b64\u793a\u4f8b\u4e2d\uff0c\u6700\u5927\u5316\u5668\u7684\u6700\u4f73\u503c\u4e3a3\u3001\n <\/div>\n

AI Alpha-Beta\u526a\u679d_https:\/\/bianchenghao6.com_\u3010ai \u6559\u7a0b\u3011_\u7b2c6\u5f20 <\/p>\n

\u5728Alpha-Beta\u526a\u679d\u4e2d\u79fb\u52a8\u987a\u5e8f: <\/h2>\n
\n alpha-beta\u526a\u679d\u7684\u6709\u6548\u6027\u9ad8\u5ea6\u4f9d\u8d56\u4e8e\u68c0\u67e5\u6bcf\u4e2a\u8282\u70b9\u7684\u987a\u5e8f\u3002\u79fb\u52a8\u987a\u5e8f\u662falpha-beta\u526a\u679d\u7684\u91cd\u8981\u65b9\u9762\u3002\n <\/div>\n
\n \u5b83\u53ef\u4ee5\u6709\u4e24\u79cd\u7c7b\u578b:\n <\/div>\n

\u6700\u5dee\u6392\u5e8f<\/strong>: \u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0calpha-beta\u526a\u679d\u7b97\u6cd5\u4e0d\u4f1a\u526a\u679d\u4efb\u4f55\u6811\u4e0a\u7684\u53f6\u5b50\uff0c\u5e76\u4e14\u4e0eminimax\u7b97\u6cd5\u5b8c\u5168\u4e00\u6837\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u7531\u4e8ealpha-beta\u56e0\u7d20\uff0c\u5b83\u8fd8\u4f1a\u6d88\u8017\u66f4\u591a\u7684\u65f6\u95f4\uff0c\u8fd9\u79cd\u526a\u679d\u52a8\u4f5c\u88ab\u79f0\u4e3a\u6700\u5dee\u6392\u5e8f\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6700\u4f73\u79fb\u52a8\u53d1\u751f\u5728\u6811\u7684\u53f3\u4fa7\u3002\u8fd9\u6837\u7684\u8ba2\u5355\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u4e3aO(b m <\/sup>)\u3002<\/span>
\n \u7406\u60f3\u6392\u5e8f<\/strong>: \u5f53\u5728\u6811\u4e2d\u8fdb\u884c\u5927\u91cf\u526a\u679d\u65f6\uff0c\u53d1\u751f\u7406\u60f3\u7684alpha-beta\u526a\u679d\u987a\u5e8f\uff0c\u5e76\u4e14\u6700\u4f73\u79fb\u52a8\u53d1\u751f\u5728\u6811\u7684\u5de6\u4fa7\u3002\u6211\u4eec\u5e94\u7528DFS\uff0c\u56e0\u6b64\u5b83\u9996\u5148\u5728\u6811\u7684\u5de6\u4fa7\u641c\u7d22\uff0c\u5e76\u4e14\u5728\u76f8\u540c\u7684\u65f6\u95f4\u5185\u7ecf\u8fc7\u4e24\u6b21\u6700\u5c0f\u6df1\u5ea6\u7b97\u6cd5\u3002\u7406\u60f3\u6392\u5e8f\u7684\u590d\u6742\u5ea6\u4e3aO(b m\/2 <\/sup>)\u3002<\/span> <\/p>\n

\u627e\u5230\u826f\u597d\u987a\u5e8f\u7684\u89c4\u5219: <\/h2>\n
\n \u4ee5\u4e0b\u662f\u4e00\u4e9b\u5728alpha-beta\u526a\u679d\u4e2d\u627e\u5230\u826f\u597d\u987a\u5e8f\u7684\u89c4\u5219:\n <\/div>\n

\u4ece\u6700\u6d45\u7684\u8282\u70b9\u83b7\u5f97\u6700\u4f73\u79fb\u52a8\u3002<\/span>
\n \u5bf9\u6811\u4e2d\u7684\u8282\u70b9\u8fdb\u884c\u6392\u5e8f\uff0c\u4ee5\u4fbf\u9996\u5148\u68c0\u67e5\u6700\u4f73\u8282\u70b9\u3002 <\/span>
\n \u4f7f\u7528\u9886\u57df\u77e5\u8bc6\uff0c\u540c\u65f6\u627e\u5230\u6700\u4f73\u65b9\u6cd5\u3002\u4f8b\u5982: \u5bf9\u4e8e\u56fd\u9645\u8c61\u68cb\uff0c\u8bf7\u5c1d\u8bd5\u987a\u5e8f: \u5148\u6355\u83b7\uff0c\u7136\u540e\u5a01\u80c1\uff0c\u7136\u540e\u5411\u524d\u79fb\u52a8\uff0c\u5411\u540e\u79fb\u52a8\u3002<\/span>
\n \u6211\u4eec\u53ef\u4ee5\u4fdd\u7559\u72b6\u6001\uff0c\u56e0\u4e3a\u72b6\u6001\u53ef\u80fd\u4f1a\u91cd\u590d\u3002<\/span> <\/p>\n


\n

<\/body>
\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"AI Alpha-Beta\u526a\u679dzh-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-1361","post","type-post","status-publish","format-standard","hentry","category-aijc"],"_links":{"self":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/1361"}],"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=1361"}],"version-history":[{"count":0,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/1361\/revisions"}],"wp:attachment":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/media?parent=1361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/categories?post=1361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/tags?post=1361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}