# Dynamic transitive closure with immediate new reachability facts

The typical definition of dynamic transitive closure (or reachability) uses two types of queries: the first one is an update (edge deletion/insertion) and the second one is a reachability query. Thus, most works on time complexity provide separated estimations on update operation and reachability query evaluation. But what about the case when one wants to get new reachability facts immediately on the update? So, we have only update queries, and as a result of each edge insertion we want to get all new reachable pairs (for edge deletion --- all pairs that became unreachable, for example). Are there any results on the theoretical time complexity of such a case?

• Interesting -- how would you measure the complexity in this case? Given that a single update can make a quadratic number of pairs change (e.g., you have n vertices connected to n vertices via a single edge), you can't hope to produce all changed pairs in less than quadratic time in the worst case. I'm guessing you would count the complexity as a function of the number of changes to produce?
– a3nm
Jan 30, 2023 at 9:49
• Also, it's not clear to me why there wouldn't be reductions between the standard setting and yours. If we have a data structure supporting only your mode of operation, you can possibly use it to emulate the standard way to do queries, by encoding them as updates: have a super-source r and super-sink vertex s, then whenever you want to query if x can reach y, then connect the r to x, connect y to s, and test if the pair (r, s) is now produced?
– a3nm
Jan 30, 2023 at 9:51

• I'm interested in such a case because incremental transitive closure with such behavior is a part of a context-free path querying algorithm that we are working on. Briefly: we have an iterative algorithm that supports transitive closure of directed graph $G$, at each iteration adds new edges in the $G$, and uses newly reachable pairs to calculate edges that should be added at the next iteration. So, we want to use existing results to provide accurate time complexity analysis.