0% found this document useful (0 votes)
13 views20 pages

Unit 03 Adversarial Search

Uploaded by

sktambe371122
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views20 pages

Unit 03 Adversarial Search

Uploaded by

sktambe371122
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Artificial Intelligence

Unit 3- Adversarial Search


By
Kushal P. Birla
Contents
• Game Theory
• Optimal Decisions in Games
• Alpha-Beta Pruning
• CSP
• Inference in CSP
• Backtracking Search for CSPs
• Local Search for CSPs
Game Theory
A Game can be formally defined with the
following elements:
• S0 :-The initial state, which includes the board position and an indication of
whose move it is.
• TO-MOVE (s) :- The player whose turn it is to move in state s.
• ACTIONS(s):- The set of legal moves in state s.
• RESULT (s,a) :- The Transition Model , Which defines the state resulting
from taking action a in state s.
• IS_TERMINAL (s) :- A terminal test, which is true when the game is over or
false otherwise. States where the game has ended are called terminal states.
• UTILITY (s , p) :- A utility function (also called objective function or a
payoff function), which defines the final numeric value to player p when the
game ends in terminal state s. In chess, the outcome is a win, loss, or draw,
which we can represent by the values +1, 0, or 1/2. Some games have a wider
variety of possible outcomes; for example, the payoffs in backgammon range
from +192 to -192.
Example of Tic-Tac-Toe
MiniMax Search
Algorithm
Alpha- Beta Search
function ALPHA-BETA-SEARCH(game, state) returns an action
player←game.TO-MOVE(state)
value, move ←MAX-VALUE(game, state,−∞,+∞)
return move
function MAX-VALUE(game, state,α, β) returns a (utility, move) pair
if game.IS-TERMINAL(state) then return game.UTILITY(state, player ), null
v ←−∞
for each a in game.ACTIONS(state) do
v2 , a2 ←MIN-VALUE(game, game.RESULT(state, a),α, β)
if v2 > v then
v, move ←v2 , a
α←MAX(α, v)
if v ≥ β then return v, move
return v, move
function MIN-VALUE(game, state,α, β) returns a (utility, move) pair
if game.IS-TERMINAL(state) then return game.UTILITY(state, player ), null
v ←+∞
for each a in game.ACTIONS(state) do
v2 , a2 ←MAX-VALUE(game, game.RESULT(state, a),α, β)
if v2 < v then
v, move ←v2 , a
β←MIN(β, v)
if v ≤ α then return v, move
return v, move
CSP

• CSP representation
• Inference in CSP
• Backtracking Search for CSPs
• Local Search for CSPs
Constraint Graph:
Constraint graph for Map problem
cryptarithmetic problem

(a) A cryptarithmetic problem. Each letter stands for a distinct digit; the aim is to find
a substitution of digits for letters such that the resulting sum is arithmetically correct,
with the added restriction that no leading zeroes are allowed.

(b) The constraint hypergraph for the cryptarithmetic problem, showing the
Alldiff constraint (square box at the top) as well as the column addition constraints
(four square boxes in the middle). The variables C1, C2, and C3 represent the carry digits
for the three columns from right to left.
Sudoku
Sudoku
Alldiff (A1, A2,…., A9)
Alldiff (B1, B2,…., B9)

Alldiff (A1, B1, C1,…., I1)


Alldiff (A2, B2, C2,…., I2)
Alldiff (A1, A2, A3,B1,B2,B3, C1,C2,C3)
Alldiff (A4, A5, A6,B4,B5,B6, C4,C5,C6)
Inference in CSP
Constraint Propogation
• Local Consistency
– Node Consistency
– Arc Consistency
– Path Consistency
– K - Consistency
Node Consistency
• Revisit Map problem
• Assign SA=Blue, then reduced domain is {Red, Green}
Arc Consistency
• <(X,Y),{(0,0),(1,1),(2,4),(3,9)}>

You might also like