SlideShare a Scribd company logo
1 of 26
Minimax and Alpha-Beta Reduction
Group Members
Md. Musabbir Hussain 141-15-3077
Faiaz Ahamed Raihan 141-15-3260
Md. Mahfuzul Yamin 141-15-3429
Ms. Habiba Sultana 141-15-3435
Content
• Minimax Decision
• Required Pieces for Minimax
• Properties of Minimax
• Deeper game trees
• Alpha-Beta Properties
• Alpha-Beta Pruning example
• Conclusion
Minimax Decision
• Assign a utility value to each possible ending
• Assures best possible ending, assuming opponent also plays
perfectly
• opponent tries to give you worst possible ending
• Depth-first search tree traversal that updates utility values as it
recourses back up the tree
Required Pieces for Minimax
• An initial state
• The positions of all the pieces
• Whose turn it is
• Operators
• Legal moves the player can make
• Terminal Test
• Determines if a state is a final state
• Utility Function
Properties of Minimax
• Complete? Yes (if tree is finite)
• Optimal? Yes (against an optimal opponent)
• Time complexity? O(bm)
• Space complexity? O(bm) (depth-first exploration
7
ED
0B C
R
0
N
4 O P
9
Q
-6
S
3
T
5
U
-7
V
-9
K MF G
-5
H
3
I
8 J L
2
W
-3
X
-5
A
Deeper Game Trees
• Minimax can be generalized for > 2 moves
• Values backed up in minimax way
terminal states
O
-5
K
5
M
-7
F
4
J
9
E
-7
B
-5
C
3
A
3
opponent
min
computer
max
opponent
min
computer max
Alpha-Beta Pruning
• Main idea: Avoid processing subtrees that have no effect on the result
• Two new parameters
• α: The best value for MAX seen so far
• β: The best value for MIN seen so far
• α is used in MIN nodes, and is assigned in MAX nodes
• β is used in MAX nodes, and is assigned in MIN nodes
Alpha-Beta Pruning
• Alpha = the value of the best choice we’ve found so far for
MAX (highest)
• Beta = the value of the best choice we’ve found so far for MIN
(lowest)
• When maximizing, cut off values lower than Alpha
• When minimizing, cut off values greater than Beta
When to Prune
• Prune whenever  ≥ .
• Prune below a Max node whose alpha value becomes greater than or
equal to the beta value of its ancestors.
• Max nodes update alpha based on children’s returned values.
• Prune below a Min node whose beta value becomes less than or
equal to the alpha value of its ancestors.
• Min nodes update beta based on children’s returned values.
Properties of α-β
• Pruning preserves completeness and optimality of original
minimax algorithm
• Good move ordering improves effectiveness of pruning
• With "perfect ordering," time complexity = O(bm/2)
Therefore, doubles depth of search
Alpha-Beta Example Revisited
, , initial values
Do DFS until first leaf
=−
 =+
=−
 =+
, , passed to kids
Alpha-Beta Example (continued)
MIN updates , based on kids
=−
 =+
=−
 =3
Alpha-Beta Example (continued)
=−
 =3
MIN updates , based on kids.
No change.
=−
 =+
Alpha-Beta Example (continued)
MAX updates , based on kids.
=3
 =+
3 is returned
as node value.
Alpha-Beta Example (continued)
=3
 =+
=3
 =+
, , passed to kids
Alpha-Beta Example (continued)
=3
 =+
=3
 =2
MIN updates ,
based on kids.
Alpha-Beta Example (continued)
=3
 =2
 ≥ ,
so prune.
=3
 =+
Alpha-Beta Example (continued)
2 is returned
as node value.
MAX updates , based on kids.
No change. =3
 =+
Alpha-Beta Example (continued)
,
=3
 =+
=3
 =+
, , passed to kids
Alpha-Beta Example (continued)
,
=3
 =14
=3
 =+
MIN updates ,
based on kids.
Alpha-Beta Example (continued)
,
=3
 =5
=3
 =+
MIN updates ,
based on kids.
Alpha-Beta Example (continued)
=3
 =+ 2 is returned
as node value.
2
Alpha-Beta Example (continued)
Max calculates the same node
value, and makes the same
move!
2
Conclusion
• Minimax finds optimal play for deterministic, fully
observable, two-player games
• Alpha-Beta reduction makes it faster
THANK YOU

More Related Content

Similar to AI-MiniMax Algorithm and Alpha Beta Reduction

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 pptxnizmishaik1
 
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 graphSyed Zaid Irshad
 
It is an artificial document, please. regarding Ai topics
It is an artificial document, please. regarding Ai topicsIt is an artificial document, please. regarding Ai topics
It is an artificial document, please. regarding Ai topicschougulesup79
 

Similar to AI-MiniMax Algorithm and Alpha Beta Reduction (7)

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
 
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
 
Capgemini 1
Capgemini 1Capgemini 1
Capgemini 1
 
Alpha-Beta Search
Alpha-Beta SearchAlpha-Beta Search
Alpha-Beta Search
 
Game playing.ppt
Game playing.pptGame playing.ppt
Game playing.ppt
 
It is an artificial document, please. regarding Ai topics
It is an artificial document, please. regarding Ai topicsIt is an artificial document, please. regarding Ai topics
It is an artificial document, please. regarding Ai topics
 
Two player games
Two player gamesTwo player games
Two player games
 

Recently uploaded

Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 

Recently uploaded (20)

Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 

AI-MiniMax Algorithm and Alpha Beta Reduction

  • 2. Group Members Md. Musabbir Hussain 141-15-3077 Faiaz Ahamed Raihan 141-15-3260 Md. Mahfuzul Yamin 141-15-3429 Ms. Habiba Sultana 141-15-3435
  • 3. Content • Minimax Decision • Required Pieces for Minimax • Properties of Minimax • Deeper game trees • Alpha-Beta Properties • Alpha-Beta Pruning example • Conclusion
  • 4. Minimax Decision • Assign a utility value to each possible ending • Assures best possible ending, assuming opponent also plays perfectly • opponent tries to give you worst possible ending • Depth-first search tree traversal that updates utility values as it recourses back up the tree
  • 5. Required Pieces for Minimax • An initial state • The positions of all the pieces • Whose turn it is • Operators • Legal moves the player can make • Terminal Test • Determines if a state is a final state • Utility Function
  • 6. Properties of Minimax • Complete? Yes (if tree is finite) • Optimal? Yes (against an optimal opponent) • Time complexity? O(bm) • Space complexity? O(bm) (depth-first exploration
  • 7. 7 ED 0B C R 0 N 4 O P 9 Q -6 S 3 T 5 U -7 V -9 K MF G -5 H 3 I 8 J L 2 W -3 X -5 A Deeper Game Trees • Minimax can be generalized for > 2 moves • Values backed up in minimax way terminal states O -5 K 5 M -7 F 4 J 9 E -7 B -5 C 3 A 3 opponent min computer max opponent min computer max
  • 8. Alpha-Beta Pruning • Main idea: Avoid processing subtrees that have no effect on the result • Two new parameters • α: The best value for MAX seen so far • β: The best value for MIN seen so far • α is used in MIN nodes, and is assigned in MAX nodes • β is used in MAX nodes, and is assigned in MIN nodes
  • 9. Alpha-Beta Pruning • Alpha = the value of the best choice we’ve found so far for MAX (highest) • Beta = the value of the best choice we’ve found so far for MIN (lowest) • When maximizing, cut off values lower than Alpha • When minimizing, cut off values greater than Beta
  • 10. When to Prune • Prune whenever  ≥ . • Prune below a Max node whose alpha value becomes greater than or equal to the beta value of its ancestors. • Max nodes update alpha based on children’s returned values. • Prune below a Min node whose beta value becomes less than or equal to the alpha value of its ancestors. • Min nodes update beta based on children’s returned values.
  • 11. Properties of α-β • Pruning preserves completeness and optimality of original minimax algorithm • Good move ordering improves effectiveness of pruning • With "perfect ordering," time complexity = O(bm/2) Therefore, doubles depth of search
  • 12. Alpha-Beta Example Revisited , , initial values Do DFS until first leaf =−  =+ =−  =+ , , passed to kids
  • 13. Alpha-Beta Example (continued) MIN updates , based on kids =−  =+ =−  =3
  • 14. Alpha-Beta Example (continued) =−  =3 MIN updates , based on kids. No change. =−  =+
  • 15. Alpha-Beta Example (continued) MAX updates , based on kids. =3  =+ 3 is returned as node value.
  • 16. Alpha-Beta Example (continued) =3  =+ =3  =+ , , passed to kids
  • 17. Alpha-Beta Example (continued) =3  =+ =3  =2 MIN updates , based on kids.
  • 18. Alpha-Beta Example (continued) =3  =2  ≥ , so prune. =3  =+
  • 19. Alpha-Beta Example (continued) 2 is returned as node value. MAX updates , based on kids. No change. =3  =+
  • 20. Alpha-Beta Example (continued) , =3  =+ =3  =+ , , passed to kids
  • 21. Alpha-Beta Example (continued) , =3  =14 =3  =+ MIN updates , based on kids.
  • 22. Alpha-Beta Example (continued) , =3  =5 =3  =+ MIN updates , based on kids.
  • 23. Alpha-Beta Example (continued) =3  =+ 2 is returned as node value. 2
  • 24. Alpha-Beta Example (continued) Max calculates the same node value, and makes the same move! 2
  • 25. Conclusion • Minimax finds optimal play for deterministic, fully observable, two-player games • Alpha-Beta reduction makes it faster