Implementing graph algorithms in clojure