Given the following functional dependencies how would I compute the minimal cover:
A -> B, ABCD -> E, EF -> GH, ACDF -> EG
In the lecture notes it gives the derivation for the minimal cover but I do not understand it.
For example for getting rid of ACDF -> E:
A -> B => AACD -> BACD -> E => ACD -> E => ACDF -> E
And then they say, similarly we do not keep ACDF -> G
And then I understand that ABCD -> E is deduced to ACD -> E because A -> B, but I do not understand the formal process of how to get to that.
So my question is, can anyone provide an explanation of how to generate the minimal cover for a set functional dependencies?
A minimal cover is a cover for which removal of any single member destroys the covering property. For example, of the five covers of , namely , , , , and , only and. are minimal covers. Similarly, the minimal covers of are given by , , , , , , , and .
A canonical cover is "allowed" to have more than one attribute on the right hand side. A minimal cover cannot. As an example, the canonical cover may be "A -> BC" where the minimal cover would be "A -> B, A -> C". That is the only difference.
Trivial functional dependency. Non-Trivial functional dependency. Multivalued functional dependency.
To get the minimal cover, you have to make two steps. To demonstrate, I'll first split the dependencies into multiple (only one attribute on the right side) to make it more clean:
A -> B
ABCD -> E
EF -> G
EF -> H
ACDF -> E
ACDF -> G
The following steps must be done in this order (#1 and then #2), otherwise you can get incorrect result.
1) get rid of redundant attributes (reduce left sides):
Take each left side and try to remove one each attribute one at a time, then try to deduce the right side (which is now only one attribute for all dependencies). If you suceed you can then remove that letter from the left side, then continue. Note that there might be more than one correct result, it depends on the order in which you do the reduction.
You will find out, that you can remove B
from the dependency ABCD -> E
, because ACD -> ABCD
(use first dep.) and from ABCD -> E
. You can use the full dep. you are currently reducing, this is sometimes confusing at first, but if you think about it, it will become clear that you can do that.
Similarly, you can remove F
from ACDF -> E
, because ACD -> ABCD -> ABCDE -> E
(you can obviously deduce a single letter from the letter itself). After this step you get:
A -> B
ACD -> E
EF -> G
EF -> H
ACD -> E
ACDF -> G
These rules still represent the same dependencies as the original. Note that now we have a duplicate rule ACD -> E
. If you look at the whole thing as a set (in the mathematical sense), then of course you can't have the same element twice in one set. For now, I'm just leaving it twice here, because the next step will get rid of it anyway.
2) get rid of redundant dependencies
Now for each rule, try to remove it, and see if you deduce the same rule by only using others. In this step you, of course, cannot use the dep. you're currently trying to remove (you could in the previous step).
If you take the left side of the first rule A -> B
, hide it for now, you see you can't deduce anything from A
alone. Therefore this rule is not redundant. Do the same for all others. You'll find out, that you can (obviously) remove one of the duplicate rules ACD -> E
, but strictly speaking, you can use the algorithm also. Hide only one of the two same rules, then take the left side (ACD
), and use the other to deduce the right side. Therefore you can remove ACD -> E
(only once of course).
You'll also see you can remove ACDF -> G
, because ACDF -> ACDFE -> G
. Now the result is:
A -> B
EF -> G
EF -> H
ACD -> E
Which is the minimal cover of the original set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With