Docplex 与 CPLEX Python API

Docplex vs CPLEX Python API

Docplex 和 CPLEX 有什么区别PythonAPI?它们中的任何一个都比另一个快吗?

CPLEX Python API is a lightweight wrapper around the C API(又名 C 可调用库)。因此,它提供对 CPLEX 必须提供的几乎所有功能的访问。变量和约束由它们在矩阵中的索引标识。

docplex is an object oriented modeling API that is numpy/pandas friendly, which may be more natural to work with. The model can be solved locally (using the CPLEX Python API under the hood), or on the cloud. In addition to providing access to CPLEX for mathematical programming, it can also be used to access the CP Optimizer 约束编程引擎。

直接使用 CPLEX Python API 构建模型通常更快,因为它是较低级别的 API。但是,docplex 可以处理一些复杂的问题,以便在构建模型时获得最佳性能,同时只产生相对较低的开销。实际求解时间应该差不多。