title: Optimize route by distance
body: <p>I am building a Here Maps based web application.
  Its main features include the ability to upload a spreadsheet file (.xls, .xlsx) to the server and plan a route with the addresses in the file, up to 500 waypoints.</p>
  
  <p>Of course, these waypoints aren't any way in an optimized order, so I'd like to let the user click on a "OPTIMIZE ROUTE" button and that would optimize it by distance.</p>
  
  <p>For example if the file has these three addresses:</p>
  
  <ol>
  <li>New York </li>
  <li>San Francisco</li>
  <li>Long Island</li>
  </ol>
  
  <p>The route by default would be to go from NY to SF, then back to LI. </p>
  
  <p>The application would check the distances and reorder the waypoints array in a way like this:</p>
  
  <p>NY -> LI -> SF</p>
  
  <p><strong>My question:</strong>
  Is there a built in route optimization function in Here Maps, or should I write my own?</p>