Distributed adaptive formation control for linear swarm systems with time-varying formation and switching topologies