Group-theoretic methods in the control problem with applications to optimal boundary layer problems in supersonic flows