And since A. K. Dewdney is fresh on my mind, he did a Computer Recreations article generally about this (about simulating orbital mechanics) and the clever bit that I remember: you dial the time slice way down as objects got close, you care little when the objects are far apart.
Not a "solution" of course, but certainly an optimization if you're just generally doing gravitational simulations.
Not a "solution" of course, but certainly an optimization if you're just generally doing gravitational simulations.