1 Blooming Trees: Space-Efficient Structures for Data Representation Author: Domenico Ficara, Stefano Giordano, Gregorio Procissi, Fabio Vitucci Publisher: ICC 2008 Presenter: Yu-Ping Chiang Date: 2009/05/20
2 Outline Blooming Tree Lookup Insert Delete Optimized Blooming Tree Lookup Insert Delete Simulations
3 Blooming Tree B0 B1 B2 B items 2 items 1 item item Bit string HASH FUNCTION 3 bits 1 bit index
4 Blooming Tree n items, k0 hash functions, L+2 layers Layer0 (B0) : m = nk0/ln2 bits Layer1~L (B1~BL) : bits/block ( b=1 in following examples ) Block numbers is modified LayerL+1 (BL+1) : Composed c-bits counters Hash function k0 hash functions log m + L*b bits output log m bit for layer0 B bits for layer1~layerL+1
5 Blooming Tree - lookup Algorithm: Using first log m bits as layer0 index. Compute a popcount on layer i, that gives index of the couple in layer i+1. Checking the bit string output by hash function, the bit for layer i. 0 for first bit. 1 for second bit. If processing bit is 0, result NOT FOUND. Otherwise continue search in next layer. Time complexity: k0 [ hash + L ( popcount + 2 * check ) ] B0 B1 B2 B item1 bit string: hash
6 Blooming Tree - lookup Algorithm: Using first log m bits as layer0 index. Compute a popcount on layer i, that gives index of the couple in layer i+1. Checking the bit string output by hash function, the bit for layer i. 0 for first bit. 1 for second bit. If processing bit is 0, result NOT FOUND. Otherwise continue search in next layer. Time complexity: k0 [ hash + L ( popcount + 2 * check ) ] B0 B1 B2 B item1 bit string: hash
7 Blooming Tree - lookup Algorithm: Using first log m bits as layer0 index. Compute a popcount on layer i, that gives index of the couple in layer i+1. Checking the bit string output by hash function, the bit for layer i. 0 for first bit. 1 for second bit. If processing bit is 0, result NOT FOUND. Otherwise continue search in next layer. Time complexity: k0 [ hash + L ( popcount + 2 * check ) ] B0 B1 B2 B item1 bit string: hash Match !!
8 Blooming Tree - lookup Algorithm: Using first log m bits as layer0 index. Compute a popcount on layer i, that gives index of the couple in layer i+1. Checking the bit string output by hash function, the bit for layer i. 0 for first bit. 1 for second bit. If processing bit is 0, result NOT FOUND. Otherwise continue search in next layer. Time complexity: k0 [ hash + L ( popcount + 2 * check ) ] B0 B1 B2 B item2 bit string: hash NOT FOUND !!
9 Blooming Tree - insert Algorithm: Using first log m bits as layer0 index. In layer1~layerL+1, using popcount of layer0~layerL and bit for each layer as index. If bit in layer I already set (means COLLOSION), directly set bit in layer i+1. else, allocate a new block and insert it into original layer i+1 blocks. Increase count at layer L+1. Time complexity: k0 [ hash + L ( popcount + shift + bitset ) ] B0 B1 B2 B item1 bit string: hash allocate a new block (2^b bits) allocate a new block (2^b bits) allocate a new block (2^b bits)
10 Blooming Tree - insert Algorithm: Using first log m bits as layer0 index. In layer1~layerL+1, using popcount of layer0~layerL and bit for each layer as index. If bit in layer I already set (means COLLOSION), directly set bit in layer i+1. else, allocate a new block and insert it into original layer i+1 blocks. Increase count at layer L+1. Time complexity: k0 [ hash + L ( popcount + shift + bitset ) ] B0 B1 B2 B item2 bit string: hash allocate a new block (2^b bits) allocate a new block (2^b bits) allocate a new block (2^b bits)
11 Blooming Tree - insert Algorithm: Using first log m bits as layer0 index. In layer1~layerL+1, using popcount of layer0~layerL and bit for each layer as index. If bit in layer I already set (means COLLOSION), directly set bit in layer i+1. else, allocate a new block and insert it into original layer i+1 blocks. Increase count at layer L+1. Time complexity: k0 [ hash + L ( popcount + shift + bitset ) ] B0 B1 B2 B item3 bit string: hash Collision occur
12 Blooming Tree - delete Algorithm: Trace to the last layer, decrease count. If counter isn’t equal to 0, terminal processing. else, remove the block and checking upper layer if there only this item in the block, if yes, remove that block too. recursive processing upper layers. B0 B1 B2 B item1 bit string: hash Remove empty block 0
13 Blooming Tree - delete Algorithm: Trace to the last layer, decrease count. If counter isn’t equal to 0, terminal processing. else, remove the block and checking upper layer if there only this item in the block, if yes, remove that block too. recursive processing upper layers. B0 B1 B2 B item2 bit string: hash 0 1
14 Outline Blooming Tree Lookup Insert Delete Optimized Blooming Tree Lookup Insert Delete Simulations
15 Optimized Blooming Tree B0 B1 B2 B items 2 items 1 item bitmap Hash substrings 11
16 Optimized Blooming Tree - lookup Algorithm: Access B0 Checking bitmap If there’s 1 in bitmap, directly compare last L*b bits of hashed bit string, and terminate processing. Else, lookup method is same as previous defined. Recursively repeat at each level.
17 Optimized Blooming Tree - lookup 1211 B0 B1 B2B2 B bitmap Hash substrings Algorithm: Access B0 Checking bitmap If there’s 1 in bitmap, directly compare last L*b bits of hashed bit string, and terminate processing. Else, lookup method is same as previous defined. Recursively repeat at each level. item1bit string : hash Popcount = 3 Popcount = 2
18 Optimized Blooming Tree - insert Without collision Add a zero-block Set bit string and hash substring B0 B1 B2 B bitmap Hash substrings item1bit string : hash Hash substrings bitmap 0 01
19 Optimized Blooming Tree - insert With collision Set corresponding branches B0 B1 B2 B bitmap Hash substrings item2bit string : hash
20 Optimized Blooming Tree - delete B0 B1 B2 B item2bit string : hash
21 Outline Blooming Tree Lookup Insert Delete Optimized Blooming Tree Lookup Insert Delete Simulations
22 Simulation Size comparison
23 Simulation Build on NP Intel IXP2800