next up previous
Next: Numerical results Up: SDPT3 - a Previous: Example files

Sample Runs

>> randn('seed',0) % reset random generator to its initial seed.
>> rand('seed',0)  % 
>> startup         % set global variables to default values, set paths
>> 
>> %%%%% random SDP %%%%%
>>
>> de=[20]; sp=[]; di=[]; %% one 20X20 dense block, no sparse/diag blocks
>> m=20;        % 20 equality constraints
>> feas=1;      % feasible initial iterate
>> solve=0;     % do not solve the problem, just generate data.
>> vers=1;      % use AHO direction
>> [blk,A,C,b,X0,y0,Z0] = randsdp(de,sp,di,m,feas,solve);
>>
>> [obj,X,y,Z,gaphist,feashist] = sdp(blk,A,C,b,X0,y0,Z0); % use IPC

 condition no. of A = 1.75e+00

***************************************************************************
         Infeasible path-following algorithms
***************************************************************************
 version  predcorr  gam  expon  use_corrprim   sw2PC_tol
   1        1      0.000   3         1          Inf

it  pstep dstep p_infeas d_infeas  gap        obj     pathres  sigma  rco
----------------------------------------------------------------------------
 0  0.000 0.000 1.8e-16 1.3e-16  7.6e+02  1.787474e+02 0.0e+00
 1  0.897 0.614 1.5e-16 1.1e-16  1.8e+02  -5.357108e+01 8.2e-01 0.100 1.5e-01
 .    .     .      .       .        .          .          .      .      . 
 .    .     .      .       .        .          .          .      .      . 
 9  0.987 0.989 2.2e-16 1.3e-16  7.1e-11  -1.151599e+02 7.6e-01 0.000 3.7e-13
10  0.944 0.978 2.3e-16 1.5e-16  4.0e-12  -1.151599e+02 7.5e-01 0.000 5.0e-15

 Stop: max(relative gap, infeasibilities) < 1.00e-13
------------------------------------
 number of iterations   = 10
 gap                    = 4.02e-12
 relative gap           = 3.49e-14
 infeasibilities        = 2.34e-16
 Total CPU time         = 3.4
 CPU time per iteration = 0.3
 termination code       =  0
------------------------------------
>>
>> % next, generate new data with a different block structure
>> feas = 0;  % and use the (infeasible) initial iterate given in (42)
>> vers=4;    % use GT direction
>> [blk,A,C,b,X0,y0,Z0] = randsdp([20 15],[4 3 3],5,30,feas,solve); 
>> 
>> [obj,X,y,Z,gaphist,feashist] = sdphlf(blk,A,C,b,X0,y0,Z0); % solve using HPC

***************************************************************************
         Homogeneous self-dual algorithms
***************************************************************************
 version  predcorr  gam  expon  use_corrprim  sw2PC_tol
   4        1      0.00    2        0         Inf

it pstep dstep p_infeas d_infeas  gap         obj     pathres  sigma  rco
-----------------------------------------------------------------------------
 0  0.000 0.000 6.8e+00 6.2e-01 5.7e+04  6.376164e+03 0.0e+00
 1  0.837 1.000 1.6e+00 1.0e-01 5.0e+03  8.941629e+02 7.1e+00 0.359 1.6e-02
 .    .     .      .       .        .          .          .      .      . 
 .    .     .      .       .        .          .          .      .      . 
10  0.989 0.989 1.7e-13 8.3e-15 5.8e-10  -1.917987e+02 8.8e-01 0.000 4.0e-18
11  0.985 0.985 5.1e-15 1.7e-16 8.8e-12  -1.917987e+02 8.9e-01 0.000 4.1e-18

 Stop: max(relative gap, infeasibilities) < 1.00e-13
------------------------------------
 number of iterations   = 11
 gap                    = 8.77e-12
 relative gap           = 4.57e-14
 infeasibilities        = 5.14e-15
 Total CPU time         = 11.8
 CPU time per iteration = 1.1
 termination code       =  0
------------------------------------
>>
>> %%%%% MAXCUT PROBLEM %%%%%
>>
>> B = graph(50,0.3); %% generate an adjacency matrix of a 50 node graph
>>                    %% where each edge is present with probability 0.3
>> solve=1;   % generate data, then solve the problem using IPF/IPC
>> feas=1;    % use a feasible initial iterate;
>> vers=2;    % use HKM direction
>> % next solve the maxcut problem defined on the given graph
>>
>> [blk,A,C,b,X0,y0,Z0,objval,X] = maxcut(B,feas,solve);

***************************************************************************
         Infeasible path-following algorithms
***************************************************************************
 version  predcorr  gam  expon  use_corrprim   sw2PC_tol
   2        1      0.000   1         0          Inf

it  pstep dstep p_infeas d_infeas  gap        obj     pathres  sigma  rco
----------------------------------------------------------------------------
 0  0.000 0.000 0.0e+00 7.3e-17  2.2e+02  -2.872000e+02 0.0e+00
 1  1.000 1.000 0.0e+00 4.7e-17  8.1e+01  -2.389877e+02 8.0e-02 0.378 6.0e-01
 .    .     .      .       .        .          .          .      .      . 
 .    .     .      .       .        .          .          .      .      . 
11  1.000 1.000 0.0e+00 4.7e-17  6.4e-09  -2.488378e+02 2.0e-01 0.040 1.3e-10
12  0.931 1.000 0.0e+00 5.4e-17  9.8e-10  -2.488378e+02 8.7e-01 0.104 5.0e-12

  lack of progress in corrector: mucorr/mu = 0.92, corr_convg_rate = 0.08
  Stop: lack of progress in corrector.

------------------------------------
 number of iterations   = 13
 gap                    = 9.83e-10
 relative gap           = 3.95e-12
 infeasibilities        = 5.42e-17
 Total CPU time         = 6.8
 CPU time per iteration = 0.5
 termination code       = -1
------------------------------------