Implementation of Particle Swarm Optimization