Search Methods in AI
Search Methods in AI
1. ADVERSARIAL SEARCH
An adversarial search is the type of search in which two or more players or agents with conflicting
interests are trying to explore the same search space for a solution. This kind of search space where
more than one agent search for solution to problem is called multi-agent environment. Here, each
agent is an opponent of the other and they all play against each other. This situation usually occurs
in game playing.
A game is a type of adversarial search which can be formalized with the following elements:
i. Initial state: It specifies how the game is set up at the start.
ii. Player(s): It specifies which player has moved in the state space.
iii.Action(s): It returns the set of legal moves in state space.
iv. Result(s, a): It is the transition model, which specifies the result of moves in the state
space.
v. Terminal-Test(s): Terminal test is true if the game is over, else it is false at any case. The
state where the game ends is called terminal states.
vi. Utility(s, p): A utility function gives the final numeric value for a game that ends in
terminal states s for player p. It is also called payoff function.
Zero-Sum Game
A Zero-sum game is an adversarial search which involves pure competition. In Zero-sum game
each agent's gain or loss of utility is exactly balanced by the losses or gains of utility of another
agent. One player of the game tries to maximize one single value, while other player tries to
minimize it. Each move by one player in the game is known as ply. Chess and Checkers are
examples of Zero-sum game.
A. Game Theory
Game theory is a branch of mathematics that deals with the study of decision-making in situations
where two or more agents have conflicting interests. In the context of adversarial search, game
theory provides a framework for modeling two-player games, such as chess or checkers, as well
as more complex, multi-agent systems. In game theory, a game is modeled as a set of players,
strategies, and payoffs. The players take turns making moves, and the outcome of the game is
determined by the final state of the game board and the payoffs associated with each possible
outcome. Game theory provides a way to analyze the game and determine the best strategy for
each player given the available information.
B. Minimax Algorithm
The minimax algorithm is a classical method for solving two-player, zero-sum games, such as
chess or checkers. The algorithm works by assuming that each player will make the move that
minimizes the maximum possible payoff for the opponent. In other words, each player tries to
minimize their worst-case scenario. The minimax algorithm works by recursively exploring the
game tree, starting from the current state of the game board. At each node in the tree, the algorithm
calculates the minimax value, which is the minimum payoff that the maximizing player can
guarantee against any move by the minimizing player. The minimax value of a node is used to
determine the best move for the maximizing player. The algorithm continues exploring the tree
until it reaches a terminal state, at which point the payoffs associated with that state are returned.
C. Alpha-Beta Pruning
Alpha-beta pruning is a technique for improving the efficiency of the minimax algorithm. The
basic idea behind alpha-beta pruning is to eliminate parts of the game tree that are not relevant to
the current search. This is done by maintaining two values, alpha and beta, that represent the best
payoff that the maximizing player and the minimizing player can guarantee, respectively. At each
node in the game tree, the algorithm first checks whether the current value of beta is less than or
equal to alpha. If this is the case, the algorithm can stop searching that branch of the tree, as it is
guaranteed that the maximizing player will not choose a move that leads to a state with a payoff
greater than beta. This significantly reduces the size of the game tree that needs to be explored,
making the minimax algorithm much more efficient.
D. Evaluation Functions
An evaluation function is a function that assigns a numerical value to the current state of a game,
indicating how desirable that state is for a particular player. Evaluation functions are used to
determine the best move for a player in situations where it is not possible to fully explore the game
tree. Evaluation functions are designed to reflect the goals and objectives of a player. For example,
in chess, an evaluation function might take into account factors such as the number of pieces on
the board, the mobility of the pieces, and the control of the center of the board. The evaluation
function is used to determine the best move for a player at each step of the game, without the need
to explore the entire game tree.
E. Cut-Off Strategies
Cut-off strategies are methods for limiting the depth of the game tree that is explored by the
minimax algorithm. These strategies are used to reduce the computational complexity of the
algorithm, as well as to make it more practical for real-world applications. Cut-off strategies are
an important aspect of adversarial search, as they allow the algorithm to find a good solution in a
reasonable amount of time. In many cases, a suboptimal solution that is found quickly is preferable
to an optimal solution that takes an unreasonable amount of time to find. There are several different
types of cut-off strategies, including depth-limited search, time-limited search, and iterative
deepening search. Depth-limited search stops the search when the algorithm reaches a certain
depth in the game tree, while time-limited search stops the search after a certain amount of time
has passed. Iterative deepening search starts with a shallow depth limit and gradually increases the
depth limit until the desired level of search is achieved.
B. Checkers
Like chess, checkers is a two-player, zero-sum game, and the goal is to find the best move for a
player given the current state of the game board. Checkers programs use a combination of minimax
algorithms, alpha-beta pruning, and various cut-off strategies to search through the possible moves
and positions. In addition, checkers programs use sophisticated evaluation functions that take into
account factors such as piece mobility and king safety.
C. Othello
Othello is a two-player game that is played on a board with 64 squares. The game is played by
placing pieces on the board, and the goal is to have the most pieces of your color on the board at
the end of the game. Othello programs use a combination of minimax algorithms, alpha-beta
pruning, and various cut-off strategies to search through the possible moves and positions. In
addition, Othello programs use sophisticated evaluation functions that take into account factors
such as piece mobility and king safety.
D. Go
Go is an ancient board game that is played on a 19x19 grid. The game is played by placing stones
on the board, and the goal is to control as much territory as possible. Go programs use a
combination of minimax algorithms, Monte Carlo tree search, and artificial neural networks to
search through the possible moves and positions. In addition, Go programs use sophisticated
evaluation functions that take into account factors such as territory control and piece mobility.
E. Video Games
Adversarial search algorithms are also widely used in video games, where they are used to control
the behavior of non-player characters (NPCs). For example, in first-person shooter games, NPCs
use adversarial search algorithms to determine the best way to attack the player, while in strategy
games, NPCs use adversarial search algorithms to determine the best way to build their army and
conquer territory. Video game combines minimax algorithms, Monte Carlo tree search, and
reinforcement learning to implement the behavior of NPCs. In addition, video game developers
often use sophisticated evaluation functions that take into account factors such as player behavior,
environmental conditions, and resource availability.
B. Evolutionary Algorithms
Evolutionary algorithms are a class of optimization algorithms that are inspired by the process of
natural selection. In the context of adversarial search, evolutionary algorithms have been used to
optimize the evaluation functions used by traditional minimax algorithms. The basic idea behind
evolutionary algorithms is to use a population of candidate solutions, which represent different
possible evaluation functions. The solutions are evaluated based on their performance in a set of
games, and the best solutions are selected and recombined to form a new generation of solutions.
This process is repeated until a satisfactory solution is found.
C. Reinforcement Learning
Reinforcement learning is a branch of machine learning that deals with learning from experience.
In the context of adversarial search, reinforcement learning has been used to learn the behavior of
agents in complex, dynamic environments. The basic idea behind reinforcement learning is to have
an agent learn from experience by taking actions in an environment and receiving rewards based
on the outcomes of those actions. Over time, the agent learns to make better decisions based on
the rewards it has received in the past.
Reinforcement learning has been used with great success in video games, where it has been used
to learn the behavior of non-player characters (NPCs). The key advantage of reinforcement
learning is that it can learn from experience in real-time, allowing it to adapt to changing conditions
and opponents.
1. Identify the problem or issue: Identify the question or issue that needs to be addressed.
2. Gather information: Collect relevant information and data to inform your analysis.
3. Formulate a hypothesis or claim: Based on the information you have gathered, formulate
a tentative conclusion or claim about the problem or issue.
4. Test the hypothesis or claim: Use evidence to test the validity of the hypothesis or claim.
5. Evaluate the evidence: Assess the quality and relevance of the evidence, and consider
alternative explanations.
6. Draw a conclusion: Based on the evidence and analysis, draw a conclusion or judgment
about the problem or issue.
7. Communicate your conclusion: Communicate your conclusion clearly and succinctly,
and be prepared to defend your reasoning if necessary.
Relationship Between Logical Reasoning and Planning
Logical reasoning and planning are closely related concepts, as both involve the use of cognitive
processes to achieve a goal or solve a problem.
Logical reasoning is the process of drawing conclusions from premises, using reasoning and
evidence to form an argument or solve a problem. It is a fundamental cognitive process that is
necessary for effective problem-solving and decision-making. Logical reasoning involves the use
of deductive, inductive, and abductive reasoning, as well as the application of critical thinking
skills.
Planning, on the other hand, is the process of establishing a course of action or a set of steps that
need to be taken to achieve a goal or solve a problem. Planning involves analyzing the problem,
setting goals, identifying potential obstacles, and developing strategies to overcome those
obstacles. Effective planning requires the use of logical reasoning, as the planner must be able to
analyze the problem, identify potential solutions, and determine the best course of action.
In essence, logical reasoning is an essential component of effective planning. Logical reasoning is
necessary to analyze the problem, identify potential solutions, and determine the best course of
action. Planning, in turn, is a way of applying logical reasoning to achieve a specific goal. The two
concepts are complementary, and effective planning requires the use of logical reasoning skills.
4. FUZZY LOGIC
Fuzzy logic is a form of many-valued logic in which the truth value of variables may be any real
number between 0 and 1. It is employed to handle the concept of partial truth, where the truth value
may range between completely true and completely false. Fuzzy logic is a unique heuristic
approach to solving logical problems in computing based on “degrees of truth” rather than “true
and false” that is associated with Boolean logic. A simplified way of explaining this is through the
use of the image in fig. 1.
6. BAYESIAN NETWORKS
A Bayesian network is a compact, flexible and interpretable representation of a joint probability
distribution. They belong to the family of probabilistic graphical models and are used to represent
knowledge about an uncertain domain. Bayesian networks involve updating our beliefs about a
situation based on new evidence. Hence, they are also called Belief Reasoning. They consist of
two parts: a structure and parameters. The structure is a directed acyclic graph (DAG) that
expresses conditional independencies and dependencies among random variables associated with
nodes. The parameters consist of conditional probability distributions associated with each node.
Each node in the graph represents a random variable, while the edges between the nodes represent
probabilistic dependencies among the corresponding random variables. In other words, a Bayesian
network can be described as a type of graphical model that uses probability to determine the
occurrence of an event.
The conditional probability distribution of each node is represented by a table called the "node
table". It contains two columns, one for each possible state of the parent node (or "parent random
variable") and one for each possible state of the child node (or "child random variable"). The rows
in this table correspond to all possible combinations of parent and child states. In order to find out
how likely it is that a certain event will happen, we need to sum up the probabilities from all paths
of that event.
iii. Bayes' Theorem
Bayesian Networks are based on Bayes' theorem, which states that the probability of a hypothesis
(an event or a state of the world) given some evidence is proportional to the product of the prior
probability of the hypothesis and the likelihood of the evidence given the hypothesis. Bayesian
Networks use Bayes' theorem to update the probabilities of hypotheses as new evidence is
observed.
iv. Directed Acyclic Graphs (DAGs)
Bayesian Networks are represented by directed acyclic graphs (DAGs), which are graphs with
directed edges between nodes that do not form cycles. The DAG specifies the structure of the
network, with each node representing a random variable and each edge representing a probabilistic
relationship between the connected nodes.
v. Conditional Probability Tables (CPTs)
Each node in a Bayesian Network has an associated conditional probability table (CPT) that
specifies the probability distribution of that node given its parent nodes in the DAG. CPTs
represent the conditional dependencies between the variables, which are necessary for inference
and prediction.
vi. Inference
Inference in Bayesian Networks involves computing the posterior probabilities of the nodes given
observed evidence. This can be done using various inference algorithms, such as exact inference
algorithms, approximate inference algorithms, or sampling methods
Application of Bayesian Networks
Bayesian networks find applications in a variety of tasks such as:
1. Spam filtering: A spam filter is a program that helps in detecting unsolicited and spam
mails. Bayesian spam filters check whether a mail is spam or not. They use filtering to
learn from spam and ham messages.
2. Biomonitoring: This involves the use of indicators to quantify the concentration of
chemicals in the human body. Blood or urine is used to measure the same.
3. Information retrieval: Bayesian networks assist in information retrieval for research,
which is a constant process of extracting information from databases. It works in a loop.
Hence, we have to continuously reconsider and redefine our research problem to avoid data
overload.
4. Image processing: A form of signal processing, image processing uses mathematical
operations to convert images into digital format. Once images are converted, their quality
can be enhanced with more operations. The input image doesn’t necessarily have to be in
the form of an image; it could be a photograph or a video frame.
5. Gene regulatory network: A Bayesian network is an algorithm that can be applied to gene
regulatory networks in order to make predictions about the effects of genetic variations on
cellular phenotypes. Gene regulatory networks are a set of mathematical equations that
describe the interactions between genes, proteins, and metabolites. They are used to study
how genetic variations affect the development of a cell or organism.
6. Turbo code: Turbo codes are a type of error correction code capable of achieving very high
data rates and long distances between error correcting nodes in a communications system.
They have been used in satellites, space probes, deep-space missions, military
communications systems, and civilian wireless communication systems, including WiFi
and 4G LTE cellular telephone systems.
7. Document classification: This is a problem often encountered in computer science and
information science. Here, the main issue is to assign a document multiple classes. The
task can be achieved manually and algorithmically. Since manual effort takes too much
time, algorithmic documentation is done to complete it quickly and effectively.