Planning and subgroup encoding