When it comes to finding connected components in a graph we can use DFS or DSU. Does there exist an algorithm which is stable to a changing graph, where node can be added, edge can be removed, node can be removed. Eg. If we add a node to a graph and we use DSU(with path compression and rank optimization), we can change the count of connected components in O(1) [Average time] by just doing the Union operation on the newly formed edge. But in case an edge is removed, we have to run the whole algorithm again.
Is there an algorithm stable for above scenario?