I have a list of vectors:




Clearly, the first entry and the third entry contain the same vectors. I want to delete one of the duplications but I am not sure how to do this.

I can tell that there is a duplication from


which returns True

However, any of the ways that I know how to delete duplicate cases involve having at least 2 different sets. I am not sure how to do this internally?

I tried using DeleteCases and OrderlessPatternSequence but I cannot seem to get it to look through the elements of v and delete duplicate lists that have the same vectors in different orders?

The only thing I can do is


Which is pretty useless as I'd have to check through each of the rows manually and Join the non-dduplicate rows manually.

Any hints/tips/suggestions welcome. Thanks!

  • 1
    $\begingroup$ DeleteDuplicates[Sort /@ v] $\endgroup$
    – MelaGo
    Commented Sep 19, 2023 at 16:17

2 Answers 2


You could just use Union:

Union[Sort /@ v]

You could also use DeleteDuplicatesBy:

DeleteDuplicatesBy[v, Sort]

Another way to do this using GatherByand Union:

GatherBy[Map[Union, v], Union][[All, 1]]

(*{{{0, 0, 0}, {0, 0, 1}, {1, 1, 0}}, {{0, 1, 1}, {1, 0, 0}, {1, 1, 1}}}*)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.