Function that returns for each candidate C the best number of groups and factors, based on the PIC.
Useful links