IIRC, wasn't it shown that ants navigate by math? That is, they may take a meandering path from point A to B, but they can take the straight-line path back from B to A because they mathematically "know" how many steps they've taken and so the actual distance covered away from the origin point.