Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
Expand all | Collapse all

addMipStart has no effect

  • 1.  addMipStart has no effect

    Posted Mon April 01, 2013 02:22 PM

    Originally posted by: SystemAdmin


    Hello,

    i hope someone here is able to help me. I'm using cplex 12.1 from Java. I try to solve a model via branch and cut using goals. Since the problem instances are really hard, I would like to provide a solution that my heuristic has found before as a starting point.

    I tried to inject a solution via a SolutionGoal, but that didn't seem to have any effect. I then tried to use the addMipStart()-method. I tried different efforts and checked the AdvInd-Parameter (of course, it has its default value 1).
    I build my model, read in my solution, save all my variables and values in arrays, then call the addMipStart() and after that solve(MyBranchGoal).

    But the call to addMipStart has no effect. In another thread, I read something about a warning, that cplex couldn't build a solution from provided MipStart. I do not even get this warning :-/

    My provided solution is correct (for small instances, cplex manages to calculate it for himself) and I'm sure that my execute()-Method accepts it.

    Now can someone help me? Thank you very much in advance!
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: addMipStart has no effect

    Posted Tue April 02, 2013 04:40 PM

    Originally posted by: SystemAdmin


    There should be a message in the log indicating how many starting solutions were accepted when you use addMIPStart. Is it there, and does it indicate your starting solution was accepted?

    MIP starts are not always as useful as (good) LP starts. Is the incumbent value at the root node at least as good as what your starting solution provides? If the starting solution is strictly better than what you are getting at the root, there may indeed be a problem.

    Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: addMipStart has no effect

    Posted Wed April 03, 2013 07:26 AM

    Originally posted by: SystemAdmin


    Thank you for your answer. When I call just cplex.solve() after I provided the MIP start, there is a message that "1 of 1 MIP starts provided solutions" and everything is fine with my small model used for testing.
    But when i call cplex.solve(myBranchGoal) then there is no message at all, but instead the warning that "Control callbacks may disable some MIP features".

    Is the warm start disabled or is something wrong with my goal or is it some other thing?
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: addMipStart has no effect

    Posted Wed April 03, 2013 07:58 AM

    Originally posted by: SystemAdmin


    Update: I now switched to 12.4, but the problem remains the same.

    (sorry for double-posting, I didn't know how to edit my old post)
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: addMipStart has no effect

    Posted Wed April 03, 2013 08:51 AM

    Originally posted by: SystemAdmin


    Sorry, my fault. If goals are used then parameter AdvInd is internally explicitly set to 0. This means that using goals implicitly disables MIP starts :-(
    There are two ways to work around this problem:
    1. Inject the MIP start from the initial goal (using a SolutionGoal).
    2. Use callbacks instead of goals. In general callbacks are preferred over goals since they are easier and cleaner to implement and also allow more flexibility.
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: addMipStart has no effect

    Posted Wed April 03, 2013 09:57 AM

    Originally posted by: SystemAdmin


    Ok, thanks. I remember that a solutionGoal did not work either when I tried them before, but I guess I just used them not correctly. So now I did this:

    
    Goal solution = cplex.solutionGoal(varArray, valArray); cplex.solve(cplex.and(solution, myBranchGoal));
    


    Is this correct? Because now the output looks like

    
    Nodes Cuts/  Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap         Variable B NodeID Parent  Depth   0     0     6827.6694   440                   6827.6694     2500 0     0     7077.7701   394                  Cuts: 3025     4679 0     0     7160.0750   431                  Cuts: 3025     6554 0     0     7198.2566   353                  Cuts: 2540     7666 0     0     7210.7158   365                  Cuts: 2030     8670 0     0     7212.9395   424                  Cuts: 1650     9692 0     0     7216.0363   344                  Cuts: 2119    10300 0     0     7218.0493   375                   Cuts: 974    11455 0     0     7221.5599   431                  Cuts: 1936    12906 0     0     7228.8707   465                  Cuts: 1571    14265 0     0     7236.8478   446                  Cuts: 1875    15255 0     0     7240.6325   446                  Cuts: 2751    16279 0     0     7249.0409   442                  Cuts: 1637    16919 0     0     7255.7220   432                  Cuts: 1233    17833 0     0     7258.9692   453                  Cuts: 2233    19444 0     0     7270.1384   479                  Cuts: 2039    21553 0     0     7278.9532   493                  Cuts: 1731    22567 0     0     7280.7677   525                   Cuts: 989    24707 0     0     7281.0454   407                  Cuts: 2633    25350 0     0     7281.0886   428                  Cuts: 1422    25795 0     0     7281.1758   359                   Cuts: 636    26198 0     0     7281.1758   403                  Cuts: 2063    26718 0     1     7281.1758   350               Local Cut: 339    26718                                 0 0 Elapsed real time =  42.87 sec. (tree size =  0.00 MB, solutions = 0) *     1     0      integral     0    14601.6000    14601.6000    27081    0.00%                 X      1      0      1
    


    and I don't know whether I can trust this 0.00% gap. Of course, it could be, that all my heuristic solutions are optimal, I don't know.
    Does this look like a trustworthy output?
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: addMipStart has no effect

    Posted Wed April 03, 2013 10:46 AM

    Originally posted by: SystemAdmin


    Actually, this looks like the solution goal is not used. Instead the LP relaxation is eventually integral and CPLEX stops.
    Can you reproduce this with a plain solve() (without goals)?
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: addMipStart has no effect

    Posted Wed April 03, 2013 02:24 PM

    Originally posted by: SystemAdmin


    No, if I call a plain solve(), then I get this:
    
    Tried aggregator 2 times. MIP Presolve eliminated 58690 rows and 19777 columns. MIP Presolve modified 12268 coefficients. Aggregator did 17 substitutions. Reduced MIP has 11226 rows, 15174 columns, and 60884 nonzeros. Reduced MIP has 14896 binaries, 0 generals, 0 SOSs, and 0 indicators. Probing time =    0.01 sec. Tried aggregator 1 time. MIP Presolve modified 22 coefficients. Reduced MIP has 11226 rows, 15174 columns, and 60884 nonzeros. Reduced MIP has 14896 binaries, 0 generals, 0 SOSs, and 0 indicators. Presolve time =    0.18 sec. Probing time =    0.01 sec. Clique table members: 13245. MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic, using up to 8 threads. Root relaxation solution time =    0.24 sec.   Nodes                                         Cuts/  Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap   0     0     6829.0580   408                   6829.0580     2305 0     0     7098.2328   450                  Cuts: 2906     4019 0     0     7175.3509   436                  Cuts: 2883     6379 0     0     7202.9259   447                  Cuts: 2906     8598 0     0     7210.0576   359                  Cuts: 2906     9138 0     0     7211.9976   367                  Cuts: 1582     9565 0     0     7213.0228   373                  Cuts: 1172     9964 0     0     7213.5708   399                  Cuts: 1464    10394 0     0     7213.7150   390                  Cuts: 1058    10616 0     0     7213.8830   377                   Cuts: 781    10905 0     0     7219.0452   392                   Cuts: 468    11288 0     0     7232.6891   376                  Cuts: 1901    11696 0     0     7232.7644   391                  Cuts: 1187    12038 0     0     7232.9083   344                   Cuts: 557    12263 0     0     7233.2617   358                  Cuts: 1599    12711 0     2     7233.2617   308                   7233.2617    12711 Elapsed real time =  24.10 sec. (tree size =  0.01 MB, solutions = 0) 3     5     7326.0538   325                   7254.5238    13760 8    10     7265.2447   343                   7254.5238    14001 11    13     7431.2665   346                   7260.1962    15570 14    16     7348.2742   379                   7260.1962    18508 23    25     7459.2622   406                   7260.1962    22020 26    28     7362.5955   368                   7260.1962    25183 30    32     7476.5408   429                   7265.4186    28997 45    47     7387.3326   381                   7265.4186    45750 50    52     7602.6065   369 7265.4186    46898 74    76     7297.7719   346                   7265.4186    58793 Elapsed real time =  34.62 sec. (tree size =  0.07 MB, solutions = 0) 108   110     7481.4712   376                   7265.4186    76575 191   193     7591.3825   348                   7265.4186   106322 217   219     7383.9225   369                   7265.4186   108515 300   302     7447.0805   335                   7265.4186   119128 389   391     7698.4258   301                   7265.4186   133121 591   589     7954.5078   300                   7265.4186   160039 847   823     7276.2802   404                   7265.4186   177672 1008   967     7662.9971   405                   7279.1997   195858 1269  1203     7623.7649   444                   7292.3279   219831 1364  1298     7624.0886   356                   7292.3279   231843 Elapsed real time =  72.47 sec. (tree size = 95.61 MB, solutions = 0) 1521  1439     7744.3292   358                   7292.3279   245900 1569  1487     8054.9555   357                   7292.3279   253086 1921  1826     7908.8504   293                   7292.3279   285156 1966  1871     8072.3217   372                   7292.3279   291706 2404  2303     7506.8877   356                   7292.3279   326173 2466  2365     7585.3108   359                   7292.3279   334887 2618  2509     7733.4143   317                   7292.3279   350003 3003  2878     9959.9911   215                   7292.3279   378041 3086  2950     7807.0068   299                   7292.3279   389011 3290  3142     7797.1968   447                   7292.3279   408763 Elapsed real time = 114.31 sec. (tree size = 322.35 MB, solutions = 0) Nodefile size = 174.26 MB (128.84 MB after compression) 3538  3384     7551.2591   387                   7303.4393   426136 3598  3444     7656.7901   386                   7303.4393   434684 3608  3454     7486.7940   279                   7486.7940   467985 3610  3455     7504.3699   300                   7489.8630   468757 3611  3455     7750.6437   361                   7489.8630   471010 3613  3455     7505.0647   294                   7504.1799   472232 3616  3457     7804.9122   355                   7504.1799   473598 3620  3459     7771.0121   330                   7504.1799   479500 3625  3463     7785.6697   302                   7504.1799   485311 3631  3466     7808.6606   320                   7504.1799   485915 Elapsed real time = 191.64 sec. (tree size = 126.71 MB, solutions = 0) 3642  3472     7563.7539   352                   7504.1799   489780 3675  3493     7851.2528   314                   7504.1799   503818 3707  3510     7970.7027   327                   7504.1799   514528 3754  3540     8002.6642   292                   7504.1799   527445 3854  3604     7945.7636   354                   7504.1799   546388 4059  3703     8079.3811   314                   7504.1799   565791 4246  3801     7674.0461   301                   7504.1799   579509 4507  3955     8137.4877   247                   7504.1799   598371 4583  3993     8119.2731   269                   7504.1799   603323 4864  4154     8196.6104   275                   7504.1799   619746 Elapsed real time = 234.58 sec. (tree size = 206.06 MB, solutions = 0) 5120  4310     8502.7843   255                   7504.1799   633312 5192  4358     8547.9821   367                   7504.1799   638535 5653  4639     8635.9977   279                   7504.1799   654282 6178  4954    10458.7527   258                   7504.1799   672889 6686  5242     8154.2026   285 7504.1799   687144 7038  5433     8202.9246   252                   7504.1799   697967 7490  3858     7277.6996   498                   7504.1799   716584 7491  3859     7307.3156   437                   7504.1799   716798 7492  3860     7356.9091   380                   7504.1799   717723 7495  3863     7397.3560   415                   7504.1799   718852 Elapsed real time = 321.20 sec. (tree size = 127.43 MB, solutions = 0) 7500  3864     7594.5720   351                   7504.1799   720354 7508  3868     7735.1813   414                   7504.1799   722051 7519  3874     7558.5716   354                   7504.1799   727184 7529  3881     7641.6534   375                   7504.1799   729737 7538  3887     7498.9991   445                   7504.1799   734685 7552  3895     7536.2007   414                   7504.1799   739865 7573  3909     7859.4426   391                   7504.1799   748996 7604  3929     7743.9536   367                   7504.1799   753064 7611  3934     8167.9653   445                   7504.1799   757963 7638  3953     7618.2876   387                   7504.1799   767054 Elapsed real time = 358.17 sec. (tree size = 127.21 MB, solutions = 0) 7665  3966     7898.4338   349                   7504.1799   779783 7671  3969     7906.9622   427                   7504.1799   785137 7686  3978     7911.9758   456                   7504.1799   790510 7723  3994     7761.3061   476                   7504.1799   797630 7765  4020     8027.8459   404                   7504.1799   808120 7800  4033     8004.0790   372                   7504.1799   817832 7833  4051     7938.8045   354                   7504.1799   821158 7883  4080     8018.2264   371                   7504.1799   825810 7900  4086     8029.6664   360                   7504.1799   830159 7953  4110     8064.4950   362                   7504.1799   836741 Elapsed real time = 402.40 sec. (tree size = 144.47 MB, solutions = 0) 7968  4118     8289.9262   315                   7504.1799   837674 8034  4157     8169.1923   398                   7504.1799   845760 8066  4173     8206.3845   374                   7504.1799   849125 8076  4179     8678.3310   485                   7504.1799   854366 8129  4206     8627.8121   366                   7504.1799   859569 8213  4255     8408.7736   431                   7504.1799   870145 8302  4310     8272.6034   316                   7504.1799   879463 8350  4337     8281.8591   398                   7504.1799   885318 8404  4369     8669.5644   405                   7504.1799   890686 8463  4403     8244.9344   337                   7504.1799   900425 Elapsed real time = 458.16 sec. (tree size = 192.42 MB, solutions = 0) 8513  4433     8727.5872   320                   7504.1799   905884 8556  4452     8410.3021   403                   7504.1799   911966 8594  4477     8920.7667   324                   7504.1799   916995 8650  4513     9146.7325   312                   7504.1799   923295 8700  4542     9239.7049   305                   7504.1799   928252 8748  4568     9316.7516   315                   7504.1799   931416 8846  4622     8327.6781   292                   7504.1799   938573 8859  4629     8483.6474   321                   7504.1799   939705 8972  4692     8716.4693   311                   7504.1799   948980 9194  4813     8744.8404   298                   7504.1799   972224 Elapsed real time = 515.93 sec. (tree size = 257.36 MB, solutions = 0) Nodefile size = 20.14 MB (18.32 MB after compression) 9449  4953     7645.5639   436                   7504.1799   998881 9672  5071     9629.2893   284                   7504.1799  1021194 9904  5200     8970.2122   368                   7504.1799  1050232 10143  5334     9220.1766   277                   7504.1799  1078918 10371  5453     9042.4816   376                   7504.1799  1105169 10642  5610     8921.7804   284                   7504.1799  1129239 10853  5717    infeasible                         7504.1799  1172254 11280  5944     8138.7578   364                   7504.1799  1209948 11642  6159    11060.1769   324                   7504.1799  1250357 12008  6366     7965.0636   410                   7504.1799  1285896 Elapsed real time = 689.91 sec. (tree size = 508.49 MB, solutions = 0) Nodefile size = 303.89 MB (274.31 MB after compression) 12353  6546    11074.7652   261                   7504.1799  1319930 12700  6715     8797.0810   422                   7504.1799  1357302 12984  6868     9316.0489   357                   7504.1799  1405903 13135  6953    11084.8094   351                   7504.1799  1425344 13446  7120     9020.0317   311                   7504.1799  1469884 13456  7124    11087.5713   369                   7504.1799  1483223 13808  7332    11127.3781   333                   7504.1799  1525117 14339  7648     9235.3795   352                   7504.1799  1585717 14363  7663     9237.1717   403                   7504.1799  1599256 14931  7970    11145.1448   359                   7504.1799  1664097 Elapsed real time = 861.08 sec. (tree size = 785.79 MB, solutions = 0) Nodefile size = 617.50 MB (558.45 MB after compression) 14963  7986    11146.6203   367                   7504.1799  1683387 15784  8462     9277.3878   268                   7504.1799  1750071 15799  8470    11150.1225   383                   7504.1799  1762801 15933 8530    infeasible                         7504.1799  1811003 16600  8952    11150.1225   374                   7504.1799  1872612 16680  9032    11150.1225   351                   7504.1799  1885926 17400  9731    11151.1799   333                   7504.1799  1957910 17480  9811    11153.8862   293                   7504.1799  1967783 18383 10696    11154.0159   310                   7504.1799  2057718 18519 10827    11157.6936   318                   7504.1799  2091981 Elapsed real time = 1032.08 sec. (tree size = 1152.84 MB, solutions = 0) Nodefile size = 998.69 MB (902.47 MB after compression) 18559 10863    11159.4965   346                   7504.1799  2105168 19105 11409    11165.7250   366                   7597.4516  2201082 19537 11841    11171.8366   273                   7597.4516  2255255 20190 12494     8313.6031   439                   7624.9808  2323184 20394 12696    infeasible                         7624.9808  2367775 20938 13238    infeasible                         7624.9808  2465950 21901 14189     8287.1500   377                   7646.7275  2596020 22181 14469     8731.4802   339                   7646.7275  2631762 22956 15234     8222.0669   395                   7646.7275  2720979 23169 15447     8131.8687   361                   7646.7275  2748270 Elapsed real time = 1237.60 sec. (tree size = 1714.34 MB, solutions = 0) Nodefile size = 1557.47 MB (1408.59 MB after compression) 23566 15844     8309.5316   422                   7646.7275  2787039 23891 16169     8566.2889   351                   7658.5786  2828162 24073 16349     9508.1979   434                   7658.5786  2857606 24604 16874    10330.0255   369                   7658.5786  2937639 24884 17154     8850.6568   335                   7658.5786  2975029 25623 17890     9634.5392   417 7677.5706  3066061 25961 18228     8618.2641   325                   7677.5706  3115754 26659 18926    10660.3779   177                   7677.5706  3186566 26726 18993     9985.1155   443                   7677.5706  3202036 26799 19064    infeasible                         7677.5706  3245887 Elapsed real time = 1426.21 sec. (tree size = 2181.37 MB, solutions = 0) Nodefile size = 2027.40 MB (1833.46 MB after compression) 27350 19611    infeasible                         7681.7136  3332113 27414 19673    infeasible                         7681.7136  3354959 28202 20452     8027.3785   342                   7681.7136  3481700 28531 20781     8824.8980   303                   7681.7136  3532830 29120 21369     8902.2568   445                   7698.8950  3609395 29240 21489     9505.4703   423                   7698.8950  3628214 30047 22296     9799.5820   289                   7700.9640  3742829 30067 22316     9532.7926   417                   7700.9640  3755336 30203 22452     9558.0717   352                   7700.9640  3776961 30796 23035     9657.2274   420                   7700.9640  3857128 Elapsed real time = 1613.13 sec. (tree size = 2690.18 MB, solutions = 0) Nodefile size = 2537.03 MB (2285.80 MB after compression) 30868 23107     9648.6510   279                   7700.9640  3872995 31004 23241    infeasible                         7700.9640  3912608 31631 23866     9338.7124   407                   7700.9640  4028519 32520 24751     8105.7249   354                   7709.9644  4175131 32888 25119     8500.5238   465                   7709.9644  4237691 33390 25621     9219.4448   431                   7713.1863  4322093 33616 25847     8265.6311   363                   7713.1863  4371687 33927 26158     8538.1359   381                   7713.1863 4416208 34159 26390     8764.7548   395                   7713.1863  4448464 34479 26710     8849.3247   286                   7713.1863  4487782 Elapsed real time = 1818.30 sec. (tree size = 3100.64 MB, solutions = 0) Nodefile size = 2942.46 MB (2646.88 MB after compression) 34793 27024     9017.2377   440                   7713.1863  4528204 35312 27543     9084.6528   253                   7719.5977  4593558 35438 27669     8931.2700   430                   7719.5977  4627871 36074 28304     9506.1914   380                   7719.5977  4733313 36278 28508     8328.2339   327                   7719.5977  4769789 36430 28660     8525.0979   413                   7719.5977  4799891 36973 29199     8722.6698   326                   7727.4389  4890955 37060 29285     9581.7953   348                   7727.4389  4909811 37306 29523    11408.7488   359                   7727.4389  4946313 37802 30018     7972.0398   419                   7727.4389  5003597 Elapsed real time = 1975.97 sec. (tree size = 3556.04 MB, solutions = 0) Nodefile size = 3402.53 MB (3059.24 MB after compression) 38066 30282     8384.0538   379                   7727.4389  5037697 38162 30378     8462.8706   412                   7727.4389  5059840 38767 30979     9073.1188   299                   7731.0814  5161018 38943 31155     9198.7712   312                   7731.0814  5193779 39031 31243     9349.3576   309                   7731.0814  5213804
    


    and then cplex crashes / is killed. There is not enough RAM for that. But I doubt that cplex manages to create an integer solution within my 1 hour time limit.

    The solution value 14601.6 from the other post is the one from my heuristic solution.
    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: addMipStart has no effect

    Posted Thu April 04, 2013 02:53 AM

    Originally posted by: SystemAdmin


    So it looks like something is wrong with your solution goal.
    How exactly do you use this goal? Could you provided a code snippet or pseudo code?
    Could you please also try to do a plain solve() (without goals) using your solution as MIP start. Does this produce the same (quick) solution as with the goals?
    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: addMipStart has no effect

    Posted Thu April 04, 2013 06:32 AM

    Originally posted by: SystemAdmin


    Thank you very much for your help!

    When I use a plain solve() and provide a MIP start before, this doesn't produce the same quick solution, but instead it does this:
    
    1 of 1 MIP starts provided solutions. MIP start 
    'm1' defined initial solution with objective 14601.6000. Tried aggregator 2 times. MIP Presolve eliminated 58690 rows and 19777 columns. MIP Presolve modified 12268 coefficients. Aggregator did 17 substitutions. Reduced MIP has 11226 rows, 15174 columns, and 60884 nonzeros. Reduced MIP has 14896 binaries, 0 generals, 0 SOSs, and 0 indicators. Probing time =    0.01 sec. Tried aggregator 1 time. MIP Presolve modified 22 coefficients. Reduced MIP has 11226 rows, 15174 columns, and 60884 nonzeros. Reduced MIP has 14896 binaries, 0 generals, 0 SOSs, and 0 indicators. Presolve time =    0.17 sec. Probing time =    0.01 sec. Clique table members: 13245. MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic, using up to 8 threads. Root relaxation solution time =    0.24 sec.   Nodes                                         Cuts/  Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap   *     0+    0                        14601.6000                   2305     --- 0     0     6829.0580   408    14601.6000 6829.0580     2305   53.23% *     0+    0                        14558.4000     6829.0580     4019   53.09% 0     0     7098.2328   450    14558.4000    Cuts: 2906     4019   51.24% 0     0     7175.3509   436    14558.4000    Cuts: 2883     6379   50.71% 0     0     7202.9259   447    14558.4000    Cuts: 2906     8598   50.52% 0     0     7210.0576   359    14558.4000    Cuts: 2906     9138   50.47% 0     0     7211.9976   367    14558.4000    Cuts: 1582     9565   50.46% 0     0     7213.0228   373    14558.4000    Cuts: 1172     9964   50.45% 0     0     7213.5708   399    14558.4000    Cuts: 1464    10394   50.45% 0     0     7213.7150   390    14558.4000    Cuts: 1058    10616   50.45% 0     0     7213.8830   377    14558.4000     Cuts: 781    10905   50.45% 0     0     7219.0452   392    14558.4000     Cuts: 468    11288   50.41% 0     0     7232.6891   376    14558.4000    Cuts: 1901    11696   50.32% 0     0     7232.7644   391    14558.4000    Cuts: 1187    12038   50.32% 0     0     7232.9083   344    14558.4000     Cuts: 557    12263   50.32% 0     0     7233.2617   358    14558.4000    Cuts: 1599    12711   50.32% 0     2     7233.2617   308    14558.4000     7233.2617    12711   50.32% Elapsed real time =  21.98 sec. (tree size =  0.01 MB, solutions = 2) 3     5     7326.0538   343    14558.4000     7254.5238    14092   50.17% 10    12     7457.4622   342    14558.4000     7254.5238    14684   50.17% 11    13     7431.2665   372    14558.4000     7260.1962    16186   50.13% 20    22     7274.3916   347    14558.4000     7260.1962    25194   50.13% 27    29     7261.7543   366    14558.4000     7260.9019    29588   50.13% 37    39     7348.2788   356    14558.4000     7260.9019    31624   50.13% 45    47     7276.9944   360    14558.4000     7260.9019    33487   50.13% 108   110     7363.1960   347    14558.4000     7273.7419    43729   50.04% 113   115     7633.7196 338    14558.4000     7273.7419    44711   50.04% 180   182     7361.9128   355    14558.4000     7274.3916    58914   50.03% Elapsed real time =  32.86 sec. (tree size =  1.94 MB, solutions = 2) 392   383     7422.5157   337    14558.4000     7274.3916    77989   50.03% 493   484     8207.3813   252    14558.4000     7274.3916    90783   50.03% 574   559     7384.5115   368    14558.4000     7274.3916    97632   50.03% 791   776     7868.4767   388    14558.4000     7274.3916   119862   50.03% 976   947     7883.7320   374    14558.4000     7274.3916   137808   50.03% 1319  1275     7281.0398   360    14558.4000     7274.3916   165152   50.03% 1681  1631    10212.5736   189    14558.4000     7274.3916   190033   50.03% 1739  1689     7497.9951   364    14558.4000     7274.3916   198159   50.03% 2118  2035    11177.2155   170    14558.4000     7274.3916   228851   50.03% 2194  2108     7778.7904   417    14558.4000     7274.3916   240094   50.03% Elapsed real time =  74.80 sec. (tree size = 231.62 MB, solutions = 2) Nodefile size = 94.75 MB (72.02 MB after compression) 2474  2364     7793.4509   411    14558.4000     7274.3916   267515   50.03% 2605  2495     7921.8589   351    14558.4000     7274.3916   283420   50.03% 2942  2810     7844.6079   355    14558.4000     7274.3916   314100   50.03% 3041  2909     7753.1512   386    14558.4000     7274.3916   325649   50.03% 3145  3002     7855.3195   347    14558.4000     7274.3916   335826   50.03% 3444  3289     7495.5990   282    14558.4000     7495.5990   384843   48.51% 3446  3290     7745.3891   359    14558.4000     7497.3791   385822   48.50% 3447  3291     7542.5425   327    14558.4000     7497.3791   386446   48.50% 3450  3294     7554.2165   320    14558.4000     7497.3791   387692   48.50% 3453  3295     7557.3007   348    14558.4000     7530.0914   389400   48.28% Elapsed real time = 154.07 sec. (tree size = 127.82 MB, solutions = 2) 3459  3299     7565.5245   332    14558.4000 7530.0914   392180   48.28% 3470  3306     7567.2823   323    14558.4000     7539.3823   398030   48.21% 3490  3319     7802.5363   313    14558.4000     7539.3823   402868   48.21% 3506  3325     7561.4480   314    14558.4000     7539.3823   409018   48.21% 3514  3329     7659.7242   286    14558.4000     7539.3823   413672   48.21% 3563  3357     7994.3552   331    14558.4000     7539.3823   426081   48.21% 3580  3368     7635.6824   344    14558.4000     7539.3823   430441   48.21% 3610  3386     7599.9264   333    14558.4000     7539.3823   436656   48.21% 3658  3414     7982.7474   394    14558.4000     7539.3823   450108   48.21% 3736  3453     7650.9891   372    14558.4000     7539.3823   474727   48.21% Elapsed real time = 186.61 sec. (tree size = 129.62 MB, solutions = 2) 3838  3512     8209.0515   280    14558.4000     7539.3823   488915   48.21% 3956  3578     8735.2891   332    14558.4000     7539.3823   502149   48.21% 4077  3650     8786.1274   310    14558.4000     7539.3823   516446   48.21% 4251  3743     8171.1861   245    14558.4000     7539.3823   533343   48.21% 4469  3872     9050.3863   287    14558.4000     7539.3823   550792   48.21% 4557  3923     7812.2853   298    14558.4000     7539.3823   556831   48.21% 4651  3981     9462.2525   291    14558.4000     7539.3823   562350   48.21% 4842  4086     7926.6313   284    14558.4000     7539.3823   575196   48.21% 5223  4278     8321.9387   263    14558.4000     7539.3823   590904   48.21% 5679  4550     8381.8508   284    14558.4000     7539.3823   611281   48.21% Elapsed real time = 226.92 sec. (tree size = 281.47 MB, solutions = 2) Nodefile size = 48.54 MB (36.87 MB after compression) 5863  4656     8363.0906   286    14558.4000     7539.3823   618961   48.21% 6353  4931     8235.9909   279    14558.4000     7539.3823   634427   48.21% 6650  5103     8446.2112   245    14558.4000     7539.3823   641128   48.21% 6978  5295     8492.2053   242    14558.4000     7539.3823 655359   48.21% 7568  5652     8614.3770   253    14558.4000     7539.3823   668725   48.21% 7976  5876     8794.3936   254    14558.4000     7539.3823   681472   48.21% 8701  6298     8723.3049   268    14558.4000     7539.3823   698677   48.21% 9117  6528     9616.8959   275    14558.4000     7539.3823   714258   48.21% 9537  6770    10926.3001   231    14558.4000     7539.3823   724708   48.21% 9882  6960    11000.0653   214    14558.4000     7539.3823   732550   48.21% Elapsed real time = 267.25 sec. (tree size = 773.58 MB, solutions = 2) Nodefile size = 605.19 MB (464.39 MB after compression) 10186  7126    11232.8293   263    14558.4000     7539.3823   745054   48.21% 10606  7358    11526.7273   220    14558.4000     7539.3823   760337   48.21% 10740  7438     7694.0488   313    14558.4000     7539.3823   771502   48.21% 10820  7486     7702.9264   308    14558.4000     7539.3823   775474   48.21% 11406  7909    11653.3846   217    14558.4000     7539.3823   803465   48.21% 11457  7959    11655.1339   228    14558.4000     7539.3823   806930   48.21% 11510  8010     7795.2364   339    14558.4000     7539.3823   812052   48.21% 11526  8026     7800.4157   406    14558.4000     7539.3823   817879   48.21% 11947  8426     7730.1152   393    14558.4000     7539.3823   840179   48.21% 11971  8447     7720.5839   407    14558.4000     7539.3823   847009   48.21% Elapsed real time = 314.17 sec. (tree size = 1004.13 MB, solutions = 2) Nodefile size = 852.23 MB (663.23 MB after compression) 12551  9008     8296.9228   326    14558.4000     7545.7835   895563   48.17% 12592  9049     7584.1165   338    14558.4000     7545.7835   900533   48.17% 12738  9194     7776.3339   333    14558.4000     7545.7835   912230   48.17% 12796  9252     8462.0674   333    14558.4000     7545.7835   918211   48.17% 13169  9604     8439.7556   357    14558.4000     7545.7835   943445   48.17% 13181  9616     7677.7719   422    14558.4000     7545.7835   949348   48.17% 13277  9706 7984.5226   360    14558.4000     7545.7835   959552   48.17% 13312  9739     7620.6343   394    14558.4000     7545.7835   970016   48.17% 13664 10089     7662.6784   365    14558.4000     7545.7835   999193   48.17% 13765 10190     8183.6833   390    14558.4000     7545.7835  1011762   48.17% Elapsed real time = 358.38 sec. (tree size = 1211.79 MB, solutions = 2) Nodefile size = 1054.02 MB (808.82 MB after compression) 13848 10273     7837.0115   391    14558.4000     7545.7835  1024791   48.17% 13953 10378     8399.2848   274    14558.4000     7545.7835  1033390   48.17% 14502 10927     9414.2531   253    14558.4000     7545.7835  1066577   48.17% 14533 10958     7875.3300   313    14558.4000     7545.7835  1072676   48.17% 14565 10990     7880.4708   312    14558.4000     7545.7835  1076490   48.17% 14613 11038     7905.2660   285    14558.4000     7545.7835  1080756   48.17% 14865 11290     8473.1882   280    14558.4000     7545.7835  1099645   48.17% 14940 11365     7978.4004   324    14558.4000     7545.7835  1108031   48.17% 14988 11413     8020.5341   334    14558.4000     7545.7835  1113306   48.17% 15076 11501     8098.1261   323    14558.4000     7545.7835  1120236   48.17% Elapsed real time = 405.31 sec. (tree size = 1387.68 MB, solutions = 2) Nodefile size = 1227.22 MB (947.68 MB after compression) 16172 12573     7552.4028   352    14558.4000     7545.7835  1174324   48.17% 16173 12574     7664.7188   399    14558.4000     7545.7835  1177685   48.17% 16189 12590     7649.9320   436    14558.4000     7545.7835  1186868   48.17% 17180 13579     7676.9505   412    14558.4000     7545.7835  1248619   48.17% 17188 13586     7682.2001   422    14558.4000     7545.7835  1252364   48.17% 17196 13594     7662.2583   477    14558.4000     7545.7835  1256785   48.17% 17682 14076     7674.7033   464    14558.4000     7545.7835  1297463   48.17% 17698 14092     7880.6274   375    14558.4000     7545.7835  1301957   48.17% 17802 14196     7749.9900   355    14558.4000 7545.7835  1315064   48.17% 18232 14609     7612.4141   456    14558.4000     7552.7117  1377587   48.12% Elapsed real time = 483.26 sec. (tree size = 1833.21 MB, solutions = 2) Nodefile size = 1678.21 MB (1315.60 MB after compression) 18546 14923     7860.0983   504    14558.4000     7567.2989  1422659   48.02% 19111 15467     7699.2119   395    14558.4000     7567.2989  1489906   48.02% 19462 15810     8667.8479   291    14558.4000     7567.2989  1554873   48.02% 19484 15832     8127.6012   472    14558.4000     7567.2989  1570465   48.02% 19865 16210     8482.8412   468    14558.4000     7588.6436  1640379   47.87% 20159 16492     7629.9402   482    14558.4000     7588.6436  1701834   47.87% 20498 16831     7709.6665   383    14558.4000     7588.6436  1772310   47.87% 20634 16967     8366.8917   350    14558.4000     7588.6436  1799673   47.87% 21126 17459     8016.2006   380    14558.4000     7612.4904  1864803   47.71% 21298 17631     8459.4869   329    14558.4000     7612.4904  1914012   47.71% Elapsed real time = 656.38 sec. (tree size = 2254.36 MB, solutions = 2) Nodefile size = 2094.76 MB (1651.94 MB after compression) 21628 17961     8104.2918   377    14558.4000     7612.4904  1962432   47.71% 21924 18257     9338.5815   312    14558.4000     7612.4904  2006051   47.71% 22097 18430     8194.3926   397    14558.4000     7612.4904  2035902   47.71% 22586 18918     7713.9679   437    14558.4000     7622.9336  2106462   47.64% 22682 19014     8087.7677   447    14558.4000     7622.9336  2131224   47.64% 23148 19479     8025.7727   373    14558.4000     7622.9336  2220982   47.64% 23592 19919     7695.6122   491    14558.4000     7622.9336  2297844   47.64% 23683 20007     7923.4937   453    14558.4000     7631.7499  2319159   47.58% 24302 20622     8052.9749   480    14558.4000     7631.7499  2416248   47.58% 24446 20766     8228.7055   377    14558.4000     7631.7499  2455685   47.58% Elapsed real time = 835.75 sec. (tree size = 2504.75 MB, solutions = 2) Nodefile size = 2350.12 MB (1868.06 MB after compression) 24952 21270     7880.8414   393    14558.4000     7631.7499  2534351   47.58% 25030 21348     8760.5681   461    14558.4000     7631.7499  2563724   47.58% 25329 21634     8010.0332   329    14558.4000     7634.3597  2646300   47.56% 25414 21714     8866.3435   430    14558.4000     7634.3597  2671295   47.56% 25916 22212     7658.5452   430    14558.4000     7634.3597  2745681   47.56% 25973 22269     7776.7461   443    14558.4000     7634.3597  2764532   47.56% 26085 22381     8068.6388   421    14558.4000     7634.3597  2784176   47.56% 26465 22758     7748.4394   494    14558.4000     7636.2988  2852419   47.55% 26544 22837     7808.2807   489    14558.4000     7636.2988  2895161   47.55% 26879 23172     7893.8243   399    14558.4000     7636.2988  2984394   47.55% Elapsed real time = 994.40 sec. (tree size = 2808.22 MB, solutions = 2) Nodefile size = 2654.40 MB (2131.15 MB after compression) 26975 23268     8148.4050   400    14558.4000     7636.2988  3014898   47.55% 27481 23774     8150.9262   394    14558.4000     7636.2988  3097257   47.55% 27603 23895     8509.9553   516    14558.4000     7636.2988  3133046   47.55% 27722 24014     8598.2643   438    14558.4000     7636.2988  3163706   47.55% 28246 24537     7769.3601   441    14558.4000     7639.7004  3244314   47.52% 28320 24611     8760.5274   355    14558.4000     7639.7004  3274482   47.52% 28769 25060     7754.7691   505    14558.4000     7639.7004  3380876   47.52% 28849 25140     8124.6031   514    14558.4000     7639.7004  3407803   47.52% 29553 25843     8587.5945   498    14558.4000     7640.0546  3528168   47.52% 29715 26002     8357.9852   419    14558.4000     7640.0546  3571889   47.52% Elapsed real time = 1181.09 sec. (tree size = 3232.90 MB, solutions = 2) Nodefile size = 3077.22 MB (2505.43 MB after compression) 30031 26317     8430.2097   489    14558.4000     7640.0546  3654350   47.52% 30289 26575     8553.5077   430    14558.4000 7640.0546  3702151   47.52% 30353 26638     8605.0755   400    14558.4000     7640.0546  3724003   47.52% 30651 26935     7810.4309   485    14558.4000     7640.0546  3786837   47.52% 30836 27120     8307.9323   455    14558.4000     7641.7750  3848508   47.51% 30913 27197     8525.7253   394    14558.4000     7641.7750  3886578   47.51% 31268 27552     8479.2805   496    14558.4000     7641.7750  3966950   47.51% 31332 27616     8693.5740   429    14558.4000     7641.7750  3988349   47.51% 31926 28208     8105.8833   497    14558.4000     7641.7750  4110619   47.51% 32009 28291     9281.3322   390    14558.4000     7641.7750  4137163   47.51% Elapsed real time = 1353.52 sec. (tree size = 3352.37 MB, solutions = 2) Nodefile size = 3199.19 MB (2603.13 MB after compression) 32250 28531     8369.3808   327    14558.4000     7641.7750  4200271   47.51% 32485 28766     8466.1167   364    14558.4000     7641.7750  4256605   47.51% 32655 28936     7921.9327   338    14558.4000     7644.4385  4303559   47.49% 32767 29048     8191.9619   306    14558.4000     7644.4385  4335143   47.49% 33241 29521     7698.8735   467    14558.4000     7644.4385  4448643   47.49% 33270 29550     7731.4241   489    14558.4000     7644.4385  4467560   47.49% 33318 29598     7848.1284   390    14558.4000     7644.4385  4484960   47.49% 34045 30325     8827.0543   254    14558.4000     7644.4385  4607871   47.49% 34162 30442     7919.3276   404    14558.4000     7644.4385  4640594   47.49% 34250 30530     8026.0980   453    14558.4000     7644.4385  4669250   47.49% Elapsed real time = 1530.41 sec. (tree size = 3590.88 MB, solutions = 2) Nodefile size = 3439.17 MB (2809.95 MB after compression) 34825 31105     8580.3300   365    14558.4000     7648.3749  4797690   47.46% 34904 31184     8388.7942   380    14558.4000     7648.3749  4821452   47.46% 35048 31328     8446.7553   354    14558.4000     7648.3749  4854102   47.46% 35486 31766     8283.7263   501    14558.4000     7648.3749  4975946   47.46% 35553 31833     8671.9220   348    14558.4000     7648.3749  5006610   47.46% 35776 32056     8303.4765   302    14558.4000     7648.3749  5057720   47.46% 36134 32411     7776.7516   513    14558.4000     7648.3749  5110240   47.46% 36135 32412     8678.0349   375    14558.4000     7650.1451  5110465   47.45% 36137 32414     8326.6778   340    14558.4000     7650.1451  5111192   47.45% 36148 32424     7702.6055   452    14558.4000     7650.1451  5129247   47.45% Elapsed real time = 1708.73 sec. (tree size = 3760.64 MB, solutions = 2) Nodefile size = 3739.73 MB (3056.41 MB after compression) 36188 32464     7810.0734   416    14558.4000     7650.1451  5157704   47.45% 36343 32619     8330.7435   365    14558.4000     7650.1451  5238194   47.45% 36798 33073     8507.0233   349    14558.4000     7652.3310  5333085   47.44% 36932 33205     8319.3973   393    14558.4000     7652.3310  5369809   47.44% 37712 33973     7716.0417   503    14558.4000     7652.3310  5478374   47.44% 37798 34059     8868.6090   412    14558.4000     7652.3744  5507553   47.44% 38514 34775     8751.7146   241    14558.4000     7652.3744  5593572   47.44% 39149 35408     7720.2624   488    14558.4000     7652.3744  5658082   47.44% 39224 35483     7774.8764   523    14558.4000     7652.3744  5682004   47.44% 39336 35595     8173.6028   448    14558.4000     7652.3744  5706703   47.44% Elapsed real time = 1906.64 sec. (tree size = 4235.04 MB, solutions = 2) Nodefile size = 4086.43 MB (3368.72 MB after compression) 39885 36118     8756.9468   381    14558.4000     7652.7539  5861459   47.43% 39912 36143     8298.3827   496    14558.4000     7652.7539  5885338   47.43% 39984 36211     8350.8681   371    14558.4000     7652.7539  5925459   47.43%
    

    and then cplex crashes again.
    Here is a snippet / pseudocode mixin:

    
    IloIntVar[][] x; IloNumVar[] B; IloNumVar[] Q;   ... read in problem...   IloCplex cplex = 
    
    new IloCplex(); cplex.setParam(IloCplex.DoubleParam.TiLim, 3600); 
    //set time limit cplex.setOut(outputStream); 
    //store output in file x = 
    
    new IloIntVar[numberOfVars][]; 
    
    for(i = 0; ...) 
    { x[i] = 
    
    new IloIntVar[numberOfVars]; 
    
    for(j = 0; ...) 
    { x[i][j] = cplex.boolVar(
    "x_"+i+
    ","+j); 
    } 
    } ... generate equalities like \sum_i x_ij = 1 \forall j ... cplex.addEq(...);   B = 
    
    new IloNumVar[numberOfVars]; 
    
    for(i = 0; ...) B[i] = cplex.numVar(lower bound, upper bound, 
    "B"+i);   ... Q is the same as B  ... ... generate inequalities ... cplex.addGe(...);   ...generate IloNumExpr \sum_ij c_ij * x_ij ...   IloNumExpr sum = cplex.constant(0); 
    
    for(i ...) 
    
    for(j ...) sum = cplex.sum(cplex.prod(c[i][j], x[i][j]));   cplex.addObjective(IloObjectiveSense.Minimize,sum); BranchGoal myGoal = 
    
    new BranchGoal(x, Q, B, parameters...); 
    //setup my own goal ... read in heuristic solution... myGoal.injectSolution(solutionFile); 
    //reads in solution and creates new, flattened varArray und valueArray Goal solution = cplex.solutionGoal(myGoal.varArray, myGoal.valueArray); cplex.solve(cplex.and(solution, myGoal));
    

    and that was it. In BranchGoal (which extends Goal), I do the following:
    
    
    
    public BranchGoal(IloIntVar[][]x, IloNumVar[] B, IloNumVar[] Q, parameters)
    { this.x = x; this.B = B; this.Q = Q; parameters = parameters; 
    }   
    
    public Goal execute(IloCplex cplex)
    { Goal goal = 
    
    this; IloCplex.IntegerFeasibilityStatus[][] feas = getFeasibilites(x); 
    
    double minInfeasVal = 0.5; 
    //I want to find the variable which is the nearest to 0.5 
    
    int infeasI = 0; 
    
    int infeasJ = 0; 
    
    boolean infeasFound = 
    
    false; 
    
    for(
    
    int i = 0; i < feas.length; i++)
    { 
    
    for(
    
    int j = 0; j < feas[i].length; j++)
    { 
    
    if(feas[i][j].equals(IntegerFeasibilityStatus.Infeasible))
    { infeasibleFound = 
    
    true; 
    
    if(Math.abs(getValue(x[i][j]) - 0.5) < minInFeas)
    { infeasI = i; infeasJ = j; minInFeas = Math.abs(getValue(x[i][j]) - 0.5); 
    } 
    } 
    } 
    } 
    
    if(infeasibleFound)
    { 
    //branch on this variable 
    
    return cplex.and(cplex.or(cplex.eqGoal(x[infeasI][infeasJ], 1),cplex.eqGoal(x[infeasI][infeasJ], 0)), goal); 
    } 
    //now we have an integer solution 
    //I'm searching for violated inequalities that were not in the model yet 
    //and potentially add them as new global cuts   ... searching ...   
    
    if(found violated inequality) 
    { goal = cplex.and(cplex.globalCutGoal(cplex.ge(cplex.constant(S.size()-2), sum)),goal); 
    
    return goal; 
    }   
    
    return 
    
    null;   
    }   
    
    private IntegerFeasibilityStatus[][] getFeasibilites(IloIntVar[][] var) 
    { 
    //I don't need this parameter, don't know why it is still there IloCplex.IntegerFeasibilityStatus[][] arr = 
    
    new IntegerFeasbilityStatus[x.length][x.length]; 
    
    for(
    
    int i = 0; i < x.length; i++)
    { arr[i] = getFeasibilites(x[i]); 
    } 
    
    return arr; 
    }
    


    I hope that you can help me.
    #CPLEXOptimizers
    #DecisionOptimization


  • 11.  Re: addMipStart has no effect

    Posted Thu April 04, 2013 08:47 AM

    Originally posted by: SystemAdmin


    I think I may found a solution:

    I used the solution goal with an "and" so cplex put my goal on the stack and then the solution goal. Then the solution goal was executed, after that my goal was executed which said that the solution is fine, returned "null" and the procedure stops.

    So maybe cplex.or(solutionGoal, myGoal) would be right, since this would create two branches?
    #CPLEXOptimizers
    #DecisionOptimization


  • 12.  Re: addMipStart has no effect

    Posted Fri April 05, 2013 11:52 AM

    Originally posted by: SystemAdmin


    I am not really an expert in goals, so I cannot tell whether you are right. However, the user manual has an explicit example how to inject a solution at the beginning of the search, see here. This may help you to get things right.
    #CPLEXOptimizers
    #DecisionOptimization


  • 13.  Re: addMipStart has no effect

    Posted Wed April 03, 2013 07:22 AM

    Originally posted by: SystemAdmin


    CPLEX 12.1 is rather old. Any chance to switch to a more recent version?
    Have you tried to export your model to a SAV file and your MIP start to an MST file right before calling solve():
    cplex.exportModel("model.sav");
    cplex.writeMIPStarts("start.mst");
    

    and then run those files through the interactive optimizer:
    CPLEX> read model.sav
    CPLEX> read start.mst
    CPLEX> optimize
    

    Is the MIP start accepted there? If not, do you at least get the warning that the MIP start did not provide a solution?
    #CPLEXOptimizers
    #DecisionOptimization