I have an infinite square and I have some automa identifies by a string (0101011001.....) and one position (x,y). On the square there are some obstacles identifies from one position (x,y, x0, y0). They are rectangles. If the automa wants to catch up the B automat being made the minimal distance and without to meet with the obstacles as I can calculate the minimal distance? Backtracking?