Optimization-based computation of locomotion trajectories for Crowd Patches