PyWraplp与CP-SAT有何不同?
在Ortools中,如果您只有0-1变量,则可以使用CP-SAT
from ortools.sat.python import cp_model
,或者可以使用
from ortools.linear_solver import pywraplp
solver = pywraplp.Solver.CreateSolver('SAT')
这些求解器相同,如果没有,则有什么区别?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
PYWRAPLP支持具有浮点系数的线性方程/不等式。
CP-SAT仅是不可或缺的,但是除线性约束外,还支持更多的约束(二次调度,路由...)。
CP-SAT确实为物镜支持浮点系数。
带有SAT后端的Pywraplp缩放所有系数,以实现仅具有积分系数的线性约束,然后称为CP-SAT求解器。
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.