A friend asked how to find strongly connected components in a graph in idiomatic Clojure. This is what I came up with: (defn edge-list [g] (mapcat (fn [[k v]] (map (partial vector k) v)) g)) (defn reverse-graph [g] (reduce…
Category archive for: Clojure
I was trying to write a PDDL parser in Clojure, and realized it could be handy to have something that does the opposite of `(~x ~@y). In other words, it takes a two versions of a syntax-tree, one with variables…