TITLE: Why may geodesic not be the shortest path on a surface?
QUESTION [6 upvotes]: As said in Geodesic in Wikipedia:

In metric geometry, a geodesic is a curve which is everywhere locally a distance minimizer

but implied that it doesn't have to be the shortest path, so in brief why does it minimize all local distance on its path, but does not minimize the total length? Is that something like greedy algorithm?

REPLY [2 votes]: Attach a image example for the above explanation, The geodesic between A and B longer than the curve from A to B: