Cluster formation in a heterogeneous metapopulation model