1.2.0 permalink Arrow_down_16x16

remove-loops

clojure.contrib.graph

  • (remove-loops g)
For each node n, remove any edges n->n.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/graph.clj:57 top

(defn remove-loops
  "For each node n, remove any edges n->n."
  [g]
  (struct directed-graph
          (:nodes g)
          (into {} (map (fn [n]
                          [n (disj (set (get-neighbors g n)) n)]) (:nodes g)))))
Vars in clojure.contrib.graph/remove-loops: defn fn into map struct
Used in 0 other vars

Comments top

No comments for remove-loops. Log in to add a comment.