title: Closest pair in R programming
body: <p>if I define the following:</p>
  
  <pre><code>X&lt;- sample(200:1000,10)
  Y&lt;- sample (200:1000, 10)
  plot(X,Y)
  </code></pre>
  
  <p>then there will be 10 random points created, so the question is how can I find the closest pair/ shortest path??</p>