Course section
Graphs & Applications
Model networks, routes, dependencies, and connectivity using traversal, shortest-path, MST, and disjoint-set algorithms.
10 topicsGraph Fundamentals
Graphs consist of vertices and edges and may be directed, undirected, weighted, cyclic, connected, or sparse.
Graph Representation
Adjacency lists use O(V+E) space and suit sparse graphs; matrices use O(V²) space and give O(1) edge tests.
Breadth-First Search
BFS explores vertices by increasing unweighted distance using a queue and produces shortest paths in edge count.
Depth-First Search
DFS follows one path deeply before backtracking and supports cycle detection, ordering, components, and structural analysis.
Dijkstra’s Algorithm
Dijkstra finalises minimum distances from one source by repeatedly extracting the closest unsettled vertex.
Floyd–Warshall
Floyd–Warshall computes all-pairs shortest paths by progressively allowing each vertex as an intermediate.
Disjoint Set Union
DSU maintains a changing partition of elements and answers whether two elements belong to the same component.
Prim’s MST
Prim grows one minimum spanning tree by repeatedly adding the cheapest edge crossing from the tree to an outside vertex.
Kruskal’s MST
Kruskal considers edges from lightest to heaviest and uses DSU to add only edges that connect different components.
Sustainable Graph Applications
Graph models support smart grids, recycling networks, transit planning, waste collection, and resilient infrastructure.