Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1.  
  2. Design an algorithm to find the shortest path ... (10 points)
  3. Twelve families live in the little village Zen. They live in twelve separate houses. Each house is connected to the other eleven via eleven different roads. Let's denote these houses as: H_1, H_2, ..., H_12. Furthermore, let's denote the road between a pair of houses H_i and H_j (where i and j are between 1 and 12 and not equal) as Road(i, j). Finally, the distance of each road is denoted as Road(i, j).distance. Notice that Road(i, j) and Road(j, i) are the same road.
  4.  
  5. Given a pair of different houses in Zen, H_s and H_e, design an algorithm to find the shortest path from H_s to H_e that consists of at most two different roads. Describe your algorithm in pseudo code with concise comments. (A gentle note:: this problem has literally nothing to do with the famous Dijkstra's algorithm.)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement