The BBS Algorithm The BBS Algorithm The BBS Algorithm Prof. Paolo - - PDF document

the bbs algorithm the bbs algorithm the bbs algorithm
SMART_READER_LITE
LIVE PREVIEW

The BBS Algorithm The BBS Algorithm The BBS Algorithm Prof. Paolo - - PDF document

The BBS Algorithm The BBS Algorithm The BBS Algorithm Prof. Paolo Ciaccia Prof. Paolo Ciaccia http://www http:// www- -db.deis.unibo.it db.deis.unibo.it/ /courses courses/SI /SI- -LS/ LS/ 04.2_BBSAlgorithm.pdf 04.2_BBSAlgorithm.pdf


slide-1
SLIDE 1

1

Sistemi Informativi LS

The BBS Algorithm The BBS Algorithm The BBS Algorithm

  • Prof. Paolo Ciaccia
  • Prof. Paolo Ciaccia

http:// http://www www-

  • db.deis.unibo.it

db.deis.unibo.it/ /courses courses/SI /SI-

  • LS/

LS/ 04.2_BBSAlgorithm.pdf 04.2_BBSAlgorithm.pdf

Sistemi Informativi LS 2

The BBS Algorithm

These slides provide a more informative description of the BBS (Branch and Bound Skyline) algorithm [PTF+03] for computing the Skyline of a relation, assuming that all attributes of interest need to be minimized The basic objective of the algorithm is to avoid accessing index nodes that cannot contain any skyline object To this end, index nodes are managed using a priority queue PQ, ordered by increasing values of MinDist Since the “target point” is 0 = (0,..,0), this is to say that nodes are ordered using the distance from 0 of their lower-left corner

For computational economy, [PTF+03] evaluates distances using L1 (Manhattan distance)

slide-2
SLIDE 2

2

Sistemi Informativi LS 3

The BBS algorithm

Input: index tree with root node RN Output: SL, the set of Skyline objects

  • 1. Initialize PQ with [ptr(RN),Dom(R),0];

// starts from the root node

  • 2. SL := ∅;

// the Skyline is initially empty

  • 3. while PQ ≠ ∅:

// until the queue is not empty… 4. [ptr(Elem), key(Elem), dMIN(0,Reg(Elem))] := DEQUEUE(PQ); 5. If no point in SL dominates Elem then: 6. if Elem is an object o then: SL := SL ∪ {o} 7. else: { Read(Elem); // …node Elem might contain Skyline points 8. if Elem is a leaf then: { for each point o in Elem: 9. if no point in SL dominates o then: 10. ENQUEUE(PQ,[ptr(o), key(o), L1(0,key(o))]) } 11. else: { for each child node Nc of Elem: 12. if no point in SL dominates Nc then: 13. ENQUEUE(PQ,[ptr(Nc), key(Nc), dMIN(0,Reg(Nc))]) }};

  • 14. return SL;
  • 15. end.

Sistemi Informativi LS 4

BBS: An example (1/2)

distance: L1

1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 A1 A2 N1 A

7 N4 7 N5 14 N6 12 E 8 F 9 G 12 H 15 I 16 J 17 K 5 N1 7 N2 6 N3 11 7 10 7

dMIN

Elem D C B A

B C D E F G H I J K N2 N3 N4 N5 N6

slide-3
SLIDE 3

3

Sistemi Informativi LS 5

BBS: An example (2/2)

(B,10) (N2,7) (N1,5) Read(RN) (B,10) (B,10) (B,10) (N2,7) (N2,7) Return(G) Return(F) Read(N5) Read(N2) Return(C) Read(N4) Return(A) Read(N3) Read(N1) Action (B,10) (N2,7) (B,10) (N5,7) (G,9) (F,8) (B,10) (G,9) (B,10) (N2,7) (N2,7) (N4,7) (N4,7) PQ (C,7) (N4,7) (A,7) (N3,6)

1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 A1 A2 N1 A B C D E F G H I J K N2 N3 N4 N5 N6 The example clearly shows why an object currently undominated, such as B, needs to be inserted into the queue