  Bacteria organize in a variety of collective states, from swarming, which has
been attributed to rapid surface exploration, to biofilms, which are highly
dense immobile communities attributed to stress resistance. It has been
suggested that biofilm and swarming are oppositely controlled, making this
transition particularly interesting for understanding the ability of bacterial
colonies to adapt to challenging environments. Here, the swarm to biofilm
transition is studied experimentally by analyzing the bacterial dynamics both
on the individual and collective scales. We show that both biological and
physical processes facilitate the transition - a few individual cells that
initiate the biofilm program cause nucleation of large, scale-free stationary
aggregates of trapped swarm cells. Around aggregates, cells continue swarming
almost unobstructed, while inside, trapped cells slowly transform to biofilm.
While our experimental findings rule out previously suggested purely physical
effects as a trigger for biofilm formation, they show how physical processes,
such as clustering and jamming, accelerate biofilm formation.
