SlideShare a Scribd company logo
1 of 112
Download to read offline
AI Game Search
MENOUFIA UNIVERSITY
FACULTY OF COMPUTERS AND INFORMATION
ALL DEPARTMENTS
ARTIFICIAL INTELLIGENCE
‫المنوفية‬ ‫جامعة‬
‫والمعلومات‬ ‫الحاسبات‬ ‫كلية‬
‫األقسام‬ ‫جميع‬
‫الذكاء‬‫اإلصطناعي‬
‫المنوفية‬ ‫جامعة‬
Ahmed Fawzy Gad
ahmed.fawzy@ci.menofia.edu.eg
Minimax
Minimax Game Search
Minimax Game Search
Two Players take turns:
Max and Min
Minimax Game Search
Two Players take turns:
Max and Min
Max : Maximizes Score.
Min : Minimizes Score.
MAX
Minimax Game Search
Two Players take turns:
Max and MinMAX
MIN
Minimax Game Search
Two Players take turns:
Max and Min
Max : Maximizes Score.
Min : Minimizes Score.
MAX
MIN
Minimax Game Search
Two Players take turns:
Max and Min
Max : Maximizes Score.
Min : Minimizes Score.
Special Case.
Max is an expert.
Min is a beginner.
MAX
MIN
Minimax Game Search
A
Minimax Game Search
Which node to follow?
No heuristic values.
A
B C
Minimax Game Search
Which node to follow?
No heuristic values.
A
B C
Minimax Game Search
Which node to follow?
No heuristic values.
A
B C
Hot to find heuristic values
for other nodes?
Minimax Game Search
Which node to follow?
No heuristic values.
A
B C
Hot to find heuristic values
for other nodes?
Use children heuristics to
calculate parent heuristic.
Minimax Game Search
Which node to follow?
No heuristic values.
A
B C
Hot to find heuristic values
for other nodes?
Use children heuristics to
calculate parent heuristic.
Minimax Game
Search Steps
Minimax Game Search
Which node to follow?
No heuristic values.
A
B C
Hot to find heuristic values
for other nodes?
Use children heuristics to
calculate parent heuristic.
Minimax Game
Search Steps
Calculate
Heuristics
Minimax Game Search
Which node to follow?
No heuristic values.
A
B C
Hot to find heuristic values
for other nodes?
Use children heuristics to
calculate parent heuristic.
Minimax Game
Search Steps
Calculate
Heuristics
Search
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B C
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B CB C
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
C
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
C
D E
B C
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
C
D E
B C
D E
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
D
C
D E
B C
D E
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
D
H I
C
D E
J
B C
D E
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
D
H I
C
D E
J
B C
D E
H I J
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
D
H I
C
D E
J
B C
D E
H I J
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
D
H I
C
D E
J
3 -2 5
B C
D E
H I J
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
D
H I
C
D E
J
3 -2 5
B C
D E
H I J
Max
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
D
H I
C
D E
J
3 -2 5
B C
D E
H I J
Max
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
D
H I
C
D E
J
3 -2 5
B C
D E
H I J
Max
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
D
H I
C
D E
J
3 -2 5
B C
D E
H I J
Max
5
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
D
H I
C
D E
J
3 -2 5
B C
D E
H I J
Max
5
5
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
C
D E
B C
D E5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
E
C
D E
B C
D E5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
E
K L
C
D E
M
B C
D E5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
E
K L
C
D E
M
B C
D E
K L M
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
E
K L
C
D E
M
7 0 3
B C
D E
K L M
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
E
K L
C
D E
M
7 0 3
B C
D E
K L M
Max
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
E
K L
C
D E
M
7 0 3
B C
D E
K L M
Max
7
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
E
K L
C
D E
M
7 0 3
B C
D E
K L M
Max
7
7
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
E
K L
C
D E
M
7 0 3
B C
D E
K L M
Max
7
7
75
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
E
K L
C
D E
M
7 0 3
B C
D E
K L M
Max
7
7
7
Min
5
75
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
E
K L
C
D E
M
7 0 3
B C
D E
K L M
Max
7
7
7
Min5
55
75
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
E
K L
C
D E
M
7 0 3
B C
D E
K L M
Max
7
7
7
Min5
5
55
75
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
B
E
K L
C
D E
M
7 0 3
B C
D E
K L M
Max
7
7
7
Min5
5
55
7
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B CB C5
7
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
CB C5
7
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
C
F G
B C5
7
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
C
F G
B C5
F G
7
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
F
C
F G
B C5
F G
7
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
F
N O
C
F G
P
B C5
F G
7
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
F
N O
C
F G
P
B C
N O P
5
F G
7
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
F
N O
C
F G
P
0 -5 4
B C
N O P
5
F G
7
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
F
N O
C
F G
P
0 -5 4
B C
N O P
Max
5
F G
7
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
F
N O
C
F G
P
0 -5 4
B C
N O P
Max
4
5
F G
7
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
F
N O
C
F G
P
0 -5 4
B C
N O P
Max
4
5
4
F G
7
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
F
N O
C
F G
P
0 -5 4
B C
N O P
Max
4
5
4
F G4
7
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
F
N O
C
F G
P
0 -5 4
B C
N O P
Max
4
5
4
F G4
47
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
C
F G
B C5
F G4
47
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
G
C
F G
B C5
F G4
47
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
G
Q R
C
F G
S
B C5
F G4
47
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
G
Q R
C
F G
S
B C
Q R S
5
F G4
47
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
5
F G4
47
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Max
5
F G4
47
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Max
8
5
F G4
47
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Max
8
5
8
F G4
47
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Max
8
5
8
F G4 8
47
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Max
8
5
8
F G4 8
Min
847
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Max
8
5
8
F G4 8
Min4
4
847
5
5
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Max
8
5
8
F G4 8
Min4
4
4
847
5
5
4
Max
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Max
8
5
8
F G4 8
Min4
4
4
847
5
5
4
Max
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Max
8
5
8
F G4 8
Min4
4
4
5
8
4
47
5
5
Max
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Max
8
5
8
F G4 8
Min4
4
4
5
5
8
4
47
5
5
Max
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Max
8
5
8
F G4 8
Min4
4
4
5
5
8
4
5
47
5
5
Max
Phase 1 : Heuristic Value Calculation
Depth-First Search
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Max
8
5
8
F G4 8
Min4
4
4
5
5
8
4
5
47
5
5
If both players play optimally then Max will win by a score 5.
Game Tree After Heuristic Value Calculation
8
4
5
47
5
5
Phase 2 : Game Search
8
4
5
47
5
5
Phase 2 : Game Search
8
4
5
47
5
5
A
Phase 2 : Game Search
8
4
5
47
5
5
BMax
A
Phase 2 : Game Search
8
4
5
47
5
5
B
D
Max
A
Min
Phase 2 : Game Search
8
4
5
47
5
5
B
D
J
Max
Min
Max
A
Minimax Game Search Drawback
• Expands all the tree
while not all
expanded nodes are
useful.
Minimax Game Search Drawback
• Expands all the tree
while not all
expanded nodes are
useful.
• In this example, just
few nodes of the
whole tree was useful
in reaching the goal.
Alpha-Beta Pruning
Alpha-Beta Pruning = Minimax Except
• This game search strategy is a modification to Minimax game search
that avoids exploring nodes that are not useful in the search.
• It gives the same results as Minimax but avoids exploring some
nodes.
• In the previous example, the path explored using Minimax was A-B-D-
J.
• Also the Alpha-Beta Pruning path will be A-B-D-J but without
exploring all nodes as in Minimax.
Alpha-Beta Pruning Motivation
Never explore values that are not useful.
=Min(Max(1, 2, 5), Max(6, x, y), Max(1, 3, 4))
=Min(5, Max(6, x, y), 4)
=Min(Max(6, x, y), 4)
=4
Alpha-Beta Game Search
Alpha-Beta Game Search
Alpha-Beta Game Search
Alpha-Beta Game Search
Alpha-Beta Game Search
Alpha-Beta Game Search
5
Alpha-Beta Game Search
5
5
Alpha-Beta Game Search
5
5
Alpha-Beta Game Search
5
5
Alpha-Beta Game Search
5
5
Alpha-Beta Game Search
7
5
5
Alpha-Beta Game Search
7
5
5
Min(5, max(7, x, y))
=5
Alpha-Beta Game Search
7
5
5
Alpha-Beta Game Search
7
5
5
Alpha-Beta Game Search
7
5
5
Alpha-Beta Game Search
7
5
5
5
Alpha-Beta Game Search
7
5
5
5
Alpha-Beta Game Search
7
5
5
5
Alpha-Beta Game Search
7
5
5
5
Alpha-Beta Game Search
7
5
5
5
Alpha-Beta Game Search
7
5
5
5
4
Alpha-Beta Game Search
7
5
5
5
4
4
Max(5, min(4, x, y, z))
=5
Alpha-Beta Game Search
7
5
5
5
4
4
Alpha-Beta Game Search
7
5
5
5
4
4
Alpha-Beta Game Search
7
5
5
5
4
4
Same results as Minimax
with fewer nodes explored.
5 Unexplored Branches.

More Related Content

What's hot

Search problems in Artificial Intelligence
Search problems in Artificial IntelligenceSearch problems in Artificial Intelligence
Search problems in Artificial Intelligenceananth
 
Control Strategies in AI
Control Strategies in AIControl Strategies in AI
Control Strategies in AIAmey Kerkar
 
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...vikas dhakane
 
lazy learners and other classication methods
lazy learners and other classication methodslazy learners and other classication methods
lazy learners and other classication methodsrajshreemuthiah
 
Artificial intelligence and knowledge representation
Artificial intelligence and knowledge representationArtificial intelligence and knowledge representation
Artificial intelligence and knowledge representationSajan Sahu
 
Heuristic or informed search
Heuristic or informed searchHeuristic or informed search
Heuristic or informed searchHamzaJaved64
 
Inductive bias
Inductive biasInductive bias
Inductive biasswapnac12
 
0 1 knapsack using branch and bound
0 1 knapsack using branch and bound0 1 knapsack using branch and bound
0 1 knapsack using branch and boundAbhishek Singh
 
K means clustering
K means clusteringK means clustering
K means clusteringkeshav goyal
 
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 algorithmHema Kashyap
 
K mean-clustering algorithm
K mean-clustering algorithmK mean-clustering algorithm
K mean-clustering algorithmparry prabhu
 
Lecture 11 Informed Search
Lecture 11 Informed SearchLecture 11 Informed Search
Lecture 11 Informed SearchHema Kashyap
 
knowledge representation using rules
knowledge representation using rulesknowledge representation using rules
knowledge representation using rulesHarini Balamurugan
 

What's hot (20)

Search problems in Artificial Intelligence
Search problems in Artificial IntelligenceSearch problems in Artificial Intelligence
Search problems in Artificial Intelligence
 
Control Strategies in AI
Control Strategies in AIControl Strategies in AI
Control Strategies in AI
 
Bagging.pptx
Bagging.pptxBagging.pptx
Bagging.pptx
 
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
 
lazy learners and other classication methods
lazy learners and other classication methodslazy learners and other classication methods
lazy learners and other classication methods
 
Artificial intelligence and knowledge representation
Artificial intelligence and knowledge representationArtificial intelligence and knowledge representation
Artificial intelligence and knowledge representation
 
Randomized algorithms ver 1.0
Randomized algorithms ver 1.0Randomized algorithms ver 1.0
Randomized algorithms ver 1.0
 
Heuristic or informed search
Heuristic or informed searchHeuristic or informed search
Heuristic or informed search
 
Inductive bias
Inductive biasInductive bias
Inductive bias
 
0 1 knapsack using branch and bound
0 1 knapsack using branch and bound0 1 knapsack using branch and bound
0 1 knapsack using branch and bound
 
A* Search Algorithm
A* Search AlgorithmA* Search Algorithm
A* Search Algorithm
 
K means clustering
K means clusteringK means clustering
K means clustering
 
search strategies in artificial intelligence
search strategies in artificial intelligencesearch strategies in artificial intelligence
search strategies in artificial intelligence
 
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
 
K mean-clustering algorithm
K mean-clustering algorithmK mean-clustering algorithm
K mean-clustering algorithm
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
Script
ScriptScript
Script
 
Lecture 11 Informed Search
Lecture 11 Informed SearchLecture 11 Informed Search
Lecture 11 Informed Search
 
Approximation Algorithms
Approximation AlgorithmsApproximation Algorithms
Approximation Algorithms
 
knowledge representation using rules
knowledge representation using rulesknowledge representation using rules
knowledge representation using rules
 

More from Ahmed Gad

ICEIT'20 Cython for Speeding-up Genetic Algorithm
ICEIT'20 Cython for Speeding-up Genetic AlgorithmICEIT'20 Cython for Speeding-up Genetic Algorithm
ICEIT'20 Cython for Speeding-up Genetic AlgorithmAhmed Gad
 
NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutiona...
NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutiona...NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutiona...
NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutiona...Ahmed Gad
 
Python for Computer Vision - Revision 2nd Edition
Python for Computer Vision - Revision 2nd EditionPython for Computer Vision - Revision 2nd Edition
Python for Computer Vision - Revision 2nd EditionAhmed Gad
 
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...Ahmed Gad
 
M.Sc. Thesis - Automatic People Counting in Crowded Scenes
M.Sc. Thesis - Automatic People Counting in Crowded ScenesM.Sc. Thesis - Automatic People Counting in Crowded Scenes
M.Sc. Thesis - Automatic People Counting in Crowded ScenesAhmed Gad
 
Derivation of Convolutional Neural Network from Fully Connected Network Step-...
Derivation of Convolutional Neural Network from Fully Connected Network Step-...Derivation of Convolutional Neural Network from Fully Connected Network Step-...
Derivation of Convolutional Neural Network from Fully Connected Network Step-...Ahmed Gad
 
Introduction to Optimization with Genetic Algorithm (GA)
Introduction to Optimization with Genetic Algorithm (GA)Introduction to Optimization with Genetic Algorithm (GA)
Introduction to Optimization with Genetic Algorithm (GA)Ahmed Gad
 
Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...
Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...
Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...Ahmed Gad
 
Avoid Overfitting with Regularization
Avoid Overfitting with RegularizationAvoid Overfitting with Regularization
Avoid Overfitting with RegularizationAhmed Gad
 
Genetic Algorithm (GA) Optimization - Step-by-Step Example
Genetic Algorithm (GA) Optimization - Step-by-Step ExampleGenetic Algorithm (GA) Optimization - Step-by-Step Example
Genetic Algorithm (GA) Optimization - Step-by-Step ExampleAhmed Gad
 
ICCES 2017 - Crowd Density Estimation Method using Regression Analysis
ICCES 2017 - Crowd Density Estimation Method using Regression AnalysisICCES 2017 - Crowd Density Estimation Method using Regression Analysis
ICCES 2017 - Crowd Density Estimation Method using Regression AnalysisAhmed Gad
 
Backpropagation: Understanding How to Update ANNs Weights Step-by-Step
Backpropagation: Understanding How to Update ANNs Weights Step-by-StepBackpropagation: Understanding How to Update ANNs Weights Step-by-Step
Backpropagation: Understanding How to Update ANNs Weights Step-by-StepAhmed Gad
 
Computer Vision: Correlation, Convolution, and Gradient
Computer Vision: Correlation, Convolution, and GradientComputer Vision: Correlation, Convolution, and Gradient
Computer Vision: Correlation, Convolution, and GradientAhmed Gad
 
Python for Computer Vision - Revision
Python for Computer Vision - RevisionPython for Computer Vision - Revision
Python for Computer Vision - RevisionAhmed Gad
 
Anime Studio Pro 10 Tutorial as Part of Multimedia Course
Anime Studio Pro 10 Tutorial as Part of Multimedia CourseAnime Studio Pro 10 Tutorial as Part of Multimedia Course
Anime Studio Pro 10 Tutorial as Part of Multimedia CourseAhmed Gad
 
Brief Introduction to Deep Learning + Solving XOR using ANNs
Brief Introduction to Deep Learning + Solving XOR using ANNsBrief Introduction to Deep Learning + Solving XOR using ANNs
Brief Introduction to Deep Learning + Solving XOR using ANNsAhmed Gad
 
Operations in Digital Image Processing + Convolution by Example
Operations in Digital Image Processing + Convolution by ExampleOperations in Digital Image Processing + Convolution by Example
Operations in Digital Image Processing + Convolution by ExampleAhmed Gad
 
MATLAB Code + Description : Real-Time Object Motion Detection and Tracking
MATLAB Code + Description : Real-Time Object Motion Detection and TrackingMATLAB Code + Description : Real-Time Object Motion Detection and Tracking
MATLAB Code + Description : Real-Time Object Motion Detection and TrackingAhmed Gad
 
MATLAB Code + Description : Very Simple Automatic English Optical Character R...
MATLAB Code + Description : Very Simple Automatic English Optical Character R...MATLAB Code + Description : Very Simple Automatic English Optical Character R...
MATLAB Code + Description : Very Simple Automatic English Optical Character R...Ahmed Gad
 
Graduation Project - Face Login : A Robust Face Identification System for Sec...
Graduation Project - Face Login : A Robust Face Identification System for Sec...Graduation Project - Face Login : A Robust Face Identification System for Sec...
Graduation Project - Face Login : A Robust Face Identification System for Sec...Ahmed Gad
 

More from Ahmed Gad (20)

ICEIT'20 Cython for Speeding-up Genetic Algorithm
ICEIT'20 Cython for Speeding-up Genetic AlgorithmICEIT'20 Cython for Speeding-up Genetic Algorithm
ICEIT'20 Cython for Speeding-up Genetic Algorithm
 
NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutiona...
NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutiona...NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutiona...
NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutiona...
 
Python for Computer Vision - Revision 2nd Edition
Python for Computer Vision - Revision 2nd EditionPython for Computer Vision - Revision 2nd Edition
Python for Computer Vision - Revision 2nd Edition
 
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...
 
M.Sc. Thesis - Automatic People Counting in Crowded Scenes
M.Sc. Thesis - Automatic People Counting in Crowded ScenesM.Sc. Thesis - Automatic People Counting in Crowded Scenes
M.Sc. Thesis - Automatic People Counting in Crowded Scenes
 
Derivation of Convolutional Neural Network from Fully Connected Network Step-...
Derivation of Convolutional Neural Network from Fully Connected Network Step-...Derivation of Convolutional Neural Network from Fully Connected Network Step-...
Derivation of Convolutional Neural Network from Fully Connected Network Step-...
 
Introduction to Optimization with Genetic Algorithm (GA)
Introduction to Optimization with Genetic Algorithm (GA)Introduction to Optimization with Genetic Algorithm (GA)
Introduction to Optimization with Genetic Algorithm (GA)
 
Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...
Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...
Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...
 
Avoid Overfitting with Regularization
Avoid Overfitting with RegularizationAvoid Overfitting with Regularization
Avoid Overfitting with Regularization
 
Genetic Algorithm (GA) Optimization - Step-by-Step Example
Genetic Algorithm (GA) Optimization - Step-by-Step ExampleGenetic Algorithm (GA) Optimization - Step-by-Step Example
Genetic Algorithm (GA) Optimization - Step-by-Step Example
 
ICCES 2017 - Crowd Density Estimation Method using Regression Analysis
ICCES 2017 - Crowd Density Estimation Method using Regression AnalysisICCES 2017 - Crowd Density Estimation Method using Regression Analysis
ICCES 2017 - Crowd Density Estimation Method using Regression Analysis
 
Backpropagation: Understanding How to Update ANNs Weights Step-by-Step
Backpropagation: Understanding How to Update ANNs Weights Step-by-StepBackpropagation: Understanding How to Update ANNs Weights Step-by-Step
Backpropagation: Understanding How to Update ANNs Weights Step-by-Step
 
Computer Vision: Correlation, Convolution, and Gradient
Computer Vision: Correlation, Convolution, and GradientComputer Vision: Correlation, Convolution, and Gradient
Computer Vision: Correlation, Convolution, and Gradient
 
Python for Computer Vision - Revision
Python for Computer Vision - RevisionPython for Computer Vision - Revision
Python for Computer Vision - Revision
 
Anime Studio Pro 10 Tutorial as Part of Multimedia Course
Anime Studio Pro 10 Tutorial as Part of Multimedia CourseAnime Studio Pro 10 Tutorial as Part of Multimedia Course
Anime Studio Pro 10 Tutorial as Part of Multimedia Course
 
Brief Introduction to Deep Learning + Solving XOR using ANNs
Brief Introduction to Deep Learning + Solving XOR using ANNsBrief Introduction to Deep Learning + Solving XOR using ANNs
Brief Introduction to Deep Learning + Solving XOR using ANNs
 
Operations in Digital Image Processing + Convolution by Example
Operations in Digital Image Processing + Convolution by ExampleOperations in Digital Image Processing + Convolution by Example
Operations in Digital Image Processing + Convolution by Example
 
MATLAB Code + Description : Real-Time Object Motion Detection and Tracking
MATLAB Code + Description : Real-Time Object Motion Detection and TrackingMATLAB Code + Description : Real-Time Object Motion Detection and Tracking
MATLAB Code + Description : Real-Time Object Motion Detection and Tracking
 
MATLAB Code + Description : Very Simple Automatic English Optical Character R...
MATLAB Code + Description : Very Simple Automatic English Optical Character R...MATLAB Code + Description : Very Simple Automatic English Optical Character R...
MATLAB Code + Description : Very Simple Automatic English Optical Character R...
 
Graduation Project - Face Login : A Robust Face Identification System for Sec...
Graduation Project - Face Login : A Robust Face Identification System for Sec...Graduation Project - Face Login : A Robust Face Identification System for Sec...
Graduation Project - Face Login : A Robust Face Identification System for Sec...
 

Recently uploaded

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 

Recently uploaded (20)

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 

Artificial Intelligence Game Search by Examples

  • 1. AI Game Search MENOUFIA UNIVERSITY FACULTY OF COMPUTERS AND INFORMATION ALL DEPARTMENTS ARTIFICIAL INTELLIGENCE ‫المنوفية‬ ‫جامعة‬ ‫والمعلومات‬ ‫الحاسبات‬ ‫كلية‬ ‫األقسام‬ ‫جميع‬ ‫الذكاء‬‫اإلصطناعي‬ ‫المنوفية‬ ‫جامعة‬ Ahmed Fawzy Gad ahmed.fawzy@ci.menofia.edu.eg
  • 4. Minimax Game Search Two Players take turns: Max and Min
  • 5. Minimax Game Search Two Players take turns: Max and Min Max : Maximizes Score. Min : Minimizes Score. MAX
  • 6. Minimax Game Search Two Players take turns: Max and MinMAX MIN
  • 7. Minimax Game Search Two Players take turns: Max and Min Max : Maximizes Score. Min : Minimizes Score. MAX MIN
  • 8. Minimax Game Search Two Players take turns: Max and Min Max : Maximizes Score. Min : Minimizes Score. Special Case. Max is an expert. Min is a beginner. MAX MIN
  • 10. Minimax Game Search Which node to follow? No heuristic values. A B C
  • 11. Minimax Game Search Which node to follow? No heuristic values. A B C
  • 12. Minimax Game Search Which node to follow? No heuristic values. A B C Hot to find heuristic values for other nodes?
  • 13. Minimax Game Search Which node to follow? No heuristic values. A B C Hot to find heuristic values for other nodes? Use children heuristics to calculate parent heuristic.
  • 14. Minimax Game Search Which node to follow? No heuristic values. A B C Hot to find heuristic values for other nodes? Use children heuristics to calculate parent heuristic. Minimax Game Search Steps
  • 15. Minimax Game Search Which node to follow? No heuristic values. A B C Hot to find heuristic values for other nodes? Use children heuristics to calculate parent heuristic. Minimax Game Search Steps Calculate Heuristics
  • 16. Minimax Game Search Which node to follow? No heuristic values. A B C Hot to find heuristic values for other nodes? Use children heuristics to calculate parent heuristic. Minimax Game Search Steps Calculate Heuristics Search
  • 17. Phase 1 : Heuristic Value Calculation Depth-First Search A
  • 18. Phase 1 : Heuristic Value Calculation Depth-First Search A B
  • 19. Phase 1 : Heuristic Value Calculation Depth-First Search A B C
  • 20. Phase 1 : Heuristic Value Calculation Depth-First Search A B CB C
  • 21. Phase 1 : Heuristic Value Calculation Depth-First Search A B B C
  • 22. Phase 1 : Heuristic Value Calculation Depth-First Search A B B C D E B C
  • 23. Phase 1 : Heuristic Value Calculation Depth-First Search A B B C D E B C D E
  • 24. Phase 1 : Heuristic Value Calculation Depth-First Search A B B D C D E B C D E
  • 25. Phase 1 : Heuristic Value Calculation Depth-First Search A B B D H I C D E J B C D E
  • 26. Phase 1 : Heuristic Value Calculation Depth-First Search A B B D H I C D E J B C D E H I J
  • 27. Phase 1 : Heuristic Value Calculation Depth-First Search A B B D H I C D E J B C D E H I J
  • 28. Phase 1 : Heuristic Value Calculation Depth-First Search A B B D H I C D E J 3 -2 5 B C D E H I J
  • 29. Phase 1 : Heuristic Value Calculation Depth-First Search A B B D H I C D E J 3 -2 5 B C D E H I J Max
  • 30. Phase 1 : Heuristic Value Calculation Depth-First Search A B B D H I C D E J 3 -2 5 B C D E H I J Max 5
  • 31. Phase 1 : Heuristic Value Calculation Depth-First Search A B B D H I C D E J 3 -2 5 B C D E H I J Max 5 5
  • 32. Phase 1 : Heuristic Value Calculation Depth-First Search A B B D H I C D E J 3 -2 5 B C D E H I J Max 5 5 5
  • 33. Phase 1 : Heuristic Value Calculation Depth-First Search A B B D H I C D E J 3 -2 5 B C D E H I J Max 5 5 5 5
  • 34. Phase 1 : Heuristic Value Calculation Depth-First Search A B B C D E B C D E5 5
  • 35. Phase 1 : Heuristic Value Calculation Depth-First Search A B B E C D E B C D E5 5
  • 36. Phase 1 : Heuristic Value Calculation Depth-First Search A B B E K L C D E M B C D E5 5
  • 37. Phase 1 : Heuristic Value Calculation Depth-First Search A B B E K L C D E M B C D E K L M 5 5
  • 38. Phase 1 : Heuristic Value Calculation Depth-First Search A B B E K L C D E M 7 0 3 B C D E K L M 5 5
  • 39. Phase 1 : Heuristic Value Calculation Depth-First Search A B B E K L C D E M 7 0 3 B C D E K L M Max 5 5
  • 40. Phase 1 : Heuristic Value Calculation Depth-First Search A B B E K L C D E M 7 0 3 B C D E K L M Max 7 5 5
  • 41. Phase 1 : Heuristic Value Calculation Depth-First Search A B B E K L C D E M 7 0 3 B C D E K L M Max 7 7 5 5
  • 42. Phase 1 : Heuristic Value Calculation Depth-First Search A B B E K L C D E M 7 0 3 B C D E K L M Max 7 7 75 5
  • 43. Phase 1 : Heuristic Value Calculation Depth-First Search A B B E K L C D E M 7 0 3 B C D E K L M Max 7 7 7 Min 5 75
  • 44. Phase 1 : Heuristic Value Calculation Depth-First Search A B B E K L C D E M 7 0 3 B C D E K L M Max 7 7 7 Min5 55 75
  • 45. Phase 1 : Heuristic Value Calculation Depth-First Search A B B E K L C D E M 7 0 3 B C D E K L M Max 7 7 7 Min5 5 55 75
  • 46. Phase 1 : Heuristic Value Calculation Depth-First Search A B B E K L C D E M 7 0 3 B C D E K L M Max 7 7 7 Min5 5 55 7 5 5
  • 47. Phase 1 : Heuristic Value Calculation Depth-First Search A B CB C5 7 5 5
  • 48. Phase 1 : Heuristic Value Calculation Depth-First Search A B C CB C5 7 5 5
  • 49. Phase 1 : Heuristic Value Calculation Depth-First Search A B C C F G B C5 7 5 5
  • 50. Phase 1 : Heuristic Value Calculation Depth-First Search A B C C F G B C5 F G 7 5 5
  • 51. Phase 1 : Heuristic Value Calculation Depth-First Search A B C F C F G B C5 F G 7 5 5
  • 52. Phase 1 : Heuristic Value Calculation Depth-First Search A B C F N O C F G P B C5 F G 7 5 5
  • 53. Phase 1 : Heuristic Value Calculation Depth-First Search A B C F N O C F G P B C N O P 5 F G 7 5 5
  • 54. Phase 1 : Heuristic Value Calculation Depth-First Search A B C F N O C F G P 0 -5 4 B C N O P 5 F G 7 5 5
  • 55. Phase 1 : Heuristic Value Calculation Depth-First Search A B C F N O C F G P 0 -5 4 B C N O P Max 5 F G 7 5 5
  • 56. Phase 1 : Heuristic Value Calculation Depth-First Search A B C F N O C F G P 0 -5 4 B C N O P Max 4 5 F G 7 5 5
  • 57. Phase 1 : Heuristic Value Calculation Depth-First Search A B C F N O C F G P 0 -5 4 B C N O P Max 4 5 4 F G 7 5 5
  • 58. Phase 1 : Heuristic Value Calculation Depth-First Search A B C F N O C F G P 0 -5 4 B C N O P Max 4 5 4 F G4 7 5 5
  • 59. Phase 1 : Heuristic Value Calculation Depth-First Search A B C F N O C F G P 0 -5 4 B C N O P Max 4 5 4 F G4 47 5 5
  • 60. Phase 1 : Heuristic Value Calculation Depth-First Search A B C C F G B C5 F G4 47 5 5
  • 61. Phase 1 : Heuristic Value Calculation Depth-First Search A B C G C F G B C5 F G4 47 5 5
  • 62. Phase 1 : Heuristic Value Calculation Depth-First Search A B C G Q R C F G S B C5 F G4 47 5 5
  • 63. Phase 1 : Heuristic Value Calculation Depth-First Search A B C G Q R C F G S B C Q R S 5 F G4 47 5 5
  • 64. Phase 1 : Heuristic Value Calculation Depth-First Search A B C G Q R C F G S -6 8 2 B C Q R S 5 F G4 47 5 5
  • 65. Phase 1 : Heuristic Value Calculation Depth-First Search A B C G Q R C F G S -6 8 2 B C Q R S Max 5 F G4 47 5 5
  • 66. Phase 1 : Heuristic Value Calculation Depth-First Search A B C G Q R C F G S -6 8 2 B C Q R S Max 8 5 F G4 47 5 5
  • 67. Phase 1 : Heuristic Value Calculation Depth-First Search A B C G Q R C F G S -6 8 2 B C Q R S Max 8 5 8 F G4 47 5 5
  • 68. Phase 1 : Heuristic Value Calculation Depth-First Search A B C G Q R C F G S -6 8 2 B C Q R S Max 8 5 8 F G4 8 47 5 5
  • 69. Phase 1 : Heuristic Value Calculation Depth-First Search A B C G Q R C F G S -6 8 2 B C Q R S Max 8 5 8 F G4 8 Min 847 5 5
  • 70. Phase 1 : Heuristic Value Calculation Depth-First Search A B C G Q R C F G S -6 8 2 B C Q R S Max 8 5 8 F G4 8 Min4 4 847 5 5
  • 71. Phase 1 : Heuristic Value Calculation Depth-First Search A B C G Q R C F G S -6 8 2 B C Q R S Max 8 5 8 F G4 8 Min4 4 4 847 5 5 4
  • 72. Max Phase 1 : Heuristic Value Calculation Depth-First Search A B C G Q R C F G S -6 8 2 B C Q R S Max 8 5 8 F G4 8 Min4 4 4 847 5 5 4
  • 73. Max Phase 1 : Heuristic Value Calculation Depth-First Search A B C G Q R C F G S -6 8 2 B C Q R S Max 8 5 8 F G4 8 Min4 4 4 5 8 4 47 5 5
  • 74. Max Phase 1 : Heuristic Value Calculation Depth-First Search A B C G Q R C F G S -6 8 2 B C Q R S Max 8 5 8 F G4 8 Min4 4 4 5 5 8 4 47 5 5
  • 75. Max Phase 1 : Heuristic Value Calculation Depth-First Search A B C G Q R C F G S -6 8 2 B C Q R S Max 8 5 8 F G4 8 Min4 4 4 5 5 8 4 5 47 5 5
  • 76. Max Phase 1 : Heuristic Value Calculation Depth-First Search A B C G Q R C F G S -6 8 2 B C Q R S Max 8 5 8 F G4 8 Min4 4 4 5 5 8 4 5 47 5 5 If both players play optimally then Max will win by a score 5.
  • 77. Game Tree After Heuristic Value Calculation 8 4 5 47 5 5
  • 78. Phase 2 : Game Search 8 4 5 47 5 5
  • 79. Phase 2 : Game Search 8 4 5 47 5 5 A
  • 80. Phase 2 : Game Search 8 4 5 47 5 5 BMax A
  • 81. Phase 2 : Game Search 8 4 5 47 5 5 B D Max A Min
  • 82. Phase 2 : Game Search 8 4 5 47 5 5 B D J Max Min Max A
  • 83. Minimax Game Search Drawback • Expands all the tree while not all expanded nodes are useful.
  • 84. Minimax Game Search Drawback • Expands all the tree while not all expanded nodes are useful. • In this example, just few nodes of the whole tree was useful in reaching the goal.
  • 86. Alpha-Beta Pruning = Minimax Except • This game search strategy is a modification to Minimax game search that avoids exploring nodes that are not useful in the search. • It gives the same results as Minimax but avoids exploring some nodes. • In the previous example, the path explored using Minimax was A-B-D- J. • Also the Alpha-Beta Pruning path will be A-B-D-J but without exploring all nodes as in Minimax.
  • 87. Alpha-Beta Pruning Motivation Never explore values that are not useful. =Min(Max(1, 2, 5), Max(6, x, y), Max(1, 3, 4)) =Min(5, Max(6, x, y), 4) =Min(Max(6, x, y), 4) =4
  • 112. Alpha-Beta Game Search 7 5 5 5 4 4 Same results as Minimax with fewer nodes explored. 5 Unexplored Branches.