Download presentation
Presentation is loading. Please wait.
Published bySydni Bridwell Modified over 9 years ago
1
SKIP GRAPHS Slides adapted from the original slides by James Aspnes Gauri Shah
2
2 Skip List [Pugh ’90] Data structure based on a linked list. AGJMRW HEAD TAIL Each node linked at higher level with probability 1/2. Level 0 AJM Level 1 J Level 2
3
3 Skip List [Pugh ’90] Probabilistic alternative to balanced trees. L0 = linked list of ALL nodes ordered by key. Each element of Li appears in L.i+1 with prob p. Higher levels denote express lanes. We will only consider p=1/2
4
4 Searching in a skip list AGJMRW HEADTAIL AJ J Search for key ‘R’ M Time for search: O(log n) on average. On average, constant number of pointers per node. Level 0 Level 1 Level 2 -- ++ success failure
5
5 Constant number of pointers? Total number of pointers = 2.n + 2. n/2 + 2. n/4 + 2. n/8 + … = 4.n So, average number of pointers per node = 4
6
6 Skip lists for P2P? Heavily loaded top-level nodes. Easily susceptible to random failures. Lacks redundancy. Disadvantages Advantages O(log n) expected search time. Retains locality. Dynamic node additions/deletions.
7
7 Look back at DHT v2 HASH v1 v4 v3 v1 v2 v3 v4 Keys Nodes Actual Route Physical Link Virtual Link Virtual Route PHYSICAL NETWORK VIRTUAL OVERLAY NETWORK
8
8 AdvantagesDisadvantages Load balancing. Decentralization. O(log n) space and search time. O(log 2 n) insert and delete time [search for (log n) neighbors]. Tolerance of random faults. SKIP GRAPHS No locality properties. No tolerance to adversarial faults. No self-stabilization (?). No optimization wrt. geography.
9
9 A Skip Graph A 001 J M 011 G 100 W 101 R 110 Level 1 G R W AJM 000001011 101 110 100 Level 2 A G JMRW 001 011100110101 Level 0 Membership vectors Link at level i to nodes with matching prefix of length i. Think of a tree of skip lists that share lower layers.
10
10 Properties of skip graphs 1.Efficient Searching. 2.Eficient node insertions & deletions. 3.Independence from system size. 4.Locality and range queries.
11
11 Searching: avg. O (log n) Same performance as DHTs. AJM GWR Level 1 G R W AJM Level 2 AGJMRW Level 0 Restricting to the lists containing the starting element of the search, we get a skip list.
12
12 Node Insertion – 1 A 001 M 011 G 100 W 101 R 110 Level 1 G R W A M 000011 101 110 100 Level 2 A GM R W 001011100110101 Level 0 J 001 Starting at buddy node, find nearest key at level 0. Basically a range query looking for key closest to new key. Takes O(log n) on average. buddy new node
13
13 Node Insertion - 2 At each level i, find nearest node with matching prefix of membership vector of length i+1. A 001 M 011 G 100 W 101 R 110 Level 1 G R W A M 000011 101 110 100 Level 2 A GM R W 001011100110101 Level 0 J 001 J J Total time for insertion: O(log n) DHTs take: O(log 2 n)
14
14 Independent of system size No need to know size of keyspace or number of nodes. E Z 10 E Z J insert Level 0 Level 1 E Z 10 E Z J 0 J 0001 E ZJ Level 0 Level 1 Level 2 Old nodes extend membership vector as required with arrivals. DHTs require knowledge of keyspace size initially.
15
15 Locality and range queries Find key F. Find largest key < x. Find least key > x. Find all keys in interval [D..O]. Initial node insertion at level 0. D F A I D F A I L O S
16
16 Applications of locality news:10/29 e.g. find latest news from yesterday. find largest key < news:10/29. news:10/27news:10/28news:10/26news:10/25 Level 0 DHTs cannot do this easily as hashing destroys locality. e.g. find any copy of some Britney Spears song. britney05britney03britney04britney02britney01 Level 0 Data Replication Version Control
17
17 So far... Decentralization. Locality properties. O(log n) space per node. O(log n) search, insert, and delete time. Independent of system size. Coming up... Load balancing. Tolerance to faults. Self-stabilization. Random faults. Adversarial faults.
18
18 Load balancing Interested in average load on a node u. i.e. the number of searches from source s to destination t that use node u. Theorem: Let dist (u, t) = d. Then the probability that a search from s to t passes through u is < 2/(d+1). where V = {nodes v: u <= v <= t} and |V| = d+1.
19
19 Nodes u Skip list restriction Level 0 Level 1 Level 2 Node u is on the search path from s to t only if it is in the skip list formed from the lists of s at each level. s
20
20 Tallest nodes Node u is on the search path from s to t only if it is in T = the set of k tallest nodes in [u..t]. u u t s u is not on path. t u u s u u is on path. Pr [u T] = Pr[|T|=k] k/(d+1) = E[|T|]/(d+1). k=1 d+1 Heights independent of position, so distances are symmetric.
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.