Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type node = int
- type graph = (node * float * node ) list
- let g = [(0, 0.5, 1); (1, 0.2, 3); (1, 0.8, 4); (2, 0.4, 4)]
- let adjacent_nodes n g = List.fold_left (fun (a,b,c) out -> if a = n then (c,b)::out else out) [] g
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement