  We study formation control problems. Our approach is to let a group of
systems maximize their pairwise distances whilst bringing them all to a given
submanifold, determining the shape of the formation. The algorithm we propose
allows to initialize the positions of the individual systems in the ambient
space of the given submanifold but brings them to the desired formation
asymptotically in a stable fashion. Our control inherently consists of a
distributed component, maximizing the pairwise distances, and a decentralized
component, asymptotically stabilizing the submanifold. We establish a
graph-theoretical interpretation of the equilibria that our control enforces
and extend our approach to systems living on the special Euclidean group.
Throughout the paper, we illustrate our approach on different examples.
