Algorithm Helps Robots Avoid Obstacles in Their Path