Questions tagged [equivalence-classes]

Use equivalence-classes for questions related to decomposing a set into subsets in which each element produces a constant output given a constant input

equivalence-classes
Filter by
Sorted by
Tagged with
54 votes
19 answers
14k views

Python: simple list merging based on intersections

Consider there are some lists of integers as: #-------------------------------------- 0 [0,1,3] 1 [1,0,3,4,5,10,...] 2 [2,8] 3 [3,1,0,...] ... n [] #-------------------------------------- The ...
Developer's user avatar
  • 8,348
19 votes
4 answers
16k views

Many-to-one mapping (creating equivalence classes)

I have a project of converting one database to another. One of the original database columns defines the row's category. This column should be mapped to a new category in the new database. For ...
Adam Matan's user avatar
  • 133k
10 votes
6 answers
5k views

Is there a standard way to partition an interable into equivalence classes given a relation in python?

Say I have a finite iterable X and an equivalence relation ~ on X. We can define a function my_relation(x1, x2) that returns True if x1~x2 and returns False otherwise. I want to write a function that ...
Brian Fitzpatrick's user avatar
9 votes
1 answer
2k views

Java: external class for determining equivalence?

Java has a Comparator<T> for providing comparison of objects external to the class itself, to allow for multiple/alternate methods of doing ordered comparisons. But the only standard way of ...
Jason S's user avatar
  • 187k
7 votes
2 answers
4k views

Implementing equivalence relations in C++ (using boost::disjoint_sets)

Assume you have many elements, and you need to keep track of the equivalence relations between them. If element A is equivalent to element B, it is equivalent to all the other elements B is equivalent ...
D R's user avatar
  • 22.2k
6 votes
3 answers
5k views

Microsoft.VisualBasic.FileIO.FileSystem equivalence in C#

I use VS 2008, .net 3.5, C# projects. I need do the same functionally like Microsoft.VisualBasic.FileIO.FileSystem.DeleteDirectory. Anyone says referencing the Microsoft.VisualBasic is often ...
Kiquenet's user avatar
  • 14.7k
2 votes
1 answer
3k views

Combine tuples in a list which have the same value [duplicate]

I have a list with tuples like this: L ={(1,2), (1,4), (1,3), (2,3), (3,4), (3,5), (4,5), (6,7)} I try to combine these to get equivalence classes (tuples of the same value are merged, like (1,2) ...
Bas's user avatar
  • 891