Skip to content

Instantly share code, notes, and snippets.

@si14

si14/hint.clj Secret

Created April 18, 2015 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save si14/c5d584bf622e6de91348 to your computer and use it in GitHub Desktop.
Save si14/c5d584bf622e6de91348 to your computer and use it in GitHub Desktop.
(defn solver [input]
(let [task (parse-task input)
s (Solver. "graph coloring")
x (VariableFactory/bounded "X" 0 5 s)
y (VariableFactory/bounded "Y" 0 5 s)
constr1 (ICF/arithm x "+" y ">" 5)
strat (IntStrategyFactory/lexico_LB (into-array IntVar [x y]))
^"[Lorg.chocosolver.solver.search.strategy.strategy.AbstractStrategy;" strats (into-array AbstractStrategy [strat])]
(prn (class strats))
(.post s constr1)
(.set s strats)
(.findSolution s))
"test")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment