SlideShare a Scribd company logo
Adversarial Search
Min Max Search
Lecture-22
Hema Kashyap
1
Introduction
• The minimax algorithm is a way of finding an optimal move in a two
player game. In the search tree for a two-player game, there are two kinds
of nodes, nodes representing yourmoves and nodes representing your
opponent's moves. Nodes representing your moves are generally drawn as
squares (or possibly upward pointing triangles):
• Below given symbols are also called MAX nodes. The goal at a MAX node
is to maximize the value of the subtree rooted at that node. To do this, a
MAX node chooses the child with the greatest value, and that becomes the
value of the MAX node.
2
• Below given are called MIN nodes. The goal at a MIN node is to minimize
the value of the subtree rooted at that node. To do this, a MIN node chooses
the child with the smallest value, and that becomes the value of the MIN
node.
3
Min Max Algorithm
4
Example: tic-tac-toe
• e (evaluation function → integer) = number of
available rows, columns, diagonals for MAX -
number of available rows, columns, diagonals
for MIN
• MAX plays with “X” and desires maximizing e.
• MIN plays with “0” and desires minimizing e.
• Symmetries are taken into account.
• A depth limit is used (2, in the example).
5
Example: tic-tac-toe
6
Example: tic-tac-toe
7
Example: tic-tac-toe
8
Example
• To demonstrate the minimax algorithm, I'm going to use the following tree.
Note that it's typical for two player games to have different branching
factors at each node. The move I make could make restrictions on what
moves are possible for the other player, or possibly remove restrictions.
Note also that in this example, we're ignoring what the game or the probem
space are in order to focus on the algorithm.
9
Example
• So now you've seen the whole search tree. For the rest of the diagrams, I'll
only show the portion of the tree that we've already explored at that
particular time. Thus, when we start the problem, all minimax sees is the
start node:
10
Example
• It begins like a depth first search, generating the first child. Then we see
this:
11
Example
• So far we've really seen no
evaluation values. The way
minimax works is to go down a
specified number of full moves
(where one "full move" is actually
a move by you and a move by your
opponent), then calculate
evaluation values for states at that
depth. For this example, we're
going to go down one full move,
which is one more level. When we
generate the values for those nodes,
here is what we see:
12
Example
• Now we have the values of the
children of the min node, so it
can do its work. It chooses the
minimum of the two child node
values, which is 3. Now we
have this:
13
Example
• The max node at the top still
has two other children nodes
that we need to generate and
search. We go on and generate
the second node and generate its
child. Since there is only one
child, the min node must take
it's value, and we have this:
14
Example
• Finally, minimax generates the
third child of the top-level max
node, generates its children, and
evaluates them:
15
Example
• Now the third min node chooses the
minimum of it's child node values, 1, and
we have this:
16
Example
• Finally we have all of the values of
the children of the max node at the
top level, so it chooses the
maximum of them, 15, and we get
the final solution:
17
Analysis
• The minimax algorithm performs a complete
depth-first exploration of the game tree.
• In minimax, at each point in the process, only
the nodes along a path of the tree are
considered and kept in memory.
18
Analysis
• If the maximum depth of the tree is m, and
there are b legal moves at each point, then
the time complexity is O(bm).
• The space complexity is:
– O(bm) for an algorithm that generates all
successors at once
– O(m) if it generates successors one at a time.
19

More Related Content

What's hot

Artificial intelligence games
Artificial intelligence gamesArtificial intelligence games
Artificial intelligence games
Sujithmlamthadam
 
Game Tree ( Oyun Ağaçları )
Game Tree ( Oyun Ağaçları )Game Tree ( Oyun Ağaçları )
Game Tree ( Oyun Ağaçları )
Alp Çoker
 
Two player games
Two player gamesTwo player games
Two player games
Subash Chandra Pakhrin
 
Games
GamesGames
Chess engine presentation
Chess engine presentationChess engine presentation
Chess engine presentation
TanushreeSharma34
 
Game theory
Game theoryGame theory
Game theory
Pooya Sagharchiha
 
Game theory in network security
Game theory in network securityGame theory in network security
Game theory in network security
RahmaSallam
 
Game Playing in Artificial Intelligence
Game Playing in Artificial IntelligenceGame Playing in Artificial Intelligence
Game Playing in Artificial Intelligence
lordmwesh
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
Altafur Rahman
 
Project on ai gaming
Project on ai gamingProject on ai gaming
Project on ai gaming
Roshan Panday
 
Game playing in artificial intelligent technique
Game playing in artificial intelligent technique Game playing in artificial intelligent technique
Game playing in artificial intelligent technique
syeda zoya mehdi
 
Modeling of players_activity_michel pierfitte_ubisoft_septembre 2013
Modeling of players_activity_michel pierfitte_ubisoft_septembre 2013Modeling of players_activity_michel pierfitte_ubisoft_septembre 2013
Modeling of players_activity_michel pierfitte_ubisoft_septembre 2013Johan-André Jeanville
 
Innovative Combat By Stoutheart
Innovative Combat By StoutheartInnovative Combat By Stoutheart
Innovative Combat By Stoutheart
dkappes
 
Capgemini 1
Capgemini 1Capgemini 1
Capgemini 1
berasrujana
 
Game Playing
Game Playing Game Playing
Game Playing
Maham Huda
 
Fun Getting into Trouble
Fun Getting into TroubleFun Getting into Trouble
Fun Getting into TroubleLorisha Riley
 
Game theory
Game theoryGame theory
Badiya haihn
Badiya haihnBadiya haihn
Badiya haihn
amitp26
 
Learning Through Gaming
Learning Through GamingLearning Through Gaming
Learning Through Gaming
Colin Smith-Clark
 

What's hot (20)

Artificial intelligence games
Artificial intelligence gamesArtificial intelligence games
Artificial intelligence games
 
Game Tree ( Oyun Ağaçları )
Game Tree ( Oyun Ağaçları )Game Tree ( Oyun Ağaçları )
Game Tree ( Oyun Ağaçları )
 
AI Lesson 07
AI Lesson 07AI Lesson 07
AI Lesson 07
 
Two player games
Two player gamesTwo player games
Two player games
 
Games
GamesGames
Games
 
Chess engine presentation
Chess engine presentationChess engine presentation
Chess engine presentation
 
Game theory
Game theoryGame theory
Game theory
 
Game theory in network security
Game theory in network securityGame theory in network security
Game theory in network security
 
Game Playing in Artificial Intelligence
Game Playing in Artificial IntelligenceGame Playing in Artificial Intelligence
Game Playing in Artificial Intelligence
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Project on ai gaming
Project on ai gamingProject on ai gaming
Project on ai gaming
 
Game playing in artificial intelligent technique
Game playing in artificial intelligent technique Game playing in artificial intelligent technique
Game playing in artificial intelligent technique
 
Modeling of players_activity_michel pierfitte_ubisoft_septembre 2013
Modeling of players_activity_michel pierfitte_ubisoft_septembre 2013Modeling of players_activity_michel pierfitte_ubisoft_septembre 2013
Modeling of players_activity_michel pierfitte_ubisoft_septembre 2013
 
Innovative Combat By Stoutheart
Innovative Combat By StoutheartInnovative Combat By Stoutheart
Innovative Combat By Stoutheart
 
Capgemini 1
Capgemini 1Capgemini 1
Capgemini 1
 
Game Playing
Game Playing Game Playing
Game Playing
 
Fun Getting into Trouble
Fun Getting into TroubleFun Getting into Trouble
Fun Getting into Trouble
 
Game theory
Game theoryGame theory
Game theory
 
Badiya haihn
Badiya haihnBadiya haihn
Badiya haihn
 
Learning Through Gaming
Learning Through GamingLearning Through Gaming
Learning Through Gaming
 

Similar to Lecture 22 adversarial search

AI3391 Artificial intelligence Session 15 Min Max Algorithm.pptx
AI3391 Artificial intelligence Session 15  Min Max Algorithm.pptxAI3391 Artificial intelligence Session 15  Min Max Algorithm.pptx
AI3391 Artificial intelligence Session 15 Min Max Algorithm.pptx
Asst.prof M.Gokilavani
 
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
 
adversial search.pptx
adversial search.pptxadversial search.pptx
adversial search.pptx
KalaiarasiRaja
 
cai
caicai
Minimax
MinimaxMinimax
Minimax
sabairshad4
 
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
udayvanand
 
Minmax and alpha beta pruning.pptx
Minmax and alpha beta pruning.pptxMinmax and alpha beta pruning.pptx
Minmax and alpha beta pruning.pptx
PriyadharshiniG41
 
Unit3_1.pdf
Unit3_1.pdfUnit3_1.pdf
Unit3_1.pdf
Pratimakumari213460
 
MINI-MAX ALGORITHM.pptx
MINI-MAX ALGORITHM.pptxMINI-MAX ALGORITHM.pptx
MINI-MAX ALGORITHM.pptx
NayanChandak1
 
Unit_I_Introduction(Part_III).ppt
Unit_I_Introduction(Part_III).pptUnit_I_Introduction(Part_III).ppt
Unit_I_Introduction(Part_III).ppt
ganesh15478
 
Greedy algorithm pptxe file for computer
Greedy algorithm pptxe file for computerGreedy algorithm pptxe file for computer
Greedy algorithm pptxe file for computer
kerimu1235
 
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
22bcs058
 
Practical AI for Business: Bandit Algorithms
Practical AI for Business: Bandit AlgorithmsPractical AI for Business: Bandit Algorithms
Practical AI for Business: Bandit Algorithms
SC5.io
 
Topic - 6 (Game Playing).ppt
Topic - 6 (Game Playing).pptTopic - 6 (Game Playing).ppt
Topic - 6 (Game Playing).ppt
SabrinaShanta2
 
Game playing (tic tac-toe), andor graph
Game playing (tic tac-toe), andor graphGame playing (tic tac-toe), andor graph
Game playing (tic tac-toe), andor graph
Syed Zaid Irshad
 
AI_Session 14 Min Max Algorithm.pptx
AI_Session 14 Min Max Algorithm.pptxAI_Session 14 Min Max Algorithm.pptx
AI_Session 14 Min Max Algorithm.pptx
Asst.prof M.Gokilavani
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
Shiwani Gupta
 
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
 
Exploring Algorithms
Exploring AlgorithmsExploring Algorithms
Exploring AlgorithmsSri Prasanna
 

Similar to Lecture 22 adversarial search (20)

AI3391 Artificial intelligence Session 15 Min Max Algorithm.pptx
AI3391 Artificial intelligence Session 15  Min Max Algorithm.pptxAI3391 Artificial intelligence Session 15  Min Max Algorithm.pptx
AI3391 Artificial intelligence Session 15 Min Max Algorithm.pptx
 
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
 
adversial search.pptx
adversial search.pptxadversial search.pptx
adversial search.pptx
 
cai
caicai
cai
 
Minimax
MinimaxMinimax
Minimax
 
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
 
Minmax and alpha beta pruning.pptx
Minmax and alpha beta pruning.pptxMinmax and alpha beta pruning.pptx
Minmax and alpha beta pruning.pptx
 
Unit3_1.pdf
Unit3_1.pdfUnit3_1.pdf
Unit3_1.pdf
 
MINI-MAX ALGORITHM.pptx
MINI-MAX ALGORITHM.pptxMINI-MAX ALGORITHM.pptx
MINI-MAX ALGORITHM.pptx
 
CNN.pptx
CNN.pptxCNN.pptx
CNN.pptx
 
Unit_I_Introduction(Part_III).ppt
Unit_I_Introduction(Part_III).pptUnit_I_Introduction(Part_III).ppt
Unit_I_Introduction(Part_III).ppt
 
Greedy algorithm pptxe file for computer
Greedy algorithm pptxe file for computerGreedy algorithm pptxe file for computer
Greedy algorithm pptxe file for computer
 
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
 
Practical AI for Business: Bandit Algorithms
Practical AI for Business: Bandit AlgorithmsPractical AI for Business: Bandit Algorithms
Practical AI for Business: Bandit Algorithms
 
Topic - 6 (Game Playing).ppt
Topic - 6 (Game Playing).pptTopic - 6 (Game Playing).ppt
Topic - 6 (Game Playing).ppt
 
Game playing (tic tac-toe), andor graph
Game playing (tic tac-toe), andor graphGame playing (tic tac-toe), andor graph
Game playing (tic tac-toe), andor graph
 
AI_Session 14 Min Max Algorithm.pptx
AI_Session 14 Min Max Algorithm.pptxAI_Session 14 Min Max Algorithm.pptx
AI_Session 14 Min Max Algorithm.pptx
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
 
I. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AII. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AI
 
Exploring Algorithms
Exploring AlgorithmsExploring Algorithms
Exploring Algorithms
 

More from Hema Kashyap

Lecture 30 introduction to logic
Lecture 30 introduction to logicLecture 30 introduction to logic
Lecture 30 introduction to logic
Hema Kashyap
 
Lecture 29 genetic algorithm-example
Lecture 29 genetic algorithm-exampleLecture 29 genetic algorithm-example
Lecture 29 genetic algorithm-example
Hema Kashyap
 
Lecture 28 genetic algorithm
Lecture 28 genetic algorithmLecture 28 genetic algorithm
Lecture 28 genetic algorithm
Hema Kashyap
 
Lecture 27 simulated annealing
Lecture 27 simulated annealingLecture 27 simulated annealing
Lecture 27 simulated annealing
Hema Kashyap
 
Lecture 26 local beam search
Lecture 26 local beam searchLecture 26 local beam search
Lecture 26 local beam search
Hema Kashyap
 
Lecture 25 hill climbing
Lecture 25 hill climbingLecture 25 hill climbing
Lecture 25 hill climbing
Hema Kashyap
 
Lecture 24 iterative improvement algorithm
Lecture 24 iterative improvement algorithmLecture 24 iterative improvement algorithm
Lecture 24 iterative improvement algorithm
Hema Kashyap
 
Lecture 23 alpha beta pruning
Lecture 23 alpha beta pruningLecture 23 alpha beta pruning
Lecture 23 alpha beta pruning
Hema Kashyap
 
Lecture 21 problem reduction search ao star search
Lecture 21 problem reduction search ao star searchLecture 21 problem reduction search ao star search
Lecture 21 problem reduction search ao star search
Hema Kashyap
 
Lecture 20 problem reduction search
Lecture 20 problem reduction searchLecture 20 problem reduction search
Lecture 20 problem reduction search
Hema Kashyap
 
Lecture 19 sma star algorithm
Lecture 19 sma star algorithmLecture 19 sma star algorithm
Lecture 19 sma star algorithm
Hema Kashyap
 
Lecture 18 simplified memory bound a star algorithm
Lecture 18 simplified memory bound a star algorithmLecture 18 simplified memory bound a star algorithm
Lecture 18 simplified memory bound a star algorithm
Hema Kashyap
 
Lecture 17 Iterative Deepening a star algorithm
Lecture 17 Iterative Deepening a star algorithmLecture 17 Iterative Deepening a star algorithm
Lecture 17 Iterative Deepening a star algorithm
Hema Kashyap
 
Lecture 16 memory bounded search
Lecture 16 memory bounded searchLecture 16 memory bounded search
Lecture 16 memory bounded search
Hema Kashyap
 
Lecture 15 monkey banana problem
Lecture 15 monkey banana problemLecture 15 monkey banana problem
Lecture 15 monkey banana problem
Hema Kashyap
 
Lecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithmLecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithm
Hema Kashyap
 
Lecture 13 Criptarithmetic problem
Lecture 13 Criptarithmetic problemLecture 13 Criptarithmetic problem
Lecture 13 Criptarithmetic problem
Hema Kashyap
 
Lecture 12 Heuristic Searches
Lecture 12 Heuristic SearchesLecture 12 Heuristic Searches
Lecture 12 Heuristic Searches
Hema Kashyap
 
Lecture 11 Informed Search
Lecture 11 Informed SearchLecture 11 Informed Search
Lecture 11 Informed Search
Hema Kashyap
 
Lecture 10 Uninformed Search Techniques conti..
Lecture 10 Uninformed Search Techniques conti..Lecture 10 Uninformed Search Techniques conti..
Lecture 10 Uninformed Search Techniques conti..
Hema Kashyap
 

More from Hema Kashyap (20)

Lecture 30 introduction to logic
Lecture 30 introduction to logicLecture 30 introduction to logic
Lecture 30 introduction to logic
 
Lecture 29 genetic algorithm-example
Lecture 29 genetic algorithm-exampleLecture 29 genetic algorithm-example
Lecture 29 genetic algorithm-example
 
Lecture 28 genetic algorithm
Lecture 28 genetic algorithmLecture 28 genetic algorithm
Lecture 28 genetic algorithm
 
Lecture 27 simulated annealing
Lecture 27 simulated annealingLecture 27 simulated annealing
Lecture 27 simulated annealing
 
Lecture 26 local beam search
Lecture 26 local beam searchLecture 26 local beam search
Lecture 26 local beam search
 
Lecture 25 hill climbing
Lecture 25 hill climbingLecture 25 hill climbing
Lecture 25 hill climbing
 
Lecture 24 iterative improvement algorithm
Lecture 24 iterative improvement algorithmLecture 24 iterative improvement algorithm
Lecture 24 iterative improvement algorithm
 
Lecture 23 alpha beta pruning
Lecture 23 alpha beta pruningLecture 23 alpha beta pruning
Lecture 23 alpha beta pruning
 
Lecture 21 problem reduction search ao star search
Lecture 21 problem reduction search ao star searchLecture 21 problem reduction search ao star search
Lecture 21 problem reduction search ao star search
 
Lecture 20 problem reduction search
Lecture 20 problem reduction searchLecture 20 problem reduction search
Lecture 20 problem reduction search
 
Lecture 19 sma star algorithm
Lecture 19 sma star algorithmLecture 19 sma star algorithm
Lecture 19 sma star algorithm
 
Lecture 18 simplified memory bound a star algorithm
Lecture 18 simplified memory bound a star algorithmLecture 18 simplified memory bound a star algorithm
Lecture 18 simplified memory bound a star algorithm
 
Lecture 17 Iterative Deepening a star algorithm
Lecture 17 Iterative Deepening a star algorithmLecture 17 Iterative Deepening a star algorithm
Lecture 17 Iterative Deepening a star algorithm
 
Lecture 16 memory bounded search
Lecture 16 memory bounded searchLecture 16 memory bounded search
Lecture 16 memory bounded search
 
Lecture 15 monkey banana problem
Lecture 15 monkey banana problemLecture 15 monkey banana problem
Lecture 15 monkey banana problem
 
Lecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithmLecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithm
 
Lecture 13 Criptarithmetic problem
Lecture 13 Criptarithmetic problemLecture 13 Criptarithmetic problem
Lecture 13 Criptarithmetic problem
 
Lecture 12 Heuristic Searches
Lecture 12 Heuristic SearchesLecture 12 Heuristic Searches
Lecture 12 Heuristic Searches
 
Lecture 11 Informed Search
Lecture 11 Informed SearchLecture 11 Informed Search
Lecture 11 Informed Search
 
Lecture 10 Uninformed Search Techniques conti..
Lecture 10 Uninformed Search Techniques conti..Lecture 10 Uninformed Search Techniques conti..
Lecture 10 Uninformed Search Techniques conti..
 

Recently uploaded

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
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
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
 
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
 
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
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
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
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
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
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
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
 
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
 
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
 

Recently uploaded (20)

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...
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
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...
 
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
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
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
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
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
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
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
 
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
 
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
 

Lecture 22 adversarial search

  • 1. Adversarial Search Min Max Search Lecture-22 Hema Kashyap 1
  • 2. Introduction • The minimax algorithm is a way of finding an optimal move in a two player game. In the search tree for a two-player game, there are two kinds of nodes, nodes representing yourmoves and nodes representing your opponent's moves. Nodes representing your moves are generally drawn as squares (or possibly upward pointing triangles): • Below given symbols are also called MAX nodes. The goal at a MAX node is to maximize the value of the subtree rooted at that node. To do this, a MAX node chooses the child with the greatest value, and that becomes the value of the MAX node. 2
  • 3. • Below given are called MIN nodes. The goal at a MIN node is to minimize the value of the subtree rooted at that node. To do this, a MIN node chooses the child with the smallest value, and that becomes the value of the MIN node. 3
  • 5. Example: tic-tac-toe • e (evaluation function → integer) = number of available rows, columns, diagonals for MAX - number of available rows, columns, diagonals for MIN • MAX plays with “X” and desires maximizing e. • MIN plays with “0” and desires minimizing e. • Symmetries are taken into account. • A depth limit is used (2, in the example). 5
  • 9. Example • To demonstrate the minimax algorithm, I'm going to use the following tree. Note that it's typical for two player games to have different branching factors at each node. The move I make could make restrictions on what moves are possible for the other player, or possibly remove restrictions. Note also that in this example, we're ignoring what the game or the probem space are in order to focus on the algorithm. 9
  • 10. Example • So now you've seen the whole search tree. For the rest of the diagrams, I'll only show the portion of the tree that we've already explored at that particular time. Thus, when we start the problem, all minimax sees is the start node: 10
  • 11. Example • It begins like a depth first search, generating the first child. Then we see this: 11
  • 12. Example • So far we've really seen no evaluation values. The way minimax works is to go down a specified number of full moves (where one "full move" is actually a move by you and a move by your opponent), then calculate evaluation values for states at that depth. For this example, we're going to go down one full move, which is one more level. When we generate the values for those nodes, here is what we see: 12
  • 13. Example • Now we have the values of the children of the min node, so it can do its work. It chooses the minimum of the two child node values, which is 3. Now we have this: 13
  • 14. Example • The max node at the top still has two other children nodes that we need to generate and search. We go on and generate the second node and generate its child. Since there is only one child, the min node must take it's value, and we have this: 14
  • 15. Example • Finally, minimax generates the third child of the top-level max node, generates its children, and evaluates them: 15
  • 16. Example • Now the third min node chooses the minimum of it's child node values, 1, and we have this: 16
  • 17. Example • Finally we have all of the values of the children of the max node at the top level, so it chooses the maximum of them, 15, and we get the final solution: 17
  • 18. Analysis • The minimax algorithm performs a complete depth-first exploration of the game tree. • In minimax, at each point in the process, only the nodes along a path of the tree are considered and kept in memory. 18
  • 19. Analysis • If the maximum depth of the tree is m, and there are b legal moves at each point, then the time complexity is O(bm). • The space complexity is: – O(bm) for an algorithm that generates all successors at once – O(m) if it generates successors one at a time. 19