我已经模拟了 MILP 问题。
执行代码时
m.Optimize()
输出如下所示:
Optimize a model with 798001 rows, 312006 columns and 2117780 nonzeros
Variable types: 1920 continuous, 310086 integer (310080 binary)
Coefficient statistics:
Matrix range [3e-01, 2e+04]
Objective range [1e-01, 9e+02]
Bounds range [1e+00, 3e+04]
RHS range [3e-01, 3e+04]
Presolve removed 725090 rows and 191031 columns
Presolve time: 3.22s
Explored 0 nodes (0 simplex iterations) in 3.59 seconds
Thread count was 1 (of 8 available processors)
Solution count 0
Model is infeasible
Best objective -, best bound -, gap -
但是当执行下面的代码时:
copy1 = m.copy()
if m.status == GRB.INFEASIBLE:
copy1.feasRelaxS(1, True, False, True)
copy1.optimize()
输出如下所示:
Solve phase I feasrelax model to determine minimal relaxation
Optimize a model with 798001 rows, 1114022 columns and 2919796 nonzeros
Model has 802016 quadratic objective terms
Variable types: 803936 continuous, 310086 integer (310080 binary)
Coefficient statistics:
Matrix range [3e-01, 2e+04]
Objective range [0e+00, 0e+00]
QObjective range [2e+00, 2e+00]
Bounds range [1e+00, 3e+04]
RHS range [3e-01, 3e+04]
Found heuristic solution: objective 3.175944e+24
Presolve removed 1620 rows and 64056 columns (presolve time = 6s) ...
Presolve removed 1620 rows and 64056 columns
Presolve time: 5.59s
Presolved: 796381 rows, 1049966 columns, 2909656 nonzeros
Presolved model has 800396 quadratic objective terms
Found heuristic solution: objective 3.169464e+24
Variable types: 802316 continuous, 247650 integer (247650 binary)
在这里它指定模型具有二次目标项。
有人可以指导我这两者之间到底有什么区别吗?为什么它给模型有二次项?