apro_gen: optimization of obtaining optimality criterium