Algorithms for nesting with defects