Topic
8 replies Latest Post - ‏2013-06-03T14:30:51Z by sana_
sana_
sana_
5 Posts
ACCEPTED ANSWER

Pinned topic Find the time spent to reach the best feasible solution

‏2013-05-22T15:27:32Z |

Hi,

as mentioned in the title, I try to find the time spent to reach the best feasible solution if my problem is not solved to optimality because of an out of memory exception.

 

I use IloCplex library with C++ language.

Thanks !

 

  • PaulRubin
    PaulRubin
    41 Posts
    ACCEPTED ANSWER

    Re: Find the time spent to reach the best feasible solution

    ‏2013-05-22T22:40:36Z  in response to sana_

    Attach an incumbent callback. In the callback, record the time at which the callback is entered.

     

    Paul

    • sana_
      sana_
      5 Posts
      ACCEPTED ANSWER

      Re: Find the time spent to reach the best feasible solution

      ‏2013-05-23T16:06:19Z  in response to PaulRubin

      Hi Paul,

      Can you explain to me how to use a callback ?

      Thanks a lot !

      Updated on 2013-05-23T16:06:31Z at 2013-05-23T16:06:31Z by sana_
      • PaulRubin
        PaulRubin
        41 Posts
        ACCEPTED ANSWER

        Re: Find the time spent to reach the best feasible solution

        ‏2013-05-25T21:21:33Z  in response to sana_

        It's described in detail in the user guide, and CPLEX ships with source code for several examples that involve callbacks.

        Paul

        • sana_
          sana_
          5 Posts
          ACCEPTED ANSWER

          Re: Find the time spent to reach the best feasible solution

          ‏2013-05-27T13:54:12Z  in response to PaulRubin

          Thanks !

    • DanielJunglas
      DanielJunglas
      110 Posts
      ACCEPTED ANSWER

      Re: Find the time spent to reach the best feasible solution

      ‏2013-05-29T07:14:18Z  in response to PaulRubin

      If you don't want to use an incumbent callback (it disables dynamic search) you can also parse the log file or use CPX_PARAM_INTSOLFILEPREFIX and check the timestamp of the created files.

      • sana_
        sana_
        5 Posts
        ACCEPTED ANSWER

        Re: Find the time spent to reach the best feasible solution

        ‏2013-05-30T19:39:30Z  in response to DanielJunglas

        I'll try to do it. The problem that I must do it automatically since I must run 620 problem tests.

        I must also explore what is the dynamic search ...

        Thanks Mr. Daniel.

        Updated on 2013-05-30T19:39:56Z at 2013-05-30T19:39:56Z by sana_
        • DanielJunglas
          DanielJunglas
          110 Posts
          ACCEPTED ANSWER

          Re: Find the time spent to reach the best feasible solution

          ‏2013-05-31T08:31:46Z  in response to sana_

          You can parse the log file from within your program. You just have to register a custom output stream via IloCplex::setOut() and then parse data as CPLEX writes data to this stream.

          If you use incumbent files then there are also functions to read the modification/creation time of a file from C++. So you can do this kind of stuff automatically from your program.

          • sana_
            sana_
            5 Posts
            ACCEPTED ANSWER

            Re: Find the time spent to reach the best feasible solution

            ‏2013-06-03T14:30:51Z  in response to DanielJunglas

            Thanks Daniel :) I used incumbent files and C++ file functions to do it.