Sub topic 16
Minimal Cover of a Set of Functional Dependencies
Prerequisites
Assume you know basic set notation, relations, attributes, and functional dependencies (FDs). An FD X → Y means that equal values of attribute set X must have equal values of attribute set Y.
A minimal cover is a smaller, equivalent set of FDs. “Equivalent” means that the original and reduced sets imply exactly the same dependencies. Minimal covers help simplify normalization and decomposition problems.
Three Reduction Rules
A minimal cover follows these rules:
- Each FD has exactly one attribute on its right side.
- No attribute on a left side is extraneous.
- No FD is redundant.
An attribute is extraneous if removing it from an FD's left side does not change the dependencies implied by the set. An FD is redundant if removing the entire FD leaves an equivalent set.
The usual process is:
flowchart TD
A[Start with the FD set] --> B[Split every right side]
B --> C[Remove extraneous left-side attributes]
C --> D[Remove redundant FDs]
D --> E[Minimal cover]caption: The three reduction stages for finding a minimal cover. alt: A flowchart showing FD splitting, removal of extraneous attributes, removal of redundant dependencies, and the resulting minimal cover.
Worked Example
Consider:
F = { A → BC, B → C, AB → D, D → E, A → E }
First split the right side of A → BC:
{ A → B, A → C, B → C, AB → D, D → E, A → E }
Now test for redundant dependencies. A → C is redundant because:
A → BB → C- Therefore,
A → C
The dependency A → E is also redundant. From A, we can derive B, then use AB → D, and finally use D → E.
The remaining set is:
{ A → B, B → C, AB → D, D → E }
The left side of AB → D cannot be reduced. Neither A → D nor B → D follows from the other dependencies. Therefore, this is a minimal cover.
| Check | Result |
|---|---|
| Singleton right sides | Yes |
| Extraneous left-side attributes | None |
| Redundant FDs | Removed |
| Minimal cover | `{A → B, B → C, AB → D, D → E}` |
Using Attribute Closure
Attribute closure provides a systematic test. The closure X+ is the set of attributes functionally determined by X.
To test whether an FD X → A is redundant, temporarily remove it and compute X+. If A still belongs to the closure, remove the FD permanently.
To test whether attribute B is extraneous in AB → D, temporarily replace the left side with A and check whether D belongs to A+. If it does, replace AB → D with A → D.
def closure(attrs, fds):
result = set(attrs)
changed = True
while changed:
changed = False
for left, right in fds:
if left <= result and not right <= result:
result |= right
changed = True
return result
fds = [({"A"}, {"B"}), ({"B"}, {"C"}), ({"A", "B"}, {"D"})]
print(sorted(closure({"A"}, fds))) # ['A', 'B', 'C']> callout note > A minimal cover is not always unique. Different reduction orders can produce different-looking covers that are still equivalent.
Exercise
Is A extraneous in the FD AB → D when the other FDs are A → B and B → C?
Show answer
Yes. Since A → B does not imply D, and B → C also does not imply D, neither single-attribute reduction determines D. Therefore, A is not extraneous; the FD must remain AB → D.