Topic
5 replies Latest Post - ‏2013-11-05T09:49:14Z by CPLEX_Xin_Cheng
kevin1981
kevin1981
2 Posts
ACCEPTED ANSWER

Pinned topic How to set the time limit for solving a MILP via yalmip

‏2011-10-29T06:37:09Z |
I use the cplex 12.2 via yalmip interface. I wanted to set the time limit for MILP. The problem is difficult and time-consuming, so I just want to get the best solution that is found in a certain time.
I have two questions:
1. How to set the time limit in Yalmip;
2. How to get the current best lower bound of the objective value or relative objective gap for MIP just like Cplex.solution.miprelgap does when using matlab toolbox functions of cplex.
Thanks a lot.
Updated on 2012-11-25T09:18:10Z at 2012-11-25T09:18:10Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    7929 Posts
    ACCEPTED ANSWER

    Re: How to set the time limit for solving a MILP via yalmip

    ‏2011-10-29T13:23:41Z  in response to kevin1981
    1.

    ops = sdpsettings('solver','cplex','cplex.whateveroptioniscalled',100)
    solvesdp(constraints,objective,ops)

    to find the suitable option, simply look at the structure, and/or read the cplex documentation
    ops = sdpsettings
    ops.cplex

    2. I don't think that is possible since YALMIP currently connects to cplex via cplexmilp etc, which if memory serves me right doesn't returns this info. If it does, this should work

    sol = solvesdp(constraints,objective,sdpsettings('savesolveroutput',1))
    sol.solveroutput
    • kevin1981
      kevin1981
      2 Posts
      ACCEPTED ANSWER

      Re: How to set the time limit for solving a MILP via yalmip

      ‏2011-10-29T14:44:21Z  in response to SystemAdmin
      Thank you for your patient explanation. I'm quite clear now.
    • SystemAdmin
      SystemAdmin
      7929 Posts
      ACCEPTED ANSWER

      Re: How to set the time limit for solving a MILP via yalmip

      ‏2012-11-25T09:18:10Z  in response to SystemAdmin
      hello johan
      i have installed the CPLEX 12.5 and the latest Yalmip.And i also set their paths in the MATLAB(R2012 a)according to your tutorial.But when i run the command'yalmiptest' in the Matlab it can't find the solver cplex.i have checked my windows 7 and cplex,they are both 64bits.i have no idea for the problem.could you help me?thanks for your help!