Possible Duplicate:
How can I remove B -> A from a list if A -> B is in the list?
Delete duplicate elements from list
Pattern matching deletion of list items
How do I delete the duplicates of a set who's elements are themselves sets?
Here is an example: Deleting the duplicates from {{x,y},{y,x}} should give {{x,y}} (or {{y,x}}, both answers are equivalent).
I am particularly interested in the case when x and y are lists, but a solution that works for x and y of any type would be better.
{{2, 1}, {1, 2}, {3, 1}}
. Should it be{{1, 2}, {1, 3}}
or{1, 2, 3}
? $\endgroup$