Advertisement
Guest User

Untitled

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