In computer graphics applications you have a bunch of objects in 3d space. You like to do collision detection. For example, if a bullet hits you or the enemy, or if you punch an enemy, you like to know if there is a collision. All objects are composed of cuboids and 3d ellipsoids. Assuming there are n objects how can you quickly determine which pair of objects collide at any given time?