Imagine we have a list:
in = {{1, 1}, {2, 2}, {3, 1}, {3, 3}, {4, 1}, {4, 4}, {5, 2}, {5, 5}, {6, 6}}
Needed (general approach for matrixes like 100 x 100):
out = {{1, 3, 4}, {2, 5}, {6}}
Explanation: there are positions of elements in a square matrix (in lower triangle).
I need to group rows indexes such that elements that interact with other indexes should group with those indexes in sublists. Note for example that 6
is not in any other position except {6, 6} and so it stays alone.
What for? Just a step in q-analysis as of vintage Atkin(1972). Stuck a bit to get a nice solution.