Csdppaper
Csdppaper
1 Introduction
A number of codes for semidenite programming (SDP) are already available, in-
cluding 1, 3, 8, 9, 10]. Why introduce yet another code for SDP?
CSDP is written in C for eciency and portability. The code is designed to make
use of highly optimized linear algebra routines from the LINPACK or LAPACK
libraries. CSDP is distributed with version of the necessary LINPACK routines
that have been translated into C. The package also includes an optimized version
of the BLAS routine DGEMM 6, 7].
CSDP is designed to handle constraint matrices with general sparse structure.
CSDP can accommodate linear inequality constraints as well as linear equality
constraints. In addition to its SDP solver, the CSDP library contains routines for
reading and writing SDP problems and solutions. The code has been designed for
use both as a stand alone solver and as a callable subroutine for use within larger
programs that require the solution of SDP subproblems. We present results from
the solution of the SDPLIB test problems 2]. CSDP has also been used in a code
for the solution of MAX-2-SAT problems 5].
The remainder of this paper is organized as follows. First, we discuss the formula-
tion of the semidenite programming problem used by CSDP. We then describe the
predictor corrector algorithm used by CSDP to solve the SDP. We discuss the stor-
age requirements of the algorithm as well as its computational complexity. Finally,
we present results from the solution of a number of test problems.
Our algorithm is designed to work with a starting solution that may not satisfy
A(X ) = a or Z = AT (y) + B T (t) ; C , so we dene
Fp = a ; A(X ) (11)
and
Fd = ;AT y ; B T (t) + C + Z: (12)
The predictor step is the Newton's method step for these equations with = 0.
Z^ ; AT (^y) ; B T (t^) = ;Fd
;A(X^ ) = ;Fp (13)
t^ (b ; B (X )) ; t B (X^ ) = ;t (b ; B (X ))
Z X^ + ZX ^ = ;ZX:
These equations are solved as in 4]. We reduce (13) to
A(Z ;1 AT (^y)X ) + A(Z ;1 B T (t^)X ) = ;a + A(Z ;1 Fd X )
B (Z A (^y)X ) + (b ; B (X )) t;1 t^ + B (Z ;1 B T (t^)X ) = ;b + B (Z ;1 Fd X ):
; 1 T
(14)
In matrix form, this system of equations can be written as
O11 O12 ^y = ;a + A(Z ;1 Fd X ) (15)
O21 O22 t^ ;b + B (Z ;1 Fd X )
where
O11 = A(Z ;1 AT (e1 )X ) : : : A(Z ;1 AT (ek )X )
O12 = A(Z ;1 B T (e1 )X ) : : : A(Z ;1 B T (el )X )
O21 = B (Z ;1 AT (e1 )X ) : : : B (Z ;1 AT (ek )X )
O22 = B (Z ;1 B T (e1 )X ) : : : B (Z ;1 B T (el )X ) + diag ((b ; B (X ) t;1 ):
(16)
As Helmberg, Rendl, Vanderbei, and Wolkowicz have shown, the O matrix is sym-
metric and positive denite 4]. Thus we can compute Cholesky factorization of
O and then use the factorization to solve the system of equations. Once we have
solved these equations for ^y and t^, we compute X^ and Z^ as
X^ = ;X + Z ;1Fd X ; Z ;1 (AT (^y) + B T (t^))X (17)
4 B. Borchers
and
Z^ = ;Fd + AT (^y) + B T (t^): (18)
Note that X^ might not be symmetric. In order to keep our solution X symmetric,
we force X^ to be symmetric by averaging the o diagonal entries.
For the corrector step, we compute a Newton step from (X + X ^ Z + Z
^ y+
^y t + t^) towards a solution to (10).
Z ; AT (y ) ; B T (t) = 0
;A(X ) = 0 (19)
t (b ; B (X + X^ )) ; t B (X ) = e ; t (b ; B (X + X^ ))
(Z + Z^)X + Z(X + X^ ) = ;(Z + Z^)(X + X^ ) + I:
Dropping higher order terms from the left hand side, and simplifying the right hand
side, we obtain
Z ; AT (y) ; B T (t) = 0
;A(X ) = 0 (20)
t (b ; B (X )) ; t B (X ) = e ; t (b ; B (X + X^ ))
Z X + ZX = ;Z^X^ + I:
These equations have the same form as (13) and are solved as before to obtain
(X Z y t). Next, we add the predictor and corrector steps to compute
X = X^ + X
Z = Z^ + Z (21)
y = ^y + y
t = t^ + t:
We would like to take full steps of length one in each of X , y, t, and Z . However,
there is a chance that this would lead to an infeasible solution. Thus we perform a
line search to nd the maximum safe steps P and D . Finally, we move from the
current point (X y t Z ) to (X + P X y + D y t + D t Z + D Z ).
In practice, the system matrix O may become numerically singular even though
X and Z are numerically nonsingular. In this case, CSDP returns to the previous
solution, and executes a centering step with
T
= tr(ZX ) (+nt+(mb ;) B (X )) : (22)
Users of CSDP can specify their own termination criteria. However, the default
criteria are that
jtr(CX );(aT y+bT t)j < 1:0 10;7
1+j(aT y +bT t)j
jjA(x);ajj < 1:0 10;7
1+jjajj
jjAT (y)+BT (t);C ;Z jjF < 1:0 10;7
1+jjC jjF (23)
B T (t) b
t 0
X Z 0:
CSDP 5
4 Computational Complexity
In this section we consider the storage requirements and computational complexity
of the predictor corrector algorithm. We will consider a problem with n by n
matrices, X , Z , and C , and m equality constraints. The analysis is essentially
unchanged by the addition of inequality constraints.
In addition to the problem data, our implementation of the algorithm requires
one array of size m by m, and twelve arrays of size n by n. Assuming that the
constraint matrices are sparse, and assuming that m is much larger than n, the
storage required by the system matrix, O, usually dominates the total storage
requirements. For example, in computing the Lovasz # number of a graph with 100
nodes and 1000 edges, n is 100, while m is 1,001. In our example, the 1,001 by
1,001 matrix O occupies over 8 megabytes of storage, while the 100 by 100 matrices
occupy a total of about 1 megabyte of storage. In this example, there are a total
of 1,100 nonzero entries in the constraint matrices.
In practice, the number of iterations required by the algorithm is generally less
than 30, and seems to grow slowly with the size of the problem. For that reason,
we'll focus on the computational complexity of a single iteration of the algorithm.
In the implementation of the semidenite programming algorithm, there are three
computational tasks that are of particular signicance:
Computing the system matrix O, requires O(m(n2 m + n3 )) time. This is in the
worst case, assuming that the constraint matrices are dense.
Factoring the system matrix O, requires O(m3 ) time.
Factoring matrices of size n, requires O(n3 ) time.
Since m is often much larger than n, computing and factoring the O matrix is usu-
ally much harder than various operations on the n by n matrices. In our example,
factoring the 1 001 by 1 001 matrix O is about 1 000 times harder than factoring
one of the 100 by 100 matrices.
This analysis assumes that the constraint matrices Ai are fully dense matrices. In
many cases, these matrices are sparse, and considerable performance improvement
is possible in the construction of O. If the individual constraint matrices have O(1)
nonzero entries, a simple analysis shows that we can construct O in O(m(n2 + m))
time. Unfortunately, the system matrix O is normally dense, so there is no way to
exploit sparsity in factoring O.
Thus if m is somewhat larger than n, and the constraint matrices are sparse, the
most dicult part of each iteration is computing the Cholesky factorization of a m
by m matrix. In our implementation, we have used routines from the LINPACK
or LAPACK libraries to compute this factorization. On many systems, highly
optimized versions of the libraries are available. Using such an optimized library
can greatly improve the performance of CSDP.
It should also be noted that in some cases it is possible to greatly simplify the
computation of A(X ), AT (y), B (X ), B T (t) and O. For example, if the constraints
are of the form Xii = 1, i = 1 : : : n, then A(X ) = diag(X ), AT (y) = diag(y), and
6 B. Borchers
O = X Z ;1 . CSDP allows the user to write routines that implement specialized
versions of these operations.
5 Test Problems
In this section, we discuss the solution of a set of test problems taken from 2]. For
comparison, we also report results from SDPA version 4.2 3]. All computations
were performed on a Sun Ultra 1/170 workstation under Solaris 2.5.1. For these
runs, 256 megabytes of virtual storage were available. A time limit of 12 CPU hours
was also enforced.
For these problems, CSDP used an initial solution similar to the one used in 9].
This initial solution has
X = I
Z = I (24)
y = 0
where
= n max
k
(1 + jak j)=(1 + jjAk jjF ) (25)
and pn:
= (1 + max(max k
( jj Ak jj F ) jj C jj F )) = (26)
Computational results for the SDPLIB problems are shown in tables 1 through
3. The notation \> 12 hrs" indicates that one of the codes couldn't solve the
problem within the 12 CPU hour time limit. The notation \mem" indicates that
the problem couldn't be solved within the 256 megabytes of available virtual stor-
age. Problems infp1, infp2, infd1, and infd2 are infeasible problems, so no optimal
objective function value is given.
In general, the two codes produced solutions of comparable quality. In some
cases SDPA nds a more accurate solution while in other cases CSDP obtains a
more accurate solution. There are some problems which CSDP was able to solve
but SDPA was not able to solve. For the 83 problems that were solved by both
codes, CSDP required roughly 99,000 CPU seconds, while SDPA required roughly
155,000 CPU seconds. CSDP ranged from about 3 times slower than SDPA (on
problem ss30 ) to about 15 times faster than SDPA (on problem gpp250{1). The
geometric mean of the ratio of CSDP CPU times to SDPA CPU times was 71%.
CSDP 7