Efficient algorithms for globally optimal trajectories | Synapse