A method and computer program product for partitioning the columns of a
matrix A. The method includes providing the matrix A in a memory device
of a computer system. The matrix A has n columns and m rows, wherein n is
an integer of at least 3, and wherein m is an integer of at least 1. The
method further includes executing an algorithm by a processor of the
computer system. Executing the algorithm includes partitioning the n
columns of the matrix A into a closed group of p clusters, wherein p is a
positive integer of at least 2 and less than n, wherein the partitioning
includes an affinity-based merging of clusters of the matrix A, and
wherein each cluster is a collection of one or more columns of A.