rubao ji advisor: dr. robert w. robinson committee: dr. e. rodney canfield dr. daniel m. everett ...

46
Rubao Ji Advisor: Dr. Robert W. Robinson Committee: Dr. E. Rodney Canfield Dr. Daniel M. Everett 2002.11 Dynamic connectivity algorithms for Feynman diagrams

Upload: lilian-mckinney

Post on 25-Dec-2015

218 views

Category:

Documents


2 download

TRANSCRIPT

Rubao Ji

Advisor: Dr. Robert W. Robinson

Committee: Dr. E. Rodney Canfield

Dr. Daniel M. Everett

2002.11

Dynamic connectivity algorithms for Feynman diagrams

Introduction

Algorithm design and time complexity analysis

Data structure and implementation

Experimental results and discussions

Outline of Thesis

5

2

01

4

3

G line V line

A Feynman diagram with order of n can be viewed as a matching on 2n nodes (edges in the matching are undirected and called V-lines) along with a permutation of the 2n nodes (represented by directed edges called G-lines)

[ Introduction ]

Feynman Diagram

5

2

0

14

3

G line V line

A Feynman diagram with order of n can be viewed as a matching on 2n nodes (edges in the matching are undirected and called V-lines) along with a permutation of the 2n nodes (represented by directed edges called G-lines)

[ Introduction ]

Feynman Diagram

3

2

0

14

5

G line V line

A Feynman diagram with order of n can be viewed as a matching on 2n nodes (edges in the matching are undirected and called V-lines) along with a permutation of the 2n nodes (represented by directed edges called G-lines)

[ Introduction ]

Feynman Diagram

a a´

b b´

Switch(a,b)

a a´

b b´

52

01

4

3

Switch(2,4)

Switch(4,0)

52

01

4

3

52

01

4

3

Connected

NotConnected

[ Introduction ]

Switching and Connectivity

a a’

b b’

Switch(a,b)

a a’

b b’

Switch(2,4)

[ Introduction ]

Switching and Connectivity

3

2

01

4

5

52

34

0

1

Dynamic graph problem:

Answer queries on graphs that are undergoing a sequence of updates (e.g. insertions and deletions of edges and vertices)

[ Introduction ]

• Fully-dynamic

• Semi-dynamic (incremental, decremental)

Dynamic algorithm:

Update the solution of a problem more efficiently after dynamic changes rather than having to re-compute it from scratch each time (static).

Dynamic vs. Static

[ Introduction ]

Running time of one single operation averaged over a

sufficiently long sequence of operations

Amortized Time any sequence long enough worst case bond

Expected Time sequence has some distribution or is random probabilistic worst case

Amortized & Expected

[ Introduction ]

A Brief History

Deterministic algorithms

Frederickson, 1985. O(m1/2) O(1)Epstein et al., 1992. O(n1/2) O(1)Henzinger&King, 1997. O(n1/3 log n) O(log n/loglog n)Holm et al., 1998. O(log2 n) O(log n/loglog n)Randomized algorithms

Henzinger&King, 1995. O(log3 n) O(log n/loglog n)Henzinger&Thorup, 1997. O(log2 n) O(log n/loglog n)Thorup, 2000. O(log n(loglog n)3) O(log n/logloglog n)

Update Query

Update Query

1. Number of G-cycles

2. Update time

3. Query time

[ Algorithm design and time complexity analysis ]

O (log n)

O (log n)

O (log? n)

Features that matter

[ Algorithm design and time complexity analysis ]

For a randomly generated Feynman diagram of order n, the expected number of G-cycles is O(log n).

Cl: G-cycle containing vertex v has length l

Pr [C1]= 1/2n

Pr [C2]=(2n-1)/2n * 1/(2n-1) = 1/2n

Pr [C3]=(2n-1)/2n * (2n-2)/(2n-1)*1/(2n-2) =1/2n

:

vProve: Pr [Cl]= 1/2n

Lemma 2.1

[ Algorithm design and time complexity analysis ]

Xi : the size of the G-cycle containing node iS: total number of G-cycles

Lemma 2.1 (cont’d)

[ Algorithm design and time complexity analysis ]

1. Splay Tree (Self-Adjusting BST)

2. Treap (BST + Heap)

Update

G-cycle: In-order traversalV-line: Implicit numbering

[ Algorithm design and time complexity analysis ]

Update

1. Splay Tree (Self-Adjusting BST)

2. Treap (BST + Heap)

G-cycle: In-order traversalV-line: Implicit numbering

[ Algorithm design and time complexity analysis ]

Lemma 2.2 Each splay operation has an amortized time of O(log n) over (n) operations such that the tree size is always O(n). (From

Sleator&Tarjan,1985)

Lemma 2.3 Each treap operation has an expected time of O(log n) averaged over all permutations of the nodes for the priority attribute. (From Seidel & Aragon, 1996)

Update

[ Algorithm design and time complexity analysis ]

x

x

Splay(x)

t1

x

Join(t1,t2)t2

xt1 t2

xSplit(x,t)

x

t1 t2

Update: Splay Tree

[ Algorithm design and time complexity analysis ]

xdelete(x)

t1

x

Join(t1,t2)t2 t1 t2

x Split(x,t)

x

t1 t2

Insert(x)

x

b

a Rotate left

Rotate right

b

a

y

Update: Treap

delete(x)

x

y

SCQ (Simplified Connectivity Query)

ACQ (Advanced Connectivity Query)

IDQ (Integrated DFS Connectivity Query)

[ Algorithm design and time complexity analysis ]

Query

Straightforward approach

Simple DFS or pre-order traversal

Linear

[ Algorithm design and time complexity analysis ]

Query: SCQ

More complicated than SCQ

Start from smallest component

O(log2 n)

[ Algorithm design and time complexity analysis ]

Query: ACQ

[ Algorithm design and time complexity analysis ]

ACQ algorithm has an expected cost of O(log2 n) time to query the connectivity of Feynman diagram.

Si The probability that at least i attempts will be needed to find another component.

D1 > 1/2, D2 > 1/2 + 1/4 …

Dn > 1/2 + 1/4 + ··· +1/2(n-1)

Di The probability that, in examing vertices in the smallest component, a V -edge joining it to another component will be found in i attempts.

Si > 1 - Di

Ex[Steps] < 1 + 1/2 + 1/4 + …= 2

O(log n) expected component, O(log n) expected joins, after each join, take O(log n) expected time to find the smallest component.

Lemma 2.4

Integrated with update process

Maintain a G-cycle graph

O(log n)

[ Algorithm design and time complexity analysis ]

Query: IDQ

[ Algorithm design and time complexity analysis ]

a

b

a

b

Case 1 Case 2

Switch(a,b)

IDQ (cont’d)

[ Algorithm design and time complexity analysis ]

a

b

a

b

Case 1 Case 2

Switch(a,b)

IDQ (cont’d)

[ Algorithm design and time complexity analysis ]

a

b

a

b

Case 1 Case 2

Switch(a,b)

IDQ (cont’d)

DFS (Linear in number of G-cycles)

Chance of disconnected O(1/n)

If connected, O(1) to update the edge

[ Algorithm design and time complexity analysis ]

IDQ (cont’d)

IDQ algorithm has an expected cost of O(log n) time to query the connectivity of Feynman diagram.

[ Algorithm design and time complexity analysis ]

Using a splay forest data structure for Feynman diagram update combined with ACQ for connectivity queries gives an amortized expected time per operation of O(log2 n).

Using a treap forest data structure for Feynman diagram update combined with ACQ for connectivity queries gives an expected time per operation of O(log2 n).

Lemma 2.5

[ Algorithm design and time complexity analysis ]

Using a splay forest data structure for Feynman diagram update combined with IDQ for connectivity queries gives an amortized expected time per operation of O(log n).

Using treap a forest data structure for Feynman diagram update combined with IDQ for connectivity queries gives an expected time per operation of O(log n).

Lemma 2.6

[ Data structures and implementations ]

ASF (Array-based Splay Forest)

i lc[i] rc[i]

012345

##0#2#

##5#13

0

3

4

5

2 1

p[i]

~24

~4542

s[i]

114162

Update -ASF

T1 T2

a a´ b b´

a´ b´

Splay(a) Splay(b)

Switch

a b

a b

[ Data structures and implementations ]

Splay(w)

w

b a´w

aw

b a´

Join

ASF: Switch(a,b) { a T1, b T2}

aa´ b

Switch (a,b)

ab´

ba´

a a´ b b´Splay(a)

b b’a’

Splay(b)

a’ b’

a

b

a

b’

Reattach

b

a a’b b’

Splay(a)

b b’ a’

Splay(b)

b’

a

b

a

b’

Reattach

b

a’

T T

[ Data structures and implementations ]

ASF: Switch(a,b) {a ,b T}

ab´ b

Switch (a,b)

aa´

bb´

a’

[ Data structures and implementations ]

ATF (Array-based Treap Forest)

i lc[i] rc[i]

012345

##0#2#

##5#13

0

3

4

5

2 1

p[i]

~24

~4542

s[i]

114162

prio[i]

124053

Update -ATF

T1 T2

a a’ b b’

Split(a) Split(b)

Switch

[ Data structures and implementations ]

a’ b’

w w

a b

b’

w

a

Delete(w)

a’

w

ba b’

Join

x

a b’ b a’

Delete (x)

a b’ b a’

Delete(w)

b a’

ATF: Switch(a,b) { a T1, b T2}

a a’ b b’

Split(a)

b b’a’

Split(b)

a’ b’

w

ww

b’

Reattach

a a’b b’

Split(a)

b b’ a’

Split(b)

b’

w

w Reattachw

a’

aa

b ba

a’ b

a b’ ab

Delete(w)

T T

Delete(w)

a b’ b a’

ATF: Switch(a,b) {a ,b T}

[ Data structures and implementations ]

2 1

34

0

0 1 2 3 4

2

4

3

1

0

2 0 0

node down nextType A node

node p1 linkType B node p2 adj_next

visited

visited

[ Data structures and implementations ]

IDQ: Adjacency list

0 1 2 3 4

2

4

3

1

0

2 0 0

[ Data structures and implementations ]

IDQ: Switch(a,b) { a T1, b T2}

5

5

5

5

2 1

34

0

15

4

0

0 1 5 3 4

2

4

3

1

0

2 0 0

[ Data structures and implementations ]

IDQ: Switch(a,b) {a ,b T}

2 1

34

0

61

34

0

5

6

5 6 1

0 1 2 3 4

2

4

3

1

0

2 0 0

[ Experimental results and discussion ]

n: 10-100,000 5000 switches ACQ random

Exp 1: ASF vs. ATF

[ Experimental results and discussion ]

Exp 2: Update vs. Query

[ Experimental results and discussion ]

Exp 3: Frequency of Dis-connection

[ Experimental results and discussion ]

Exp 4: Time per Switching

[ Experimental results and discussion ]

Exp 5: IDQ/ACQ/SCQ

[ Experimental results and discussion ]

Splay tree vs. Treap

IDQ vs. ACQ vs. SCQ

Further study

Discussion

Thanks !

Animation downloaded from: http://www.egglescliffe.org.uk/physics/particles/parts/parts1.html

20

0Insert(2) 2

0Rotate(2) 2

0Insert(5)

5

Insert(3)

20

3

5Insert(4)2

0

3

5

4

Rotate(4)20

3

5

4

Rotate(4)

20

3

4

5

0

3

4

5Rotate(4) 2

0

3

4

5Insert(1) 2 1

i W[i] P[i]

012345

205413

324051

[ Data structures and implementations ]

ATF: Insert