Combining adaptive control and barrier functions ensures safe and stable formation control in multi-agent systems.