Input: K: Number of the last fragment Rmax: Number of database relations Nmax: Number of fragments in each relation Step 1: Set 0 to K Step 2: Set 1 to R Step 3: Do steps (4 - 21) until R > Rmax Step 4: Set 1 to I Step 5: Do steps (6 - 20) until I > Nmax Step 6: Set 1 to J Step 7: Do steps (8-18) until J > Nmax Step 8: If I ¹ J and Else Add 1 to J, go to step (18) Step 9: If Si ∩ Sj ≠ Ø do steps (10)-(17) Else, Add 1 to J and go to step (19) Step 10: Add 1 to K Step 11: Create new fragment Fk = Si ∩ Sj and add it to F Step 12: Create new fragment Fk+1 = Si - Fk and add it to F Step 13: Create new fragment Fk+2 = Sj - Fk and add it to F Step 14: Delete Si Step 15: Delete Sj Step 16: Set Nmax + 1 to J Step 17: End IF Step 18: End IF Step 19: Loop Step 20: Add 1 to I Step 21: Loop Step 22: Set 1 to I Step 23 Do steps (24 - 35) until I > Nmax Step 24: Set 1 to J Step 25: Do steps (26 - 33) until J > Nmax Step 26: If I ¹ J and Else Add 1 to J, go to step (33) Step 27: If Si ∩ Sj = Ø do steps (28)-(33) Step 28: Add 1 to K Step 29: Create new fragment Fk = Rj - UF Step 30: End IF Step 31: If Fk ≠ Ø Add Fk to the set of F Step 32: End IF Step 33: Loop Step 34: Add 1 to I Step 35: Loop Step 36: Set 1 to I Step 37: Do steps (38 - 53) until I > F Step 38: Set 1 to J Step 39: Do steps (40 - 51) until J > F Step 40: If I ¹ J and Else, Add 1 to J and go to step (50) Step 41: If Fi ∩ Fj ≠ Ø do steps (42)-(49) Else, Add 1 to J and go to step (49) Step 42: Add 1 to K Step 43: Create new fragment Fk = Fi ∩ Fj and add it to F Step 44: Create new fragment Fk+1 = Fi - Fk and add it to F Step 45: Create new fragment Fk+2 = Fj - Fk and add it to F Step 46: Delete Fi Step 47: Delete Fj Step 48: Set F + 1 to J Step 49: End IF Step 50: End IF Step 51: Loop Step 52: Add 1 to I Step 53: Loop Step 54: Add 1 to R Step 55: Loop |