Docplex与CPLEX Python API [英] Docplex vs CPLEX Python API

查看:404
本文介绍了Docplex与CPLEX Python API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

What is the difference between Docplex and CPLEX Python API? Is any of them faster than the other?

推荐答案

CPLEX Python API 是围绕 C API (又名C可调用库)。这样,它可以访问CPLEX必须提供的几乎所有功能。变量和约束由它们在矩阵中的索引标识。

The CPLEX Python API is a lightweight wrapper around the C API (aka, the C Callable Library). As such, it provides access to nearly all of the functionality CPLEX has to offer. Variables and constraints are identified by their indices in the matrix.

docplex 是面向对象的建模API,它对numpy / pandas友好,因此使用起来可能更自然。可以在本地(使用内部的CPLEX Python API)或在云上求解模型。除了提供用于数学编程的CPLEX的访问权限之外,它还可用于访问 CP优化器约束编程引擎。

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 constraint programming engine.

通常,使用CPLEX Python API,因为它是较低级别的API。但是,docplex可以解决构建模型时获得最佳性能的一些复杂问题,而只会产生相对较低的开销。实际求解时间应大致相同。

It is usually faster to build the model directly with the CPLEX Python API as it is a lower-level API. However, docplex can take care of some of the intricacies of getting the best performance when building a model while only incurring a relatively low overhead. The actual solve time should be more or less identical.

这篇关于Docplex与CPLEX Python API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆