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