FindShortestTour[{e_1, e_2, ...}] attempts to find an ordering of the e_i that minimizes the total distance on a tour that visits all the e_i once.
Mathematica has over 3000 built-in functions and other objects, all based on a single unified framework, and all carefully designed to work together, both in simple ...