title: shortest path in hash map
body: <p>The following is a data set I have stored in a hash map, and I have to find the shortest path between two values.</p>
  
  <pre><code>9244, 4322, 4886, 5989, 8598, 9979, 1447, 9657
  8598, 6752, 7146, 1951, 660, 1447, 7779
  568, 1951, 4886, 2570, 9026, 9489, 7779
  6752, 3424, 1977, 4746, 9657
  77
  </code></pre>
  
  <p>The key value of the hash map is the first value of each line, the rest are the supposed "friends" of 9244 (same in each case).</p>
  
  <p>i have saved in hash table in this format: <code>hashmap(key, array)</code>, where:</p>
  
  <ul>
  <li>key is e.g. 9244</li>
  <li>array then holds [ 4322, 4886, 5989, 8598, 9979, 1447, 9657 ]</li>
  </ul>
  
  <p>How to find shortest path between two keys?</p>