# Euclidean space vs metric space in density clustering algorithms

I'm trying to find out if these algorithm still work if i replace the Euclidean space with metric space defined on the input point set. But i'm having some trouble figuring it out for some of them. I have:

1. k-means clustering using Lloyd algorithm, with random initialization
2. DBSCAN using the graph-approach
3. DBSCAN using the Box-Graph
• $k$-means algorithm will not work directly in the metric spaces because you need to find the centroid of a set of points. In general metric spaces, there is no concept of the centroid. See here for more discussion. – Inuyasha Yagami Jun 16 at 16:36
• However, you can use $k$-means++ algorithm in general metric spaces. It is as good as the $k$-means algorithm. – Inuyasha Yagami Jun 16 at 16:37