Assembly redesign for layered manufacturing: an algorithmic approach