0

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.

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

3 Comments

Sir, I used that code in my iteration mod file. But it doesn't give a solution(real schedule), but only give an Objective function value. I mean, simply, I want to get a solution 'OP-value like 23.254", I want to get a solution schedule with decision variation like [1 0 1 0 1 1 1 0] Thank you, sir.
Additionally, it could be a little fundamental question, if it is possible, why do we use a technique of heuristic for that kind of problem? I mean, most of the timelimit solutions by MILP(CPLEX) better than a heuristic solution. Thank you, sir.
Hi, if you use OPL and CPLEX , in the postprocess part you may print any results through writeln functions in execute blocks See ibm.com/developerworks/community/forums/html/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.