Я работаю со смешанным целочисленным квадратичным программированием (MIQP) на CPLEX 12.8.0, Python API.Я сгенерировал модель в файл .lp.Оказалось, что целочисленная модель неосуществима.Это очень странно, потому что раньше я создавал ту же самую проблему с Гуроби, и она разрешима.
Я приложил здесь ссылку на файл .lp и результаты решения с использованием CPLEX и Gurobi.Я объявил некоторые полунепрерывные переменные.Моя целевая функция квадратична, однако я не думаю, что это причина целочисленной неосуществимости, не так ли?В конце концов, я действительно хочу использовать CPLEX для своей работы из-за некоторых функций, которые CPLEX может сделать, но Gurobi не может.
.lp file:
Minimize
obj: - wi0k0 - wi1k0 - wi2k0 - wi3k0 - wi0k1 - wi1k1 - wi2k1 - wi3k1 + [ m0 ^2
+ m1 ^2 + 1.54315034142201 loss0 ^2 + 1.54315034142201 loss1 ^2
+ 1.54315034142201 loss2 ^2 + 1.54315034142201 loss3 ^2 ] / 2
Subject To
c1i0k0: - 2.98563348744947 zi0k0 - ti0k0 <= 0
c2i0k0: - 1.33632173341833 zi0k0 + ti0k0 <= 0
c3i0k0: m0 + 1.33632173341833 zi0k0 - ti0k0 <= 1.33632173341833
c4i0k0: - m0 + 2.98563348744947 zi0k0 + ti0k0 <= 2.98563348744947
c5i0k0: - 2.30258509299405 zi0k0 - wi0k0 <= 0
c6i0k0: 0.22314355131421 zi0k0 + wi0k0 <= 0
c7i0k0: v0 - 0.22314355131421 zi0k0 - wi0k0 <= -0.22314355131421
c8i0k0: - v0 + 2.30258509299405 zi0k0 + wi0k0 <= 2.30258509299405
c1i1k0: - 2.98563348744947 zi1k0 - ti1k0 <= 0
c2i1k0: - 1.33632173341833 zi1k0 + ti1k0 <= 0
c3i1k0: m0 + 1.33632173341833 zi1k0 - ti1k0 <= 1.33632173341833
c4i1k0: - m0 + 2.98563348744947 zi1k0 + ti1k0 <= 2.98563348744947
c5i1k0: - 2.30258509299405 zi1k0 - wi1k0 <= 0
c6i1k0: 0.22314355131421 zi1k0 + wi1k0 <= 0
c7i1k0: v0 - 0.22314355131421 zi1k0 - wi1k0 <= -0.22314355131421
c8i1k0: - v0 + 2.30258509299405 zi1k0 + wi1k0 <= 2.30258509299405
c1i2k0: - 2.98563348744947 zi2k0 - ti2k0 <= 0
c2i2k0: - 1.33632173341833 zi2k0 + ti2k0 <= 0
c3i2k0: m0 + 1.33632173341833 zi2k0 - ti2k0 <= 1.33632173341833
c4i2k0: - m0 + 2.98563348744947 zi2k0 + ti2k0 <= 2.98563348744947
c5i2k0: - 2.30258509299405 zi2k0 - wi2k0 <= 0
c6i2k0: 0.22314355131421 zi2k0 + wi2k0 <= 0
c7i2k0: v0 - 0.22314355131421 zi2k0 - wi2k0 <= -0.22314355131421
c8i2k0: - v0 + 2.30258509299405 zi2k0 + wi2k0 <= 2.30258509299405
c1i3k0: - 2.98563348744947 zi3k0 - ti3k0 <= 0
c2i3k0: - 1.33632173341833 zi3k0 + ti3k0 <= 0
c3i3k0: m0 + 1.33632173341833 zi3k0 - ti3k0 <= 1.33632173341833
c4i3k0: - m0 + 2.98563348744947 zi3k0 + ti3k0 <= 2.98563348744947
c5i3k0: - 2.30258509299405 zi3k0 - wi3k0 <= 0
c6i3k0: 0.22314355131421 zi3k0 + wi3k0 <= 0
c7i3k0: v0 - 0.22314355131421 zi3k0 - wi3k0 <= -0.22314355131421
c8i3k0: - v0 + 2.30258509299405 zi3k0 + wi3k0 <= 2.30258509299405
c9k0: - pi0 + omk0j1 + omk0j2 + omk0j3 + omk0j4 = 0
c10k0: - v0 + 5.78057663816274 omk0j1 - 2.88064275681032 gk0j1
+ 2.81415134341597 omk0j2 - 2.06487580075496 gk0j2
+ 1.87716609698306 omk0j3 - 1.64323243986015 gk0j3
+ 1.41062901675158 omk0j4 - 1.35164676471547 gk0j4 = 0
c11k0: gk0j1 + gk0j2 + gk0j3 + gk0j4 = 1
c12k0j1: - omk0j1 + 0.1 gk0j1 <= 0
c13k0j1: omk0j1 - 0.275 gk0j1 <= 0
c12k0j2: - omk0j2 + 0.275 gk0j2 <= 0
c13k0j2: omk0j2 - 0.45 gk0j2 <= 0
c12k0j3: - omk0j3 + 0.45 gk0j3 <= 0
c13k0j3: omk0j3 - 0.625 gk0j3 <= 0
c12k0j4: - omk0j4 + 0.625 gk0j4 <= 0
c13k0j4: omk0j4 - 0.8 gk0j4 <= 0
c14k0: - 4 pi0 + zi0k0 + zi1k0 + zi2k0 + zi3k0 = 0
c15k0: 1.33632173341833 zi0k0 - ti0k0 - 1.17708699624777 zi1k0 - ti1k0
- 2.28656128473847 zi2k0 - ti2k0 - 2.98563348744947 zi3k0 - ti3k0
= 0
c1i0k1: - 2.98563348744947 zi0k1 - ti0k1 <= 0
c2i0k1: - 1.33632173341833 zi0k1 + ti0k1 <= 0
c3i0k1: m1 + 1.33632173341833 zi0k1 - ti0k1 <= 1.33632173341833
c4i0k1: - m1 + 2.98563348744947 zi0k1 + ti0k1 <= 2.98563348744947
c5i0k1: - 2.30258509299405 zi0k1 - wi0k1 <= 0
c6i0k1: 0.22314355131421 zi0k1 + wi0k1 <= 0
c7i0k1: v1 - 0.22314355131421 zi0k1 - wi0k1 <= -0.22314355131421
c8i0k1: - v1 + 2.30258509299405 zi0k1 + wi0k1 <= 2.30258509299405
c1i1k1: - 2.98563348744947 zi1k1 - ti1k1 <= 0
c2i1k1: - 1.33632173341833 zi1k1 + ti1k1 <= 0
c3i1k1: m1 + 1.33632173341833 zi1k1 - ti1k1 <= 1.33632173341833
c4i1k1: - m1 + 2.98563348744947 zi1k1 + ti1k1 <= 2.98563348744947
c5i1k1: - 2.30258509299405 zi1k1 - wi1k1 <= 0
c6i1k1: 0.22314355131421 zi1k1 + wi1k1 <= 0
c7i1k1: v1 - 0.22314355131421 zi1k1 - wi1k1 <= -0.22314355131421
c8i1k1: - v1 + 2.30258509299405 zi1k1 + wi1k1 <= 2.30258509299405
c1i2k1: - 2.98563348744947 zi2k1 - ti2k1 <= 0
c2i2k1: - 1.33632173341833 zi2k1 + ti2k1 <= 0
c3i2k1: m1 + 1.33632173341833 zi2k1 - ti2k1 <= 1.33632173341833
c4i2k1: - m1 + 2.98563348744947 zi2k1 + ti2k1 <= 2.98563348744947
c5i2k1: - 2.30258509299405 zi2k1 - wi2k1 <= 0
c6i2k1: 0.22314355131421 zi2k1 + wi2k1 <= 0
c7i2k1: v1 - 0.22314355131421 zi2k1 - wi2k1 <= -0.22314355131421
c8i2k1: - v1 + 2.30258509299405 zi2k1 + wi2k1 <= 2.30258509299405
c1i3k1: - 2.98563348744947 zi3k1 - ti3k1 <= 0
c2i3k1: - 1.33632173341833 zi3k1 + ti3k1 <= 0
c3i3k1: m1 + 1.33632173341833 zi3k1 - ti3k1 <= 1.33632173341833
c4i3k1: - m1 + 2.98563348744947 zi3k1 + ti3k1 <= 2.98563348744947
c5i3k1: - 2.30258509299405 zi3k1 - wi3k1 <= 0
c6i3k1: 0.22314355131421 zi3k1 + wi3k1 <= 0
c7i3k1: v1 - 0.22314355131421 zi3k1 - wi3k1 <= -0.22314355131421
c8i3k1: - v1 + 2.30258509299405 zi3k1 + wi3k1 <= 2.30258509299405
c9k1: - pi1 + omk1j1 + omk1j2 + omk1j3 + omk1j4 = 0
c10k1: - v1 + 5.78057663816274 omk1j1 - 2.88064275681032 gk1j1
+ 2.81415134341597 omk1j2 - 2.06487580075496 gk1j2
+ 1.87716609698306 omk1j3 - 1.64323243986015 gk1j3
+ 1.41062901675158 omk1j4 - 1.35164676471547 gk1j4 = 0
c11k1: gk1j1 + gk1j2 + gk1j3 + gk1j4 = 1
c12k1j1: - omk1j1 + 0.1 gk1j1 <= 0
c13k1j1: omk1j1 - 0.275 gk1j1 <= 0
c12k1j2: - omk1j2 + 0.275 gk1j2 <= 0
c13k1j2: omk1j2 - 0.45 gk1j2 <= 0
c12k1j3: - omk1j3 + 0.45 gk1j3 <= 0
c13k1j3: omk1j3 - 0.625 gk1j3 <= 0
c12k1j4: - omk1j4 + 0.625 gk1j4 <= 0
c13k1j4: omk1j4 - 0.8 gk1j4 <= 0
c14k1: - 4 pi1 + zi0k1 + zi1k1 + zi2k1 + zi3k1 = 0
c15k1: 1.33632173341833 zi0k1 - ti0k1 - 1.17708699624777 zi1k1 - ti1k1
- 2.28656128473847 zi2k1 - ti2k1 - 2.98563348744947 zi3k1 - ti3k1
= 0
c16i0: zi0k0 + zi0k1 = 1
c16i1: zi1k0 + zi1k1 = 1
c16i2: zi2k0 + zi2k1 = 1
c16i3: zi3k0 + zi3k1 = 1
c17k0: zi0k0 + zi1k0 + zi2k0 + zi3k0 >= 0.4
c18k0: zi0k0 + zi1k0 + zi2k0 + zi3k0 <= 3.2
c17k1: zi0k1 + zi1k1 + zi2k1 + zi3k1 >= 0.4
c18k1: zi0k1 + zi1k1 + zi2k1 + zi3k1 <= 3.2
c21k0: m0 - m1 <= 0
c22: pi0 + pi1 = 1
c23i0: ti0k0 + ti0k1 + loss0 = 1.33632173341833
c23i1: ti1k0 + ti1k1 + loss1 = -1.17708699624777
c23i2: ti2k0 + ti2k1 + loss2 = -2.28656128473847
c23i3: ti3k0 + ti3k1 + loss3 = -2.98563348744947
Bounds
0.1 <= pi0 <= 0.8
-2.98563348744947 <= m0 <= 1.33632173341833
-2.30258509299405 <= v0 <= -0.22314355131421
0 <= zi0k0 <= 1
-2.98563348744947 <= ti0k0 <= 1.33632173341833
-2.30258509299405 <= wi0k0 <= -0.22314355131421
0 <= zi1k0 <= 1
-2.98563348744947 <= ti1k0 <= 1.33632173341833
-2.30258509299405 <= wi1k0 <= -0.22314355131421
0 <= zi2k0 <= 1
-2.98563348744947 <= ti2k0 <= 1.33632173341833
-2.30258509299405 <= wi2k0 <= -0.22314355131421
0 <= zi3k0 <= 1
-2.98563348744947 <= ti3k0 <= 1.33632173341833
-2.30258509299405 <= wi3k0 <= -0.22314355131421
0.1 <= omk0j1 <= 0.8
0 <= gk0j1 <= 1
0.1 <= omk0j2 <= 0.8
0 <= gk0j2 <= 1
0.1 <= omk0j3 <= 0.8
0 <= gk0j3 <= 1
0.1 <= omk0j4 <= 0.8
0 <= gk0j4 <= 1
0.1 <= pi1 <= 0.8
-2.98563348744947 <= m1 <= 1.33632173341833
-2.30258509299405 <= v1 <= -0.22314355131421
0 <= zi0k1 <= 1
-2.98563348744947 <= ti0k1 <= 1.33632173341833
-2.30258509299405 <= wi0k1 <= -0.22314355131421
0 <= zi1k1 <= 1
-2.98563348744947 <= ti1k1 <= 1.33632173341833
-2.30258509299405 <= wi1k1 <= -0.22314355131421
0 <= zi2k1 <= 1
-2.98563348744947 <= ti2k1 <= 1.33632173341833
-2.30258509299405 <= wi2k1 <= -0.22314355131421
0 <= zi3k1 <= 1
-2.98563348744947 <= ti3k1 <= 1.33632173341833
-2.30258509299405 <= wi3k1 <= -0.22314355131421
0.1 <= omk1j1 <= 0.8
0 <= gk1j1 <= 1
0.1 <= omk1j2 <= 0.8
0 <= gk1j2 <= 1
0.1 <= omk1j3 <= 0.8
0 <= gk1j3 <= 1
0.1 <= omk1j4 <= 0.8
0 <= gk1j4 <= 1
0 <= loss0 <= 4.3219552208678
-2.5134087296661 <= loss1 <= 1.80854649120169
-3.6228830181568 <= loss2 <= 0.699072202710996
-4.3219552208678 <= loss3 <= 0
Binaries
zi0k0 zi1k0 zi2k0 zi3k0 gk0j1 gk0j2 gk0j3 gk0j4 zi0k1 zi1k1 zi2k1
zi3k1 gk1j1 gk1j2 gk1j3 gk1j4
Semi-Continuous
ti0k0 wi0k0 ti1k0 wi1k0 ti2k0 wi2k0 ti3k0 wi3k0 omk0j1 omk0j2
omk0j3 omk0j4 ti0k1 wi0k1 ti1k1 wi1k1 ti2k1 wi2k1 ti3k1 wi3k1
omk1j1 omk1j2 omk1j3 omk1j4
End
Здесь Gurobi может решить модель, но не CPLEX.
Выход CPLEX:
Выход Gurobi: