title: Minimum Euclidean distance between two points in an array of points
body: <p>The obvious O(N^2) is to calculate the Euclidean distance between each pair of points. I've implemented in Python (calc_euclidean_dist() implementation is omitted):</p>
  <pre><code>def closestPointPair(pairs):
  
      min_dist = sys.maxsize
  
      for i in range(len(pairs)):
          for j in range(i+1, len(pairs)):
              dist = calc_euclidean_dist(pairs[i], pairs[j])
              if dist &lt; min_dist:
                  min_dist = dist
  
      return min_dist
  </code></pre>
  <p>Is there a better solution? Maybe ordering the points?</p>