0% found this document useful (0 votes)
20 views4 pages

AI LAB (2) SS Organized

The document outlines an AI lab experiment focused on implementing the Depth-First Search (DFS) algorithm. It includes the aim of the practical, tasks to be completed, an algorithm flowchart, and learning outcomes. The experiment emphasizes understanding DFS, graph visualization, and recursive problem-solving techniques.

Uploaded by

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

AI LAB (2) SS Organized

The document outlines an AI lab experiment focused on implementing the Depth-First Search (DFS) algorithm. It includes the aim of the practical, tasks to be completed, an algorithm flowchart, and learning outcomes. The experiment emphasizes understanding DFS, graph visualization, and recursive problem-solving techniques.

Uploaded by

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

INDEX PAGE

Subject Name & Code: AI lab (24CAP-674)


UID: 24MCI10198 NAME: SURAJ SHARMA
COURSE: MCA (AI ML) SECTION & GROUP: 24MAM- 2B

S. Exp. Exp Name Exp Conduct Worksheet Viva Total Signature


No Date
No. (12 (8 marks) (10 (30
marks)
marks) marks)

01 1.) Implement Breadth-First Search


(BFS) Algorithm

02 2.) Implement Depth-First Search


(DFS) Algorithm

03 3.) Implement Best-First Search


Algorithm with a chosen
heuristic

04 4.) Implement A* Search


Algorithm

05 5.) Implement Hill climbing

06 6.) Implement Minimax


Algorithm
Experiment – 2

Student Name: SURAJ SHARMA UID: 24MCI10198


Branch: MCA (AI ML) Section/Group: 24MAM-2B
Semester: 2ND Date of Performance: 01-20-2024
Subject Name: AI Lab Subject Code: 24CAP-674

Experiment 2: Implement Depth-First Search (DFS) Algorithm.


1. Aim/Overview of the Practical:
The aim of this practical is to understand and implement the Depth-First Search (DFS) algorithm for
traversing or searching through a graph data structure. DFS explores as far as possible along each branch
before backtracking. It is useful for exploring all possible paths and solving problems like maze traversal,
topological sorting, and cycle detection.

2. Task to be Done:
 Create a directed graph with multiple nodes and edges.
 Implement the Depth-First Search (DFS) algorithm.
 Visualize the graph structure using the NetworkX library.
 Verify the traversal output by comparing it with the expected DFS order.

3. Algorithm/Flowchart
Algorithm for DFS
1. Initialize a visited list to keep track of visited nodes.
2. Define a recursive function:
o If the current node is not visited:
 Add it to the visited list.
 Recursively call the function for all adjacent nodes (neighbors).
3. Start the traversal from the root node.
4. Continue until all reachable nodes are visited.
4. Code for Experiment/Practical:

5. Result/Output/Writing Summary
DFS Traversal Output
The DFS traversal for the given graph starting from node 'A' is:

Graph Visualization:
Learning Outcomes (What I Have Learned):
1. Gained a solid understanding of the DFS algorithm and its recursive nature.
2. Learned how to implement DFS on a graph represented as an adjacency list.
3. Understood the process of visualizing graphs using the NetworkX library.
4. Observed the difference between exploring nodes depth-first versus breadth-first.
5. Improved problem-solving skills by implementing recursive graph traversal techniques.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy