title: Find closest nodes given list of nodes and coordinates
body: <p>Let's say I have a series of locations and their X, Y coordinates:</p>
  
  <p>L1(X1, Y1)
  L2(X2, Y2)
  L3(X3, Y3)
  ...
  L10000(X10000, Y10000)</p>
  
  <p>And I have a function that returns the distance between 2 locations:  distance(L1, L2) = 5 miles</p>
  
  <p>For a given location, how do I find all of the locations within 100 miles?  Or if it's easier, the 50 closest locations</p>
  
  <p>Our setup is a SQL Server table of locations and their zip codes.  The function takes 2 zip codes, looks up the latitude / longitude of each and returns the distance.  We can cache the results since they don't change very often.  </p>