Topic
1 reply Latest Post - ‏2013-05-02T08:48:46Z by Petr Vilím
anshu.iitv
anshu.iitv
3 Posts
ACCEPTED ANSWER

Pinned topic getting values of decision variable at time of aborting the run

‏2012-10-16T15:11:33Z |
I am using CP model of OPL.This is the program that I have written
using CP;
int n=...;
range R=1..n;
dvar int x[R] in 1..n*n;

minimize x10;

subject to
{
forall(i in 1..n)
forall(j in i..n)
forall(k in j+1..n)
x[k]-x[j]-x[i]!=0;
forall(i in 1..n)
forall(j in i+1..n)
forall(k in j..n)
forall(l in k+1..n)
x[l]+x[i]-x[j]-x[k]!=0;
forall(i in 1..n)
forall(j in i..n)
forall(k in j..n)
forall(l in k+1..n)
x[l]-x[i]-x[j]-x[k]!=0;

forall(i in 1..n-1)
{
0<x[i];
x[i]<xi+1;
xi+1<=n*n;

}
}
for n=10 it does not produces its optimal value in more than 10 hours.So if I want to get the values of decision variable at a particular time after aborting the execution of program. what should I do?Please help me.
I have working on COP a problem that has multiple solution for obtaining multiple solution I am doing it by converting it to a CSP problem and getting the value.After running the program it produces identical solution of many sets. What should I do to avoid this. I am using CP model in OPL.
  • Petr Vilím
    Petr Vilím
    13 Posts
    ACCEPTED ANSWER

    Re: getting values of decision variable at time of aborting the run

    ‏2013-05-02T08:48:46Z  in response to anshu.iitv

    Hello,

    if you do not want to wait for the proof, you can use search limit. For example, you can limit the search to just five minutes:

    execute {
      cp.param.timeLimit=300;
    }
    

    Regarding the identical solutions. If there is no objective, then there's no guarantee that the same solution is reported multiple times. This is documented for example in C++ function IloCP::next:

    This member function searches for a new (or first) solution to the model. In the case of an optimization problem (with an instance of IloObjective in the model), next finds a solution strictly better than the previous solution found. In the case of a satisfaction problem, next returns a solution usually different from those previously found but, it may occasionally find a solution that had been found already. Repeatedly calling next until it returns IloFalse is guaranteed to terminate and to not miss any solutions of the model being solved.

    Best, Petr