230 likes | 524 Views
STCON in Directed Unique-Path Graphs. Sampath Kannan Sanjeev Khanna Sudeepa Roy University of Pennsylvania. (Directed) st-connectivity (STCON). t. t. s. directed path from s to t in G?. Questions involving STCON. Known Results NL-complete O(n) space and O(m+n) time (BFS or DFS)
E N D
STCON in Directed Unique-Path Graphs SampathKannan SanjeevKhanna Sudeepa Roy University of Pennsylvania
(Directed) st-connectivity (STCON) t t s directed path from s to t in G?
Questions involving STCON • Known Results • NL-complete • O(n) space and O(m+n) time (BFS or DFS) • O(log2 n) space and O(nlog n) time (Savitch) • USTCON L (Reingold’04) • Open Questions • O(log n) space algorithm for STCON? (L = NL!) • Time-space tradeoff analysis
Time-Space Trade-off for STCON Sublinear-space poly-time algorithm for STCON? Space () Time () BFS/DFS O(n) O(m+n) Barnes et al ’98 n / 2(√log n) poly-time ? O(nε), ε < 1 poly-time Savitch O(log2 n) O(nlog n)
(Poly-time) STCON in Special Graphs Tree:O(log n)-space StrongUL:O(log2 n / log log n)-space (AL’98) ReachUL:O(log2 n / log log n)-space (AL’98) s UL or Unambiguous Logspace Unique computation path from start to accepting configuration Can we allow some cycles reachable from s? Unique-Path Graphs
Back Edges, Forward Edges and Cross Edges s Forward Edge Tree Edge Back Edge Cross Edge
Unique-Path Graphs • At most one directed simple path from s to any vertex s s • No forward edge or cross edge in DFS-tree from any vertex reachable from s v
Main Theorem Poly-time, O(nε) space algorithm for constant ε • In unique-path graphs, STCON is solvable in O(nε/ε) space and nO(1/ε) time for any ε (0, 1] “Small-space implementation” of DFS
Space Requirement in Standard DFS • Linear space needed to remember • where to backtrack to from a vertex • if a vertex has been already visited Backtrack Step Discovery Step • Goal: Implement “backtrack step” and “discovery step” in poly-time and sublinear space
Plan for Rest of the Talk … • An O(√n)-space algorithm • Backtrack Step in O(√n) space • Discovery Step in O(√n) space • Extension to O(nε)-space algorithm • Recognition of unique-path graphs
√n-bounded DFS • Backtrack when length of exploration path > √n • Visits all and only the vertices within √n distance • O(√n)-space implementation in unique-path graphs
Landmark Vertices s = z0 • Vertices evenly spaced at √n distance from s along the current exploration path √n z1 √n z2 Can be stored in O(√n) space x
IN(v) y x u IN(v) y x u IN(v) y x u IN(v) y x u Backtrack Step s Backtrack(v) • Z = last landmark vertex • u = parent(v) iff v is not reachable from z in G – (u, v) by a √n-bounded DFS. z ≤ √n u y v x O(√n)-space implementation
Discovery Step s discovery (u, v) ≡ (u, v) is a back edge • do a √n-bounded DFS from v • zi = highest indexed landmark vertex reached • do a √n-bounded DFS from zi-1 • (u, v) is a back edge iff v is reached before zi zi-1 √n v zi u v O(√n)-space implementation
O(nε)-space Poly-time Algorithm √n nε √n n1- ε O(nε) O(√n) Backtrack and discovery steps use reachability queries
O(nε)-space Poly-time Algorithm Example • Backtrack(x) • suppose z is the last landmark vertex on the exploration path to v. • for any u IN(v), v is not reachable from z in G – (u, v) by a √n-bounded DFSiff u is parent of x z √n u y n1- ε v n1- ε-bounded DFS (recursively) x Reach(z, v, G–(u, v), n1- ε)? Reach(s, t, G, n-1)?
O(m) calls to n1- ε -bounded reachability queries T(n) ≤ cm T(n1- ε) + O(m+n) T(n) = nO(1/ε) O(nε/ε) space O(nε)-space Poly-time Algorithm
Other Results Recognize unique-path graphs in poly-time and O(nε) space
Simpler Problem: Either solve STCON correctly or report that the graph is not a unique-path graph Recognize Unique-Path Graphs DFS from any vertex reachable from s does not produce any forward or cross edge
Should be correct as long as it runs Should be poly-time Ideally: should not revisit vertices Even if revisits vertices poly-time should be enforced Solve STCON or Detect Violation Run previous algorithm as long as no forward or cross edge is detected √n-bounded DFS can be modified to work correctly
Detect Forward/Cross Edges • Forward edges are easy to detect • ‘Some’ cross edges are also easy to detect • Other cross edges we cannot detect • They do not affect correctness • Run a clock to ensure poly-time ≤ √n > √n zi-1 √n v zi u v Can be extended further to recognize Unique-Path Graphs
Open Problems • Poly-log space poly-time algorithm for unique-path graphs? • Poly-log space poly-time algorithm for other directed graphs? • O(log n)-space algorithm for regular directed graphs – RTV’06 • O(log n)-space algorithm for single source multiple sink planar directed graphs – Allender et. al.’06 • O(nε)-space poly-time algorithm for general directed graphs?