AIUT2
AIUT2
=> A*Algorithm: A* is a heuristic search algorithm commonly used for pathfinding and graph traversal.
It efficiently finds the shortest path from a start node to a goal node in a weighted graph. Properties:
Optimality: A* guarantees finding the optimal path if the heuristic is admissible (never overestimates actual cost)
and consistent. Completeness: A* is complete, meaning it will find a solution if one exists. Time Complexity: Depends
on the heuristic; generally efficient with a good heuristic. Memory Usage: Can be memory-intensive due to storing
and prioritizing nodes in a priority queue. Algorithm Steps: - G(n): Cost from start node to node n. -H(n): Heuristic
estimate of cost from node n to goal. - F(n) = G(n) + H(n): Evaluation function. - Start with the initial node and
initialize its cost. - Expand the node with the lowest F(n). - Generate successor nodes and calculate their F(n).
- Add successors to the open list. - Repeat until the goal is reached or the open list is empty. Example:
Consider a grid where each cell has a cost and the goal is to find the shortest path from the top-left to the bottom-
right corner. Grid: S: Start, G: Goal, X: Obstacle S 2 1 3 , 4 5 X 2 , 2 X 3 4 , 1 2 4 G ,
Path: S-> (1,2)->(2,3)->(3,4)->G..
2. Explain constraint satisfaction with N-Queen problem any one.
=> - Constraint satisfaction problems (CSPs) are a type of problem in artificial intelligence where the goal is to find a
solution that satisfies a set of constraints. - CSPs are used in a wide range of applications, such as scheduling,
resource allocation, and planning. - CSPs can be represented using variables, domains, and constraints. - CSPs can be
solved using a combination of search and inference techniques. N-Queens Problem: In the N-Queen problem, the
goal is to place N-Queens on an N*N chessboard, in such a way that no two queens share the same row, column , or
diagonal. Ex: N=4 , Variables: represents columns : {Q1, Q2, Q3, Q4} . Domains: represents row (for each
variable): {1,2,3,4}. Solution: A possible solution for N=4 might look lick this , Q - - - , - - Q -, - Q - -, - - -Q.
3. Write note on Neural network.
=> The term "Artificial neural network" refers to a biologically inspired sub-field of artificial intelligence modeled
after the brain. An Artificial neural network is usually a computational network based on biological neural networks
that construct the structure of the human brain. Similar to a human brain has neurons interconnected to each other,
artificial neural networks also have neurons that are linked to each other in various layers of the networks. These
neurons are known as nodes. Key Components: - Neurons (Nodes): Mimic biological neurons, processing and
transmitting information. - Weights: Each connection between neurons has a weight, determining the strength of
the connection. - Activation Function: Governs the output of a node based on its input. Common functions include
sigmoid, tanh, and ReLU.
4.Explain iterative hill climbing.
=> Iterative hill climbing is a simple optimization algorithm used in artificial intelligence to find the best possible
solution for a given problem. It belongs to the family of local search algorithms and is often used in optimization
problems where the goal is to find the best solution from a set of possible solutions. How it works: - The algorithm
starts with an initial solution and then iteratively makes small changes to it in order to improve the solution.
- These changes are based on a heuristic function that evaluates the quality of the solution. -The algorithm
continues to make these small changes until it reaches a local maximum, meaning that no further improvement can
be made with the current set of moves.
10.Explain recursive best first search with example.
=> Recursive best-first search (RBFS) is a graph traversal and path-finding algorithm that can determine the shortest
route in a weighted graph between a defined start node and any one of a group of goal nodes. It is a kind of iterative
deepening depth-first search that adopts the A* search algorithm’s idea of using a heuristic function to assess the
remaining cost to reach the goal. Example: Consider the below search problem, and we will traverse it using greedy
best-first search. At each iteration, each node is expanded using evaluation function f(n)=h(n) , which is given in the
below table.