Port of "Dancing with Friends and Enemies" swarm algorithm