title: retrieving and storing route Map data
body: <p>I am working on a project where the requirement is to retrieve map related data for a specific source and destination. On each of the future requests this already fetched information which is cached is to be used. However now if either the source or destination changes, map is to be reconstructed which is inclusive of old source and destination.</p>
  
  <p>Some of my questions are:</p>
  
  <ol>
  <li><p>which data structure to use so that searching is easy and finding all the intermediate nodes between source and destination is easy and efficient.</p></li>
  <li><p>I have a limited memory resource so the luxury of having a very large DSC in the memory is not possible.</p></li>
  </ol>
  
  <p>I am considering storing the route data between source and destination as a list however this might make search as a linear search which i would want to avoid at any cost. It is ok if there is some overhead in constructing the structure for storing the route information, but search must be quick and easy. I am using java as the programming language.</p>
  
  <p>Thank you in advance for any help</p>