There are no efficient algorithms for many computer science problems. The simplest approach is to try all possible (or many) solutions until the desired outcome is reached. This is called Brute Force Method.
I created a Python script that creates arrangements of intersecting digital sculptures in front of a "frozen" cloth simulation, similar to a traditional still life, but with no physical constraints. The HDR image texture used to create the reflections on the genometry was taken at my studio, placing the virtual setup in the real world.