Linear optimization of profile cutting