 
 
 (defn is-compatible
+  "Checks if two edges are compatible.
+
+  For an ordering given as graph and two edges e1 and e2 this means that the
+  transitive closure of the graph with both edges added does not contain a
+  (non-trivial) cycle."
   [digraph e1 e2]
   (let [tc (transitive-closure
              (uber/add-directed-edges digraph e1 e2))]

                   CAtom (atom ())]
               ;(println "<=CAtom: " @<=CAtom)
               (while (= @<=CAtom nil)
                 (swap! CAtom
                        (fn [C] (let [I (tig (transitive-edge-union P <= C))]
                                  ;(println "(transitive-edge-union P <= C):")
                                  ;(uber/pprint (transitive-edge-union P <= C))

                (not (lg/has-edge? tc (lg/dest e) (lg/src e)))))))

(defn tig
  "Returns the \"transitive incompatibility graph\" (tig) for a given ordering
  (given ad graph).

  See Section 3, Dürrschnabel, Hanika, Stumme (2019) https://arxiv.org/abs/1903.00686"
  [graph]
  (let [ccg (co-comparability (lg/nodes graph) #(lg/has-edge? graph %1 %2))
        tig-nodes (map edge->vec (lg/edges ccg))]
