Dynamic connectivity algorithms for Feynman diagrams Rubao Ji
Dynamic connectivity algorithms for Feynman diagrams Rubao Ji Advisor: Dr. Robert W. Robinson Committee: Dr. E. Rodney Canfield Dr. Daniel M. Everett 2002. 11
Outline of Thesis Introduction Algorithm design and time complexity analysis Data structure and implementation Experimental results and discussions
[ Introduction ] Feynman Diagram A Feynman diagram with order of n can be viewed as a matching on 2 n nodes (edges in the matching are undirected and called V-lines) along with a permutation of the 2 n nodes (represented by directed edges called Glines) 5 2 3 0 4 1 G line V line
[ Introduction ] Feynman Diagram 2 A Feynman diagram with order of n can be viewed as a matching on 2 n nodes (edges in the matching are undirected and called V-lines) along with a permutation of the 2 n nodes (represented by directed edges called Glines) 3 5 4 1 0 G line V line
[ Introduction ] Feynman Diagram 2 A Feynman diagram with order of n can be viewed as a matching on 2 n nodes (edges in the matching are undirected and called V-lines) along with a permutation of the 2 n nodes (represented by directed edges called Glines) 5 3 4 1 0 G line V line
[ Introduction ] Switching and Connectivity 5 a b a´ b´ 5 Switch(a, b) a a´ b b´ 3 0 4 Switch(2, 4) 2 3 0 4 1 2 Switch(4, 0) Connected 1 5 2 3 0 4 1 Not Connected
[ Introduction ] Switching and Connectivity a a’ b b’ 5 2 5 3 Switch(a, b) a a’ b b’ Switch(2, 4) 4 1 0 2 1 3 0 4
[ Introduction ] Dynamic vs. Static Dynamic graph problem: Answer queries on graphs that are undergoing a sequence of updates (e. g. insertions and deletions of edges and vertices) • Fully-dynamic • Semi-dynamic (incremental, decremental) Dynamic algorithm: Update the solution of a problem more efficiently after dynamic changes rather than having to recompute it from scratch each time (static).
[ Introduction ] Amortized & Expected 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
[ Introduction ] A Brief History Deterministic algorithms Frederickson, 1985. Epstein et al. , 1992. Henzinger&King, 1997. n) Holm et al. , 1998. n/loglog n) Randomized algorithms Henzinger&King, 1995. n) Henzinger&Thorup, 1997. n) Thorup, 2000. n/logloglog n) Update Query O(m 1/2) O(n 1/3 log n) O(log 2 n) Update O(1) O(log n/loglog O(log Query O(log 3 n) O(log n/loglog O(log 2 n) O(log n/loglog O(log n(loglog n)3) O(log
[ Algorithm design and time complexity analysis ] Features that matter 1. Number of G-cycles O (log n) 2. Update time O (log n) 3. Query time O (log? n)
[ Algorithm design and time complexity analysis ] Lemma 2. 1 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 Prove: Pr [Cl]= 1/2 n Pr [C 1]= 1/2 n Pr [C 2]=(2 n-1)/2 n * 1/(2 n-1) = 1/2 n Pr [C 3]=(2 n-1)/2 n * (2 n-2)/(2 n-1)*1/(2 n-2) =1/2 n : v
[ Algorithm design and time complexity analysis ] Lemma 2. 1 (cont’d) Xi : the size of the G-cycle containing node i S: total number of G-cycles
[ Algorithm design and time complexity analysis ] Update 1. Splay Tree (Self-Adjusting BST) 2. Treap (BST + Heap) 3. G-cycle: In-order traversal V-line: Implicit numbering
[ Algorithm design and time complexity analysis ] Update 1. Splay Tree (Self-Adjusting BST) 2. Treap (BST + Heap) 3. G-cycle: In-order traversal V-line: Implicit numbering
[ Algorithm design and time complexity analysis ] Update 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)
[ Algorithm design and time complexity analysis ] Update: Splay Tree x Splay(x) x x Join(t 1, t 2) t 1 x t 2 t 1 t 2 x x Split(x, t) t 1 t 2
[ Algorithm design and time complexity analysis ] Update: Treap delete(x) x Insert(x) x a Rotate left b x delete(x) Join(t 1, t 2) b t 1 t 2 a y Rotate right x Split(x, t) t 1 x y x t 2
[ Algorithm design and time complexity analysis ] Query SCQ (Simplified Connectivity Query) ACQ (Advanced Connectivity Query) IDQ (Integrated DFS Connectivity Query)
[ Algorithm design and time complexity analysis ] Query: SCQ Straightforward approach Simple DFS or pre-order traversal Linear
[ Algorithm design and time complexity analysis ] Query: ACQ More complicated than SCQ Start from smallest component O(log 2 n)
[ Algorithm design and time complexity analysis ] Lemma 2. 4 ACQ algorithm has an expected cost of O(log 2 n) time to query the connectivity of Feynman diagram. 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. D 1 > 1/2, D 2 > 1/2 + 1/4 … Dn > 1/2 + 1/4 + ··· +1/2(n-1) Si The probability that at least i attempts will be needed to find another component. 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.
[ Algorithm design and time complexity analysis ] Query: IDQ Integrated with update process Maintain a G-cycle graph O(log n)
[ Algorithm design and time complexity analysis ] IDQ (cont’d) Switch(a, b) a a b Case 1 b Case 2
[ Algorithm design and time complexity analysis ] IDQ (cont’d) Switch(a, b) a a b Case 1 b Case 2
[ Algorithm design and time complexity analysis ] IDQ (cont’d) Switch(a, b) a a b Case 1 b Case 2
[ 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. DFS (Linear in number of Gcycles) Chance of disconnected O(1/n) If connected, O(1) to update the edge
[ Algorithm design and time complexity analysis ] Lemma 2. 5 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).
[ Algorithm design and time complexity analysis ] Lemma 2. 6 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).
[ Data structures and implementations ] Update -ASF (Array-based Splay Forest) i lc[i] rc[i] p[i] s[i] 0 1 2 3 4 5 # # 0 # 2 # # # 5 # 1 3 ~2 4 ~4 5 4 2 1 1 4 1 6 2 4 2 0 1 5 3
[ Data structures and implementations ] ASF: Switch(a, b) { a T 1, b T 2} T 1 Splay(a) a b Splay(b) a a´ b b´ T 2 Switch a b´ b w Splay(w) Switch (a, b) b´ w b´ a Join b a´ w a b´ b a´ a´ b a´
[ Data structures and implementations ] ASF: Switch(a, b) {a , b T} a´ T T a a a´ b b’ b b´ Splay(a) a a’ Splay(a) a a Switch (a, b) a b´ b a’ a´ b b’ Splay(b) b b’ a’ Splay(b) b b b’ b’ Reattach a b b’ a’ a’ a b b’ a’
[ Data structures and implementations ] Update -ATF (Array-based Treap Forest) i lc[i] rc[i] p[i] s[i] prio[i] 0 1 2 3 4 5 # # 0 # 2 # # # 5 # 1 3 ~2 4 ~4 5 4 2 1 1 4 1 6 2 1 2 4 0 5 3 4 2 0 1 5 3
[ Data structures and implementations ] ATF: Switch(a, b) { a T 1, b T 2} T 1 w Split(a) w Split(b) a a’ b b’ a a’ b Switch w b’ w Delete(w) a b’ T 2 Delete(w) a b’ b a’ Join x Delete (x) a b’ b a’
[ Data structures and implementations ] ATF: Switch(a, b) {a , b T} T a a’ Reattach b’ a w w b b’ w a’ T Split(a) b b’ Split(b) b b’ a a’ Split(b) w w b b’ w Reattach b a’ a b’ a b a’ Delete(w) a b’ b a’
[ Data structures and implementations ] IDQ: Adjacency list 0 1 2 3 4 2 2 1 0 0 4 0 3 2 Type A node visited down 1 next 0 3 4 Type B node visited p 1 p 2 adj_next link
[ Data structures and implementations ] IDQ: Switch(a, b) { a T 1, b T 2} 2 0 1 2 25 25 1 4 35 5 3 4 0 0 1 0 3 4 0 1 5 0 4
[ Data structures and implementations ] IDQ: Switch(a, b) {a , b T} 0 1 2 3 4 0 1 5 6 3 4 2 2 1 0 0 25 26 1 1 0 0 4 3 0 3 2 1 0 3 4 6 1 5 0 3 4
[ Experimental results and discussion ] Exp 1: ASF vs. ATF n: 10 -100, 000 5000 switches ACQ random
[ 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 ] Discussion Splay tree vs. Treap IDQ vs. ACQ vs. SCQ Further study
Thanks ! Animation downloaded from: http: //www. egglescliffe. org. uk/physics/particles/parts 1. html
[ Data structures and implementations ] ATF: Insert 0 i 0 1 2 3 4 5 Insert(2) 3 2 4 0 5 1 2 Rotate(2) 2 W[i] P[i] 2 0 5 4 1 3 0 2 Insert(5) 0 0 5 Insert(3) 2 2 Rotate(4) 0 5 0 2 Insert(4) 5 0 4 5 3 3 3 4 Rotate(4) 4 2 0 4 5 Rotate(4) 4 2 0 Insert(1) 5 3 3 2 0 1 5 3
- Slides: 46