Theory and applications of swarm intelligence