Suppose I have a set of categorical data $X=\{x_1,x_2,\cdots, x_n\}$, (in my case $n =~ 10,000-50,000$) as well as a precomputed "distance" measure $g(x_i,x_j)$ (in my case I just have an array of distances). However, this measure doesn't necessarily satisfy the triangle inequality.
I want to cluster this data via some sort of k-means-like routine, but as the triangle inequality doesn't hold doing the usual procedure of iterating with a centroid of average values won't really work.
My hope was to use some sort of graphical model where each $x_i$ was a node and each $g(x_i,x_j)$ was an arrow, and do some sort of clustering based on that. However, my current literature review wasn't that fruitful. Does anyone have any insight into an algorithm that might work for this sort of analysis?