I have a big list of certain objects that are of type Order. Furthermore, I have defined an IEqualityComparer<Order> and my goal is to efficiently create a list of lists (or groupings) where every sublist contains the objects that are equal to each other. Mathematically, I have an equivalence relation (IEqualityComparer) and want to have a list of all equivalence classes. I thought about using HashSet<Order>, Dictionary<> or Lookup<> but they dont seem to be perfect for my case. So any ideas?
Efficient way to group all equal objects defined by IEqualityComparer
106 views Asked by T_D At
1
I think this something like this shluod to the job: