                                             k "s")
          clauses (concat node-clauses edge-clauses no-more-than-k-bad-edges-clauses)
          raw-solution (sat/solve-symbolic-cnf clauses)
-         C (map first (filter #(and (sat/positive? %) (= (% 1) 3)) raw-solution))]
+         C (if (= raw-solution nil)
+             nil
+             (map first (filter #(and (sat/positive? %) (= (% 1) 3)) raw-solution)))]
      ;(println node-clauses)
      ;(println edge-clauses)
      ;(println no-more-than-k-bad-edges-clauses)

   (first (drop-while #(= % nil) (map #(sat-reduction g %) (range)))))
  ([g k]
   (let [node-clauses (mapcat
                        #(vec [[[% 1] [% 2] [% 3]]])        ;either V_{i,1}, V_{i,2}, or V_{i,3} is true
                        (nodes g))
         ;edge-clauses (mapcat
         ;               #(let [vi (:src %) vj (:dest %)]
         ;                  [[[vi 1] [vj 1]] [[vi 2] [vj 2]]])
         ;               (lg/edges g))
         edge-clauses (mapcat
                        #(let [vi (:src %) vj (:dest %)]
                           [[(! [vi 1]) (! [vj 1])]

         [[(! (xs (- n 1))) (! [:tmp s (- n 2) (- k 1)])]]))
     (vec (map #(vec [(! %)]) xs)))))


(defn sat-reduction
  "Reduces the problem of finding a maximum bipartite subgraph to satisfiability.
