Advertisement
Guest User

pseudocode

a guest
Oct 23rd, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. dijkstras shortest path algorithm pseudocode
  2.  
  3. let s be starting vertex
  4. let c be set of all verticies minus s
  5. let d[v] = dist(s,v) and p[v] = s fr each v E c
  6. repeat until c is empty
  7. choose v from c that has minimum d[v] value
  8. let c = c - {v}
  9. for each neighbor w of v in c
  10. if d[v] + dist(v,w) < d[w]
  11. then let d[w] = d[v] + dist(v,w) and let p[w] = v
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement