Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Compute the equivalence classes associated with a given set of elementwise identifications
ResourceFunction["EquivalenceClasses"][list,{{a1,a2},{b1,b2},…}] partitions list into equivalence classes according to the relations a1~a2,b1~b2,…. |
Equivalence classes of Range[1,5] under the relations 1~3 and 3~5:
In[1]:= | ![]() |
Out[1]= | ![]() |
If no relations are given, EquivalenceClasses returns the singleton elements of list:
In[2]:= | ![]() |
Out[2]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License