Solutions to some basic graph theory problems in OCaml