title: Algorithms to find nearest nodes in a graph
body: <p>I have a large road network graph. Suppose I know a specific location (say source node). Now my interest is to find out all the nearest neighbor nodes within a specific range. Say I want to find out all the locations (other nodes) which are in a range of 20 kilometers around the known location / source node. </p>
  
  <p>I know BFS or Dijkastra's algorithm can solve this matter but I feel these are inefficient in my application as my application needs to process these kind of queries again and again.</p>
  
  <p>So is there any other algorithm or technique to accomplish the goal.</p>
  
  <p>Assume this is a weighted graph, nodes represent locations where edges represent distance between two corresponding locations.</p>
  
  <p><strong>Edit:</strong>  diskastra can solve the problem but what about storing the results? If I store results for all possible pairs after a certain number of queries, what would be the cache size? How to tackle that space inefficiency?</p>
  
  <p>I have also heard about kd-tree, r-tree indexing etc. Are they useful in this context? </p>
  
  <p><strong>Edit:</strong> To be more advanced, I am willing to use neo4j graph database for making this graph. I have seen neo4j has a special library called 'neo4j spatial' where R-Tree indexing is used for the purpose but i want to use directed graph concept rather than spatial index library. So is there any way to do this?</p>