  We study the problem of community detection in a general version of the block
spin Ising model featuring M groups, a model inspired by the Curie-Weiss model
of ferromagnetism in statistical mechanics. We solve the general problem of
identifying any number of groups with any possible coupling constants. Up to
now, the problem was only solved for the specific situation with two groups of
identical size and identical interactions. Our results can be applied to the
most realistic situations, in which there are many groups of different sizes
and different interactions. In addition, we give an explicit algorithm that
permits the reconstruction of the structure of the model from a sample of
observations based on the comparison of empirical correlations of the spin
variables, thus unveiling easy applications of the model to real-world voting
data and communities in biology.
