Advertisement
Guest User

Untitled

a guest
Jan 5th, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. let djikstra graph =
  2.  
  3. let rec loop times est pred accum =
  4.  
  5. if (accum <= 25)
  6. then
  7. (if times < 5
  8. then (
  9.  
  10. let (x,y) = mindistance est pred in
  11. (
  12. Printf.printf "\n%3s %3d %3d\n" "Updating estimates" y accum;
  13. loop (times + 1) (updateestimates est (update pred y true) y graph)) pred (succ accum) ;
  14. )
  15. else
  16. loop 0 est pred (succ accum)
  17. )
  18. else
  19. est
  20. in loop 0 (update (estimates 5) 0 (float_of_int 0)) (predecessor 5) 0
  21. ;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement