Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Finding a feasible solution in Cplex

    Posted 06/28/11 05:05 AM

    Originally posted by: SystemAdmin


    Hi all,

    I am using cplex+matlab and i need to find the first feasible solution and stop. In the later steps I would like to move from the next feasible solution and so on.
    Is there a way to do that in cplex with matlab?

    Thanks a lot in advance,
    Nihan
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Finding a feasible solution in Cplex

    Posted 06/28/11 05:15 AM

    Originally posted by: John Cui


    How about this:
    cplex=Cplex();
    cplex.readModel('sosex3.lp');
    cplex.Param.mip.limits.solutions.Cur = 1;
    cplex.solve();
    cplex.Solution
    cplex.setDefault();
    cplex.solve();
    

    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Finding a feasible solution in Cplex

    Posted 06/28/11 05:31 AM

    Originally posted by: SystemAdmin


    Thanks a lot for the answer but when i tried that it gives me such output:

    status: 1
    statusstring: 'optimal'
    time: 0.0150
    objval: 202.5000
    x: 3x1 double
    method: 2
    dual: 2x1 double
    ax: 2x1 double
    reducedcost: 3x1 double
    itcnt: 2
    basis: 1x1 struct
    phase1cnt: 1

    Parallel mode: deterministic, using up to 2 threads for concurrent optimization.
    Using devex.
    Using devex.
    Using devex.

    Primal simplex solved model.
    I have also attached the myprob.lp file which I have used in the code.

    What am I doing wrong?

    Thanks a lot.
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Finding a feasible solution in Cplex

    Posted 06/28/11 05:44 AM

    Originally posted by: SystemAdmin


    You are solving an LP, so the MIP solution limit parameter does not help.

    What exactly do you want to do? I guess you want to find a first optimal vertex of the LP, and then enumerate all other alternative optimal vertices as well.

    This cannot be done directly with CPLEX, but you can probe the optimal face of your polyhedron with random objective function vectors. First, optimize the problem as usual. Then look at the reduced costs and dual solution values. Fix all variables with non-zero reduced costs to their current value, and convert all inequalities with non-zero dual solution value into equations. Now, you have changed the problem such that is forced to stay on the optimal face of the polyhedron. Finally, you can just change the objective function in a random fashion and reoptimize to (hopefully) get to a different optimal vertex. But please note that this only samples the set of optimal vertices and is not a systematic or exhaustive approach.

    Tobias
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Finding a feasible solution in Cplex

    Posted 06/28/11 05:53 AM

    Originally posted by: SystemAdmin


    Thanks for the help.

    What I am trying to do is normally i am trying to use two stage programming method for my problem.

    The problem that i sent( not my actual problem but still a very easy one) will represent the first stage of my problem.

    After i obtain a good feasible solution from it, i would like to put the results into the second stage of the problem which is basically another lp problem.

    So the solutions does not have to be in any extreme point, i just need to get a feasible solution in order to put them to the second stage of my problem.

    I wonder whether it is possible to do that?
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Finding a feasible solution in Cplex

    Posted 06/28/11 06:28 AM

    Originally posted by: RWunderling


    I suggest you set your objective function to 0 and solve. Clearly, this solution will be feasible for your original problem and should thus serve as a starting point for your phase 2. Don't forget to reset your objective function before proceeding.

    • Roland

    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Finding a feasible solution in Cplex

    Posted 06/28/11 06:48 AM

    Originally posted by: SystemAdmin


    For the first iteration i am already doing this. But I have to run my algorithm many times each should start with a different feasible solution. I wonder whether there exists a way of doing this.

    Thanks a lot.
    Nihan
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Finding a feasible solution in Cplex

    Posted 06/29/11 02:38 AM

    Originally posted by: RWunderling


    I suggest to use a random objective instead of a 0 objective then.

    • Roland

    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Finding a feasible solution in Cplex

    Posted 06/29/11 05:12 AM

    Originally posted by: SystemAdmin


    But unfortunately that will change the structure of my problem :(

    Anyways thanks again for the help.
    #CPLEXOptimizers
    #DecisionOptimization