Graph Algorithms
Graph problems describe things and the links between them, such as cities and roads, or courses and their prerequisites in Course Schedule. Once you can see the graph, most questions come down to a known algorithm.
The nine chapters cover traversal, topological sort, shortest paths, minimum spanning trees, Eulerian paths, strongly and biconnected components, bipartite coloring, network flow, and miscellaneous graph problems. It is the last plan on the route and assumes you are comfortable with recursion and BFS.
Want company while you work through this list? Sign in, open the study room, and your heroine will bring you the problems one at a time.
I. Graph Traversal
§1.1 Depth-First Search (DFS)
§1.2 Breadth-First Search (BFS)
§1.3 Modeling + BFS Shortest Path
II. Topological Sort
§2.1 Topological Sort
§2.2 DP on Topological Order
| Problem | Rating |
|---|---|
| 851. Loud AND Rich | 1783 |
| 2050. Parallel Courses III | 2084 |
| 1857. Largest Color Value in a Directed Graph | 2313 |
§2.3 Pseudotrees (Functional Graphs)
III. Shortest Paths
§3.1 Single Source Shortest Path (Dijkstra)
§3.2 All-Pairs Shortest Path (Floyd-Warshall)
IV. Minimum Spanning Tree (MST)
IV. Minimum Spanning Tree (MST)
| Problem | Rating |
|---|---|
| 1584. Min Cost to Connect All Points | 1858 |
| 1489. Find Critical AND Pseudo Critical Edges in Minimum Spanning Tree | 2572 |
V. Eulerian Path & Circuit
V. Eulerian Path & Circuit
| Problem | Rating |
|---|---|
| 332. Reconstruct Itinerary | Unrated |
| 753. Cracking the Safe | 2274 |
| 2097. Valid Arrangement of Pairs | 2651 |
VI. Connected Components (SCC/BCC)
VI. Strongly / Biconnected Components
| Problem | Rating |
|---|---|
| 1192. Critical Connections in a Network | 2085 |
| 1568. Minimum Number of Days to Disconnect Island | 2209 |
VII. Bipartite Coloring
VII. Bipartite Coloring
| Problem | Rating |
|---|---|
| 785. Is Graph Bipartite | 1625 |
| 886. Possible Bipartition | 1795 |
VIII. Network Flow
VIII. Network Flow
IX. Miscellaneous Graph Algorithms
IX. Miscellaneous
This is the final plan on the route; after its core sections, your heroine moves on to the advanced lists, where the optional sections from earlier plans wait.
Ratings come from zerotrac's LeetCode contest ratings. Some problems have no zerotrac rating and are marked Unrated.
Open the study room