What is a *NIX way of removing redundancy in a case where I have pairwise comparisons like these in two columns
A B
B A
A C
A D
C A
D A
B C
C B
A B and B A represent the same comparison and I would like to remove such redundancy from the dataset. The final result should be
A B
A C
A D
B C