Dynamic Graph Algorithms Giuseppe F. (Pino) Italiano University of - - PowerPoint PPT Presentation

dynamic graph algorithms
SMART_READER_LITE
LIVE PREVIEW

Dynamic Graph Algorithms Giuseppe F. (Pino) Italiano University of - - PowerPoint PPT Presentation

Dynamic Graph Algorithms Giuseppe F. (Pino) Italiano University of Rome Tor Vergata giuseppe.italiano@uniroma2.it http://people.uniroma2.it/giuseppe.italiano/ Main Goals Understand whats going on in a rich area (35+ years, still very


slide-1
SLIDE 1

Dynamic Graph Algorithms

Giuseppe F. (Pino) Italiano

University of Rome Tor Vergata giuseppe.italiano@uniroma2.it

http://people.uniroma2.it/giuseppe.italiano/

slide-2
SLIDE 2

Main Goals

Understand what’s going on in a rich area (35+ years, still very active) Master the main algorithmic ideas, tools and techniques introduced Get involved and contribute to solving some exciting open problems!

slide-3
SLIDE 3

Prerequisites

Basic data structures:

  • Binary search trees, linking and cutting trees,

union-find, etc… Basic (graph) algorithms:

  • DFS, BFS, MST, shortest paths, etc…

Analysis of algorithms:

  • worst-case, average, amortized, randomized,

etc…

slide-4
SLIDE 4

Outline

Dynamic Graph Problems – Quick Intro Topic 1. (Undirected Graphs) Dynamic Connectivity & MST Topic 2. (Undirected/Directed Graphs) Dynamic Shortest Paths Topic 3. (Non-dynamic?) 2-Connectivity in Directed Graphs

slide-5
SLIDE 5

Theory is when you know something, but it doesn't work.

Theory

slide-6
SLIDE 6

Practice is when something works, but you don't know why.

The real world out there…

slide-7
SLIDE 7

Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why.

Combining Theory and Practice?

slide-8
SLIDE 8

Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Big challenge: combine theory and practice… …i.e., nothing works and you don't know why.

Combining Theory and Practice?

slide-9
SLIDE 9

Outline

Dynamic Graph Problems – Quick Intro Topic 1. (Undirected Graphs) Dynamic Connectivity & MST Topic 2. (Undirected/Directed Graphs) Dynamic Shortest Paths Topic 3. (Non-dynamic?) 2-Connectivity in Directed Graphs

slide-10
SLIDE 10

Dynamic Graphs

Graphs subject to update operations

Insert(u,v) Delete(u,v) ChangeWeight(u,v,w)

Typical updates:

slide-11
SLIDE 11

A graph

Initialize Insert Delete Query

Dynamic Graphs

slide-12
SLIDE 12

Dynamic Graph Algorithms

The goal of a dynamic graph algorithm is to support query and update operations as fast as possible (usually much faster than recomputing from scratch). We will use also amortized analysis:

Total worst-case time over sequence of ops # operations

Notation:

G = (V,E) n = |V| m = |E|

slide-13
SLIDE 13

Dynamic Graphs

Partially Dynamic Problems

Graphs subject to insertions only (incremental),

  • r deletions only (decremental), but not both.

Fully Dynamic Problems

Graphs subject to intermixed sequences

  • f insertions and deletions.

Usually much more difficult problems.

slide-14
SLIDE 14

Dynamic Graph Problems

Support queries about properties on a dynamic graph

Dynamic Connectivity (undirected graph G) 


Connected(): Connected(x,y):

Is G connected? Are x and y connected in G? Dynamic Minimum Spanning Tree (undirected graph G) 
 Any property on a MST of G

slide-15
SLIDE 15

Dynamic Graph Problems

Dynamic All Pairs Shortest Paths


Distance(x,y):

What is the distance from x to y in G?

ShortestPath(x,y):

What is the shortest path from x to y in G? Dynamic Transitive Closure (directed graph G) 


Reachable(x,y):

Is y reachable from x in G?

slide-16
SLIDE 16

Dynamic Graph Problems

Dynamic Min Cut

MinCut(): Cut(x,y):

Min cut? Are x and y on the same side of a min cut of G? Dynamic Planarity Testing

planar():

Is G planar? Dynamic k-connectivity

k-connected(): k-connected(x,y):

Is G k-connected? Are x and y k-connected?

slide-17
SLIDE 17

Dynamic Graph Problems

Dynamic (Approximate) Maximum Matching

Matching():

Maximum Matching?

ApproximateMatching():

Approximate Maximum Matching? ValueofMatching(): Dynamic (Approximate) Minimum Vertex Cover VertexCover(): Approximate Minimum Vertex Cover?

slide-18
SLIDE 18

Outline

Dynamic Graph Problems – Quick Intro Topic 1. (Undirected Graphs) Dynamic Connectivity & MST Topic 2. (Undirected/Directed Graphs) Dynamic Shortest Paths Topic 3. (Non-dynamic?) 2-Connectivity in Directed Graphs

slide-19
SLIDE 19

19

Fully Dynamic Graph Connectivity

Maintain an undirected graph G under an intermixed sequence of

  • perations of the following type:
  • insert(u,v) : Add a new edge (u,v)
  • delete(u,v) : Remove edge (u,v) from G (assumes (u,v) in G)
  • connected(u,v) : Return yes if there is a path between u and v;

return no otherwise Subproblem (basic ingredient) in many other problems Minimum spanning trees, 2-connectivity, … Simple problem but lots of interesting ideas!

slide-20
SLIDE 20

20

connected(v,w)

slide-21
SLIDE 21

21

connected(v,w)

slide-22
SLIDE 22

22

connected(v,w)

slide-23
SLIDE 23

23

insert(v,w)

slide-24
SLIDE 24

24

insert(v,w)

slide-25
SLIDE 25

25

delete(v,w)

slide-26
SLIDE 26

26

delete(v,w)

slide-27
SLIDE 27

27

delete(v,w)

slide-28
SLIDE 28

28

delete(v,w)

slide-29
SLIDE 29

29

Incremental connectivity: Without deletions, union-find data structures would be just enough

Observation

slide-30
SLIDE 30

Disjoint Set-Union:

  • makeset(x): {x}
  • find(x): returns set containing x
  • union(x,y): replaces find(x) and find(y) by

their union

Incremental Connectivity

slide-31
SLIDE 31
  • insert(x,y): if find(x) ≠ find(y) then union(x,y)
  • connected(x,y): return (find(x) == find(y))

(true iff x and y are connected) Amortized cost per operation is O(α(m,n)) (inverse Ackermann)

Incremental Connectivity

slide-32
SLIDE 32

32

Incremental connectivity: Without deletions, union-find data structures would be just enough

Observation

Incremental MST: Without deletions, linking and cutting trees [Sleator & Tarjan 1983] would be just enough. Why?

slide-33
SLIDE 33

33

Back to Fully Dynamic Connectivity

But simple case first: Graph is a forest

slide-34
SLIDE 34

34

Operations we need to do on the forest

link(v,w) : Join two trees in the forest by inserting edge (v,w) (assume v and w are in different trees) cut(v,w) : Split a tree by deleting edge (v,w) (assume v and w are adjacent in a tree) findtree(v) : Return the tree containing vertex v in the forest

slide-35
SLIDE 35

35

Operations we need to do on the forest

link(v,w) : Join two trees in the forest by inserting edge (v,w) (assume v and w are in different trees) cut(v,w) : Split a tree by deleting edge (v,w) (assume v and w are adjacent in a tree) findtree(v) : Return the tree containing vertex v in the forest Can do this in O(log n) per operation in the worst case with several data structures, e.g.:

  • Sleator & Tarjan dynamic trees [1983],
  • ET-trees (Euler Tour trees) [Tarjan & Vishkin 1984]

We refer to those as dynamic tree data structures

slide-36
SLIDE 36

36

ET-trees

slide-37
SLIDE 37

37

A B D E R G C F

ET-trees

Euler tour of a tree

slide-38
SLIDE 38

38

ET-trees

Euler tour of a tree

slide-39
SLIDE 39

39

ET-trees

ET-tree is a balanced binary tree over the Euler tour of a tree. Can perform link, cut and findtree in O(log n)

slide-40
SLIDE 40

Euler tour tree :

A data structure for dynamic trees

a b c e f g h d b-c-d-c-b-a- e-f-e-g-e-h-e

  • a-b

b d b e e c c a f e g h a e b

How to transform a tree into a one dimensional data structure ?

slide-41
SLIDE 41

Euler tour tree :

A data structure for dynamic trees

: minimum value of all

nodes in the subtree.

a b c e f g h d b-c-d-c-b-a- e-f-e-g-e-h-e

  • a-b

b d b e e c c a f e g h a e b a f b c d e g h

slide-42
SLIDE 42

Euler tour tree :

A data structure for dynamic trees

a b c e f g h d b-c-d-c-b-a- e-f-e-g-e-h-e -a-b

slide-43
SLIDE 43

Euler tour tree :

A data structure for dynamic trees

a b c e f g h d b-c-d-c-b-a- e-f-e-g-e-h-e

  • a-b
slide-44
SLIDE 44

Euler tour tree :

A data structure for dynamic trees

a b c e f g h d a-b b-c-d-c-b-a e-f-e-g-e-h-e T1 T2 T1

slide-45
SLIDE 45

Euler tour tree :

A data structure for dynamic trees

a b c e f g h d a-b b-c-d-c-b-a T1 T2 T1 T1 e-f-e-g-e-h-e

slide-46
SLIDE 46

Euler tour tree :

A data structure for dynamic trees

a b c e f g h d a-b b-c-d-c-b-a e-f-e-g-e-h-e T1 T2 T1

T1

slide-47
SLIDE 47

Euler tour tree :

A data structure for dynamic trees

a b c e f g h d a-b b-c-d-c-b-a e-f-e-g-e-h-e T1 T2 T1 T1

slide-48
SLIDE 48

Euler tour tree :

A data structure for dynamic trees

  • Split(T,(e,a))
  • Merge(T1,T2,(u,v))
  • Change-origin(T,x) :

change the origin of Euler tour to vertex x. Each operation can be implemented in O(log n) worst-case time

a b c e f g h d b-c-d-c-b-a-b e-f-e-g-e-h-e T1 T2 T1 T1 T2 T2

slide-49
SLIDE 49

49

Fully Dynamic Connectivity

Get to the real thing: Graph is a graph

slide-50
SLIDE 50

50

Maintain a spanning forest of the graph We will have to link trees, cut trees, and determine whether two vertices are in the same tree in this forest Reduce the problem to a problem on trees (i.e., maintain a certificate for the property)

slide-51
SLIDE 51

51

But dynamic tree data structures are not enough: we still have a problem with deleting a tree edge

slide-52
SLIDE 52

52

slide-53
SLIDE 53

53

slide-54
SLIDE 54

54

How do we find

  • ut whether

there is a “replacement” edge for the forest or it really got disconnected ? For dynamic MSF it is not enough to find a repacement edge, we need to find the best replacement edge

slide-55
SLIDE 55

55

Recap (so far)

Tree Edge Non-Tree Edge Insert Link Easy Delete Cut, Replacement? Easy

slide-56
SLIDE 56

(Main) History of the Problem

Update Query Reference

O(log3 n) [Henzinger, King JACM’99] [Holm, de Lichtenberg & log n log log n O( )

Type

O(m1/2 ) O(1) [Frederickson SICOMP’85] det/w-c O(n1/2 ) O(1) [Eppstein, Galil, I. & det/w-c rand/amort O(log2 n) [Henzinger, Thorup log n log log n O( ) rand/amort O(log2 n) log n log log n O( ) det/amort O(log n (log log n)) log n log log log n O( ) rand/amort [Thorup STOC’00] [Wulff-Nilsen SODA’13] log n log log n O( ) log2 n log log n O( ) det/amort O(log5 n) [Kapron, King & O( ) rand/w-c log n log log n Nissenzweig JACM’97]

  • Rand. Struct. & Algs. ’97]

Thorup JACM’01] Mountjoy SODA’13]

slide-57
SLIDE 57

Very Recent Results

Update Query Reference Type

n log n O( ( )½ log log n ) O(log4 n) [Gibb, Kapron, King & O( ) rand/w-c log n log log n Thorn arXiv’15] O(1) [Keilberg-Rasmussen, det/w-c Thorup, arXiv’15] Kopelowitz, Pettie &

slide-58
SLIDE 58

Very Recent Results

Update Query Reference Type

n log n O( ( )½ log log n ) O(log4 n) [Gibb, Kapron, King & O( ) rand/w-c log n log log n Thorn arXiv’15] O(1) [Keilberg-Rasmussen, det/w-c Thorup, arXiv’15] Kopelowitz, Pettie &

Questions (Open): For worst-case per operation, can we bridge the gap between randomized (polylog) and deterministic (polynomial)? Or at least get a Las Vegas polylog bound? (I.e., no errors)

slide-59
SLIDE 59

Will see

Update Query Reference

O(log3 n) [Henzinger, King JACM’99] [Holm, de Lichtenberg & log n log log n O( )

Type

O(m1/2 ) O(1) [Frederickson SICOMP’85] det/w-c O(n1/2 ) O(1) [Eppstein, Galil, I. & det/w-c rand/amort O(log2 n) [Henzinger, Thorup log n log log n O( ) rand/amort O(log2 n) log n log log n O( ) det/amort O(log n (log log n)) log n log log log n O( ) rand/amort [Thorup STOC’00] [Wulff-Nilsen SODA’13] log n log log n O( ) log2 n log log n O( ) det/amort O(log5 n) [Kapron, King & O( ) rand/w-c log n log log n Nissenzweig JACM’97]

  • Rand. Struct. & Algs. ’97]

Thorup JACM’01] Mountjoy SODA’13]

slide-60
SLIDE 60

Will actually see

Update Query Reference

O(log3 n) [Henzinger, King JACM’99] [Holm, de Lichtenberg & log n log log n O( )

Type

O(m1/2 ) O(1) Simpler version det/w-c O(n1/2 ) O(1) [Eppstein, Galil, I. & det/w-c rand/amort O(log2 n) [Henzinger, Thorup log n log log n O( ) rand/amort O(log2 n) O(log n) det/amort O(log n (log log n)) log n log log log n O( ) rand/amort [Thorup STOC’00] [Wulff-Nilsen SODA’13] log n log log n O( ) log2 n log log n O( ) det/amort O(log5 n) [Kapron, King & O( ) rand/w-c log n log log n Nissenzweig JACM’97]

  • Rand. Struct. & Algs. ’97]

Thorup JACM’01] Mountjoy SODA’13]