Optimal Industrial Automation