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



(defn is-compatible
  [digraph e1 e2]
  (let [tc (transitive-closure
             (uber/add-directed-edges digraph e1 e2))]

                (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))]
