We use rotations to construct a path equal in length to the sum of the distances AE+BE+CE, whose end points are fixed. Minimum for AE+BE+CE occurs when this path is a straight line.
So long as no angles of the original triangle are greater than 120 degrees, this works. What goes wrong when an angle does exceed 120 degrees?