Abstract

A common ancestor of two vertices u , v in a directed acyclic graph is a vertex w that can reach both. A { u , v } - junction is a common ancestor w so that there are two paths, one from w to u and the other from w to v , that are internally vertex-disjoint. A lowest common ancestor (LCA) of u and v is a common ancestor w so that no other common ancestor of u and v is reachable from w . Every { u , v } -LCA is a { u , v } -junction, but the converse is not true. Similarly, not every common ancestor is a junction. The all-pairs common ancestor (APCA) problem computes (or determines the non-existence of) a common ancestor for all pairs of vertices. Similarly defined are the all-pairs junction (APJ) and the all-pairs LCA (APLCA) problems. The APCA problem also has an existence version. Bender et al. obtained an algorithm for APCA existence by reduction to transitive closure. Their algorithm runs in O ̃ ( n ω ) time where ω < 2.376 is the exponent of fast Boolean matrix multiplication and n is the number of vertices. Kowaluk and Lingas obtained an algorithm for APLCA whose running time is O ( n 2 + 1 / ( 4 − ω ) ) ≤ o ( n 2.616 ) . Our main result is an O ̃ ( n ω ) time algorithm for APJ. Thus, junctions for all pairs can also be computed in essentially the time needed for transitive closure. For a subset of vertices S , a common ancestor of S is a vertex that can reach each vertex of S . A lowest common ancestor of S is a common ancestor w of S so that no other common ancestor of S is reachable from w . For k ≥ 2 , the k -APCA and the k -APLCA problems are to find, respectively, a common ancestor and a lowest common ancestor for each k -set of vertices. We prove that for all fixed k ≥ 8 , the k -APCA problem can be solved in O ̃ ( n k ) time, thereby obtaining an essentially optimal algorithm. We also prove that for all k ≥ 4 , the k -APLCA problem can be solved in O ̃ ( n k + 1 / 2 ) time.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call