The former implementation takes a matrix of pairwise similarities between data points as input, whereas the latter approach is a generalization of k-means to an arbitrary matrix of pairwise distances.
they can be run on the scores relative to the question pairs (q i , q j ).