Please implement a particle swarm optimization algorithm in Python that can be applicable for a wide range of optimization problems. The implementation should have efficient and well-commented code that is readable and understandable by other developers. Additionally, please include necessary explanations and sample usage scenarios to the documentation.
This prompt doesn't seem malicious.