0% found this document useful (0 votes)
2 views

Adversarial search

Adversarial search is a strategy used in competitive environments where agents have conflicting goals, particularly in two-player zero-sum games. It enables AI agents to make optimal decisions by anticipating opponents' actions, and is crucial in game-playing scenarios and decision-making processes. The Minimax algorithm is a key component of adversarial search, operating on a game tree to determine the best move by maximizing the chances of winning for the player.

Uploaded by

hadi rakab
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Adversarial search

Adversarial search is a strategy used in competitive environments where agents have conflicting goals, particularly in two-player zero-sum games. It enables AI agents to make optimal decisions by anticipating opponents' actions, and is crucial in game-playing scenarios and decision-making processes. The Minimax algorithm is a key component of adversarial search, operating on a game tree to determine the best move by maximizing the chances of winning for the player.

Uploaded by

hadi rakab
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Adversarial Search

 The Adversarial search is a well-suited approach in a


competitive environment, where two or more agents have conflicting
goals.

 The adversarial search can be employed in two-player zero-sum


games which means what is good for one player will be the misfortune
for the other.
 In such a case, there is no win-win outcome. In artificial intelligence,
adversarial search plays a vital role in decision-making, particularly in
competitive environments associated with games and strategic
interactions.

 By employing adversarial search, AI agents can make optimal


decisions while anticipating the actions of an opponent with their
opposing objectives.

 It aims to establish an effective decision for a player by considering the


possible moves and the counter-moves of the opponents.

 The adversarial search in competitive environments can be utilized in


the below scenarios where the AI system can assist in determining the
best course of action by both considering the possible moves and
counter-moves of the opponents:
 Each agent seeks to boost their utility or minimize their loss.
 One agent’s action impacts the outcomes and objectives of the other
agents.
 Additionally, strategic uncertainty arises when the agents may lack
sufficient information about each other’s strategies.
Role of Adversarial Search in AI
 Game-playing: The Adversarial search finds a significant application
in game-playing scenarios, including renowned games like chess, Go,
and poker. The adversarial search offers the simplified nature of these
games that represents the state of a game in a straightforward approach
and the agents are limited to a small number of actions whose effects are
governed by precise rules.

 Decision-making: Decision-making plays a central role in adversarial


search algorithms, where the goal is to find the best possible move or
strategy for a player in a competitive environment against one or more
components. This requires strategic thinking, evaluation of potential
outcomes, and adaptive decision-making throughout the game.

Minimax algorithm

 The Minimax algorithm is claimed to be a recursive or backtracking


algorithm that is responsible for choosing the best optimal move in the
conflicting environment.

 The Minimax algorithm operates on a tree structure known as the


game tree, which is the collection of all the possible moves in the
corresponding game states in a given game.

 The game tree’s leaf node accommodates all the possible moves. The
game state denotes the current board condition.

 With every single move, the game state changes and the game tree
gets updated height-wise.

 This algorithm simply works by proceeding down to the tree until it


reaches the leaf node and then it backs up the minimax values through
the tree as the recursion unwinds.
 The prime motive of the Minimax algorithm is to maximize the chance
of winning for the maximizer.

 In the game tree, every node is assigned weights that influence the
chances of winning, the higher the weights, the higher the chances of
winning.

Minimax Algorithm:
def minimax(depth, node_index, is_max, scores, height):

if depth == height:

return scores[node_index]

if is_max:

return max(minimax(depth + 1, node_index * 2, False, scores, height),

minimax(depth + 1, node_index * 2 + 1, False, scores, height))

else:

return min(minimax(depth + 1, node_index * 2, True, scores, height),

minimax(depth + 1, node_index * 2 + 1, True, scores, height))

You might also like