Skip to content

Latest commit

 

History

History
46 lines (26 loc) · 1.3 KB

README.md

File metadata and controls

46 lines (26 loc) · 1.3 KB

Playing with chocosolver

Simple stuff, really.

LogicalSatisfiability

Source: LogicalSatisfiability

A very simple example:

  • Given a logical statement
  • Find a set of boolean parameters so that it evaluates to true

Sudoku

Source: Sudoku

Solves sudoku

  • Given a grid of 81 variables: some with a 1-digit domain, and others in the 1-9 domain
  • Add constraints so rows are all different, columns are all different, and each of the 9 sub-squares on non different
  • Solve it, and print it

Graph colouring

Source GraphColouring

More complex graph colouring example

This is trying to minimize the number of distinct colours, instead of just finding the first solution (as the sudoku one does).

It's also applying a rule that no colour can be used more than N times, to mimic the idea that this could be modelling a human worker, who could only do so many tasks in a day.

Travelling salesman

Source TravellingSalesman

A copy of this sample, but with comments to explain it better to me ;)