文档介绍:ConnectFourusingAlpha-BetaPruningBillyLandowskiCptS5407December2010OverviewBackgroundConnectFourasasearchproblemAlpha-betapruningDetailsaboutwinningHeuristicsImplementation/DemoConclusionBackgroundSoldbyMiltonBradleyinFebruary19742playersAlternateturnsGoal:Connectfourtilesinarowhorizontally,vertically,ordiagonallyConnectFourasaSearchProblem≤7possiblemovesperturnEnumerateeachmoveContinueforeachboardconfigurationPlayer1Player2ConnectFourasaSearchProblemStates:Anyboardconfigurationwithatmostoneplayer’stileineachlocationInitialState::Placeatileofthecurrentplayer’::Aplayerhasfourofhertilesinalineeitherhorizontally,vertically,ordiagonally,orthegameboardisfull(indicatingatie).Utility:+∞ifplayerhasconnectedfour,0ifboardisfull,–∞-betapruningO(bd/2)plexityb=branchingfactor=7d=depth=7×6=putationallyintensiveNeedcut-offdepthCanalsoaddheuristicsWinningConnectFourTowin,playerneedsa“winningline”of43-out-of-4HeuristicTowin,playerneedsa“near”winninglineof33-out-of-4Heuristic(cont.)Counttotal3-out-of-4“unblocked”paretoopponentUtility(p,G)=f(p,G)–f(opponent(p),G)f(a,G)=#of3-out-of-4winninglinesforplayeraonboardGScoreboardHeuristicExtend3-out-of-4heuristicton-out-of-4forn≤3AwardweightedpointsbasedonthevalueofnScore(p,G)=100(n3)+10(n2)+1(n1)niisthenumberofi-out-of-4winninglinesforplayerpongameboardG