title: algorithm implementation compare with c++ and php
body: <p>I am getting <code>(x,y)</code> coordinates value from MySQL table. Suppose there are 50 such points.</p>
  
  <p>I want to apply nearest neighborhood algo on these points to get most central/dense points among all.</p>
  
  <ol>
  <li>For each points find nearest neightbour using euclidian distance formula <code>sqrt[(x2-x1)^2 - (y2 - y1)^2]</code></li>
  <li>Point which appears maximum times as nearest neighbour should be marked as dense/center point</li>
  </ol>
  
  <p>I have two alternatives.</p>
  
  <ol>
  <li>Sending coordinate values to c++ compiled executable server process which performs above task and return resulting value</li>
  <li>perform above processing in php script itself to get the result</li>
  </ol>
  
  <p>Can some one tell me which one is faster and appropriate?</p>