Title: Dynamic%20connectivity%20algorithms%20for%20Feynman%20diagrams
1Dynamic connectivity algorithms for Feynman
diagrams
Rubao Ji
Advisor Dr. Robert W.
Robinson Committee Dr. E.
Rodney Canfield
Dr. Daniel M. Everett
? 2002.11 ?
2Outline of Thesis
- Introduction
- Algorithm design and time complexity analysis
- Data structure and implementation
- Experimental results and discussions
3Feynman Diagram
Introduction
5
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)
3
2
4
0
1
G line
V line
4Feynman Diagram
Introduction
2
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)
3
5
4
1
0
G line
V line
5Feynman Diagram
Introduction
2
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)
5
3
4
1
0
G line
V line
6Switching and Connectivity
Introduction
a
a
Connected
b
b
Switch(a,b)
Not Connected
a
a
b
b
7Switching and Connectivity
Introduction
a
a
5
b
b
1
2
Switch(2,4)
Switch(a,b)
0
3
4
a
a
b
b
8Dynamic vs. Static
Introduction
- 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 re-compute it from scratch each time
(static).
9Amortized Expected
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
10A Brief History
Introduction
Deterministic algorithms Frederickson, 1985.
O(m1/2)
O(1) Epstein et al., 1992. O(n1/2)
O(1) HenzingerKing,
1997. O(n1/3 log n)
O(log n/loglog n) Holm et al., 1998.
O(log2 n)
O(log n/loglog n)
Update
Query
Randomized algorithms HenzingerKing, 1995.
O(log3 n)
O(log n/loglog n) HenzingerThorup, 1997.
O(log2 n) O(log
n/loglog n) Thorup, 2000.
O(log n(loglog n)3) O(log
n/logloglog n)
Update
Query
11Features that matter
Algorithm design and time complexity analysis
O (log n) O (log n) O (log? n)
- Number of G-cycles
- Update time
- Query time
12Lemma 2.1
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
v
Prove Pr Cl 1/2n
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
13Lemma 2.1 (contd)
Algorithm design and time complexity analysis
Xi the size of the G-cycle containing node i S
total number of G-cycles
14Update
Algorithm design and time complexity analysis
- Splay Tree (Self-Adjusting BST)
- Treap (BST Heap)
-
G-cycle In-order traversal V-line Implicit
numbering
15Update
Algorithm design and time complexity analysis
- Splay Tree (Self-Adjusting BST)
- Treap (BST Heap)
-
G-cycle In-order traversal V-line Implicit
numbering
16Update
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
SleatorTarjan,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)
17Update Splay Tree
Algorithm design and time complexity analysis
x
Splay(x)
x
x
t1
t2
t1
t2
Join(t1,t2)
x
x
t1
t2
Split(x,t)
x
18Update Treap
Algorithm design and time complexity analysis
delete(x)
x
Insert(x)
x
x
t1
t2
t1
t2
delete(x)
Join(t1,t2)
b
a
Rotate left
b
a
y
t1
t2
Split(x,t)
x
Rotate right
x
x
y
19Query
Algorithm design and time complexity analysis
- SCQ (Simplified Connectivity Query)
- ACQ (Advanced Connectivity Query)
- IDQ (Integrated DFS Connectivity Query)
20Query SCQ
Algorithm design and time complexity analysis
- Straightforward approach
- Simple DFS or pre-order traversal
- Linear
21Query ACQ
Algorithm design and time complexity analysis
- More complicated than SCQ
- Start from smallest component
- O(log2 n)
22Lemma 2.4
Algorithm design and time complexity analysis
ACQ algorithm has an expected cost of O(log2 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.
D1 gt 1/2, D2 gt 1/2 1/4 Dn gt 1/2 1/4
1/2(n-1)
- Si The probability that at least i attempts will
be needed to find another component.
Si gt 1 - Di
ExSteps lt 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.
23Query IDQ
Algorithm design and time complexity analysis
- Integrated with update process
- Maintain a G-cycle graph
- O(log n)
24IDQ (contd)
Algorithm design and time complexity analysis
Switch(a,b)
a
a
b
b
Case 2
Case 1
25IDQ (contd)
Algorithm design and time complexity analysis
Switch(a,b)
a
a
b
b
Case 2
Case 1
26IDQ (contd)
Algorithm design and time complexity analysis
Switch(a,b)
a
a
b
b
Case 2
Case 1
27IDQ (contd)
Algorithm design and time complexity analysis
IDQ algorithm has an expected cost of O(log n)
time to query the connectivity of Feynman diagram.
- DFS (Linear in number of G-cycles)
- Chance of disconnected O(1/n)
- If connected, O(1) to update the edge
28Lemma 2.5
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).
29Lemma 2.6
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).
30Update -ASF
Data structures and implementations
ASF (Array-based Splay Forest)
i
lci
rci
pi
si
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
1
0
5
3
31ASF Switch(a,b) a ? T1, b ? T2
Data structures and implementations
a
b
T1
T2
Splay(a)
Splay(b)
a
b
a
b
a
b
a
Switch
b
a
a
b
w
b
Splay(w)
b
a
a
w
b
Switch (a,b)
b
Join
a
w
b
a
a
b
a
b
32ASF Switch(a,b) a ,b ? T
Data structures and implementations
T
T
a
a
a
a
b
b
a
b
a
b
Splay(a)
Splay(a)
b
b
a
a
Switch (a,b)
b
b
a
b
b
b
a
b
a
Splay(b)
Splay(b)
a
b
b
Reattach
Reattach
b
a
b
a
a
b
b
b
b
a
a
33Update -ATF
Data structures and implementations
ATF (Array-based Treap Forest)
i
lci
rci
pi
si
prioi
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
1
0
5
3
34ATF Switch(a,b) a ? T1, b ? T2
Data structures and implementations
Split(a)
w
w
Split(b)
T1
T2
a
a
b
b
a
b
a
b
Switch
w
w
Delete(w)
Delete(w)
b
a
a
b
a
b
b
a
Join
x
Delete (x)
a
b
b
a
a
b
b
a
35ATF Switch(a,b) a ,b ? T
Data structures and implementations
T
Split(a)
T
Split(a)
a
a
b
b
w
a
a
b
b
w
b
b
a
a
b
b
a
a
Split(b)
Split(b)
w
w
w
w
Reattach
Reattach
a
b
b
b
a
b
b
a
a
b
b
b
a
a
Delete(w)
Delete(w)
b
a
a
b
36IDQ Adjacency list
Data structures and implementations
0
1
2
3
4
2
1
2
0
0
4
0
3
2
1
node
down
next
Type A node
visited
0
3
4
node
p1
link
Type B node
p2
adj_next
visited
37IDQ Switch(a,b) a ? T1, b ? T2
Data structures and implementations
2
1
5
0
3
0
1
2
3
4
4
2
1
2
0
0
5
5
4
0
1
5
3
5
0
4
38IDQ Switch(a,b) a ,b ? T
Data structures and implementations
0
1
5
3
4
6
0
1
2
3
4
2
1
2
0
0
5
6
1
2
1
2
0
0
4
0
4
0
3
3
6
2
1
1
5
0
3
0
3
4
4
39Exp 1 ASF vs. ATF
Experimental results and discussion
- n 10-100,000
- 5000 switches
- ACQ
- random
40Exp 2 Update vs. Query
Experimental results and discussion
41Exp 3 Frequency of Dis-connection
Experimental results and discussion
42Exp 4 Time per Switching
Experimental results and discussion
43Exp 5 IDQ/ACQ/SCQ
Experimental results and discussion
44Discussion
Experimental results and discussion
- Splay tree vs. Treap
- IDQ vs. ACQ vs. SCQ
- Further study
45Thanks !
Animation downloaded from http//www.egglescliffe
.org.uk/physics/particles/parts/parts1.html
46ATF Insert
Data structures and implementations
0
Insert(2)
2
Rotate(2)
2
Insert(5)
0
2
0
0
5
i
Wi
Pi
Insert(3)
0 1 2 3 4 5
2 0 5 4 1 3
3 2 4 0 5 1
2
Insert(4)
2
Rotate(4)
2
0
5
0
5
0
5
3
3
4
4
3
Rotate(4)
4
4
2
2
2
Rotate(4)
Insert(1)
1
0
4
0
0
5
5
5
3
3
3