title: Sum of distances from a point to all other points
body: <p>I have two lists </p>
  
  <p><code>available_points = [[2,3], [4,5], [1,2], [6,8], [5,9], [51,35]]</code></p>
  
  <p>and</p>
  
  <p><code>solution = [[3,5], [2,1]]</code></p>
  
  <p>I'm trying to <em>pop</em> a point in <code>available_points</code> and <em>append</em> it to <code>solution</code> for which the sum of euclidean distances from that point, to all points in the <code>solution</code> is the greatest.</p>
  
  <p>So, I would get this </p>
  
  <p><code>solution = [[3,5], [2,1], [51,35]]</code></p>
  
  <hr>
  
  <p>I was able to select the initial 2 furthest points like this, but not sure how to proceed.</p>
  
  <pre><code>import numpy as np
  from scipy.spatial.distance import pdist, squareform
  
  available_points = np.array([[2,3], [4,5], [1,2], [6,8], [5,9], [51,35]])
  
  D = squareform(pdist(available_points)
  I_row, I_col = np.unravel_index(np.argmax(D), D.shape)
  solution = available_points[[I_row, I_col]]
  </code></pre>
  
  <p>which gives me</p>
  
  <p><code>solution = array([[1, 2], [51, 35]])</code></p>