The Alpha-Beta Procedure There are two rules for terminating search: Search can be stopped below any MIN node having a beta value less than or equal to the alpha value of any of its MAX ancestors. Search can be stopped below any MAX node having an alpha value greater than or equal to the beta value of any of its MIN ancestors. The Alpha-Beta Procedure Example: max min max min The Alpha-Beta Procedure Example: max min max =4 4 min The Alpha-Beta Procedure Example: max min max =4 4 5 min The Alpha-Beta Procedure Example: max min =3 =3 4 5 3 max min The Alpha-Beta Procedure Example: max min =3 =3 max =1 4 5 3 1 min The Alpha-Beta Procedure Example: max =3 min =3 =3 max =1 =8 4 5 3 1 8 min The Alpha-Beta Procedure Example: max =3 min =3 =3 max =1 4 5 3 1 =6 8 6 min The Alpha-Beta Procedure Example: max =3 =3 =3 min =6 =1 4 5 3 1 =6 8 6 7 max min The Alpha-Beta Procedure =3 Example: =3 =3 =3 min =6 =1 4 5 3 1 max =6 8 6 7 max min The Alpha-Beta Procedure =3 Example: max =3 =3 =3 min =6 =1 4 5 3 1 =6 8 6 7 max =2 2 min The Alpha-Beta Procedure =3 Example: max =3 =3 =3 min =6 =1 4 5 3 1 =6 8 6 7 =3 =2 2 max min The Alpha-Beta Procedure =3 Example: max =3 =3 =3 min =6 =1 4 5 3 1 =6 8 6 7 =3 max =2 =5 2 5 min The Alpha-Beta Procedure =3 Example: max =3 =3 =3 min =6 =1 4 5 3 1 =6 8 6 7 =3 =2 2 max =4 5 4 min The Alpha-Beta Procedure =3 Example: max =3 =3 =3 =4 =6 =1 4 5 3 1 =6 8 6 7 =4 =2 2 min max =4 5 4 4 min The Alpha-Beta Procedure =3 Example: max =3 =3 =3 =4 =6 =1 4 5 3 1 =6 8 6 7 min =4 =2 2 max =4 =6 5 4 4 6 min The Alpha-Beta Procedure =3 Example: max =3 =3 =3 =4 =6 =1 4 5 3 1 =6 8 6 7 min =4 =2 2 max =4 =6 5 4 4 6 7 min The Alpha-Beta Procedure =4 Example: max =3 =3 =3 =4 =6 =1 4 5 3 1 =6 8 6 7 min =4 =2 2 =6 =4 =6 5 4 4 6 7 7 max min The Alpha-Beta Procedure =4 Example: Done! =3 =3 =3 =4 =6 =1 4 5 3 1 =6 8 6 7 min =4 =2 2 =6 =4 max =6 5 4 4 6 7 7 max min Real Time A* Considers the cost (> 0) for switching from one branch to another in the search Example: path finding in real life 11 4 1 F D B f(B) = 1 + 1 = 2 f(D) = 1 + 4 = 5 f(B) = 1 + 5 = 6 f(A) = 1 + 6 = 7 f(B) = 1 + 5 = 6 f(D) = 1 + 4 = 5 f(F)=1+11= 12 (D) A 2 7 16 C E G (A) (B) (A) (C) (A) (B) f(C) = f(A) = f(C) = f(E) = f(C) = f(A) = f(B) = 1+2=3 1+3=4 1+2=3 1+7=8 1+8=9 1 + 9 = 10 1 + 10 = 11
© Copyright 2025 Paperzz