Search code examples
cplexmixed-integer-programmingtime-limiting

How to display a solution with using timelimit in CPLEX for scheduling(CP)


Now I am trying to get a solution within a specific time-limit in my code.

Actually, my problem(scheduling) is NP-hard.

It spends lots of time to get a solution or out of memory. So, I set a time-limit in my code(60s) and I'd like to get a solution(scheduling) solved for 60s.

Is it possible?

If possible, please let me know.

Thank you, sir.


Solution

  • yes you can stop after a time limit

    In OPL you would write

    execute {
            cp.param.timelimit = 60;
    }
    

    You have the same parameter for all APIs