(defn add-loops "For each node n, add the edge n->n if not already present." [g] (struct directed-graph (:nodes g) (into {} (map (fn [n] [n (conj (set (get-neighbors g n)) n)]) (:nodes g)))))
Comments top
No comments for add-loops. Log in to add a comment.