title: Best programming language to implement DBSCAN algorithm querying a MongoDB database?
body: <p>I've to implement the DBSCAN algorithm.
  Assuming to start from this pseudocode</p>
  
  <pre><code>DBSCAN(D, eps, MinPts)
     C = 0
     for each unvisited point P in dataset D
        mark P as visited
        NeighborPts = regionQuery(P, eps)
        if sizeof(NeighborPts) &lt; MinPts
           mark P as NOISE
        else
           C = next cluster
           expandCluster(P, NeighborPts, C, eps, MinPts)
  
  expandCluster(P, NeighborPts, C, eps, MinPts)
     add P to cluster C
     for each point P' in NeighborPts 
        if P' is not visited
           mark P' as visited
           NeighborPts' = regionQuery(P', eps)
           if sizeof(NeighborPts') &gt;= MinPts
              NeighborPts = NeighborPts joined with NeighborPts'
        if P' is not yet member of any cluster
           add P' to cluster C
  
  regionQuery(P, eps)
     return all points within P's eps-neighborhood
  </code></pre>
  
  <p>My code has to run on an <strong>Amazon EC2</strong> Instance with Ubuntu Linux 64 bit.</p>
  
  <p>The function <strong>regionQuery</strong> queries a <strong>MongoDB</strong> database to obtain all points within P's eps-neighborhood.</p>
  
  <p>So, according to you, what is the best programming language to implement it to improve performances? <strong>C</strong>, <strong>PHP</strong>, <strong>Java</strong> (I don't think)?</p>