SCIP 列生成错误:“定价已中止,但无法创建分支!”

问题描述 投票:0回答:1

我尝试使用 SCIP 运行列生成程序,使用定价回调(有点类似于在线提供的 VRP 示例,但采用轻松/连续的多商品流程)。

程序在生成新变量时运行良好,但一旦没有更多变量生成,求解器就会崩溃。返回的错误是“错误:定价已中止,但无法创建分支!” - 请注意,我没有尝试进行任何分支,并且所有变量都是连续的。

在每次调用 scip_redcost 函数时,我都会打印返回 SCIP_OKAY 之前创建的变量数量,并在玩具示例中得到以下结果:

 time | node  | left  |LP iter|LP it/n|mem/heur|mdpt |vars |cons |rows |cuts |sepa|confs|strbr|  dualbound   | primalbound  |  gap   | compl.
t 0.0s|     1 |     0 |     0 |     - | trivial|   0 |  23 |  43 |   0 |   0 |  0 |   0 |   0 |      --      | 4.020402e+07 |    Inf | unknown
* 0.0s|     1 |     0 |     3 |     - |    LP  |   0 |  23 |  43 |  43 |   0 |  0 |   0 |   0 |      --      | 4.020402e+02 |    Inf | unknown
Pricing ends with 3 new variable.
  0.0s|     1 |     0 |    12 |     - |   746k |   0 |  26 |  43 |  43 |   0 |  0 |   0 |   0 |      --      | 4.020402e+02 |    Inf | unknown
r 0.0s|     1 |     0 |    12 |     - |simplero|   0 |  26 |  43 |  43 |   0 |  0 |   0 |   0 |      --      | 6.100000e+01 |    Inf | unknown
Pricing ends with 2 new variable.
  0.0s|     1 |     0 |    18 |     - |   748k |   0 |  28 |  43 |  43 |   0 |  0 |   0 |   0 |      --      | 6.100000e+01 |    Inf | unknown
r 0.0s|     1 |     0 |    18 |     - |simplero|   0 |  28 |  43 |  43 |   0 |  0 |   0 |   0 |      --      | 1.500000e+01 |    Inf | unknown
Pricing ends with 1 new variable.
  0.0s|     1 |     0 |    19 |     - |   748k |   0 |  29 |  43 |  43 |   0 |  0 |   0 |   0 |      --      | 1.500000e+01 |    Inf | unknown
Pricing ends with 2 new variable.
  0.0s|     1 |     0 |    20 |     - |   749k |   0 |  31 |  43 |  43 |   0 |  0 |   0 |   0 |      --      | 1.500000e+01 |    Inf | unknown
r 0.0s|     1 |     0 |    20 |     - |simplero|   0 |  31 |  43 |  43 |   0 |  0 |   0 |   0 |      --      | 1.450000e+01 |    Inf | unknown
Pricing ends with 0 new variable.
  0.0s|     1 |     0 |    20 |     - |   751k |   0 |  31 |  43 |  43 |   0 |  0 |   0 |   0 |      --      | 1.450000e+01 |    Inf | unknown
[solve.c:4561] ERROR: pricing was aborted, but no branching could be created!
[solve.c:4994] ERROR: Error <-10> in function call
[scip_solve.c:2789] ERROR: Error <-10> in function call
terminate called after throwing an instance of 'SCIPException'
  what():  method returned an invalid result code
Aborted (core dumped)

14.5 的目标值确实是预期的最小值,并且生成的列确实为我的问题提供了最佳解决方案。 当打印更多细节时,似乎出现了一些不可行的问题(但这里的日志对我来说变得相当模糊)


Pricing ends with no new variable.
  0.0s|     1 |     0 |    20 |     - |   751k |   0 |  31 |  43 |  43 |   0 |  0 |   0 |   0 |      --      | 1.450000e+01 |    Inf | unknown
Equilibrium scaling LP (persistent)
before scaling: min= 1.00000000e+00 max= 1.34013400e+02 col-ratio= 1.34013400e+02 row-ratio= 4.46711333e+01
Row scaling min= 3.90625000e-03 max= 1.00000000e+00
Col scaling min= 1.00000000e+00 max= 1.00000000e+00
after scaling:  min= 1.17187500e-02 max= 1.00000000e+00 col-ratio= 8.53333333e+01 row-ratio= 4.46711333e+01
ICHBAS02 basis redimensioning invalidates factorization
ICHBAS10 setup slack basis
IBASIS02 loading of Basis invalidates factorization
LP has 0 equations, 0 ranged rows, 3 boxed columns
Round 1:
Simplifier result: 1
simplifier detected infeasibility or unboundedness - solve again without simplifying
ICHBAS09 explicit invalidation of factorization
ICHBAS02 basis redimensioning invalidates factorization
ICHBAS02 basis redimensioning invalidates factorization
ICHBAS10 setup slack basis
IBASIS02 loading of Basis invalidates factorization
Switching to entering algorithm
 --- using hypersparse pricing, sparsity: 0.3750
starting value = 0.00000000e+00
starting shift = 0.00000000e+00
type |   time |   iters | facts |    shift | viol sum | viol num | obj value
  E  |    0.0 |       0 |     2 | 0.00e+00 | 2.11e+00 |        3 | 0.00000000e+00
IENTER02 unboundedness/infeasibility found in enter()
 --- enter finished. iteration: 1, value: 0.00000000e+00, shift: 0.00000000e+00, epsilon: 1.00000000e-16, feastol: 1.00000000e-06, opttol: 1.00000000e              -07
ISOLVE56 stop: 1, basis status: 5 (5), solver status: 0 (0)
Finished solving (status=3, iters=1, leave=0, enter=1, flips=0)
  E  |    0.0 |       1 |     2 | 0.00e+00 | 3.50e+00 |        3 | 0.00000000e+00
 --- unscaling external solution

SoPlex status       : problem is solved [infeasible]
Solving time (sec)  : 0.00
Iterations          : 1
Objective value     : 1.00000000e+100

ICHBAS02 basis redimensioning invalidates factorization
IBASIS02 loading of Basis invalidates factorization
Switching to leaving algorithm
starting value = 0.00000000e+00
starting shift = 0.00000000e+00
  L  |    0.0 |       0 |     1 | 0.00e+00 | 2.50e+00 |        4 | 0.00000000e+00
ILEAVE01 factorization triggered in leave() for feasibility test
 --- refactorizing basis matrix
ILEAVE02 unboundedness/infeasibility found in leave()
 --- leave finished. iteration: 7, value: 0.00000000e+00, shift: 0.00000000e+00, epsilon: 1.00000000e-16, feastol: 1.00000000e-06, opttol: 1.00000000e              -07
ISOLVE57 stop: 1, basis status: 5 (5), solver status: 0 (0)
Finished solving (status=3, iters=7, leave=7, enter=0, flips=2)
  L  |    0.0 |       7 |     2 | 0.00e+00 | 2.90e-01 |        1 | 0.00000000e+00
 --- unscaling external solution

SoPlex status       : problem is solved [infeasible]
Solving time (sec)  : 0.00
Iterations          : 7
Objective value     : 1.00000000e+100

[solve.c:4561] ERROR: pricing was aborted, but no branching could be created!
[solve.c:4994] ERROR: Error <-10> in function call
[scip_solve.c:2789] ERROR: Error <-10> in function call
terminate called after throwing an instance of 'SCIPException'
  what():  method returned an invalid result code
Aborted (core dumped)

将定价回调函数中转换后的问题转储到 .lp 文件并运行它,效果很好,并给出了预期的结果。

由于问题出现在我们可见的代码部分之外,我有点卡住了;如果有人遇到类似的问题或对正在发生的事情有深入的了解,我会很高兴获得一些见解。

c++ optimization linear-programming scip
1个回答
0
投票

在更仔细地阅读了提供的示例后我找到了答案:-(

因为花了一些时间所以我把它发布在这里。

scip_redcost 函数中的

result
指针应设置为 SCIP_SUCCESS - 否则只要生成列,定价器就会工作,但在没有生成列时就会失败。

© www.soinside.com 2019 - 2024. All rights reserved.