W = 4 (fixed size) |
Current item
|
V
Input: 3 5 2 7 1 8 9 1 6 8 9
| |
+-+
Sum = 3
|
(Note: N < W can only happen when m < W)
(One extra element is processed, the element is added to the bag so the window is increased by 1)
(No element is processed, but one element is removed in the bag, so the window is decreased by 1)
It will only succeed when N ≤ W − 1 (When the window is full, you need to delete an element before you insert a new one)
(No element is processed, but one element is removed in the bag, so the window is decreased by 1)
input: a b c d e f g h i j k ....
| |
window: +---------------------+
(imagine that the window is huge)
Window moves:
input: a b c d e f g h i j k l m....
| |
window: +---------------------+
|
Current window
+-----------------------------+
| |
input: a b c d e f g h i j k l m ....
| | | | | | | |
+---------+ +---------+ +---------+ +---------+
block 1 block 2 block 3 block 4
|
NOTE: the accuracy that you need to run Manku or Greenwald on the values in a block is ε' and ε' may be different from ε !!!
As a result, the amount of memory space used by Manku's/Greenwald's algorithm will be too large
W/(2L)
(ε/4) × W
NOTE: because ε × W is a power of 2, (ε/4) × W will always be an integer :-)
|
N0 = (ε/4) × W
N1 = 21 × (ε/4) × W
N2 = 22 × (ε/4) × W
Nl = 2l ×
(ε/4) × W
How can we now conserve space when block sizes get smaller ?
In order to conserve space using a smaller block size,
the period must be reduced.
The period in Manku/Greenwald algorithm depends on the error
parameter.
A larger error parameter will make the period
in Manku or Greenwald algorithm smaller !!!
At the end of each period, the algorithms remove
some "unneccessary data items" from the data structure !!
1 2L εi = ---- × ------ × ε 2i 4L+4
You can see that εi decreases when i increases - so the accuracy parameter for a higher level block (with more elements in them), are smaller.
(fe − ε) × N
≤ f ≤
fe
or:
feN −
ε N
≤ f ≤
fe
(φ − ε) × N
≤ r ≤
(φ + ε) × N
or:
φ N −
ε N
≤ f ≤
φ N +
ε N
1 2L
εi = ---- × ------ × ε
2i 4L+4
2L = 4/ε
εi × Ni =
{ 2i ×
(ε/4) × W }
×
{ 1/(2i) ×
2L/(4L + 4) } × ε
or:
εi × Ni =
{
(ε/4) × W }
×
{
2L/(4L + 4) }
× ε
or:
εi × Ni =
{
W }
×
{
1/(4L + 4) }
× ε
or:
εi × Ni =
ε ×
W/(4L + 4)
- only ACTIVE blocks will be used to compute the query on a window W
- UNDER-CONSTRUCTION blocks are NOT USED to compute the query on a window W
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
These uncovered (unaccounted) elements will contribute to the total error
Arasu's method will make certain that the error contributed by these uncovered elements will not be significant (that is done by many the blocks at the lowest level very small...)