Decide which groups are suitable before scheduling, fixes #3