Guest User

Untitled

a guest
Nov 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. // Graph: Graph with vertices v and edges e
  2. // source: starting vertex
  3. ModifiedDijkstra (Graph, source)
  4. foreach vertex v in Graph G
  5. dist[v] := infinity
  6. previous[v] := undefined
  7. biggestEdge[v] := infinity
  8. dist[source] = 0
  9. biggestEdge[source] = 0
  10. Q := the set of all vertices in G
  11. while Q is not empty
  12. u = vertices in Q with smallest dist[v]
  13. remove u from Q
  14. foreach neightbour v of u
  15. old = dist[u] + dist_between(u,v)
  16. size = max(biggestEdge[u], dist_between(u,v))
  17. if (size < biggestEdge[v])
  18. dist[v] = old
  19. previous[u] = u
  20. biggestEdge[v] = size
  21. return previous[]
Add Comment
Please, Sign In to add comment