ortools-sat
Crystal bindings for the OR-Tools SAT Solver
Installation
-
Add the dependency to your
shard.yml
:dependencies: ortools-sat: github: darkstego/ortools-sat
-
Run
shards install
Usage
Example:
require "ortools-sat"
model = ORTools::Sat::Model.new
a = model.new_int_var(0,3)
b = model.new_int_var(5,10)
model.add_constraint 2*a > b
solution = model.solve
if solution.is_a? ORTools::Sat::ValidSolution
puts "a = #{solution.value a}"
puts "b = #{solution.value b}"
end
Contributing
- Fork it (https://github.com/darkstego/ortools-sat/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Abdulla Bubshait - creator and maintainer