Dynamic Matchings in Convex Bipartite Graphs

Download Report

Transcript Dynamic Matchings in Convex Bipartite Graphs

Comparison Based Dictionaries:
Fault Tolerance versus I/O Efficiency
Gerth Stølting Brodal
Allan Grønlund Jørgensen
Thomas Mølhave
University of Aarhus
ADS 2007, 3rd Bertinoro Workshop on Algorithms and Data Structures
University Residential Centre of Bertinoro, Italy, September 30-October 5, 2007
Binary
Searching
This
talk
Fault
tolerance
2
Future
work
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
I/O
Efficiency
Search(17)
4 7 10 13 14 15 16 18 19 23 25 26 27 29 30 31 32 33 34 36 38
17
O(log N) comparisons
3
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
Search(17)
soft memory error
4 7 10 13 14 15 16 18 19 23 25 26 27 29 30 31 32 33 34 36 38
9
17?
4
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
Faulty-Memory RAM Model
Finocchi and Italiano, STOC’04




Content of memory cells can get corrupted
Corrupted and uncorrupted content cannot be distinguished
O(1) safe registers
Assumption: At most δ corruptions
 Example: Sorting requires time Θ(N·log N+δ2)
Finocchi, Grandoni, Italiano, ICALP‘06
5
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
Faulty-Memory RAM:
Searching
Θ(log N + δ) comparisons
 Lower bound
Finocchi, Grandoni, Italiano, ICALP’06
 Upper bound
Brodal, Fagerberg, Finocchi, Grandoni, Italiano,
Jørgensen, Moruz, Mølhave, ESA’07
6
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
Faulty-Memory RAM:
Searching
Problem?
Low confidence High confidence
4 7 10 13 14 15 16 18 19 23 25 26 27 29 30 31 32 33 34 36 38
9
17?
Requirement: If there exists an uncorrupted element
equal to the search key, we should find such an element
7
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
Faulty-Memory RAM:
Searching
When are we
done (δ=3)?
Contradiction, i.e.
at least one fault
If range contains at least δ+1 and δ+1 then
there is at least one uncorrupted and , i.e. x
must be contained in the range
8
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
Faulty-Memory RAM:
Θ(log N + δ) Searching
Brodal, Fagerberg, Finocchi, Grandoni, Italiano,
Jørgensen, Moruz, Mølhave, ESA’07
1
5
4 3
2
4
3
5
If verification fails
→ contradiction, i.e. ≥1 memory-fault
→ ignore 4 last comparisons
→ backtrack one level of search
9
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
1
2
Faulty-Memory RAM:
Θ(log N + δ) Searching
Brodal, Fagerberg, Finocchi, Grandoni, Italiano,
Jørgensen, Moruz, Mølhave, ESA’07
1
4 3
2
4
3
1
2
 Standard binary search + verification steps
 At most δ verification steps can fail/backtracking
 Detail: Avoid repeated comparison with the same
(wrong) element by grouping elements into blocks
of size O(δ)
10
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
Faulty-Memory RAM:
Reliable Values
 Store 2δ+1 copies of value x - at most δ copies uncorrupted
 x = majority
 Time O(δ) using two safe registers (candidate and count)
Boyer and Moore ‘91
11
δ=5
y y y x x y x x x y x
Candidate
y y y y y y y – x – x
Count
1 2 3 2 1 2 1 0 1 0 1
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
Faulty-Memory RAM:
Dynamic Dictionaries




Itai, Konheim, Rodeh, 1981
Packed array
Reliable pointers and keys
...
...
Updates O(δ ·log2 N)
Searches = fault tolerant O(log N+δ)
Θ(δ·log N)
elements
 2-level buckets of size O(δ·log N)
 Root: Reliable pointers and keys
 Bucket search/update amortized
O(log N+δ)
...
Θ(δ) elements
 Search and update amortized O(log N+δ)
12
Brodal, Fagerberg,
Finocchi, Grandoni,
Italiano, Jørgensen,
Moruz, Mølhave,
ESA’07
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
I/O Model
13
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
I/O Model
Aggarwal and Vitter 1988
I/O
 N = problem size
 M = memory size
 B = I/O block size
M
e
m
o
r
y
CPU
External
Memory
 One I/O moves B consecutive records from to disk
 Complexity = number of I/Os
 Example: Sorting requires 
N
N
logM / B  I/Os
B
B
14
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
B-trees
O(logB N)
Ω(B)
....
Search path
 Search and update O(logB N)
15
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
Fault-Tolerance
versus
I/O Efficiency
16
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
Lower Bound for
Fault-Tolerant External Searching
 Adversary argument
Possible values
 If Bε slabs per I/O → factor Bε reduction and B1-ε faults
 After k I/Os N/(Bε)k–k· B1-ε elements remain
 
1
  logB N  1  I/Os required [minimized wrt ε ]
B 

17
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
Randomized Upper Bound for
Fault-Tolerant External Searching
 Sorted array + 2δ identical B-trees
(over N/(2δ) elements, stored in BFS layout)
 Search: Select random tree for each
node on search path + verification
 Probability no faults on path:
log N
  i  1 where Σβ ≤δ
i
1 


2  2
i 1 
B
 Search O(logB N+δ/B) expected
18
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
....
Deterministic Upper Bound for
Fault-Tolerant External Searching
 Sorted array
+ 2δ/B1-ε identical B-trees of degree Bε
+ B1-ε copies of each key + min/max
 Search: Verify against min/max in
each step – if fail, backtrack one
level and advance to next copy

 
1
O
log
N


 I/Os
 Search 
B
1
B
B 

19
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
Dynamic
Fault-Tolerant External Dictionaries
Static structure
+ Packed arrays
+ Buckets of size O(δ ·log3 N)
Static
...
...
 Deterministic
 
1
O logB N  1  I/Os search and updates
B 

 Randomized
Expected O(logB N+δ/B) I/Os search and updates
20
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
Conclusion
 Fault-tolerant external memory searching
 
1
 logB N  1  I/Os
B 

worst-case [minized wrt ε]
 Randomized O(logB N+δ/B) I/Os
21
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
Future Work
Fault Tolerance versus I/O Efficiency
 Randomized algorithms:
Memory faults in internal memory?
 Sorting:
N
N 2 
 logM / B  
B B
B
 ...
22
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave
?
THANKS
23
Dictionaries: Fault Tolerance versus I/O Efficiency
Brodal, Jørgensen, Mølhave