Numerical Trajectory Optimization with Swarm Intelligence and Dynamic Assignment of Solution Structure