  The paper addresses a new class of optimal control problems governed by the
dissipative and discontinuous differential inclusion of the sweeping/Moreau
process while using controls to determine the best shape of moving convex
polyhedra in order to optimize the given Bolza-type functional, which depends
on control and state variables as well as their velocities. Besides the highly
non-Lipschitzian nature of the unbounded differential inclusion of the
controlled sweeping process, the optimal control problems under consideration
contain intrinsic state constraints of the inequality and equality types. All
of this creates serious challenges for deriving necessary optimality
conditions. We develop here the method of discrete approximations and combine
it with advanced tools of first-order and second-order variational analysis and
generalized differentiation. This approach allows us to establish constructive
necessary optimality conditions for local minimizers of the controlled sweeping
process expressed entirely in terms of the problem data under fairly
unrestrictive assumptions. As a by-product of the developed approach, we prove
the strong $W^{1,2}$-convergence of optimal solutions of discrete
approximations to a given local minimizer of the continuous-time system and
derive necessary optimality conditions for the discrete counterparts. The
established necessary optimality conditions for the sweeping process are
illustrated by several examples.
