# Correlation with Multi-Dimensional Clustering

I have a dataframe with multiple features, where I'm selecting 3 features to cluster on. Ex.

Col1 | Col2 | Col3
-------------------
A    |  1  |   i
B    |  1  |   j
C    |  2  |   k
D    |  3  |   j


I'm trying to cluster such that If there is a matching value in any two columns, it will add that row to the same cluster, for all matches within the values in a cluster.

So from this table, my intended output for a cluster would be:

A    |  1  |   i
B    |  1  |   j
D    |  3  |   j


Is there a clustering algorithm that I can use to achieve this type of clustering?