As noted by btilly, you actually don't need transitivity to classify records. In the case of names of English people, you can represent each name with two initials, and each record with a sorted list of initials. Then you just need to do a full O (N ^ 2) comparison between entries of the same class. There is an additional problem, that the same pair of records can be displayed in several classes, but it can be easily detected by supporting a separate set of pairs of matching records (indicated by record indexes).
In this example, you would put record 1 in the class "DF, JS", record 2 in the class "DL, NJ", record 3 in the class "JC, NJ", record 4 in the classes "DJ, JS", "JF, JS "and" DF, JS "and entry 5 in the classes" DF, JM "," DF, JS "and" DF, MS ". You get a total of 7 classes: "DF, JM", "DF, MS", "DF, JS", "DJ, JS", "DL, NJ", "JC, NJ", "JF, JS", of which only the class "DF, JS" contains several records, namely records 1, 4 and 5. Thus, in this example you only need to perform the full comparison function twice.
On the other hand, there is a problem that people have strange names. This blog post on this subject is worth a look if you have not seen this before. No matter what you do, you will miss some matches.