title: How to optimize the order of elements based on similarity coefficients?
body: <p>I have to reorder a sequence of elements based on the similarity between each other (expressed by a coefficient) so that each element is the most similar possible to each of its neighbors. I have to find an algorithm rather than a code.</p>
  
  <p>Example with 10 elements and similarity coefficients calculated for each pair of the elements below : </p>
  
  <p><a href="https://i.stack.imgur.com/Y7UES.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y7UES.png" alt="enter image description here"></a></p>
  
  <p>The excel file can be find here : <a href="https://1drv.ms/x/s!AtmZN4-kjgrPms99fqgaDwAS_F4uYw" rel="nofollow noreferrer">https://1drv.ms/x/s!AtmZN4-kjgrPms99fqgaDwAS_F4uYw</a></p>
  
  <p>What I have tried :</p>
  
  <ol>
  <li>Find a pair with the highest coefficient. In the example : 0.98 for T3 (left-end) and T5 (right-end)</li>
  <li>Find maximum coefficient between the left-end and the remaining elements </li>
  <li>Find maximum coefficient between the right-end and the remaining elements</li>
  <li>Take the maximum between 2. and 3.</li>
  <li>If maximum is 2. add on the left the element corresponding to the maximum coefficient for the left-end. Else, add on the right the element corresponding to the maximum coefficient for the right-end </li>
  <li>Repeat points 2 - 6 until no elements left.</li>
  </ol>
  
  <p>Here is the result :</p>
  
  <p><a href="https://i.stack.imgur.com/nNbpL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nNbpL.png" alt="enter image description here"></a></p>
  
  <p>The result isn't bad. One of the disadvantages I see is that 0.99>0.98 is considered in the same way as 0.99>0.01.</p>
  
  <p>The second option I thought about was maximizing the sum of coefficients between all neighbors, but don't really know where to start from. Especially if there are significantly more than 10 elements. More, it could result in a more "flat" order where while having better similarities overall some extremely similar elements could be placed far from each other.</p>
  
  <p>Being really new to this kind of problems I am pretty sure this should be a rather standard issue with existing solutions. Could you please point to those?</p>
  
  <p>Thank you!</p>