Affinity propagation [1]} is a clustering technique that does not require an input number of clusters. It relies on similarity calculation between pairs of data points to determine a subset of representative examples in the dataset. The similarity between two points satisfies that \(s(x_i,x_j)>s(x_i,x_k)\)  if and only if \(x_i\)  is more similar to \(x_j\)  than to \(x_k\) . A responsibility matrix \(\mathcal {R}\)  and availability matrix \(\mathcal {A}\)  serve as message exchanging paths between data points. Clusters are updated by alternating between the responsibility matrix update and availability matrix update.
\(r(i,k)&=& s(i,k)-\max _{k^{\prime }\ne k} \lbrace a(i,k^{\prime })+s(i,k^{\prime })\rbrace \\a(i,k)&=&\min \big (0,r(k,k)+\sum _{i^{\prime }\notin \lbrace i,k\rbrace }\max (0,r(i^{\prime },k))\big )\; i\ne k\\a(k,k)&=&\sum _{i^{\prime }\ne k}\max (0,r(i^{\prime },k))\) 
