  This article concerns an optimal crowd motion control problem in which the
crowd features a structure given by its organization into N groups
(participants) each one spatially confined in a set. The overall optimal
control problem consists in driving the ensemble of sets as close as possible
to a given point (the 'exit') while the population in each set minimizes its
control effort subject to its sweeping dynamics with a controlled state
dependent velocity drift. In order to capture the conflict between the goal of
the overall population and those of the various groups, the problem is cast as
a bilevel optimization framework. A key challenge of this problem consists in
bringing together two quite different paradigms: bilevel programming and
sweeping dynamics with a controlled drift. Necessary conditions of optimality
in the form of a Maximum Principle of Pontryagin in the Gamkrelidze framework
are derived. These conditions are then used to solve a simple illustrative
example with two participants, emphasizing the interaction between them.
