Loading repovive.com/roadmaps/graph-theory
Roadmaps
Graph Theory
Rerooting Technique
Problemset
Discussion
AI Helper
Graph Fundamentals
0/41
Depth First Search (DFS)
0/41
Breadth First Search (BFS)
0/40
Flood Fill & Grid Graphs
0/32
Bipartite Graphs
0/48
Tree Fundamentals
0/44
Tree Diameter & Center
0/45
Subtree DP
0/44
Floyd-Warshall Algorithm
0/41
Dijkstra's Algorithm
0/40
Bellman-Ford Algorithm
0/48
Mixed Practice - Shortest Paths
0/36
Disjoint Set Union (DSU)
0/49
Minimum Spanning Trees
0/48
Topological Sort
0/41
DP on DAGs
0/50
Mixed Practice: Graph Traversals
0/35
Strongly Connected Components
0/45
2-SAT
0/51
Mixed Practice: Connectivity & MST
0/35
Rerooting Technique
0/39
1
Intro
2
The Single-Root Problem (Why you need rerooting)
3
Rerooting Intuition (Reusing previous work)
4
The Two-Pass Algorithm (Down and up)
5
Down Pass (Computing subtree answers)
6
Up Pass (Propagating parent contributions)
7
Combining Down and Up (Final answers)
8
Contribution (What each subtree gives)
9
Prefix-Suffix Arrays (Excluding one child)
10
Rerooting Template (General pattern)
11
Problem - Tree Distances II (CSES 1133)
12
Core Observation (Moving root changes distances)
13
Down Pass (Subtree distances)
14
Up Pass (Parent contribution)
15
Final Answer (Combining down and up)
16
Tree Distances II - Implementation (Two DFS passes)
17
Walkthrough (Small tree example)
18
Lessons Learned (Sum aggregation)
19
Problem - Sum of Distances in Tree (LeetCode 834)
20
Implementation Notes (Array indexing)
21
Complexity Analysis (Linear time)
22
Rerooting vs Brute Force (Why rerooting wins)
23
When to Use Rerooting (Problem patterns)
24
State Design (What to track)
25
Handling Multiple Children (Prefix-suffix pattern)
26
Rerooting with Max (Not just sum)
27
Rerooting with Count (Combinatorial problems)
28
Edge Cases (Small trees)
29
Debugging Rerooting (Common mistakes)
30
Rerooting Variations (Different problems)
31
Practice Tips (Getting comfortable)
32
Quiz: Rerooting Answer
33
Quiz: Rerooting Up Value
34
Quiz: Rerooting Selection
35
Common Mistakes (What to avoid)
36
Rerooting in Contests (Recognition)
37
Advanced Rerooting (Multiple states)
38
Rerooting with Updates (Dynamic trees)
39
Section Recap
Euler Tour Technique
0/51
Mixed Practice: Tree Fundamentals
0/29
Binary Lifting
0/50
Lowest Common Ancestor (LCA)
0/51
Games on Graphs
0/62
Heavy-Light Decomposition
0/49
Centroid Decomposition
0/55
Small-to-Large Merging
0/40
Functional Graphs
0/47
Mixed Practice: Advanced Tree Techniques
0/36
Bridges and Articulation Points
0/58
Network Flow
0/54
Maximum Bipartite Matching
0/50
Minimum Cut
0/47
Euler Paths and Circuits
0/37
Mixed Practice: Advanced Graphs
0/24
21.1
Intro
3 minutes
100%
Tasks
Read Unit