kmedoids(x, k)"dist", or a square matrix of pairwise
object-to-object dissimilarity values."kmedoids" representing the obtained
partition, which is a list with the following components.x. A $k$-medoids partition of x is
defined as a partition of the numbers from 1 to $n$, the number of
objects in x, into $k$ classes $C_1, \ldots, C_k$ such
that the criterion function
$L = \sum_l \min_{j \in C_l} \sum_{i \in C_l} d_{ij}$
is minimized. This is an NP-hard optimization problem. PAM (Partitioning Around
Medoids, see Kaufman & Rousseeuw (1990), Chapter 2) is a very popular
heuristic for obtaining optimal $k$-medoids partitions, and
provided by pam in package
kmedoids is an exact algorithm based on a binary linear
programming formulation of the optimization problem (e.g., Gordon &
Vichi (1998), [P4']), using lp from package
A. D. Gordon and M. Vichi (1998). Partitions of partitions. Journal of Classification, 15, 265--285.