Is there any known algorithm for building a tree from set of sets, using a minimum number of nodes?
For example I have the following sets:
1. {A, B, C}
2. {B, C}
3. {D, B, A}
4. {C, A}
Every set is represented by a path from root to a leaf. They are sets, so the order that the nodes appear in the path is not important.
I need a tree using as few nodes as possible that will represent all of the given sets as paths. One possible solution (not sure if it is minimal) is:
0
/ \
C A
/ \ \
A B B
/ \ \ \
4 B 2 D
| |
1 3
where the root node 0 is some empty element.