Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Solution Pools for MILP in matlab

    Posted 03/05/12 10:44 PM

    Originally posted by: EPED_Nicholas_Drake


    I am having trouble creating solution pools with the MATlab interface for cplex. I am having trouble understanding what parameters I need to set to catch all possible solutions.

    My matlab file looks as follows

    %%%%%%%%%%%%%%%%
    function LCP_final
    try
    clc
    m= 1 -1; 0 -1;
    q = -2, 4';
    xv = sym('x1');
    lm = length(m);
    yv = sym(zeros(1, lm))';
    zv = sym(zeros(1, lm))';
    for k=1:lm
    yv(k) = sym(sprintf('x%d', k+1));
    zv(k) = sym(sprintf('x%d', k+lm+1));
    end
    A = m*yv+xv*q+zv;-(m*yv+xv*q); yv-zv;
    for i=1:length(A)
    A(i,:)=sort(A(i,:));
    end
    xx = cat(1,xv ,yv,zv);
    Aineq = zeros(numel(A),numel(xx));
    for j=1:length(A)
    for i=1:length(xx)
    y=xx(i);
    c,t=coeffs(A(j),y);
    if (length(t)<2)
    else
    insert=c(2);
    Aineq(j,i)=insert;
    end
    end
    end
    bineq=zeros(length(Aineq),1);
    for temp=1:(length(zv))
    bineq(temp,1)=1;
    end
    f = -1 -1 -1 0 0';
    Aeq=[];
    beq=[];
    ub= inf; 1; 1; 1; 1;
    lb=0; 0;0;0;0;
    ctype= 'CCCBB';
    options = cplexoptimset, populate;
    options.Diagnostics = 'on';
    x, fval, exitflag, output = cplexmilp (f, Aineq, bineq, Aeq, beq,...
    [ ], [ ], ], lb, ub, ctype, [, options);
    fprintf ('\nSolution status = %s \n', output.cplexstatusstring);
    fprintf ('Solution value = %f \n', fval);
    disp ('Values =');
    disp (x);
    catch m
    disp (m.message);
    end
    end
    %%%%%%%%%%%%%%%%%%%%%%%%%%%
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Solution Pools for MILP in matlab

    Posted 03/05/12 10:57 PM

    Originally posted by: EPED_Nicholas_Drake


    I forgot to add that I receive the following solution:
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Solution Pools for MILP in matlab

    Posted 03/05/12 10:59 PM

    Originally posted by: EPED_Nicholas_Drake


    I forgot to add I do get a solution:
    Tried aggregator 2 times.
    MIP Presolve eliminated 2 rows and 1 columns.
    MIP Presolve modified 2 coefficients.
    Aggregator did 1 substitutions.
    Reduced MIP has 3 rows, 3 columns, and 7 nonzeros.
    Reduced MIP has 1 binaries, 0 generals, 0 SOSs, and 0 indicators.
    Presolve time =    0.00 sec.
    MIP emphasis: balance optimality and feasibility.
    MIP search method: dynamic search.
    Parallel mode: deterministic, using up to 2 threads.
    Root relaxation solution time =    0.00 sec.
     
            Nodes                                         Cuts/ 
       Node  Left     Objective  IInf  Best Integer     Best Node    ItCnt     Gap
     
    *     0+    0                           -0.7500                      1     --- 
    *     0     0      integral     0       -1.8333       -1.8333        1    0.00%
     
    Root node processing (before b&c):
      Real time             =    0.02
    Parallel b&c, 2 threads:
      Real time             =    0.00
      Sync time (average)   =    0.00
      Wait time (average)   =    0.00
                              -------
    Total (root+branch&cut) =    0.02 sec.
    Solution status = integer optimal solution 
    Solution value = -1.833333 
    Values =
        0.1667
        1.0000
        0.6667
        1.0000
        1.0000
    


    The problem I have is that I know this is not the global optimal solution, first values values should be .25 for the optimal for this problem.

    Any help would be great.
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Solution Pools for MILP in matlab

    Posted 03/06/12 01:18 AM

    Originally posted by: John Cui


    How about the objective value?

    I think it is possible that the decision variables are different with same objective value.
    John Cui
    #CPLEXOptimizers
    #DecisionOptimization