daily pastebin goal
75%
SHARE
TWEET

pseudocode

a guest Oct 23rd, 2018 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top