A Graph-Search Based Approach for Movement Primitive Sequencing