Order activities and production to ensure a better graph