Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Graph: Graph with vertices v and edges e
- // source: starting vertex
- ModifiedDijkstra (Graph, source)
- foreach vertex v in Graph G
- dist[v] := infinity
- previous[v] := undefined
- biggestEdge[v] := infinity
- dist[source] = 0
- biggestEdge[source] = 0
- Q := the set of all vertices in G
- while Q is not empty
- u = vertices in Q with smallest dist[v]
- remove u from Q
- foreach neightbour v of u
- old = dist[u] + dist_between(u,v)
- size = max(biggestEdge[u], dist_between(u,v))
- if (size < biggestEdge[v])
- dist[v] = old
- previous[u] = u
- biggestEdge[v] = size
- return previous[]
Add Comment
Please, Sign In to add comment