Ai Lab Manual Exp
Ai Lab Manual Exp
1. Title
2. Objective
3. Tools Required
4. Background
5. Explain the procedure
6. What are the Expected Outcomes?
7. Conclusion
1. What was the primary goal of the AI application discussed in the case
study?
2. Which deep learning models or algorithms were used in the case study,
and why were they chosen over other models?
3. Describe the dataset used in the case study. What are the key features of
the dataset, and what challenges might arise in working with such data?
4. What evaluation metrics did the researchers used to measure the
performance of their model, and why were they appropriate for the
problem?
5. What challenges might arise when deploying this AI solution in a real-
world environment?
EXP 2
Implementing BFS
1. Initialize a queue with the start node and an empty set to track visited
nodes.
2. While the queue is not empty:
a. Dequeue a node from the front of the queue.
b. If the node is the goal node, return the path to reach the goal.
c. Otherwise, enqueue all its unvisited neighbors.
3. Continue until the goal node is found or the queue is empty.
Implementing DFS
1. Initialize a stack with the start node and an empty set to track visited nodes.
2. While the stack is not empty:
a. Pop a node from the top of the stack.
b. If the node is the goal node, return the path to reach the goal.
c. Otherwise, push all its unvisited neighbors to the stack.
3. Continue until the goal node is found or the stack is empty.
2. You ran BFS and DFS on a graph to find the path to a goal. What do you
observe about the paths that both algorithms return in an unweighted graph?
Do they always return the same path, and if not, why?
3. In real-world applications, when would you use BFS over DFS and vice
versa? Can you think of an example where one algorithm would clearly
outperform the other in terms of efficiency or correctness?
4. After completing the lab, what aspects of BFS and DFS did you find most
difficult to understand or implement? How did you resolve those challenges?
5. What type of graph structure would you prefer for using BFS, and what
kind of graph would you prefer DFS for? Justify your answers.
CONCLUSION
CONCLUSION
EXP 4: IMPLEMENTING A* SEARCH ALGORITHM TO
REACH GOAL STATE
A Search Algorithm*
A* is a pathfinding algorithm that combines the advantages of
Dijkstra's algorithm (guaranteed shortest path) and Greedy Best-First
Search (efficiency). It uses a heuristic function to estimate the cost to
reach the goal, making it both optimal and efficient.
Heuristic Function
The heuristic function h(n) must be admissible (never
overestimates the cost).
Post-Lab Questions
Advantages
Completeness: The IDA* method is a complete search algorithm,
which means that, if an optimum solution exists, it will be
discovered.
Memory effectiveness: The IDA* method only keeps one path in
memory at a time, making it memory efficient.
Flexibility: Depending on the application, the IDA* method may
be employed with a number of heuristic functions.
Performance: The IDA* method sometimes outperforms other
search algorithms like uniform-cost search (UCS) or breadth-first
search (BFS) (UCS).
The IDA* algorithm is incremental, which means that it may be
stopped at any time and continued at a later time without losing
any progress.
Disadvantages
Ineffective for huge search areas. IDA* potential for being
incredibly ineffective for vast search spaces is one of its biggest
drawbacks. Since IDA* expands the same nodes using a depth-
first search on each iteration, this might result in repetitive
calculations.
Get caught in a nearby minima. The ability of IDA* to become
caught in local minima is another drawback.
Extremely reliant on the effectiveness of the heuristic function.
The effectiveness of the heuristic function utilised heavily
influences IDA* performance.
Conclusion