简体   繁体   English

C ++中的CPLEX:将LP转换为MIP

[英]CPLEX in C++: Converting a LP to MIP

I am a beginner in using CPLEX in c++. 我是在c ++中使用CPLEX的初学者。 I know how to solve a simple LP using CPLEX. 我知道如何使用CPLEX解决简单的LP。

I am wondering if setting variables as integer (as follows), causes CPLEX use the branch and bound method to solve the MIP or it just solves a LP and at the end rounds the resulted values to integer? 我想知道是否将变量设置为整数(如下所示),是否导致CPLEX使用分支定界方法来解决MIP还是只是解决了LP并最终将结果值舍入为整数?

I define everything same as a LP problem except variables. 除变量外,我定义与LP问题相同的所有内容。 This is how I set the variables : IloIntVarArray Variables(env,LowerBound,UpperBound) 这就是我设置变量的方式:IloIntVarArray变量(env,LowerBound,UpperBound)

I really appreciate if you can help me or introduce a good tutorial for CPLEX in c++. 如果您能为我提供帮助或为c ++中的CPLEX介绍一个很好的教程,我将不胜感激。

Thank you 谢谢

Yes. 是。 Declaring any of your modelling variables as integer will give you a MILP model. 将任何建模变量声明为整数将为您提供一个MILP模型。 CPLEX will (usually) use B&B to solve such models. CPLEX(通常)将使用B&B来解决此类模型。 Check out the provided samples which are available in C++ as well as C#, Java,etc. 检查提供的示例,这些示例在C ++以及C#,Java等中可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM