Initial affinity propagation code.