Nesting algorithms are used to make the most efficient use of material or space. This could for instance be done by evaluating many different possible combinations via recursion.