Improved Decremental Algorithms for

Post on 21-Jan-2016

33 views 0 download

Tags:

description

Improved Decremental Algorithms for. Transitive Closure All-Pairs Shortest Paths in Directed Graphs. Surender Baswana work supported by a fellowship from Infosys Tech. Bangalore Sandeep Sen work supported in part by an IBM UPP award I.I.T. Delhi India. - PowerPoint PPT Presentation

Transcript of Improved Decremental Algorithms for

Improved Decremental Algorithms for

• Transitive Closure• All-Pairs Shortest Paths in Directed Graphs

34th ACM STOC 2002

• Surender Baswana work supported by a fellowship from Infosys Tech. Bangalore

• Sandeep Senwork supported in part by

an IBM UPP award

I.I.T. Delhi

India

• Ramesh Hariharan

I.I.Sc. Bangalore

India

Two Fundamental Algorithmic Graph Problems

• Transitive Closure

• All-Pairs Shortest Paths

Transitive Closure

• Process a given directed graph G(V,E) so that any query

of the form,

“ Is there a path from u to v in the graph?”

can be answered efficiently

Existing Static Algorithms

• Classical Algorithms : O(mn)

• Algorithms based on fast matrix multiplications : O(n2.575)

(Zwick, FOCS 1998)

Dynamic Maintenance of APSP (Transitive Closure)

Given a directed graph G(V,E) followed by an online sequence of updates interspersed with queries

Process each query and update efficiently

Aim of Dynamic Algorithms for APSP (Transitive Closure)

To Maintain a data-structure that

• can answer each query efficiently

• can be updated efficiently after each update (in time less than the best static

algorithm)

Two Types of Dynamic Algorithms

• Fully Dynamic ( both insertion and deletion of edges allowed)

• Partially Dynamic Incremental (only insertion) Deletion (only deletion)

Decremental Algorithms for Transitive Closure

Query Time Update time(per edge deletion)

Leeuwen et al.

1998O(1) O(m)

Henzinger & King, STOC 1995

O(n/log n) O(n log n)

Demetrescu et al.

FOCS 2000O(1) O(n/m)

2

3

Contribution of our Paper

Decremental Algorithms for

• Transitive Closure

• APSP

that achieve improved update time while keeping optimal query time

Decremental Algorithm for transitive closure

Main Idea

A new data-structure that

• stores transitive closure imformation implicitly

• is more suitable for maintaining reachability for long paths

Main Idea Contd.

Suitably combine two data-structures

• S:

suitable for reachability corresponding to short paths.

• L :

suitable for reachability corresponding to long paths.

Basic Data-structure Used

Theorem : A BFS tree of depth d, rooted at a vertex can be maintained under deletion of edges that

• takes O(1) query time

• requires O(d) amortized update time per edge deletion.

Explicit Maintenance of Transitive Closure

uv

Explicit Maintenance of Transitive Closure contd.

uv

Implicit Maintenance of Transitive Closure

uv

Implicit Maintenance of Transitive Closure

uv

Implicit Maintenance of Transitive Closure

uv

In_treeOut_tree

Transitive closure corresponding to paths of length d passing through

set of witnesses W

Transitive closure corresponding to paths of length d passing through

set of witnesses W

Transitive closure corresponding to paths of length d passing through

set of witnesses W

u

vM

Transitive closure corresponding to paths of length d passing through

set of witnesses W

u

v

w

M

Handling Edge Deletion

u

v

w

u vw

W’

M

Handling Edge Deletion contd.

u

v

w

u vw

u vW’

W’

M

Handling Edge Deletion contd.

u

v

w

u vw

u vW’

W’

M

Handling Edge Deletion contd.

• For each w, update in_tree(w) and out_tree(w)

• For each pair (u,v) for which w has ceased to remain witness, search for new witness.

• Update M[u,v] appropriately

Handling Edge Deletion contd.

• Invariant maintained :

M[u,v] points to the first vertex in the witness list W that is a witness of

reachability from u to v

Total update time

• For each pair (u,v), the witness list is scanned exactly once.

O(n |W|)

• Total update time for maintaining in_trees

and out_trees

O(md|W|)

2

Maintaining all-pairs reachability corresponding to paths of length <d

passing through W

Theorem :

All-pairs reachability corresponding to paths of length <d passing through vertices of set W can be maintained under deletion of edges in amortized time :

O((n2/m + d)W) per edge deletion

Random sampling to pick the witness vertices

Theorem : Given a path puv of length l from u to v, if we sample cn/l log2 n vertices (for any c>0), then with probability 1-1/nc , at least one of the vertices will be picked from the path puv

Maintaining all-pairs reachability corresponding to paths of length

[d/2,d]

• Form a set Wd of n/d log n vertices uniformly randomly.

• Build and maintain in_trees and out_trees on vertices of set Wd.

Update time : O((n3/(dm) + n)log n)

Maintaining all-pairs reachability corresponding to paths of length

[d,n]

• For each interval [2id,2i+1d], build and maintain in_trees and out_trees on a collection of n/(2id) log n vertices. • Maintain the reachability matrix M Total Update time : O((n3/(dm) + n)log2 n)

Comparing the two data-structures

• Explicit maintenance of transitive closure

for path of length

[1,d]

Update time :

O(nd)

• Implicit maintenance of transitive closure for paths of length

[d,n]

Update time :

O((n3/(dm)+n)log2n)

Comparing the two data-structures

• Explicit maintenance of transitive closure

for path of length [1,d] Update time : O(nd)

Suitable for short paths

• Implicit maintenance of transitive closure for paths of length

[d,n] Update time : O((n3/(dm)

+n)log2n)

Suitable for long paths

Improved algorithm for transitive closure

Previous New

Update time O(n3/2) O(n4/3)

Source Leeuwen et al. (1988) and Demetrescu (FOCS 2000)

Improved Decremental Algorithm for maintaining all-

pairs 2-approximate paths

u

v

w

• Invariant maintained :

M[u,v] points to the first vertex in the witness list W that is a witness of

reachability from u to v

Improved update bounds for maintaining 2-approximate

APSPPrevious New

Update time per edge deletion none O(n2/m)

Improved Update bounds for maintaining exact APSP

Type of query Previous New

Report distance from u to v

O(n3m log3 n)

FOCS 2000

O(n3/m log2 n)

Report shortest path from u to v

O(n3/m log3 n)

FOCS 2000

Min(n3/m log2n,

n1.5 log n)