Decision Optimization

 View Only
Expand all | Collapse all

Stop CPLEX optimization run and resume it

  • 1.  Stop CPLEX optimization run and resume it

    Posted Mon December 03, 2018 12:22 PM

    Originally posted by: 88Simon88


    Hello everybody,

    I am new to CPLEX, I am running a model but it is around 70 hours that it is running. So I want to write the solution in an external file, then I can read the solution and restart it from where I was. How can I do it?

    Thanks



  • 2.  Re: Stop CPLEX optimization run and resume it



  • 3.  Re: Stop CPLEX optimization run and resume it

    Posted Mon December 03, 2018 12:46 PM

    Originally posted by: 88Simon88


    Thanks for your fast reply. I found that I can do it if I code in C++. I cannot do it in the "IBM ILOG CPLEX Optimization Studio". right?



  • 4.  Re: Stop CPLEX optimization run and resume it

    Posted Mon December 03, 2018 04:04 PM

    Hi,

    in OPL have a look in the IloCplex OPL object at

    readMIPStarts
    {void} readMIPStarts(name)
    Reads the MST file denoted by name and copies the MIP start information into the invoking IloCplex object. The parameter AdvInd must be turned on (its default is 1 (one)) in order for the MIP start information to be used with a subsequent MIP optimization.

    and

    writeMIPStarts
    {void} writeMIPStarts(name, first, nb)

    Writes MIP start information to the file denoted by name. The designated MIP starts begin with the one designated by the index first and continue to the specified number nb of members. All MIP starts will be written if the first and nb arguments are omitted. The single MIP start designated by first will be written if the num argument is omitted.

     

     

    regards

     

    PS:

    Tiny example at https://www.ibm.com/developerworks/community/forums/html/topic?id=c3f299b6-46d5-4d52-8371-d8cd81ecbd4e



  • 5.  Re: Stop CPLEX optimization run and resume it

    Posted Tue December 04, 2018 12:59 PM

    Originally posted by: 88Simon88


    Thanks for your reply, but I couldn't use that code. Could you please provide me a sample code? or give me an example how to use that.



  • 6.  Re: Stop CPLEX optimization run and resume it

    Posted Tue December 04, 2018 02:44 PM

    Hi

    if you want to stop and go within the IDE you may read

     

    regards



  • 7.  RE: Re: Stop CPLEX optimization run and resume it

    Posted Thu June 02, 2022 09:36 AM
    Hi Alex,

    Thanks for your sharing.

    Can you also share an example code of C# (.net core)?

    Regards. Orhan

    ------------------------------
    Orhan Ozguven
    ------------------------------