【问题标题】:CPLEX: Error 5002 Objective is not convex -> Problem can be solved to global optimality with optimality target 3 ->CPLEX:错误 5002 目标不是凸的 -> 问题可以通过最优目标 3 解决到全局最优 ->
【发布时间】:2020-09-23 15:34:48
【问题描述】:

我在 CPLEX Optimization Studio 上收到此错误。该问题是一个简单的二次问题,具有一个等式和两个不等式约束。

.mod 代码如下所示(未使用 .dat):

    /*********************************************
 * OPL 12.10.0.0 Model
 * Author: qdbra
 * Creation Date: Sep 14, 2020 at 9:40:57 PM
 *********************************************/

range R = 1..5;
range B= 6..10;

dvar float x[R];
dvar boolean y[B];

minimize
  ( x[1]^2 - 2*x[2]^2 + 3*x[3]^2 + 4*x[4]^2
  - 5*x[5]^2 + 6*y[6]^2 + 7*y[7]^2 - 
  8*y[8]^2 + 9*y[9]^2 + 10*y[10]^2 +
  8*x[1]*x[2] + 17*x[3]*y[8] - 20*y[6]*y[9]
  + 26*y[9]*y[10])/2 ;
  
subject to {
  ct1: 
  x[1] + x[2] + x[3] + x[5] + y[6] + y[7] == 20;
       
  ct2: 
  x[1] + x[4] + y[8] + y[9] + y[10] >= 1;
       
  ct3: 
  x[2] - x[4] - y[6] + y[7] >= 0;
}

【问题讨论】:

    标签: optimization cplex opl quadratic-programming non-convex


    【解决方案1】:

    如果你将最优目标设置为 3,你会得到一个结果:

    execute
    {
      cplex.optimalitytarget=3;
    }
    
    range R = 1..5;
    range B= 6..10;
    
    dvar float x[R];
    dvar boolean y[B];
    
    minimize
      ( x[1]^2 - 2*x[2]^2 + 3*x[3]^2 + 4*x[4]^2
      - 5*x[5]^2 + 6*y[6]^2 + 7*y[7]^2 - 
      8*y[8]^2 + 9*y[9]^2 + 10*y[10]^2 +
      8*x[1]*x[2] + 17*x[3]*y[8] - 20*y[6]*y[9]
      + 26*y[9]*y[10])/2 ;
      
    subject to {
      ct1: 
      x[1] + x[2] + x[3] + x[5] + y[6] + y[7] == 20;
           
      ct2: 
      x[1] + x[4] + y[8] + y[9] + y[10] >= 1;
           
      ct3: 
      x[2] - x[4] - y[6] + y[7] >= 0;
    }
    

    会给

    x = [20
             0 0 0 0];
    y = [0 0 0 0 0];
    

    【讨论】:

      猜你喜欢
      • 2021-01-31
      • 1970-01-01
      • 2022-07-19
      • 1970-01-01
      • 1970-01-01
      • 2019-04-04
      • 2019-07-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多