Consider a list as
list = Table[{{i, j}, {k, l}}, {i, 1, 2, 1}, {j, 1, 2, 1}, {k, 1, 2, 1}, {l, 1, 2, 1}];
The outcome of this is:
{{{{{{1, 1}, {1, 1}}, {{1, 1}, {1, 2}}}, {{{1, 1}, {2, 1}}, {{1, 1}, {2, 2}}}}, {{{{1, 2}, {1, 1}}, {{1, 2}, {1, 2}}}, {{{1, 2}, {2, 1}}, {{1, 2}, {2, 2}}}}}, {{{{{2, 1}, {1, 1}}, {{2, 1}, {1, 2}}}, {{{2, 1}, {2, 1}}, {{2, 1}, {2, 2}}}}, {{{{2, 2}, {1, 1}}, {{2, 2}, {1, 2}}}, {{{2, 2}, {2, 1}}, {{2, 2}, {2, 2}}}}}}
I consider, {{a, b}, {c, d}}}
and {{c, d}, {a, b}}}
as duplicate and I want to remove the duplicates from the list.
I further wish to remove elements of the form {{a, b}, {a, b}}}
(This is answered here. However, I don’t know how to accomplish the first task and do both the operations together using Pick
or DeleteCases
).
It would be more appreciable if some conditioning can be imposed while constructing the list itself to accomplish the above-mentioned tasks.