We would appreciate help in determining a linear time complexity algorithm for building the intersection graph of a set of subsets of a finite set of elements U.
For example, let U = {a,b,c,d,e,f,g,h}. Consider the set S = { {{a,b}, {c,d}, {a,e,h}, {e,f,g} } of U. We need to build the intersection graph G of S in linear time, if possible. Each element in S is a node of G. Two nodes N1 and N2 in G have a edge between them if and only if N1 and N2 have at least one element in common.
For example, the intersection graph G of S above would have four nodes, namely, {a,b}, {c,d}, {a,e,h}, and {e,f,g}. G would have 2 edges of G, i.e. {a,b}-{a,e,h} and {a,e,h}-{e,f,g}.
Is there a linear algorithm for building the intersection graph from a set of subsets of a finite set of elements?