  Understanding physical rules underlying collective motions requires
perturbation of controllable parameters in self-propelled particles. However,
controlling parameters in animals is generally not easy, which makes collective
behaviours of animals elusive. Here, we report an experimental system in which
a conventional model animal, \textit {Caenorhabditis elegans}, collectively
forms dynamical networks of bundle-shaped aggregates. We investigate the
dependence of our experimental system on various extrinsic parameters (material
of substrate, ambient humidity and density of worms). Taking advantage of
well-established \textit {C.~elegans} genetics, we also control the intrinsic
parameters (genetically determined motility) by mutations and by forced neural
activation via optogenetics. Furthermore, we develop a minimal agent-based
model that reproduces the dynamical network formation and its dependence on the
parameters, suggesting that the key factors are alignment of worms after
collision and smooth turning. Our findings imply that the concepts of active
matter physics may help us to understand biological functions of animal groups.
