  Natural, social, and artificial multi-agent systems usually operate in
dynamic environments, where the ability to respond to changing circumstances is
a crucial feature. An effective collective response requires suitable
information transfer among agents, and thus is critically dependent on the
agents' interaction network. In order to investigate the influence of the
network topology on collective response, we consider an archetypal model of
distributed decision-making---the leader-follower linear consensus---and study
the collective capacity of the system to follow a dynamic driving signal (the
"leader") for a range of topologies and system sizes. The analysis reveals a
nontrivial relationship between optimal topology and frequency of the driving
signal. Interestingly, the response is optimal when each individual interacts
with a certain number of agents which decreases monotonically with the
frequency and, for large enough systems, is independent of the size of the
system. This phenomenology is investigated in experiments of collective motion
using a swarm of land robots. The emergent collective response to both a slow-
and a fast-changing leader is measured and analyzed for a range of interaction
topologies. These results have far-reaching practical implications for the
design and understanding of distributed systems, since they highlight that a
dynamic rewiring of the interaction network is paramount to the effective
collective operations of multi-agent systems at different time-scales.
