[Csdp] Sparse Formulation and Solver

Duro, Joao j.a.duro at cranfield.ac.uk
Sat May 14 21:12:23 EDT 2011


Hi,

I am currently formulating a SDP problem using for that the C library from CSDP. My problem is described as follows.
I have 9 variables 7 constraints I would like to maximize the trace of C*X and X must be psd.

Objective function coefficients (C in CSDP)
C=[ 2/3 -1/3 -1/3 -1/3 2/3 -1/3 -1/3 -1/3 2/3 ];

Constraint coefficients (Ax in CSDP where x=1..7)
At=[
1 1 1 1 1 1 1 1 1;
1 -1 0 -1 1 0 0 0 0;
1 0 -1 0 0 0 -1 0 1;
0 0 0 0 1 -1 0 -1 1;
1 -1 0 -1 1 0 0 0 0;
0 0 0 0 1 -1 0 -1 1;
1 0 -1 0 0 0 -1 0 1;
];

Constraint equalities (b in CSDP)
b=[0.000000 0.130967 0.231414 0.139552 0.130967 0.139552 0.231414];

Using a solver called Sedumi in Matlab I do:
K.s=[3]; [X]=sedumi(At,b,C,K);
The coefficient matrix is not full row rank, numerical problems may occur.
SeDuMi 1.3 by AdvOL, 2005-2008 and Jos F. Sturm, 1998-2003.
Alg = 2: xz-corrector, Adaptive Step-Differentiation, theta = 0.250, beta = 0.500
eqs m = 7, order n = 4, dim = 10, blocks = 2
nnz(A) = 24 + 0, nnz(ADA) = 49, nnz(L) = 28
 it :     b*y       gap    delta  rate   t/tP*  t/tD*   feas cg cg  prec
  0 :            1.67E+01 0.000
  1 :  -1.36E-02 3.19E+00 0.000 0.1905 0.9000 0.9000   1.25  1  1  2.0E+00
  2 :   1.41E-01 5.91E-01 0.000 0.1856 0.9000 0.9000   2.11  1  1  2.6E-01
  3 :   1.67E-01 1.53E-02 0.000 0.0259 0.9900 0.9900   1.39  1  1  5.3E-03
  4 :   1.67E-01 3.59E-07 0.000 0.0000 1.0000 1.0000   1.01  1  1  1.2E-07
  5 :   1.67E-01 3.85E-14 0.000 0.0000 1.0000 1.0000   1.00  1  4  1.3E-14

iter seconds digits       c*x               b*y
  5      0.1  13.7  1.6731100000e-01  1.6731100000e-01
|Ax-b| =   6.1e-15, [Ay-c]_+ =   0.0E+00, |x|=  1.3e-01, |y|=  6.1e-01

Detailed timing (sec)
   Pre          IPM          Post
3.289E-02    1.722E-01    3.330E-02    
Max-norms: ||b||=2.314140e-01, ||c|| = 6.666667e-01,
Cholesky |add|=0, |skip| = 3, ||L.L|| = 2.04072.

The obtained learnt matrix is:
mat(X)

    0.0650   -0.0158   -0.0493
   -0.0158    0.0344   -0.0186
   -0.0493   -0.0186    0.0679


Using CSDP I am getting primal infeasibility as such:

Iter:  0 Ap: 0.00e+00 Pobj: -8.8789832e+00 Ad: 0.00e+00 Dobj:  0.0000000e+00 
Iter:  1 Ap: 8.72e-01 Pobj: -1.7933602e+01 Ad: 1.00e+00 Dobj:  2.0904101e+00 
Iter:  2 Ap: 9.46e-01 Pobj: -4.9484284e-01 Ad: 1.00e+00 Dobj:  2.0335513e+00 
Iter:  3 Ap: 8.00e-01 Pobj: -4.9557359e-02 Ad: 1.00e+00 Dobj:  2.3268098e-01 
Iter:  4 Ap: 1.95e-01 Pobj:  6.4445451e-02 Ad: 3.77e-01 Dobj: -1.7190467e+01 
Iter:  5 Ap: 1.43e-01 Pobj:  1.2187333e-01 Ad: 8.60e-01 Dobj: -4.9203333e+02 
Iter:  6 Ap: 3.07e-03 Pobj:  1.0362899e-01 Ad: 1.19e-01 Dobj: -3.6106653e+04 
Iter:  7 Ap: 8.61e-03 Pobj:  1.3201208e-01 Ad: 6.43e-02 Dobj: -1.8467582e+06 
Iter:  8 Ap: 6.50e-04 Pobj:  1.0846532e-01 Ad: 1.57e-03 Dobj: -5.6943047e+06 
Iter:  9 Ap: 2.93e-03 Pobj:  1.3144031e-01 Ad: 1.00e+00 Dobj: -7.9309967e+09 
Declaring primal infeasibility.
Success: SDP is primal infeasible
Certificate of primal infeasibility: a'*y=-1.00000e+00, ||A'(y)-Z||=2.01564e-10
SDP failed.

The C code for this example is available in the following link http://pastebin.com/sYgbtyHx. 
The generated file with the problem in SDPA sparse format can be found in the following link http://pastebin.com/X4ykk2Sh .. I wonder if there is any mistake considering the values given above.

1st Question: is the problem well formulated in sparse format?

By default Sedumi minimizes (C*X) and CSDP maximizes tr(C*X). 
I have tried to multiply the coefficients (C) with (-1) in both cases, however I still got the same results as mentioned before.

2nd Question: The fact that one solver minimizes and the other maximizes could be an issue?

Let me know if you could spot anything.

Regards,
Joao




More information about the Csdp mailing list