1

In ortools if you have only 0-1 variables you can either use CP-SAT from

from ortools.sat.python import cp_model

or you can use

from ortools.linear_solver import pywraplp
solver = pywraplp.Solver.CreateSolver('SAT')

Are these solvers the same and if not, what is the difference?

byteful
  • 309
  • 1
  • 8

1 Answers1

3

Pywraplp supports linear equations/inequations with floating point coefficients.

CP-SAT is integral only, but support much more constraints (quadratic scheduling, routing...) in addition to linear constraints. CP-SAT does support floating point coefficients for the objective.

pywraplp with the SAT backend scales all coefficients to achieve linear constraints that only have integral coefficients, then calls the CP-SAT solver.

Laurent Perron
  • 8,594
  • 1
  • 8
  • 22