If there is one area in competitive programming that quietly intimidates even seasoned problem solvers, it is the world of dynamic connectivity. At first glance, it appears to be nothing more than a niche extension of graph problems. But as anyone who has tried their hand at online queries, incremental graph updates, or fully dynamic edge operations knows, this topic has layers—deep, intricate layers—where mathematical elegance meets algorithmic engineering. And once you begin exploring it, you realize how many problems you had previously swept under the “too complex” category suddenly start opening up.
This course, with its one hundred carefully designed articles, exists to guide you across that landscape. Not through shortcuts or memorized templates, but by building your intuition piece by piece. Dynamic connectivity isn’t just a technique; it’s a way of thinking. It teaches you to process evolving information, to maintain structure inside disorder, and to anticipate how local changes ripple across a global system. By the end of this journey, you will not only understand it—you will feel at home with it.
But before we dive into that world, let’s reflect on what dynamic connectivity really means and why it matters so much in competitive programming.
Static graphs are the comfortable territory. You get a graph, you analyze it, you run DFS or BFS or DSU or Dijkstra or whatever fits, and you’re done. But life becomes much messier when the graph does not stay still. When edges keep appearing or disappearing. When queries are interspersed with updates. When each change can potentially alter reachability, component sizes, or even influence answers long after it occurs.
That is dynamic connectivity.
It's the study of maintaining information about a graph that keeps changing.
And this is where the real excitement begins, because suddenly you’re dealing with a living, breathing structure. One update at the wrong time, and everything you computed so far collapses. One careless approach, and your algorithm becomes too slow to keep up. In these scenarios, the difference between O(n + m) and O(m log n) or O(m α(n)) matters more than ever.
Every time you handle a query that depends on history—like “are these two nodes connected after these previous operations?”—you are brushing against the realm of dynamic connectivity.
If you’ve spent time in contests like Codeforces, AtCoder, ICPC, or Google Kick Start, you’ve probably come across problems that look innocent at first:
At surface level, these problems look like straightforward graph tasks. But when updates are mixed with queries in non-trivial ways, the difficulty rises sharply. A simple DFS cannot re-run for every modification. A naive rebuild after each update is impossibly slow. What you need instead are powerful data structures that maintain connectivity efficiently even as the graph reshapes itself.
And that is exactly what this course teaches you—not just one or two such structures, but the entire ecosystem.
The first instinct when approaching dynamic connectivity is always to reach for DSU (Disjoint Set Union), also known as Union–Find. And DSU truly is one of the most beautiful, foundational tools in competitive programming. It handles incremental (only-add-edge) connectivity like magic.
But the moment you introduce edge deletions—or queries that refer to various time segments—you quickly hit DSU’s limitations. DSU simply cannot undo operations unless special modifications are applied. And that is where creative techniques enter the story.
Dynamic connectivity branches into several directions depending on what exactly changes:
Different flavors of the problem require different tools, different mindsets, and different trade-offs. Sometimes you can exploit the fact that operations are offline. Sometimes the direction of updates unlocks a simpler solution. Sometimes a rollback DSU is magical. Sometimes you need link–cut trees or Euler Tour Trees. And sometimes, surprisingly, the smartest approach is not fully dynamic at all but a cleverly flipped version of the problem that makes it behave like an incremental one.
This course walks you through every one of these paths.
There are two major reasons:
1. The topic sits at a crossroads of multiple advanced concepts.
To handle dynamic connectivity properly, you must juggle ideas from DSU, trees, divide and conquer, amortization analysis, and sometimes persistent data structures. Many contestants shy away from it because they feel they would have to study everything at once. Thankfully, you don’t. With the right breakdown, everything becomes digestible.
2. The implementations can look daunting.
Link–cut trees, Euler Tour Trees, DSU rollback, segment tree of sets—if you’ve seen these in passing, you know how dense they can appear. But complexity doesn’t come from unnecessary difficulty; it comes from the richness of the problem itself. Once you understand the intuition behind these tools, the code stops feeling like a monster and starts feeling like a well-designed machine.
This course aims to remove that intimidation. Not by simplifying the problems into something they’re not, but by gradually building the exact understanding you need.
Just like the graph changes over time, your understanding will evolve through these articles.
In the early parts, we begin with the raw basics:
Then we move to the familiar playground: DSU and its optimizations. But soon, we push beyond what DSU can naturally do. You’ll learn how to reverse operations. How to use DSU with rollback. How to pair DSU with divide and conquer so it pretends to be dynamic without ever fully being so.
As you progress, you’ll meet powerful tools like:
You’ll explore how nodes and edges behave when the graph is seen not as a static object but as a timeline—a sequence of states that must be traversed with precision.
There’s a beautiful shift that happens when you start thinking this way. You stop treating updates as disruptions, and you begin seeing them as opportunities: every update gives you structure, gives you boundaries, gives you events that can be mapped onto ranges or combined offline. The chaos of changing edges becomes a playground where segment trees, recursion, and clever rollbacks work together in harmony.
One core principle guides this course: you should deeply understand the “why”, not merely the “how.”
In competitive programming, memorized templates take you only so far. When you encounter a new variant—maybe nodes appear and disappear, or queries happen based on conditions, or updates overlap in unexpected ways—you need intuition. You need to see the skeleton underneath the problem.
Dynamic connectivity is especially rewarding in this regard, because every technique is powered by intuition:
If you learn these ideas as living concepts rather than tricks, you become capable of adapting them to any variation a contest throws at you.
Though this is a course for competitive programming, dynamic connectivity has a life far beyond contests. It sits at the heart of many real systems:
Understanding dynamic connectivity gives you a taste of real-world algorithmic engineering—where structure changes constantly, and answers must be delivered quickly without rebuilding from scratch.
It’s a reminder that competitive programming is often a distilled form of real computational challenges.
Competitive programmers often describe a certain moment of breakthrough—when a once-intimidating topic suddenly becomes graspable. For many, dynamic connectivity is tied to that experience. At the beginning, the whole field feels like an uncharted forest. But slowly, as the ideas settle, you start recognizing the landmarks: DSU rollback, segment trees, Euler tours, tree splitting, time compression.
Eventually, you reach a stage where a problem that once felt “out of your league” becomes comfortably solvable. Where you can sketch the solution on paper without stress. Where you start noticing that you’re no longer afraid of the phrase “fully dynamic graph.”
This course is designed to help you reach that moment.
Not through brute force, but by guiding your intuition step by step.
Not through dense academic presentations, but through relatable, human explanations.
Not through shortcuts, but through understanding.
You might wonder why dynamic connectivity deserves a hundred articles. The answer is simple: the topic is rich, subtle, and full of beautiful ideas. Compressing everything into a single article or even a short series would blur the insights, rush the intuition, and oversimplify the depth.
Each article in this course plays a specific role:
some clarify fundamental ideas,
some walk through detailed examples,
some focus entirely on intuition,
and some dig deep into intricate data structures.
The aim is not information overload but gradual transformation—by the end, you will not only feel comfortable with dynamic connectivity, you will be able to use it as naturally as DSU or BFS.
Dynamic connectivity is not a topic you speed through. It’s a topic you grow into. Some concepts will click instantly; others will simmer in the back of your mind before suddenly revealing their clarity. Be patient with yourself. Curiosity is far more important than immediate mastery.
There will be moments where you write something, run it, and watch it fail spectacularly. There will be times you think you understand a technique, only to realize you missed a small but crucial detail. But these moments are not setbacks—they are signs of growth.
Every expert who now casually implements link–cut trees or solves fully dynamic connectivity problems was once confused by them. What matters is the willingness to keep exploring.
In this course, you won’t just study algorithms—you will develop the mindset of someone who can guide a system through change, who can maintain stability in a world of updates, and who can engineer solutions that stay fast even when everything evolves.
Dynamic connectivity is challenging, yes. But it's also deeply rewarding, intellectually stimulating, and surprisingly elegant once you get the hang of it.
So take a breath, get comfortable, and let your curiosity lead the way.
You’re about to enter a fascinating world where graphs aren’t fixed, where updates are opportunities, and where clever structures keep everything woven together despite constant change.
Welcome to the journey.
1. Introduction to Dynamic Connectivity
2. Basic Concepts in Graph Theory
3. What is Dynamic Connectivity?
4. Understanding Connectivity in Static Graphs
5. Dynamic Graphs and Their Applications
6. Introduction to Union-Find Data Structure
7. Basic Union-Find Operations: Union and Find
8. Path Compression in Union-Find
9. Union by Rank in Union-Find
10. Union-Find and Its Efficiency
11. Basic Graph Traversal Techniques: BFS and DFS
12. Exploring the Disjoint Set Data Structure
13. Union-Find in Static Connectivity Problems
14. Implementing Union-Find in Competitive Programming
15. Introduction to Dynamic Connectivity Queries
16. Handling Edge Insertion and Deletion in Dynamic Graphs
17. Basic Query Types in Dynamic Connectivity
18. Connected Components in Dynamic Graphs
19. Incremental Updates in Dynamic Connectivity
20. Examples of Dynamic Connectivity in Competitive Programming
21. Introduction to Offline Dynamic Connectivity
22. Persistent Data Structures in Dynamic Connectivity
23. Dynamic Connectivity with Dynamic Forests
24. Path Compression and its Impact on Dynamic Connectivity
25. Handling Edge Deletions in Dynamic Connectivity
26. Euler Tour Technique in Dynamic Connectivity
27. Using Union-Find for Dynamic Connectivity Queries
28. Efficient Union-Find Implementations
29. Introduction to the Dynamic Connectivity Problem in Graphs
30. Kruskal’s Algorithm and Dynamic Connectivity
31. Binary Lifting for Dynamic Connectivity
32. Understanding Link-Cut Trees for Dynamic Connectivity
33. Applications of Dynamic Connectivity in Network Design
34. Handling Dynamic Bridges in Graphs
35. Maintaining Connectivity in Planar Graphs
36. Connectivity in Undirected Graphs with Edge Updates
37. Dynamic Connectivity in Sparse Graphs
38. Maintaining Connected Components with Union-Find
39. Efficient Path Querying in Dynamic Graphs
40. Offline Processing of Dynamic Connectivity Queries
41. Dynamic Connectivity with Link-Cut Trees
42. Persistent Union-Find for Dynamic Connectivity
43. Dynamic Connectivity in Directed Graphs
44. Handling Multiple Edge Updates Efficiently
45. The Role of Heavy-Light Decomposition in Dynamic Connectivity
46. Using Euler Tour Trees for Dynamic Connectivity
47. Fully Dynamic Connectivity: An Overview
48. Euler Tour Trees for Dynamic Connectivity Queries
49. Dynamic Connectivity with Dynamic Trees
50. Optimizing Dynamic Connectivity with Decomposition Techniques
51. Online vs Offline Dynamic Connectivity Algorithms
52. Handling Edge Deletions in Dynamic Connectivity Problems
53. Fast Dynamic Connectivity Using Link-Cut Trees
54. Dynamic Connectivity in Graphs with Multiple Components
55. Dynamic Connectivity Using Persistent Data Structures
56. Lazy Propagation for Dynamic Connectivity
57. Real-Time Dynamic Connectivity in Streaming Graphs
58. Applications of Dynamic Connectivity in Network Reliability
59. Segment Trees for Dynamic Connectivity Queries
60. Advanced Union-Find Techniques for Dynamic Connectivity
61. Using Link-Cut Trees to Answer Connectivity Queries
62. Maintaining Connectivity in Real-Time Systems
63. Dealing with Offline Edge Updates in Dynamic Connectivity
64. Duality and Combinatorics in Dynamic Connectivity
65. Dynamic Connectivity in Planar Graphs
66. Handling Queries on Dynamic Graphs with Path Queries
67. Dynamic Connectivity Algorithms for Online Platforms
68. Dynamic Connectivity in Geometric Graphs
69. Time Complexity Analysis of Dynamic Connectivity Solutions
70. Using Decomposition for Faster Dynamic Connectivity
71. Incremental Algorithm for Dynamic Connectivity
72. Dynamic Connectivity and Tree Structures
73. Advanced Algorithms for Fully Dynamic Connectivity
74. Dynamic Connectivity with Weighted Edges
75. Optimal Data Structures for Dynamic Connectivity
76. Efficiently Handling Dynamic Connectivity with Path Queries
77. Solving Dynamic Connectivity Problems in Sparse Graphs
78. Topological Sorting for Dynamic Connectivity Queries
79. Advanced Link-Cut Trees: Operations and Applications
80. Interactive Applications of Dynamic Connectivity
81. Graph Representations for Dynamic Connectivity
82. Advanced Query Processing Techniques in Dynamic Connectivity
83. Optimizing Union-Find for Dynamic Connectivity Problems
84. Applications of Dynamic Connectivity in Social Networks
85. Dynamic Connectivity in Data Streams
86. Maintaining Connectivity in Randomized Graphs
87. Dynamic Connectivity in Streaming Graphs with Edge Insertions
88. Efficiently Dealing with Edge Deletions in Graphs
89. Dynamic Connectivity in Real-Time Graph Queries
90. Combinatorial Optimization and Dynamic Connectivity
91. Fully Dynamic Connectivity with Link-Cut Trees
92. Optimized Offline Algorithms for Dynamic Connectivity
93. Dynamic Connectivity and Graph Partitioning
94. Dealing with Dynamic Connectivity in 2D Graphs
95. Advanced Offline Processing of Dynamic Connectivity
96. Dynamic Connectivity Algorithms for Large-Scale Graphs
97. Segment Trees and Binary Lifting for Dynamic Connectivity
98. Real-Time Applications of Fully Dynamic Connectivity
99. Using Dynamic Connectivity to Solve Network Flow Problems
100. Complexity Lower Bounds in Dynamic Connectivity