Robot: Line follower - Obstacle avoidance - High Speed

And how are A and B told to the robot? By the coloured line? By coordinates? By direction and distance? To find the fastest path, the robot has to know if the path turns to the left or the right after the obstacle. Which way around the obstacle is the fastest?

Since it is a race, I assume others have also got the same assignment. So you can't just set up convenient rules and premisses for yourself while developing the idea. You need more facts.