Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Rubao Ji Advisor: Dr. Robert W. Robinson Committee: Dr. E. Rodney Canfield Dr. Daniel M. Everett  2002.11  Dynamic connectivity algorithms for Feynman."— Presentation transcript:

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

2  Introduction  Algorithm design and time complexity analysis  Data structure and implementation  Experimental results and discussions Outline of Thesis

3 5 2 0 1 4 3 G lineV 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

4 5 2 0 1 4 3 G lineV 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 3 2 0 1 4 5 G lineV 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

6 aa´a´ bb´b´ Switch(a,b) aa´a´ bb´b´ 5 2 0 1 4 3 Switch(2,4) Switch(4,0) 5 2 0 1 4 3 5 2 0 1 4 3 Connected Not Connected [ Introduction ] Switching and Connectivity

7 aa’ bb’ Switch(a,b) aa’ bb’ Switch(2,4) [ Introduction ] Switching and Connectivity 3 2 0 1 4 5 5 2 3 4 0 1

8  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

9 [ 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

10 [ Introduction ] A Brief History Deterministic algorithms Frederickson, 1985. O(m 1/2 ) O(1) Epstein et al., 1992. O(n 1/2 ) O(1) Henzinger&King, 1997. O(n 1/3 log n) O(log n/loglog n) Holm et al., 1998. O(log 2 n) O(log n/loglog n) Randomized algorithms Henzinger&King, 1995. O(log 3 n) O(log n/loglog n) Henzinger&Thorup, 1997. O(log 2 n) O(log n/loglog n) Thorup, 2000. O(log n(loglog n) 3 ) O(log n/logloglog n) UpdateQuery UpdateQuery

11 1.Number of G-cycles 2.Update time 3.Query time [ Algorithm design and time complexity analysis ] O (log n) O (log ? n) Features that matter

12 [ 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). C l : G-cycle containing vertex v has length l Pr [C 1 ]= 1/2n Pr [C 2 ]=(2n-1)/2n * 1/(2n-1) = 1/2n Pr [C 3 ]=(2n-1)/2n * (2n-2)/(2n-1)*1/(2n-2) =1/2n : v Prove: Pr [C l ]= 1/2n Lemma 2.1

13 [ Algorithm design and time complexity analysis ] X i : the size of the G-cycle containing node i S: total number of G-cycles Lemma 2.1 (cont’d)

14 [ Algorithm design and time complexity analysis ] 1.Splay Tree (Self-Adjusting BST) 2.Treap (BST + Heap) Update G-cycle: In-order traversal V-line: Implicit numbering

15 [ Algorithm design and time complexity analysis ] Update 1.Splay Tree (Self-Adjusting BST) 2.Treap (BST + Heap) G-cycle: In-order traversal V-line: Implicit numbering

16 [ 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

17 [ Algorithm design and time complexity analysis ] x x Splay(x) t1 x Join(t1,t2) t2 x t1t2 x Split(x,t) x t1t2 Update: Splay Tree

18 [ Algorithm design and time complexity analysis ] x delete(x) t1 x Join(t1,t2) t2 t1t2 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

19  SCQ (Simplified Connectivity Query)  ACQ (Advanced Connectivity Query)  IDQ (Integrated DFS Connectivity Query) [ Algorithm design and time complexity analysis ] Query

20  Straightforward approach  Simple DFS or pre-order traversal  Linear [ Algorithm design and time complexity analysis ] Query: SCQ

21  More complicated than SCQ  Start from smallest component  O(log 2 n) [ Algorithm design and time complexity analysis ] Query: ACQ

22 [ Algorithm design and time complexity analysis ] ACQ algorithm has an expected cost of O(log 2 n) time to query the connectivity of Feynman diagram.  S i The probability that at least i attempts will be needed to find another component. D 1 > 1/2, D 2 > 1/2 + 1/4 … D n > 1/2 + 1/4 + ··· +1/2 (n-1)  D i The probability that, in examing vertices in the smallest component, a V -edge joining it to another component will be found in  i attempts. S i > 1 - D i 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

23  Integrated with update process  Maintain a G-cycle graph  O(log n) [ Algorithm design and time complexity analysis ] Query: IDQ

24 [ Algorithm design and time complexity analysis ] a b a b Case 1 Case 2 Switch(a,b) IDQ (cont’d)

25 [ Algorithm design and time complexity analysis ] a b a b Case 1 Case 2 Switch(a,b) IDQ (cont’d)

26 [ Algorithm design and time complexity analysis ] a b a b Case 1 Case 2 Switch(a,b) IDQ (cont’d)

27  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.

28 [ 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(log 2 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(log 2 n). Lemma 2.5

29 [ 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

30 [ Data structures and implementations ] ASF (Array-based Splay Forest) ilc[i]rc[i] 012345012345 ##0#2###0#2# ##5#13##5#13 0 3 4 5 2 1 p[i]p[i] ~2 4 ~4 5 4 2 s[i]s[i] 114162114162 Update -ASF

31 T1T2 a a´a´ b b´b´ a´a´ b´b´ b´b´ Splay(a)Splay(b) Switch a´a´ ab ab [ Data structures and implementations ] Splay(w) w b a´a´ w b´b´ a w b a´a´ Join ASF: Switch(a,b) { a  T1, b  T2} a a´a´ b b´b´ Switch (a,b) a b´b´ b a´a´

32 a a´a´ b b´b´ Splay(a) bb’a’ Splay(b) a’b’ a b a Reattach b aa’bb’ Splay(a) bb’a’ Splay(b) b’ a b a Reattach b a’ T T [ Data structures and implementations ] ASF: Switch(a,b) {a,b  T} a b´b´ b a´a´ Switch (a,b) a a´a´ b b´b´ a’

33 [ Data structures and implementations ] ATF (Array-based Treap Forest) ilc[i]rc[i] 012345012345 ##0#2###0#2# ##5#13##5#13 0 3 4 5 2 1 p[i]p[i] ~2 4 ~4 5 4 2 s[i]s[i] 114162114162 prio[i] 124053124053 Update -ATF

34 T1 T2 aa’ bb’ Split(a) Split(b) Switch [ Data structures and implementations ] a’b’ ww ab w a Delete(w) a’ w b ab’ Join x ab’ba’ Delete (x) ab’ba’ Delete(w) ba’ ATF: Switch(a,b) { a  T1, b  T2}

35 aa’bb’ Split(a) bb’a’ Split(b) a’b’ w w w Reattach aa’bb’ Split(a) bb’a’ Split(b) b’ w w Reattach w a’ a a b b a b a b’a b Delete(w) T T ab’ ba’ ATF: Switch(a,b) {a,b  T} [ Data structures and implementations ]

36 21 3 4 0 01234 2 4 3 1 0 200 nodedownnext Type A node nodep1link Type B node p2adj_next visited [ Data structures and implementations ] IDQ: Adjacency list

37 01234 2 4 3 1 0 200 [ Data structures and implementations ] IDQ: Switch(a,b) { a  T1, b  T2} 5 5 5 5 21 3 4 0 1 5 4 0

38 01534 2 4 3 1 0 200 [ Data structures and implementations ] IDQ: Switch(a,b) {a,b  T} 21 3 4 0 6 1 3 4 0 5 6 56 1 01234 2 4 3 1 0 200

39 [ Experimental results and discussion ]  n: 10-100,000  5000 switches  ACQ  random Exp 1: ASF vs. ATF

40 [ Experimental results and discussion ] Exp 2: Update vs. Query

41 [ Experimental results and discussion ] Exp 3: Frequency of Dis-connection

42 [ Experimental results and discussion ] Exp 4: Time per Switching

43 [ Experimental results and discussion ] Exp 5: IDQ/ACQ/SCQ

44 [ Experimental results and discussion ]  Splay tree vs. Treap  IDQ vs. ACQ vs. SCQ  Further study Discussion

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

46 2 0 0 Insert(2) 2 0 Rotate(2) 2 0 Insert(5) 5 Insert(3) 2 0 3 5 Insert(4) 2 0 3 5 4 Rotate(4) 2 0 3 5 4 2 0 3 4 5 0 3 4 5 2 0 3 4 5 Insert(1) 2 1 iW[i]W[i]P[i]P[i] 012345012345 205413205413 324051324051 [ Data structures and implementations ] ATF: Insert


Download ppt "Rubao Ji Advisor: Dr. Robert W. Robinson Committee: Dr. E. Rodney Canfield Dr. Daniel M. Everett  2002.11  Dynamic connectivity algorithms for Feynman."

Similar presentations


Ads by Google