Biologically-inspired Algorithms For Collective Behavior