What is the optimal algorithm (or a fast one) to compute the volume of a large collection of spheres placed randomly in a large box? (No gravity, spheres can intersect, radius is small compared to box size)
I have around 2000 spheres. Later I want to generalize to tetrahedra and other shapes.
An error of upto 5% is fine.
You can get a good approximation by considering that the expected volume added from the nth sphere is equal to volume of sphere*(1-(current volume))/(box volume). This gives a linear reccurence relation which you can solve.