SlideShare a Scribd company logo
1 of 57
Minimax Algorithm
PRESENTED BY: SULAIMAN M. KARIM
STUDENT NO: 4013031617
E-MAIL: SULAIMAN_MUSARIA@YAHOO.COM
Introduction
 Minimax is one of the oldest heuristic in IT.
 In 1950, the first chess programs were written by
C.Shannon & A.Tuting based on this algorithm.
 IBM’s Deep blue supercomputer defeats the chess
grandmaster kasparov in 1997.
-In two players games with perfect information,
the minimax algorithm can determine the best
move for a player by evaluating (enumerating)
the entire game tree.
-Player 1 is called Max. : Maximizes result.
-Player 2 is called Min.
Minimizes opponent’s
result.
Two persons games
Properties of minimax
 It is complete (if the tree is finite).
 It is Optimal (against an optimal
opponent).
 d=depth of the tree .
 b=legal moves.
1-Time complexity : bᵈ .
2-Space complexity : b*d .
MinMax Algorithm types
1. Game theory.
2. Combinatorial game theory.
3. Minimax for individual decisions.
4. Maximin in philosophy.
Minimax steps
The minimax algorithm consists of 5
steps:-
1-Generate the whole game tree.
2-Apply the utility function to leaf
nodes to get their values.
3-Use the utility of nodes at level N to
determine the utility of nodes at level
N-1 in the search tree.
Minimax steps
4-Continue backing up values
towards the root , layer at a time.
5-Eventually the backed values
reach the top of the tree , at that
point Max chooses the move that
leads to the highest value .
MinMax Algorithm code
Int MinMax (state s, int depth, int type)
{
if( terminate(s)) return Eval(s);
if( type == max ) {
for ( child =1, child <= NmbSuccessor(s); child++) {
value = MinMax(Successor(s, child), depth+1, Min)
if( value > BestScore) BestScore = Value; } }
if( type == min ) {
for ( child =1, child <= NmbSuccessor(s); child++) {
value = MinMax(Successor(s, child), depth+1, Max)
if( value < BestScore) BestScore = Value;
} }
return BestScore; }
Game theory
-In general games:-The maximin value of
a player is the largest value that the player
can be sure to get without knowing the
actions of the other players. Its formal
definition is:-
Example 1 (STEP 1)
 Max
 Min
 Max
B D
E F I J
52 3 4
Example 1 (STEP 1)
 Max
 Min
 Max
B D
E F I J
52 3 4
2
Example 1 (STEP 1)
 Max
 Min
 Max
B D
E F I J
52 3 4
2
2
Example 1 (STEP 1)
 Max
 Min
 Max
B D
E F I J
52 3 4
2
2
4
Example 1 (STEP 1)
 Max
 Min
 Max
B D
E F I J
5
B<D=A
A=D
3 4
2
4
4
2
Example 1 (STEP 2)
 Max
 Min
 Max
B D
E F I J
53 42
We use Alpha= -∞,and Beta= +∞
maximizer=alpha,Minimizer=beta
+∞
-∞
Example 1 (STEP 2)
 Max
 Min
 Max
B D
E F I J
53 42
+∞
-∞
Example 1 (STEP 2)
 Max
 Min
 Max
B D
E F I J
53 42
2
-∞
Example 1 (STEP 2)
 Max
 Min
 Max
B D
E F I J
53 42
2
2
Example 1 (STEP 2)
 Max
 Min
 Max
B D
E F I J
53 42
2
2
+∞
Example 1 (STEP 2)
 Max
 Min
 Max
B D
E F I J
53 42
2
2
4
Example 1 (STEP 2)
 Max
 Min
 Max
B D
E F I J
53 42
2
2
4
B<D
A=D
Progressive deepening(STEP 3)
 Max
 Min
 Max
BD
E F
IJ
354
2
2
4
4
Example 2 (STEP 1)
 Max
 Min
 Max
 Min
B D
E F I J
52 3 4
C
Z X
MS
81
9
Example 2 (STEP 1)
 Max
 Min
 Max
 Min
B D
E F I J
52 3 4
C
Z X
MS
81
9
2
Example 2 (STEP 1)
 Max
 Min
 Max
 Min
B D
E F I J
52 3 4
C
Z X
MS
81
9
2
2
8
Example 2 (STEP 1)
 Max
 Min
 Max
 Min
B D
E F I J
52 3 4
C
Z X
MS
81
9
2
2
8
8
Example 2 (STEP 1)
 Max
 Min
 Max
 Min
B D
E F I J
52 3 4
C
Z X
MS
81
9
2
8
8
8
B<C
A=C
Example 2 (STEP 1)
 Max
 Min
 Max
 Min
B D
E F I J
52 3 4
C
Z X
MS
81
9
2
8
8
8
4
Example 2 (STEP 1)
 Max
 Min
 Max
 Min
B D
E F I J
52 3 4
C
Z X
MS
81
9
2
8
8
8
4
C>D
A=C
Example 2 (STEP 2)
 Max
 Min
 Max
 Min
B D
E F I J
52 3 4
C
Z X
MS
81
9
We use Alpha= -∞,and Beta= +∞
maximizer=alpha,Minimizer=beta
+∞
-∞
Example 2 (STEP 2)
 Max
 Min
 Max
 Min
B D
E F I J
52 3 4
C
Z X
MS
81
9
+∞
-∞
Example 2 (STEP 2)
 Max
 Min
 Max
 Min
B D
E F I J
52 3 4
C
Z X
MS
81
9
2
-∞
Example 2 (STEP 2)
 Max
 Min
 Max
 Min
B D
E F I J
52 3 4
C
Z X
MS
81
9
2
2
Example 2 (STEP 2)
 Max
 Min
 Max
 Min
B D
E F I J
52 3 4
C
Z X
MS
81
9
2
2
+∞
Example 2 (STEP 2)
 Max
 Min
 Max
 Min
B D
E F I J
52 3 4
C
Z X
MS
81
9
2
2
+∞
8
Example 2 (STEP 2)
 Max
 Min
 Max
 Min
B D
E F I J
52 3 4
C
Z X
MS
81
9
2
2
8
8
Example 2 (STEP 2)
 Max
 Min
 Max
 Min
B D
E F I J
52 3 4
C
Z X
MS
81
9
2
8
8
8
B<C
A=C
Example 2 (STEP 2)
 Max
 Min
 Max
 Min
B D
E F I J
52 3 4
C
Z X
MS
81
9
2
8
8
8
∞+
Example 2 (STEP 2)
 Max
 Min
 Max
 Min
B D
E F I J
52 3 4
C
Z X
MS
81
9
2
8
8
8
4
Example 2 (STEP 2)
 Max
 Min
 Max
 Min
B D
E F I J
52 3 4
C
Z X
MS
81
9
2
8
8
8
C>D
A=C
4
Example 2 (STEP 2)
 Max
 Min
 Max
 Min
B D
E F I J
52 3 4
C
Z X
MS
81
9
2
8
8
8
4
Here we will use prune for the nodes that’s we
don’t need it again like node (S).
Progressive deepening(STEP 3)
 Max
 Min
 Max
C B
Z X E F
28 9 3
D
J I
5
8
8
4
4
2
Example 3 (STEP 1)
 Max
 Min
 Max
 Min
 Max
B C D
E F G H I J
K L M N O P
Q R
1 10
202703
12 6
Example 3(STEP 1)
 Max
 Min
 Max
 Min
 Max
B C D
E F G H I J
K L M N O P
Q R
1 10
202703
12 6
2
2
3
Example 3 (STEP 1)
 Max
 Min
 Max
 Min
 Max
B C D
E F G H I J
K L M N O P
Q R
1 10
202703
12 6
2
2<6=6
1
7
6
3
Example 3 (STEP 1)
 Max
 Min
 Max
 Min
 Max
B C D
E F G H I J
K L M N O P
Q R
1 10
202703
12 6
2
6>1=6
1
7
6
20
1
3
Example 3(STEP 2)
 Max
 Min
 Max
 Min
 Max
B C D
E F G H I J
K L M N O P
Q R
1 10
202703
12 6
We use Alpha= -∞,and Beta= +∞
maximizer=alpha,Minimizer=beta
+∞
-∞
Example 3(STEP 2)
 Max
 Min
 Max
 Min
 Max
B C D
E F G H I J
K L M N O P
Q R
1 10
202703
12 6
We use Alpha= -∞,and Beta= +∞
maximizer=alpha,Minimizer=beta
+∞
-∞
Example 3(STEP 2)
 Max
 Min
 Max
 Min
 Max
B C D
E F G H I J
K L M N O P
Q R
1 10
202703
12 6
2
-∞
3
Example 3(STEP 2)
 Max
 Min
 Max
 Min
 Max
B C D
E F G H I J
K L M N O P
Q R
1 10
202703
12 6
2
2
3
-∞
Example 3(STEP 2)
 Max
 Min
 Max
 Min
 Max
B C D
E F G H I J
K L M N O P
Q R
1 10
202703
12 6
2
2<6=6
3
6
1
7
Example 3(STEP 2)
 Max
 Min
 Max
 Min
 Max
B C D
E F G H I J
K L M N O P
Q R
1 10
202703
12 6
2
6
3
6
1
7
-∞
Example 3(STEP 2)
 Max
 Min
 Max
 Min
 Max
B C D
E F G H I J
K L M N O P
Q R
1 10
202703
12 6
2
6>1=6
3
6
1
7
1
20
Example 3 (STEP 2)
 Max
 Min
 Max
 Min
 Max
B C D
E F G H I J
K L M N O P
Q R
1 10
202703
12 6
2
6
3
6
1
7
1
20
Example 3 (STEP 2)
 Max
 Min
 Max
 Min
 Max
B C D
E F G H I J
K L M N O P
Q R
1 10
202703
12 6
2
6
3
6
1
7
1
20
Here we will use prune for the nodes that’s we
don’t need it again
Progressive deepening(STEP 3)
 Max
 Min
 Max
B C D
E F G H I J
2
6
3
6
7
1
2012 6
Progressive deepening(STEP 3)
 Max
 Min
 Max
BC D
E FGH
I J
2
6
3
6
7
1
201
26

More Related Content

What's hot

Codes from the cyclic group of order three
Codes from the cyclic group of order threeCodes from the cyclic group of order three
Codes from the cyclic group of order threeEditor Jacotech
 
B tree by-jash acharya
B tree by-jash acharyaB tree by-jash acharya
B tree by-jash acharyaJash Acharya
 
McGregor Grouping and Ungrouping Lesson
McGregor Grouping and Ungrouping LessonMcGregor Grouping and Ungrouping Lesson
McGregor Grouping and Ungrouping Lessonmcgre1cn
 
Compfuncdiff
CompfuncdiffCompfuncdiff
Compfuncdiffdianenz
 
6.1 & 6.4 an overview of the area problem area
6.1 & 6.4 an overview of the area problem area6.1 & 6.4 an overview of the area problem area
6.1 & 6.4 an overview of the area problem areadicosmo178
 
Solutions to the algebra of summation notation
Solutions to the algebra of summation notationSolutions to the algebra of summation notation
Solutions to the algebra of summation notationMi L
 
Digital textbook -EXPONENTS AND POWERS
Digital textbook -EXPONENTS AND POWERSDigital textbook -EXPONENTS AND POWERS
Digital textbook -EXPONENTS AND POWERSGANESHKRISHNANG
 
ゲーム理論NEXT コア第4回(最終回) -平衡ゲームとコア-
ゲーム理論NEXT コア第4回(最終回) -平衡ゲームとコア-ゲーム理論NEXT コア第4回(最終回) -平衡ゲームとコア-
ゲーム理論NEXT コア第4回(最終回) -平衡ゲームとコア-ssusere0a682
 
On approximate bounds of zeros of polynomials within
On approximate bounds of zeros of polynomials withinOn approximate bounds of zeros of polynomials within
On approximate bounds of zeros of polynomials withineSAT Publishing House
 
ゲーム理論BASIC 演習7 -シャープレイ値を求める-
ゲーム理論BASIC 演習7 -シャープレイ値を求める-ゲーム理論BASIC 演習7 -シャープレイ値を求める-
ゲーム理論BASIC 演習7 -シャープレイ値を求める-ssusere0a682
 
Digital signal processing (2nd ed) (mitra) solution manual
Digital signal processing (2nd ed) (mitra) solution manualDigital signal processing (2nd ed) (mitra) solution manual
Digital signal processing (2nd ed) (mitra) solution manualRamesh Sundar
 
الجلسة الأولى
الجلسة الأولىالجلسة الأولى
الجلسة الأولىYaman Rajab
 
4.5 calculation with log and exp t
4.5 calculation with log and exp t4.5 calculation with log and exp t
4.5 calculation with log and exp tmath260
 
Niem khuccuoi kyam
Niem khuccuoi kyamNiem khuccuoi kyam
Niem khuccuoi kyam1bidvn1616
 

What's hot (18)

Codes from the cyclic group of order three
Codes from the cyclic group of order threeCodes from the cyclic group of order three
Codes from the cyclic group of order three
 
B tree by-jash acharya
B tree by-jash acharyaB tree by-jash acharya
B tree by-jash acharya
 
McGregor Grouping and Ungrouping Lesson
McGregor Grouping and Ungrouping LessonMcGregor Grouping and Ungrouping Lesson
McGregor Grouping and Ungrouping Lesson
 
B tree
B treeB tree
B tree
 
Ch10
Ch10Ch10
Ch10
 
Compfuncdiff
CompfuncdiffCompfuncdiff
Compfuncdiff
 
6.1 & 6.4 an overview of the area problem area
6.1 & 6.4 an overview of the area problem area6.1 & 6.4 an overview of the area problem area
6.1 & 6.4 an overview of the area problem area
 
Solutions to the algebra of summation notation
Solutions to the algebra of summation notationSolutions to the algebra of summation notation
Solutions to the algebra of summation notation
 
Sol3
Sol3Sol3
Sol3
 
Digital textbook -EXPONENTS AND POWERS
Digital textbook -EXPONENTS AND POWERSDigital textbook -EXPONENTS AND POWERS
Digital textbook -EXPONENTS AND POWERS
 
ゲーム理論NEXT コア第4回(最終回) -平衡ゲームとコア-
ゲーム理論NEXT コア第4回(最終回) -平衡ゲームとコア-ゲーム理論NEXT コア第4回(最終回) -平衡ゲームとコア-
ゲーム理論NEXT コア第4回(最終回) -平衡ゲームとコア-
 
On approximate bounds of zeros of polynomials within
On approximate bounds of zeros of polynomials withinOn approximate bounds of zeros of polynomials within
On approximate bounds of zeros of polynomials within
 
ゲーム理論BASIC 演習7 -シャープレイ値を求める-
ゲーム理論BASIC 演習7 -シャープレイ値を求める-ゲーム理論BASIC 演習7 -シャープレイ値を求める-
ゲーム理論BASIC 演習7 -シャープレイ値を求める-
 
Digital signal processing (2nd ed) (mitra) solution manual
Digital signal processing (2nd ed) (mitra) solution manualDigital signal processing (2nd ed) (mitra) solution manual
Digital signal processing (2nd ed) (mitra) solution manual
 
Bb2
Bb2Bb2
Bb2
 
الجلسة الأولى
الجلسة الأولىالجلسة الأولى
الجلسة الأولى
 
4.5 calculation with log and exp t
4.5 calculation with log and exp t4.5 calculation with log and exp t
4.5 calculation with log and exp t
 
Niem khuccuoi kyam
Niem khuccuoi kyamNiem khuccuoi kyam
Niem khuccuoi kyam
 

Similar to Minimax Algorithm

Jarrar.lecture notes.aai.2011s.ch6.games
Jarrar.lecture notes.aai.2011s.ch6.gamesJarrar.lecture notes.aai.2011s.ch6.games
Jarrar.lecture notes.aai.2011s.ch6.gamesPalGov
 
Juegos minimax AlfaBeta
Juegos minimax AlfaBetaJuegos minimax AlfaBeta
Juegos minimax AlfaBetanelsonbc20
 
Graphical Method
Graphical MethodGraphical Method
Graphical MethodSachin MK
 
Game Theory Operation Research
Game Theory Operation ResearchGame Theory Operation Research
Game Theory Operation ResearchR A Shah
 
Image segmentation
Image segmentation Image segmentation
Image segmentation Amnaakhaan
 
Spm additional-mathematical-formulae-pdf
Spm additional-mathematical-formulae-pdfSpm additional-mathematical-formulae-pdf
Spm additional-mathematical-formulae-pdfMahadzir Ismail
 
Spm additional-mathematical-formulae-pdf
Spm additional-mathematical-formulae-pdfSpm additional-mathematical-formulae-pdf
Spm additional-mathematical-formulae-pdfMahadzir Ismail
 
De thi hsg lop 9 co dap an de 9
De thi hsg lop 9 co dap an   de 9De thi hsg lop 9 co dap an   de 9
De thi hsg lop 9 co dap an de 9Trần Lê Quốc
 
1)  Use properties of logarithms to expand the following logarit.docx
1)  Use properties of logarithms to expand the following logarit.docx1)  Use properties of logarithms to expand the following logarit.docx
1)  Use properties of logarithms to expand the following logarit.docxhirstcruz
 
Business Math Chapter 2
Business Math Chapter 2Business Math Chapter 2
Business Math Chapter 2Nazrin Nazdri
 
Solucionario_de_Chapra_y_Canale_Quinta_E.pdf
Solucionario_de_Chapra_y_Canale_Quinta_E.pdfSolucionario_de_Chapra_y_Canale_Quinta_E.pdf
Solucionario_de_Chapra_y_Canale_Quinta_E.pdfJeancarlosPatalasanc
 
Chapter 7: Matrix Multiplication
Chapter 7: Matrix MultiplicationChapter 7: Matrix Multiplication
Chapter 7: Matrix MultiplicationHeman Pathak
 
Calculus And Its Applications 10th Edition Bittinger Solutions Manual
Calculus And Its Applications 10th Edition Bittinger Solutions ManualCalculus And Its Applications 10th Edition Bittinger Solutions Manual
Calculus And Its Applications 10th Edition Bittinger Solutions Manualfujumazaja
 
3 chapter2 algorithm_analysispart2
3 chapter2 algorithm_analysispart23 chapter2 algorithm_analysispart2
3 chapter2 algorithm_analysispart2SSE_AndyLi
 
AST: threats and opportunities
AST: threats and opportunitiesAST: threats and opportunities
AST: threats and opportunitiesAlexander Lifanov
 
1) Use properties of logarithms to expand the following logarithm.docx
1)  Use properties of logarithms to expand the following logarithm.docx1)  Use properties of logarithms to expand the following logarithm.docx
1) Use properties of logarithms to expand the following logarithm.docxdorishigh
 

Similar to Minimax Algorithm (20)

Jarrar.lecture notes.aai.2011s.ch6.games
Jarrar.lecture notes.aai.2011s.ch6.gamesJarrar.lecture notes.aai.2011s.ch6.games
Jarrar.lecture notes.aai.2011s.ch6.games
 
Juegos minimax AlfaBeta
Juegos minimax AlfaBetaJuegos minimax AlfaBeta
Juegos minimax AlfaBeta
 
Graphical Method
Graphical MethodGraphical Method
Graphical Method
 
Game Theory Operation Research
Game Theory Operation ResearchGame Theory Operation Research
Game Theory Operation Research
 
1.game
1.game1.game
1.game
 
Image segmentation
Image segmentation Image segmentation
Image segmentation
 
Spm additional-mathematical-formulae-pdf
Spm additional-mathematical-formulae-pdfSpm additional-mathematical-formulae-pdf
Spm additional-mathematical-formulae-pdf
 
Spm additional-mathematical-formulae-pdf
Spm additional-mathematical-formulae-pdfSpm additional-mathematical-formulae-pdf
Spm additional-mathematical-formulae-pdf
 
De thi hsg lop 9 co dap an de 9
De thi hsg lop 9 co dap an   de 9De thi hsg lop 9 co dap an   de 9
De thi hsg lop 9 co dap an de 9
 
1)  Use properties of logarithms to expand the following logarit.docx
1)  Use properties of logarithms to expand the following logarit.docx1)  Use properties of logarithms to expand the following logarit.docx
1)  Use properties of logarithms to expand the following logarit.docx
 
Business Math Chapter 2
Business Math Chapter 2Business Math Chapter 2
Business Math Chapter 2
 
Indices
IndicesIndices
Indices
 
Solucionario_de_Chapra_y_Canale_Quinta_E.pdf
Solucionario_de_Chapra_y_Canale_Quinta_E.pdfSolucionario_de_Chapra_y_Canale_Quinta_E.pdf
Solucionario_de_Chapra_y_Canale_Quinta_E.pdf
 
Chapter 7: Matrix Multiplication
Chapter 7: Matrix MultiplicationChapter 7: Matrix Multiplication
Chapter 7: Matrix Multiplication
 
Calculus And Its Applications 10th Edition Bittinger Solutions Manual
Calculus And Its Applications 10th Edition Bittinger Solutions ManualCalculus And Its Applications 10th Edition Bittinger Solutions Manual
Calculus And Its Applications 10th Edition Bittinger Solutions Manual
 
3 chapter2 algorithm_analysispart2
3 chapter2 algorithm_analysispart23 chapter2 algorithm_analysispart2
3 chapter2 algorithm_analysispart2
 
AST: threats and opportunities
AST: threats and opportunitiesAST: threats and opportunities
AST: threats and opportunities
 
Factoring quadratic trinomial
Factoring quadratic trinomialFactoring quadratic trinomial
Factoring quadratic trinomial
 
1) Use properties of logarithms to expand the following logarithm.docx
1)  Use properties of logarithms to expand the following logarithm.docx1)  Use properties of logarithms to expand the following logarithm.docx
1) Use properties of logarithms to expand the following logarithm.docx
 
power and exponents
power and exponents power and exponents
power and exponents
 

Recently uploaded

Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 

Recently uploaded (20)

Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 

Minimax Algorithm

  • 1. Minimax Algorithm PRESENTED BY: SULAIMAN M. KARIM STUDENT NO: 4013031617 E-MAIL: SULAIMAN_MUSARIA@YAHOO.COM
  • 2. Introduction  Minimax is one of the oldest heuristic in IT.  In 1950, the first chess programs were written by C.Shannon & A.Tuting based on this algorithm.  IBM’s Deep blue supercomputer defeats the chess grandmaster kasparov in 1997.
  • 3. -In two players games with perfect information, the minimax algorithm can determine the best move for a player by evaluating (enumerating) the entire game tree. -Player 1 is called Max. : Maximizes result. -Player 2 is called Min. Minimizes opponent’s result. Two persons games
  • 4. Properties of minimax  It is complete (if the tree is finite).  It is Optimal (against an optimal opponent).  d=depth of the tree .  b=legal moves. 1-Time complexity : bᵈ . 2-Space complexity : b*d .
  • 5. MinMax Algorithm types 1. Game theory. 2. Combinatorial game theory. 3. Minimax for individual decisions. 4. Maximin in philosophy.
  • 6. Minimax steps The minimax algorithm consists of 5 steps:- 1-Generate the whole game tree. 2-Apply the utility function to leaf nodes to get their values. 3-Use the utility of nodes at level N to determine the utility of nodes at level N-1 in the search tree.
  • 7. Minimax steps 4-Continue backing up values towards the root , layer at a time. 5-Eventually the backed values reach the top of the tree , at that point Max chooses the move that leads to the highest value .
  • 8. MinMax Algorithm code Int MinMax (state s, int depth, int type) { if( terminate(s)) return Eval(s); if( type == max ) { for ( child =1, child <= NmbSuccessor(s); child++) { value = MinMax(Successor(s, child), depth+1, Min) if( value > BestScore) BestScore = Value; } } if( type == min ) { for ( child =1, child <= NmbSuccessor(s); child++) { value = MinMax(Successor(s, child), depth+1, Max) if( value < BestScore) BestScore = Value; } } return BestScore; }
  • 9. Game theory -In general games:-The maximin value of a player is the largest value that the player can be sure to get without knowing the actions of the other players. Its formal definition is:-
  • 10. Example 1 (STEP 1)  Max  Min  Max B D E F I J 52 3 4
  • 11. Example 1 (STEP 1)  Max  Min  Max B D E F I J 52 3 4 2
  • 12. Example 1 (STEP 1)  Max  Min  Max B D E F I J 52 3 4 2 2
  • 13. Example 1 (STEP 1)  Max  Min  Max B D E F I J 52 3 4 2 2 4
  • 14. Example 1 (STEP 1)  Max  Min  Max B D E F I J 5 B<D=A A=D 3 4 2 4 4 2
  • 15. Example 1 (STEP 2)  Max  Min  Max B D E F I J 53 42 We use Alpha= -∞,and Beta= +∞ maximizer=alpha,Minimizer=beta +∞ -∞
  • 16. Example 1 (STEP 2)  Max  Min  Max B D E F I J 53 42 +∞ -∞
  • 17. Example 1 (STEP 2)  Max  Min  Max B D E F I J 53 42 2 -∞
  • 18. Example 1 (STEP 2)  Max  Min  Max B D E F I J 53 42 2 2
  • 19. Example 1 (STEP 2)  Max  Min  Max B D E F I J 53 42 2 2 +∞
  • 20. Example 1 (STEP 2)  Max  Min  Max B D E F I J 53 42 2 2 4
  • 21. Example 1 (STEP 2)  Max  Min  Max B D E F I J 53 42 2 2 4 B<D A=D
  • 22. Progressive deepening(STEP 3)  Max  Min  Max BD E F IJ 354 2 2 4 4
  • 23. Example 2 (STEP 1)  Max  Min  Max  Min B D E F I J 52 3 4 C Z X MS 81 9
  • 24. Example 2 (STEP 1)  Max  Min  Max  Min B D E F I J 52 3 4 C Z X MS 81 9 2
  • 25. Example 2 (STEP 1)  Max  Min  Max  Min B D E F I J 52 3 4 C Z X MS 81 9 2 2 8
  • 26. Example 2 (STEP 1)  Max  Min  Max  Min B D E F I J 52 3 4 C Z X MS 81 9 2 2 8 8
  • 27. Example 2 (STEP 1)  Max  Min  Max  Min B D E F I J 52 3 4 C Z X MS 81 9 2 8 8 8 B<C A=C
  • 28. Example 2 (STEP 1)  Max  Min  Max  Min B D E F I J 52 3 4 C Z X MS 81 9 2 8 8 8 4
  • 29. Example 2 (STEP 1)  Max  Min  Max  Min B D E F I J 52 3 4 C Z X MS 81 9 2 8 8 8 4 C>D A=C
  • 30. Example 2 (STEP 2)  Max  Min  Max  Min B D E F I J 52 3 4 C Z X MS 81 9 We use Alpha= -∞,and Beta= +∞ maximizer=alpha,Minimizer=beta +∞ -∞
  • 31. Example 2 (STEP 2)  Max  Min  Max  Min B D E F I J 52 3 4 C Z X MS 81 9 +∞ -∞
  • 32. Example 2 (STEP 2)  Max  Min  Max  Min B D E F I J 52 3 4 C Z X MS 81 9 2 -∞
  • 33. Example 2 (STEP 2)  Max  Min  Max  Min B D E F I J 52 3 4 C Z X MS 81 9 2 2
  • 34. Example 2 (STEP 2)  Max  Min  Max  Min B D E F I J 52 3 4 C Z X MS 81 9 2 2 +∞
  • 35. Example 2 (STEP 2)  Max  Min  Max  Min B D E F I J 52 3 4 C Z X MS 81 9 2 2 +∞ 8
  • 36. Example 2 (STEP 2)  Max  Min  Max  Min B D E F I J 52 3 4 C Z X MS 81 9 2 2 8 8
  • 37. Example 2 (STEP 2)  Max  Min  Max  Min B D E F I J 52 3 4 C Z X MS 81 9 2 8 8 8 B<C A=C
  • 38. Example 2 (STEP 2)  Max  Min  Max  Min B D E F I J 52 3 4 C Z X MS 81 9 2 8 8 8 ∞+
  • 39. Example 2 (STEP 2)  Max  Min  Max  Min B D E F I J 52 3 4 C Z X MS 81 9 2 8 8 8 4
  • 40. Example 2 (STEP 2)  Max  Min  Max  Min B D E F I J 52 3 4 C Z X MS 81 9 2 8 8 8 C>D A=C 4
  • 41. Example 2 (STEP 2)  Max  Min  Max  Min B D E F I J 52 3 4 C Z X MS 81 9 2 8 8 8 4 Here we will use prune for the nodes that’s we don’t need it again like node (S).
  • 42. Progressive deepening(STEP 3)  Max  Min  Max C B Z X E F 28 9 3 D J I 5 8 8 4 4 2
  • 43. Example 3 (STEP 1)  Max  Min  Max  Min  Max B C D E F G H I J K L M N O P Q R 1 10 202703 12 6
  • 44. Example 3(STEP 1)  Max  Min  Max  Min  Max B C D E F G H I J K L M N O P Q R 1 10 202703 12 6 2 2 3
  • 45. Example 3 (STEP 1)  Max  Min  Max  Min  Max B C D E F G H I J K L M N O P Q R 1 10 202703 12 6 2 2<6=6 1 7 6 3
  • 46. Example 3 (STEP 1)  Max  Min  Max  Min  Max B C D E F G H I J K L M N O P Q R 1 10 202703 12 6 2 6>1=6 1 7 6 20 1 3
  • 47. Example 3(STEP 2)  Max  Min  Max  Min  Max B C D E F G H I J K L M N O P Q R 1 10 202703 12 6 We use Alpha= -∞,and Beta= +∞ maximizer=alpha,Minimizer=beta +∞ -∞
  • 48. Example 3(STEP 2)  Max  Min  Max  Min  Max B C D E F G H I J K L M N O P Q R 1 10 202703 12 6 We use Alpha= -∞,and Beta= +∞ maximizer=alpha,Minimizer=beta +∞ -∞
  • 49. Example 3(STEP 2)  Max  Min  Max  Min  Max B C D E F G H I J K L M N O P Q R 1 10 202703 12 6 2 -∞ 3
  • 50. Example 3(STEP 2)  Max  Min  Max  Min  Max B C D E F G H I J K L M N O P Q R 1 10 202703 12 6 2 2 3 -∞
  • 51. Example 3(STEP 2)  Max  Min  Max  Min  Max B C D E F G H I J K L M N O P Q R 1 10 202703 12 6 2 2<6=6 3 6 1 7
  • 52. Example 3(STEP 2)  Max  Min  Max  Min  Max B C D E F G H I J K L M N O P Q R 1 10 202703 12 6 2 6 3 6 1 7 -∞
  • 53. Example 3(STEP 2)  Max  Min  Max  Min  Max B C D E F G H I J K L M N O P Q R 1 10 202703 12 6 2 6>1=6 3 6 1 7 1 20
  • 54. Example 3 (STEP 2)  Max  Min  Max  Min  Max B C D E F G H I J K L M N O P Q R 1 10 202703 12 6 2 6 3 6 1 7 1 20
  • 55. Example 3 (STEP 2)  Max  Min  Max  Min  Max B C D E F G H I J K L M N O P Q R 1 10 202703 12 6 2 6 3 6 1 7 1 20 Here we will use prune for the nodes that’s we don’t need it again
  • 56. Progressive deepening(STEP 3)  Max  Min  Max B C D E F G H I J 2 6 3 6 7 1 2012 6
  • 57. Progressive deepening(STEP 3)  Max  Min  Max BC D E FGH I J 2 6 3 6 7 1 201 26