Problem. You have user records, each with a name, a set of emails and a set of phone numbers. Two records belong to the same person if they share any email or phone, and "same person" is transitive. Group the records and return each group.
r0: Ana ana@x.io +1 555 0100
r1: A. Diaz ana.d@y.com +1-555-0100 (shares a phone with r0, after normalising)
r2: Ana D ana.d@y.com (shares an email with r1)
r3: Bo bo@z.net 555 0199
r4: Bo K BO@Z.NET (same email, different case)
groups: {r0, r1, r2}, {r3, r4}
Records are nodes and a shared key is an edge; the groups are connected components (lesson 11.8). The two real problems are avoiding n² comparisons, and deciding when two keys are "the same" (normalisation, and for free text, near-duplicates).
Why it matters. Deduplication is one of the highest-value steps in data preparation. Duplicate users inflate metrics and leak across train/test splits; duplicate and near-duplicate documents make up a large share of web-scale pretraining corpora, and removing them improves models and reduces memorisation. The tools are exactly these: exact keys with union-find for structured records, MinHash with LSH for text (Change A).