
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Explore the differences between directed and undirected graphs, showing how arrows constrain movement and how directed acyclic graphs enable specific algorithms and applications.
Implement and trace a depth-first search in Python using an adjacency-list graph, with a recursive DFS function, a visited set, and backtracking.
Trace the dfs recursion on a graph using an adjacency list and a visited set, observing how nodes are printed in depth-first order from 1 to 4.
Use depth-first search to visit all nodes and accumulate their values to compute the sum of all nodes in a graph.
Apply Dijkstra's algorithm to a weighted graph by initializing distances, setting the source to zero, and iteratively relaxing neighbors to update shortest paths with a greedy minimum-distance step.
Demonstrates coding implementation of the Djikstra's algorithm to find the shortest paths from a source in a weighted graph using an adjacency matrix and Python lists.
Explore the Bellman-Ford algorithm for shortest paths, handling negative weights where Dijkstra's fails by repeatedly relaxing edges for v minus one times, updating distances from a chosen source.
Watch a dry run of the Bellman-Ford algorithm on a directed weighted graph with negative weights, showing iterative relaxation and distance updates.
Explains spanning trees and minimum cost spanning trees in graphs, clarifies vertices and edges, cycles, and demonstrates selecting the minimum-cost spanning tree using two algorithms.
I welcome you all to my course on 'Graph Theory and it's Algorithms - Advanced DSA'
This course deals with the concepts of Graph Theory such as
1. What is Graph Data Structure?
2. Applications of Graphs to solve real life problems.
3. Terminologies involved in Graph Theory
4. Types of Graph Data Structure - Weighted, Unweighted, Directed, Undirected, Cyclic, Acyclic, Directed Acyclic Graphs.
This course also gives the explanation of the following algorithms and also provide their implementation in Python.
1. Representation of Graphs - Adjacency List, Adjacency Matrix.
2. Implementation of Adjacency List, Adjacency Matrix using OOPS in Python.
3. Depth First Search (DFS) Algorithm in Python
4. Breadth First Search (BFS)
5. Problems based on DFS - Topological Sort, Sum, Max, Min.
Single Source Shortest Path Problems.
1. Djikstra's Algorithm - Algorithm and Code in Python.
2. Bellman Ford - Algorithm and Code in Python.
Minimum Spanning Tree Problems
1. Explanation of Spanning Trees, Finding out Minimum Spanning Tree.
2. Prim's and Kruskal's Algorithm.
Note: Knowledge in Basic Data Structures and Python is preferred.
A graph data structure consists of a finite (and possibly mutable) set of vertices (also called nodes or points), together with a set of unordered pairs of these vertices for an undirected graph or a set of ordered pairs for a directed graph. These pairs are known as edges (also called links or lines), and for a directed graph are also known as edges but also sometimes arrows or arcs. The vertices may be part of the graph structure, or may be external entities represented by integer indices or references.