SlideShare a Scribd company logo
1 of 8
Download to read offline
An Alpha-Beta Primer
                                           Stephen D. Bay



Minimax search with alpha-beta pruning involves depth rst search of a game tree, keeping
track of

        Alpha: highest value seen so far on a maximizing level
        Beta: lowest value seen so far on a minimizing level

Note that when we look at alpha and beta values we look only at nodes along the path from
our current node to the root.
Pruning is done according to the following two rules:

        When on a maximizing level, do not expand any more sibling nodes once a node has
        been seen whose evaluation is lower than or equal to Alpha.
        When on a minimizing level, do not expand any more sibling nodes once a node has
        been seen whose evaluation is greater than or equal to Beta.

For this primer, we will consider the following search tree:

                                             A                                     MAX



                      B                                          C                 MIN



           D                       E                     F               G         MAX




    H            I            J        K             L       M       N       O     MIN

   2           -3         8            5         -2          1       5       4


This is the full search tree to depth 3. The numbers beneath the leaves are values returned
by the evaluation function.
                                                 1
Step 1


                   A                              MAX



                                                  MIN



                                                  MAX




                                                  MIN


alpha = unde ned, beta = unde ned, Expand A


Step 2


                            A                           MAX



           B                                  C         MIN



                                                        MAX




                                                        MIN


alpha = unde ned, beta = unde ned, Expand B




                                       2
Step 3


                                    A                                         MAX



                    B                                  C                      MIN



        D                   E                                                 MAX




                                                                              MIN


alpha = unde ned, beta = unde ned, Expand D


Step 4


                                        A                                      MAX



                        B                                  C                   MIN



            D                   E                                              MAX




    H           I                                                              MIN

    2


alpha = unde ned, beta = unde ned, Evaluate H and propagate values upwards.



                                            3
Step 5


                                     A                                         MAX



                    B                                      C                   MIN


  >= 2
         D                   E                                                 MAX




   H          I                                                                MIN

             -3


alpha = 2, beta = unde ned, Evaluate I and propagate values upwards.


Step 6


                                     A                                         MAX


             <= 2
                    B                                      C                   MIN



  2
         D                   E                                                 MAX




   H          I                                                                MIN



alpha = unde ned, beta = 2, Expand E. Note that alpha is unde ned since we are at E and
we only consider alpha-beta values from E to the root A i.e. values at B and A.


                                          4
Step 7


                                        A                                       MAX


             = 2
                     B                                       C                  MIN



         D                   E                                                  MAX




   H          I          J          K                                           MIN

                         8


alpha = unde ned, beta = 2, Evaluate J and propagate values upwards.


Step 8


                                        A                                       MAX

              = 2

                     B                                       C                  MIN

                             = 8

         D                   E                                                  MAX




   H          I          J          K                                           MIN



alpha = 8, beta = 2, Prune K as evalj         8  2. Once K has been pruned we can
propagate values up to A.


                                             5
Step 9

                              = 2
                                         A                   MAX

                  2
                      B                              C       MIN



          D                   E                              MAX




   H          I           J          K                       MIN



alpha = 2, beta = unde ned, Expand C


Step 10

                              = 2
                                         A                   MAX



                      B                              C       MIN



          D                   E                  F       G   MAX




   H          I           J          K                       MIN



alpha = 2, beta = unde ned, Expand F



                                             6
Step 11

                             = 2
                                        A                                 MAX



                  B                                         C             MIN



          D                 E                       F                 G   MAX




   H          I        J            K           L       M                 MIN

                                            -2


alpha = 2, beta = unde ned, Evaluate L and propagate values upward.


Step 12

                             = 2
                                        A                                 MAX



                  B                                         C             MIN

                                            = -2

          D                 E                       F                 G   MAX




   H          I        J            K           L       M                 MIN

                                                        1


alpha = 2, beta = unde ned, Evaluate M and propagate values upward.


                                            7
Step 13

                             = 2
                                        A                                          MAX

                                                                = 1

                  B                                             C                  MIN

                                                    1

          D                  E                          F                G         MAX




   H          I         J           K           L           M                      MIN



alpha = 2, beta = 1, Prune G as evalF            1  2. Once G has been pruned we can
propagate values up to A.


Step 14

                             2
                                        A                                          MAX

                                                                1

                  B                                             C                  MIN



          D                  E                          F                G         MAX




   H          I         J           K           L           M                      MIN



The computer choses the move that leads to B.


                                            8

More Related Content

Viewers also liked

Adversarial search with Game Playing
Adversarial search with Game PlayingAdversarial search with Game Playing
Adversarial search with Game PlayingAman Patel
 
Artificial intelligence in gaming.
Artificial intelligence in gaming.Artificial intelligence in gaming.
Artificial intelligence in gaming.Rishikese MR
 
Update on-crisp-iana-stewardship-transition
Update on-crisp-iana-stewardship-transitionUpdate on-crisp-iana-stewardship-transition
Update on-crisp-iana-stewardship-transitionlordmwesh
 
Telephone call-simulation
Telephone call-simulationTelephone call-simulation
Telephone call-simulationPrakash Poudel
 
Searchadditional2
Searchadditional2Searchadditional2
Searchadditional2chandsek666
 
Lecture 09 uninformed problem solving
Lecture 09 uninformed problem solvingLecture 09 uninformed problem solving
Lecture 09 uninformed problem solvingHema Kashyap
 
Lecture 12 Heuristic Searches
Lecture 12 Heuristic SearchesLecture 12 Heuristic Searches
Lecture 12 Heuristic SearchesHema Kashyap
 
9 Examples of Artificial Intelligence in Use Today
9 Examples of Artificial Intelligence in Use Today9 Examples of Artificial Intelligence in Use Today
9 Examples of Artificial Intelligence in Use TodayIQVIS
 
Artificial intelligence In Modern-Games.
Artificial intelligence In Modern-Games. Artificial intelligence In Modern-Games.
Artificial intelligence In Modern-Games. Nitish Kavishetti
 
Artificial Intelligence in Computer and Video Games
Artificial Intelligence in Computer and Video GamesArtificial Intelligence in Computer and Video Games
Artificial Intelligence in Computer and Video GamesLuke Dicken
 
Ch2 3-informed (heuristic) search
Ch2 3-informed (heuristic) searchCh2 3-informed (heuristic) search
Ch2 3-informed (heuristic) searchchandsek666
 
cờ tướng khai cuộc cẩm nang (china chess)
cờ tướng khai cuộc cẩm nang (china chess)cờ tướng khai cuộc cẩm nang (china chess)
cờ tướng khai cuộc cẩm nang (china chess)Hung Pham Thai
 
Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence Yasir Khan
 

Viewers also liked (20)

Adversarial search with Game Playing
Adversarial search with Game PlayingAdversarial search with Game Playing
Adversarial search with Game Playing
 
AI Lesson 08
AI Lesson 08AI Lesson 08
AI Lesson 08
 
Artificial intelligence in gaming.
Artificial intelligence in gaming.Artificial intelligence in gaming.
Artificial intelligence in gaming.
 
Update on-crisp-iana-stewardship-transition
Update on-crisp-iana-stewardship-transitionUpdate on-crisp-iana-stewardship-transition
Update on-crisp-iana-stewardship-transition
 
Soap xp-wg
Soap xp-wgSoap xp-wg
Soap xp-wg
 
Writing a good cv
Writing a good cvWriting a good cv
Writing a good cv
 
Telephone call-simulation
Telephone call-simulationTelephone call-simulation
Telephone call-simulation
 
AI Lesson 41
AI Lesson 41AI Lesson 41
AI Lesson 41
 
Answer quiz minimax
Answer quiz minimaxAnswer quiz minimax
Answer quiz minimax
 
Searchadditional2
Searchadditional2Searchadditional2
Searchadditional2
 
Lecture 09 uninformed problem solving
Lecture 09 uninformed problem solvingLecture 09 uninformed problem solving
Lecture 09 uninformed problem solving
 
Lecture 12 Heuristic Searches
Lecture 12 Heuristic SearchesLecture 12 Heuristic Searches
Lecture 12 Heuristic Searches
 
9 Examples of Artificial Intelligence in Use Today
9 Examples of Artificial Intelligence in Use Today9 Examples of Artificial Intelligence in Use Today
9 Examples of Artificial Intelligence in Use Today
 
Artificial intelligence In Modern-Games.
Artificial intelligence In Modern-Games. Artificial intelligence In Modern-Games.
Artificial intelligence In Modern-Games.
 
First order logic
First order logicFirst order logic
First order logic
 
Fp growth
Fp growthFp growth
Fp growth
 
Artificial Intelligence in Computer and Video Games
Artificial Intelligence in Computer and Video GamesArtificial Intelligence in Computer and Video Games
Artificial Intelligence in Computer and Video Games
 
Ch2 3-informed (heuristic) search
Ch2 3-informed (heuristic) searchCh2 3-informed (heuristic) search
Ch2 3-informed (heuristic) search
 
cờ tướng khai cuộc cẩm nang (china chess)
cờ tướng khai cuộc cẩm nang (china chess)cờ tướng khai cuộc cẩm nang (china chess)
cờ tướng khai cuộc cẩm nang (china chess)
 
Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence
 

Recently uploaded

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 

Alphabeta

  • 1. An Alpha-Beta Primer Stephen D. Bay Minimax search with alpha-beta pruning involves depth rst search of a game tree, keeping track of Alpha: highest value seen so far on a maximizing level Beta: lowest value seen so far on a minimizing level Note that when we look at alpha and beta values we look only at nodes along the path from our current node to the root. Pruning is done according to the following two rules: When on a maximizing level, do not expand any more sibling nodes once a node has been seen whose evaluation is lower than or equal to Alpha. When on a minimizing level, do not expand any more sibling nodes once a node has been seen whose evaluation is greater than or equal to Beta. For this primer, we will consider the following search tree: A MAX B C MIN D E F G MAX H I J K L M N O MIN 2 -3 8 5 -2 1 5 4 This is the full search tree to depth 3. The numbers beneath the leaves are values returned by the evaluation function. 1
  • 2. Step 1 A MAX MIN MAX MIN alpha = unde ned, beta = unde ned, Expand A Step 2 A MAX B C MIN MAX MIN alpha = unde ned, beta = unde ned, Expand B 2
  • 3. Step 3 A MAX B C MIN D E MAX MIN alpha = unde ned, beta = unde ned, Expand D Step 4 A MAX B C MIN D E MAX H I MIN 2 alpha = unde ned, beta = unde ned, Evaluate H and propagate values upwards. 3
  • 4. Step 5 A MAX B C MIN >= 2 D E MAX H I MIN -3 alpha = 2, beta = unde ned, Evaluate I and propagate values upwards. Step 6 A MAX <= 2 B C MIN 2 D E MAX H I MIN alpha = unde ned, beta = 2, Expand E. Note that alpha is unde ned since we are at E and we only consider alpha-beta values from E to the root A i.e. values at B and A. 4
  • 5. Step 7 A MAX = 2 B C MIN D E MAX H I J K MIN 8 alpha = unde ned, beta = 2, Evaluate J and propagate values upwards. Step 8 A MAX = 2 B C MIN = 8 D E MAX H I J K MIN alpha = 8, beta = 2, Prune K as evalj 8 2. Once K has been pruned we can propagate values up to A. 5
  • 6. Step 9 = 2 A MAX 2 B C MIN D E MAX H I J K MIN alpha = 2, beta = unde ned, Expand C Step 10 = 2 A MAX B C MIN D E F G MAX H I J K MIN alpha = 2, beta = unde ned, Expand F 6
  • 7. Step 11 = 2 A MAX B C MIN D E F G MAX H I J K L M MIN -2 alpha = 2, beta = unde ned, Evaluate L and propagate values upward. Step 12 = 2 A MAX B C MIN = -2 D E F G MAX H I J K L M MIN 1 alpha = 2, beta = unde ned, Evaluate M and propagate values upward. 7
  • 8. Step 13 = 2 A MAX = 1 B C MIN 1 D E F G MAX H I J K L M MIN alpha = 2, beta = 1, Prune G as evalF 1 2. Once G has been pruned we can propagate values up to A. Step 14 2 A MAX 1 B C MIN D E F G MAX H I J K L M MIN The computer choses the move that leads to B. 8