 (defn sahucs-dijkstra [henv]
   (hierarchical-search henv (if-cycle-fn :transparent :recursive) 
     make-incremental-dijkstra-sa-search))
+
+(defn sahucs-inverted [henv]
+  (hierarchical-search henv :dummy
+    make-inverted-sa-search))
 
 
 

                (let [next-min-reward (max min-reward (queue-best-reward queue))]
                  (queues/pq-replace! partial-queue best (make-queue-priority best-reward))
                  (let [{:keys [result-pairs max-reward]} (expand-fn best next-min-reward)]
                    (queues/pq-replace! partial-queue best (make-queue-priority max-reward))
                    (doseq [[ni nr] result-pairs] 
 ;                    (println "NEW" max-reward (class ni) nr (:name ni))
                      (assert (not (= :re-added (queues/pq-add! new-queue ni (make-queue-priority nr))))))

          (next-partial-solution [min-reward]
            (if (< @index-atom (count @result-vec-atom))
                (let [[_ rew :as result] (nth @result-vec-atom @index-atom)]
                 ;; TODO: remove
                  (util/assert-is (<= (count @result-vec-atom) 1) "%s" [@result-vec-atom])
                  (if (>= rew min-reward)
                      (do (swap! index-atom inc) 
                          (PartialResult [result] 
                                         (max (second (get @result-vec-atom @index-atom [nil Double/NEGATIVE_INFINITY])) 
                                              @next-reward-atom)))
                    (PartialResult nil rew)))
              (if (viable? @next-reward-atom min-reward)
                  (let [{:keys [result-pairs max-reward]} (next-partial-solution search-problem min-reward)]
                    (reset! next-reward-atom max-reward)
                    ;; TODO: remove!
                    (doseq [x1 @result-vec-atom x2 result-pairs] (assert (not (= (first x1) (first x2)))))
                    (swap!  result-vec-atom into result-pairs)
                    (recur min-reward))
                (PartialResult nil @next-reward-atom)))))))))
