SlideShare a Scribd company logo
Adversarial Search
- Dheerendra
Outline
 Introduction
 Game as search problems
 Optimal decisions- Minimax Algorithm
 α - β Pruning
 Imperfect, real-time decision
Adversarial search
 Examine the problem that arise when we try to plan ahead in a world
where other agent are planning against us.
 A good example is in board game.
 Adversarial games, while much studies in AI, are a small part of game
theory in economics.
Typical AI assumptions
 Two agents whose actions alternates.
 Utility values for each agents are opposite to each other.
 Creates the adversarial situation.
 Fully observable environment.
 In game theory terms: Zero-sum games of perfect information.
Search versus Games
 Search – no adversary
 Solution is (heuristic) method of finding goal.
 Heuristic techniques can find the optimal solution.
 Evaluation function: estimate of cost from start to goal through given node.
 Example: path finding, scheduling activities.
 Game – adversary
 Solution is strategy (strategy specifies moves for every possible opponent reply.
 Optimality depends on opponents.
 Time limit force an approximation solution.
 Evaluation function: evaluate “goodness” of game position.
 Examples: Chess, Checkers, GO.
Game setup
 Two player: MAX and MIN.
 MAX moves first and they take turns until game is over.
 Winner get awarded, looser get penalty.
 Game as search:
 Initial state: e.g. board configuration of the chess.
 Successor function: list of( move, state) pairs specifying legal moves.
 Terminal test: is the game finished?
 Utility function: gives numerical values of terminal state. E.g. win(+1), lose(-1)
or draw(0) in tic-tac-toe or chess.
 MAX uses search tree to determine the next move.
Partial game tree for tic-tac-toe
Minimax strategy: look ahead and reason
backward
 Find the optimal strategy for MAX assuming an infallible MIN opponent.
 Need to compute this all the down the tree.
 Complete depth first exploration of the game tree.
 Assumption: Both players play optimally.
 Given a game tree, the optimal strategy can be determined by using the
minimax value of each node.
Two-ply game tree
Practical problem with minimax search
 Number of game state is exponential in the number of moves
 Solution: do not examine every node.
=> pruning
Remove branches that do not influence the final decision.
Alpha-beta algorithm
 Depth-first search only consider nodes along a single path at any time.
α= highest value choice that we can guarantee for MAX so far in the current
subtree.
β= lowest value choice that we can guarantee for MIN so far in the current
subtree.
 Update value for α and β during search and prunes remaining branches as
soon as the value is known to be worse than the current α or β value for
MAX or MIN.
Alpha-Beta example
 Do depth-first search until first leaf
(1) (2)
Alpha-Beta example(continued)
(3) (4)
Alpha-Beta example(continued)
(5) (6)
Alpha-Beta example(continued)
(7) (8)
Alpha-Beta example(continued)
(9)
Effectiveness of Alpha-beta search
 Worst-case
 Branches are ordered so that no pruning takes place. In this case alpha-beta
gives no improvement over exhaustive search.
 Best-case
 Each player’s best move is the left-most alternative.
 In practice, performance is closer to best rather than worst-case.
 In practice, often get O(b(d/2)) rather than O(bd)
 This is same as having branching factor of sqrt(b)
 Since (sqrt(b))d =b(d/2)
 i.e., we have effectively gone from b to square root of b
 E.g., in chess go from b~35 to b~6
 This permits much deeper search in the same amount of time.
 Typically twice as deep.
Final comments about Alpha-beta
Pruning
 Pruning does not affect the final result.
 Entire subtree can be pruned.
 Good move ordering improves effectiveness of pruning.
 Repeated states are again possible.
 Store them in memory = transposition table.
Practical implementation
How do we make these ideas practical in real life game trees?
Standard approach:
 Cut-off test: (where do we stop descending the tree)
 Depth limit
 Better: iterative deepening
 Cut-off only when no big changes are expected to occur next (quiescence search)
 Evaluation function
 When the search is cut-off, we evaluate the current state by estimating its utility using
an evaluation function.
Static (Heuristic) Evaluation Function
 An evaluation function:
 Estimate how good the current board configuration is for a player.
 Typically, one figures out how it is for the player, and how good for the opponent, and
subtract the opponent score from the players.
 Chess : value of white pieces – value of black pieces
 Typical values from –infinity(loss) to +infinity(win) or[-1,+1].
 If the board evaluation is X for a player, it is –X for opponent.
 Many clever ideas about how to use the evaluation function.
 E.g. null move heuristic: let opponent moves twice.
 Examples
 Chess
 Checkers
 Tic-tac-toe
Iterative (Progressive) Deepening
 In real games, there is usually a time limit T on making a move.
 How do we take this into account?
 Using alpha-beta we cannot use “partial” result with any confidence unless the full
breadth of the tree has been searched.
 So, we could be conservative and set a conservative depth-limit which guarantees that
we will find a move in time < T.
 Disadvantage is that we may finish early, could do more search.
 In practice, iterative deepening search (IDS) is used
 IDS runs depth first search with an increasing depth limit.
 When the clock runs out we use the solution found at the previous depth limit.
The state of play
 Checkers
 Chinook ended 40-year reign of human world-champion Marion Tinsley in 1994.
 Chess
 Deep blue defeated human world-champion Garry Kasparov in a six-game match in
1997.
 GO
 AlphaGo developed by Alphabet Inc. ‘s Google DeepMind, beats Ke Jie, the world
No. 1 ranked Go player at the time, in 2017.
 See (e.g.) http://www.cs.ualberta.ac/~games for more information's.
Conclusion
 Game playing can be effectively modelled as a search problem.
 Game tree represent alternate computer/opponent moves.
 Evaluation functions estimate the quality of a given board configuration for
the MAX player.
 Minimax is a approach which choose move by assuming that opponent will
always choose the move which is best for them.
 Alpha-beta is a procedure which can prune large parts of the search tree and
allow search to go deeper.
 For many very well known games, computer algorithms based on heuristic
search match or out-perform the human world expert.
References

More Related Content

What's hot

I. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AII. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AI
vikas dhakane
 
AI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction ProblemAI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction Problem
Mohammad Imam Hossain
 
Alpha-Beta Search
Alpha-Beta SearchAlpha-Beta Search
Alpha-Beta Search
Harshit Thakur
 
Heuristic search
Heuristic searchHeuristic search
Heuristic search
NivethaS35
 
Minimax
MinimaxMinimax
Minimax
Nagarajan
 
Solving problems by searching
Solving problems by searchingSolving problems by searching
Solving problems by searchingLuigi Ceccaroni
 
AI Lecture 4 (informed search and exploration)
AI Lecture 4 (informed search and exploration)AI Lecture 4 (informed search and exploration)
AI Lecture 4 (informed search and exploration)
Tajim Md. Niamat Ullah Akhund
 
Local search algorithm
Local search algorithmLocal search algorithm
Local search algorithm
Megha Sharma
 
AI local search
AI local searchAI local search
AI local search
Renas Rekany
 
AI: AI & Problem Solving
AI: AI & Problem SolvingAI: AI & Problem Solving
AI: AI & Problem Solving
DataminingTools Inc
 
5 csp
5 csp5 csp
5 csp
Mhd Sb
 
AI 6 | Adversarial Search
AI 6 | Adversarial SearchAI 6 | Adversarial Search
AI 6 | Adversarial Search
Mohammad Imam Hossain
 
AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)
Tajim Md. Niamat Ullah Akhund
 
Stuart russell and peter norvig artificial intelligence - a modern approach...
Stuart russell and peter norvig   artificial intelligence - a modern approach...Stuart russell and peter norvig   artificial intelligence - a modern approach...
Stuart russell and peter norvig artificial intelligence - a modern approach...
Lê Anh Đạt
 
A* Search Algorithm
A* Search AlgorithmA* Search Algorithm
A* Search Algorithm
vikas dhakane
 
Problem Solving
Problem Solving Problem Solving
Problem Solving
Amar Jukuntla
 
Game Playing in Artificial Intelligence
Game Playing in Artificial IntelligenceGame Playing in Artificial Intelligence
Game Playing in Artificial Intelligence
lordmwesh
 
Alpha beta pruning in ai
Alpha beta pruning in aiAlpha beta pruning in ai
Alpha beta pruning in ai
Savyasachi14
 
Constraint satisfaction problems (csp)
Constraint satisfaction problems (csp)   Constraint satisfaction problems (csp)
Constraint satisfaction problems (csp)
Archana432045
 
Uncertain Knowledge and Reasoning in Artificial Intelligence
Uncertain Knowledge and Reasoning in Artificial IntelligenceUncertain Knowledge and Reasoning in Artificial Intelligence
Uncertain Knowledge and Reasoning in Artificial Intelligence
Experfy
 

What's hot (20)

I. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AII. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AI
 
AI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction ProblemAI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction Problem
 
Alpha-Beta Search
Alpha-Beta SearchAlpha-Beta Search
Alpha-Beta Search
 
Heuristic search
Heuristic searchHeuristic search
Heuristic search
 
Minimax
MinimaxMinimax
Minimax
 
Solving problems by searching
Solving problems by searchingSolving problems by searching
Solving problems by searching
 
AI Lecture 4 (informed search and exploration)
AI Lecture 4 (informed search and exploration)AI Lecture 4 (informed search and exploration)
AI Lecture 4 (informed search and exploration)
 
Local search algorithm
Local search algorithmLocal search algorithm
Local search algorithm
 
AI local search
AI local searchAI local search
AI local search
 
AI: AI & Problem Solving
AI: AI & Problem SolvingAI: AI & Problem Solving
AI: AI & Problem Solving
 
5 csp
5 csp5 csp
5 csp
 
AI 6 | Adversarial Search
AI 6 | Adversarial SearchAI 6 | Adversarial Search
AI 6 | Adversarial Search
 
AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)
 
Stuart russell and peter norvig artificial intelligence - a modern approach...
Stuart russell and peter norvig   artificial intelligence - a modern approach...Stuart russell and peter norvig   artificial intelligence - a modern approach...
Stuart russell and peter norvig artificial intelligence - a modern approach...
 
A* Search Algorithm
A* Search AlgorithmA* Search Algorithm
A* Search Algorithm
 
Problem Solving
Problem Solving Problem Solving
Problem Solving
 
Game Playing in Artificial Intelligence
Game Playing in Artificial IntelligenceGame Playing in Artificial Intelligence
Game Playing in Artificial Intelligence
 
Alpha beta pruning in ai
Alpha beta pruning in aiAlpha beta pruning in ai
Alpha beta pruning in ai
 
Constraint satisfaction problems (csp)
Constraint satisfaction problems (csp)   Constraint satisfaction problems (csp)
Constraint satisfaction problems (csp)
 
Uncertain Knowledge and Reasoning in Artificial Intelligence
Uncertain Knowledge and Reasoning in Artificial IntelligenceUncertain Knowledge and Reasoning in Artificial Intelligence
Uncertain Knowledge and Reasoning in Artificial Intelligence
 

Similar to Adversarial search

AI_unit3.pptx
AI_unit3.pptxAI_unit3.pptx
AI_unit3.pptx
G1719HarshalDafade
 
Minmax and alpha beta pruning.pptx
Minmax and alpha beta pruning.pptxMinmax and alpha beta pruning.pptx
Minmax and alpha beta pruning.pptx
PriyadharshiniG41
 
Badiya haihn
Badiya haihnBadiya haihn
Badiya haihn
amitp26
 
Game playing
Game playingGame playing
Game playing
Tribhuvan University
 
AI subject - Game Theory and cps ppt pptx
AI subject  - Game Theory and cps ppt pptxAI subject  - Game Theory and cps ppt pptx
AI subject - Game Theory and cps ppt pptx
nizmishaik1
 
cai
caicai
ch_5 Game playing Min max and Alpha Beta pruning.ppt
ch_5 Game playing Min max and Alpha Beta pruning.pptch_5 Game playing Min max and Alpha Beta pruning.ppt
ch_5 Game playing Min max and Alpha Beta pruning.ppt
SanGeet25
 
AI3391 Artificial Intelligence UNIT III Notes_merged.pdf
AI3391 Artificial Intelligence UNIT III Notes_merged.pdfAI3391 Artificial Intelligence UNIT III Notes_merged.pdf
AI3391 Artificial Intelligence UNIT III Notes_merged.pdf
Asst.prof M.Gokilavani
 
cs-171-07-Games and Adversarila Search.ppt
cs-171-07-Games and Adversarila Search.pptcs-171-07-Games and Adversarila Search.ppt
cs-171-07-Games and Adversarila Search.ppt
Samiksha880257
 
Topic - 6 (Game Playing).ppt
Topic - 6 (Game Playing).pptTopic - 6 (Game Playing).ppt
Topic - 6 (Game Playing).ppt
SabrinaShanta2
 
adversial search.pptx
adversial search.pptxadversial search.pptx
adversial search.pptx
KalaiarasiRaja
 
GamePlaying.ppt
GamePlaying.pptGamePlaying.ppt
GamePlaying.ppt
VihaanN2
 
1.game
1.game1.game
1.game
veeramakali
 
Two player games
Two player gamesTwo player games
Two player games
Subash Chandra Pakhrin
 
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
udayvanand
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
pramod naik
 
Capgemini 1
Capgemini 1Capgemini 1
Capgemini 1
berasrujana
 
Games
GamesGames

Similar to Adversarial search (20)

AI_unit3.pptx
AI_unit3.pptxAI_unit3.pptx
AI_unit3.pptx
 
Minmax and alpha beta pruning.pptx
Minmax and alpha beta pruning.pptxMinmax and alpha beta pruning.pptx
Minmax and alpha beta pruning.pptx
 
AI Lesson 07
AI Lesson 07AI Lesson 07
AI Lesson 07
 
Badiya haihn
Badiya haihnBadiya haihn
Badiya haihn
 
Game playing
Game playingGame playing
Game playing
 
AI subject - Game Theory and cps ppt pptx
AI subject  - Game Theory and cps ppt pptxAI subject  - Game Theory and cps ppt pptx
AI subject - Game Theory and cps ppt pptx
 
cai
caicai
cai
 
Games.4
Games.4Games.4
Games.4
 
ch_5 Game playing Min max and Alpha Beta pruning.ppt
ch_5 Game playing Min max and Alpha Beta pruning.pptch_5 Game playing Min max and Alpha Beta pruning.ppt
ch_5 Game playing Min max and Alpha Beta pruning.ppt
 
AI3391 Artificial Intelligence UNIT III Notes_merged.pdf
AI3391 Artificial Intelligence UNIT III Notes_merged.pdfAI3391 Artificial Intelligence UNIT III Notes_merged.pdf
AI3391 Artificial Intelligence UNIT III Notes_merged.pdf
 
cs-171-07-Games and Adversarila Search.ppt
cs-171-07-Games and Adversarila Search.pptcs-171-07-Games and Adversarila Search.ppt
cs-171-07-Games and Adversarila Search.ppt
 
Topic - 6 (Game Playing).ppt
Topic - 6 (Game Playing).pptTopic - 6 (Game Playing).ppt
Topic - 6 (Game Playing).ppt
 
adversial search.pptx
adversial search.pptxadversial search.pptx
adversial search.pptx
 
GamePlaying.ppt
GamePlaying.pptGamePlaying.ppt
GamePlaying.ppt
 
1.game
1.game1.game
1.game
 
Two player games
Two player gamesTwo player games
Two player games
 
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
 
Capgemini 1
Capgemini 1Capgemini 1
Capgemini 1
 
Games
GamesGames
Games
 

Recently uploaded

HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 

Recently uploaded (20)

HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 

Adversarial search

  • 2. Outline  Introduction  Game as search problems  Optimal decisions- Minimax Algorithm  α - β Pruning  Imperfect, real-time decision
  • 3. Adversarial search  Examine the problem that arise when we try to plan ahead in a world where other agent are planning against us.  A good example is in board game.  Adversarial games, while much studies in AI, are a small part of game theory in economics.
  • 4. Typical AI assumptions  Two agents whose actions alternates.  Utility values for each agents are opposite to each other.  Creates the adversarial situation.  Fully observable environment.  In game theory terms: Zero-sum games of perfect information.
  • 5. Search versus Games  Search – no adversary  Solution is (heuristic) method of finding goal.  Heuristic techniques can find the optimal solution.  Evaluation function: estimate of cost from start to goal through given node.  Example: path finding, scheduling activities.  Game – adversary  Solution is strategy (strategy specifies moves for every possible opponent reply.  Optimality depends on opponents.  Time limit force an approximation solution.  Evaluation function: evaluate “goodness” of game position.  Examples: Chess, Checkers, GO.
  • 6. Game setup  Two player: MAX and MIN.  MAX moves first and they take turns until game is over.  Winner get awarded, looser get penalty.  Game as search:  Initial state: e.g. board configuration of the chess.  Successor function: list of( move, state) pairs specifying legal moves.  Terminal test: is the game finished?  Utility function: gives numerical values of terminal state. E.g. win(+1), lose(-1) or draw(0) in tic-tac-toe or chess.  MAX uses search tree to determine the next move.
  • 7. Partial game tree for tic-tac-toe
  • 8. Minimax strategy: look ahead and reason backward  Find the optimal strategy for MAX assuming an infallible MIN opponent.  Need to compute this all the down the tree.  Complete depth first exploration of the game tree.  Assumption: Both players play optimally.  Given a game tree, the optimal strategy can be determined by using the minimax value of each node.
  • 10. Practical problem with minimax search  Number of game state is exponential in the number of moves  Solution: do not examine every node. => pruning Remove branches that do not influence the final decision.
  • 11. Alpha-beta algorithm  Depth-first search only consider nodes along a single path at any time. α= highest value choice that we can guarantee for MAX so far in the current subtree. β= lowest value choice that we can guarantee for MIN so far in the current subtree.  Update value for α and β during search and prunes remaining branches as soon as the value is known to be worse than the current α or β value for MAX or MIN.
  • 12. Alpha-Beta example  Do depth-first search until first leaf (1) (2)
  • 17. Effectiveness of Alpha-beta search  Worst-case  Branches are ordered so that no pruning takes place. In this case alpha-beta gives no improvement over exhaustive search.  Best-case  Each player’s best move is the left-most alternative.  In practice, performance is closer to best rather than worst-case.  In practice, often get O(b(d/2)) rather than O(bd)  This is same as having branching factor of sqrt(b)  Since (sqrt(b))d =b(d/2)  i.e., we have effectively gone from b to square root of b  E.g., in chess go from b~35 to b~6  This permits much deeper search in the same amount of time.  Typically twice as deep.
  • 18. Final comments about Alpha-beta Pruning  Pruning does not affect the final result.  Entire subtree can be pruned.  Good move ordering improves effectiveness of pruning.  Repeated states are again possible.  Store them in memory = transposition table.
  • 19. Practical implementation How do we make these ideas practical in real life game trees? Standard approach:  Cut-off test: (where do we stop descending the tree)  Depth limit  Better: iterative deepening  Cut-off only when no big changes are expected to occur next (quiescence search)  Evaluation function  When the search is cut-off, we evaluate the current state by estimating its utility using an evaluation function.
  • 20. Static (Heuristic) Evaluation Function  An evaluation function:  Estimate how good the current board configuration is for a player.  Typically, one figures out how it is for the player, and how good for the opponent, and subtract the opponent score from the players.  Chess : value of white pieces – value of black pieces  Typical values from –infinity(loss) to +infinity(win) or[-1,+1].  If the board evaluation is X for a player, it is –X for opponent.  Many clever ideas about how to use the evaluation function.  E.g. null move heuristic: let opponent moves twice.  Examples  Chess  Checkers  Tic-tac-toe
  • 21. Iterative (Progressive) Deepening  In real games, there is usually a time limit T on making a move.  How do we take this into account?  Using alpha-beta we cannot use “partial” result with any confidence unless the full breadth of the tree has been searched.  So, we could be conservative and set a conservative depth-limit which guarantees that we will find a move in time < T.  Disadvantage is that we may finish early, could do more search.  In practice, iterative deepening search (IDS) is used  IDS runs depth first search with an increasing depth limit.  When the clock runs out we use the solution found at the previous depth limit.
  • 22. The state of play  Checkers  Chinook ended 40-year reign of human world-champion Marion Tinsley in 1994.  Chess  Deep blue defeated human world-champion Garry Kasparov in a six-game match in 1997.  GO  AlphaGo developed by Alphabet Inc. ‘s Google DeepMind, beats Ke Jie, the world No. 1 ranked Go player at the time, in 2017.  See (e.g.) http://www.cs.ualberta.ac/~games for more information's.
  • 23. Conclusion  Game playing can be effectively modelled as a search problem.  Game tree represent alternate computer/opponent moves.  Evaluation functions estimate the quality of a given board configuration for the MAX player.  Minimax is a approach which choose move by assuming that opponent will always choose the move which is best for them.  Alpha-beta is a procedure which can prune large parts of the search tree and allow search to go deeper.  For many very well known games, computer algorithms based on heuristic search match or out-perform the human world expert.