PS: New to this SE, but old time SE/SO user.
Background study - I've gone through this, computer science and computational science SE and also various papers (skimmed) related to fully dynamic connectivity/bi-connectivity papers/algorithms and I still find my problem to be a bit different not solved/answered before.
Problem Statement:
I have an undirected graph of V vertices and E edges between those vertices. The core query I want to be able to answer is if this graph is disconnected. i.e. if there are more than one connected components in this graph. This is easy to answer. I can do a basic floodfill and get an answer in O(V+E).
Now given a graph which is known to be connected, and you also have the articulation points calculated for that graph, I have to do N queries on this graph:
- Each query has a set of operation and then the core question.
- This operation first removes X vertices from the graph and then adds Y nodes (these nodes maybe connected to one or more remaining vertex of the graph). It is assumed that the resulting graph is not the same graph as original. Also, V > X >= 0 and Y >= 0 and X + Y > 0
- The operation is always performed on the original graph and are not incremental on top of the previous query.
- The question remains the same. After doing the above operation, is the resultant graph disconnected?
In a naive approach, I can disregard the original AP information and simply do N floodfills to figure out the result of the queries. That makes my time complexity to be O(N*(V+E))
But given that I have the AP info for the original graph and each query is run on some modification of the original graph, is there a more efficient way of doing this?
I am envisioning an algorithm/data structure/approach than can incrementally update the original AP info in logarithmic or poly-log time complexity and then answer the "disconnected" question in constant time (or along the way of that poly time complexity itself)
Thoughts? Is it even feasible? Any way to prove its feasible or not feasible?