0% found this document useful (0 votes)
3 views2 pages

Dijkstra's Algorithm Graph Implementation

This document outlines a practice assignment focused on Trees and Graphs, specifically aimed at implementing a graph management system using Dijkstra's algorithm. It details tasks such as creating a class for graph representation, adding vertices and edges, displaying the graph, and calculating the shortest path. The assignment is intended for individuals with intermediate to advanced knowledge of data structures and algorithms.

Uploaded by

rajkiranjntuhcem
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)
3 views2 pages

Dijkstra's Algorithm Graph Implementation

This document outlines a practice assignment focused on Trees and Graphs, specifically aimed at implementing a graph management system using Dijkstra's algorithm. It details tasks such as creating a class for graph representation, adding vertices and edges, displaying the graph, and calculating the shortest path. The assignment is intended for individuals with intermediate to advanced knowledge of data structures and algorithms.

Uploaded by

rajkiranjntuhcem
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

MODULE | DATA STRUCTURE AND ANALYSIS OF ALGORITHM

Trees and Graphs

Intermediate to Advanced

Practice Assignment
120 min

This Intermediate to Advanced case study helps you apply your knowledge and skills
of Trees and Graphs to solve the problems of a real-life scenario.

Practice Assignment II
Graph Implementation with Dijkstra's Algorithm
Problem Description

A software application needs a system to manage a graph and find the


shortest path using Dijkstra's algorithm. This case study outlines a
structured approach for developing a simple Graph Implementation with
Dijkstra's Algorithm.

This material is owned by Tata Consultancy Services Limited. Unauthorized duplication,


reproduction, downloading, or screen capturing is strictly forbidden and may result in legal 1
action, unless you obtain TCS's written permission. Using our Services does not give you
ownership of any intellectual property rights in our Services or the content you access.
MODULE | DATA STRUCTURE AND ANALYSIS OF ALGORITHM
Trees and Graphs

Tasks

1. Graph Management

Create a class to represent a graph. Each graph should support the


following operations:

• Add Vertex (add a vertex to the graph)

• Add Edge (add an edge between two vertices with a weight)

• Display (display the graph)

2. Shortest Path Calculation

Implement Dijkstra's algorithm to find the shortest path from a source


vertex to all other vertices.

Hints
ü Use a class to represent the graph.

ü Implement methods to add vertices and edges, and display the


graph.

ü Implement Dijkstra's algorithm to find the shortest path.

ü Test the system by adding vertices and edges, displaying the graph,
and finding the shortest path using Dijkstra's algorithm.

Unauthorized duplication, reproduction, downloading, or screen capturing is strictly 2


forbidden and may result in legal action.

You might also like