What is the branch and topic of mathematics concerned with volume optimization of objects that can be morphed/manipulated? I.e. finding the most efficient way to position 3D objects, where each object can be morphed under certain conditions, inside an enclosed volume?
Ex: You are bagging apples in identical bags. Each bag must have 4 apples (4 apples is also the maximum any bag can hold). The bags are morph-able to 'some extent', but you can't have the 4 apples in a straight line inside a bag, for example. You place the apple bags inside of a box. What is the most efficient way to do this so you can have the highest number of apples that is physically possible inside one box. (This can get tricky because bags in the box won't necessarily fit together in the ideal ways.)