Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------------------------
- Dijkstra's Algortihm
- set = adjaency matrix from graph
- s = source vertex
- g = goal vertex
- weight = 0
- best_vertex = s
- while best_vertex != g
- for each neighbour of best_vertex do
- find distance from s to neighbours
- end
- for
- best_neighbour = neighbour with minimum weight from s (p(s, best_neighbour) + p'(best_neighbour, neighbour))
- best_vertex = best_neighbour
- update weight from s to best_neighbour
- end
- -------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement