Clustering in non-metric spaces