A Low-Complexity Algorithm for Trajectory Generation in the Three-Body Problem