https://github.com/darkstego/ortools-sat
Crystal Lang bindings for OR-Tools Sat solver
https://github.com/darkstego/ortools-sat
constraint-programming crystal crystal-lang ortools sat-solver
Last synced: 12 months ago
JSON representation
Crystal Lang bindings for OR-Tools Sat solver
- Host: GitHub
- URL: https://github.com/darkstego/ortools-sat
- Owner: darkstego
- License: mit
- Created: 2024-08-07T03:49:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-23T01:22:41.000Z (over 1 year ago)
- Last Synced: 2025-02-05T21:25:40.009Z (about 1 year ago)
- Topics: constraint-programming, crystal, crystal-lang, ortools, sat-solver
- Language: Crystal
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ortools-sat
Crystal bindings for the OR-Tools SAT Solver
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
ortools-sat:
github: darkstego/ortools-sat
```
2. Run `shards install`
## Usage
Example:
```crystal
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
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Contributors
- [Abdulla Bubshait](https://github.com/darkstego) - creator and maintainer