Workspace

Graphs

3 day streakD
All algorithms

Graph algorithms.

Learn the idea, walk through a graph, then put it into code.

15 lessons · Python & C++

Traversal

ProblemDifficultyTime complexityPractice
Depth-First Search (DFS)EasyO(V + E)GFG
Breadth-First Search (BFS)EasyO(V + E)GFG

Shortest paths

ProblemDifficultyTime complexityPractice
Dijkstra’s AlgorithmMediumO((V + E) log V)GFG
Bellman–Ford AlgorithmMediumO(V × E)GFG
Floyd–Warshall AlgorithmMediumO(V³)GFG

Ordering

ProblemDifficultyTime complexityPractice
Topological Sort (Kahn’s Algorithm)MediumO(V + E)GFG
Directed Cycle DetectionMediumO(V + E)GFG

Spanning trees

ProblemDifficultyTime complexityPractice
Prim’s AlgorithmMediumO((V + E) log V)GFG
Kruskal’s AlgorithmMediumO(E log E + V)GFG

Connectivity

ProblemDifficultyTime complexityPractice
Disjoint Set Union (Union-Find)MediumO(α(V)) amortized / operationGFG
Bipartite Graph CheckMediumO(V + E)LeetCode
Kosaraju’s AlgorithmHardO(V + E)GFG
Tarjan’s SCC AlgorithmHardO(V + E)GFG
Bridges in an Undirected GraphHardO(V + E)LeetCode
Articulation PointsHardO(V + E)GFG

A good place to start

Explore a pattern

A little guidance

Start with a pattern, read through a problem, and mark it solved when the idea clicks. Save anything you want to revisit.

New tutorials are added one at a time. Your bookmarks and solved checkmarks stay in this browser.

Explore the roadmap