Question:
Given an undirected graph with N nodes and M edges. Given Q queries, there are 2 types of query:
- 1 - A - B - U - V
Check if there's a path between the node A and B after you remove the edge U-V
- 2 - A - B - X
Check if there's a path between the node A and B after you remove the node X
Constraints:
N <= 100000
M <= 500000
Q <= 100000
P/S:
I think that the only way there's path between A and B after the removal is that A, B is in the same Biconnected Component or the edge/node is not a bridge/arc.
But since we only have logN time for each query (because there're at most 100.000 queries), I can't find a way to check if A, B is in the same Biconnected Component in O(logN).
Is there a way to do it? Or is there a different solution to this problem?