Path Planning with Smooth Curve Using Electromagnetism-like Mechanism Algorithm