Particle swarm optimization with switched topology