I have a list of sets (a,b,c,d,e in below example). Each of the sets contains a list of nodes in that set (1-6 below). I was wondering that there probably is a general known algorithm for achieving the below, and I just do not know about it.
sets[ a[1,2,5,6], b[1,4,5], c[1,2,5], d[2,5], e[1,6], ]
I would like to generate a new structure, a list of groups, with each group having
- all the (sub)sets of nodes that appear in multiple sets
- references to the original sets those nodes belong to