CSDP User s Guide. Brian Borchers. August 15, 2006

Similar documents
CSDP User s Guide. Brian Borchers. November 1, 2006

CSDP User s Guide

CSDP 5.0 User s Guide

Package Rcsdp. April 25, 2016

Issues In Implementing The Primal-Dual Method for SDP. Brian Borchers Department of Mathematics New Mexico Tech Socorro, NM

Abstract Primal dual interior point methods and the HKM method in particular

Implementation of a Primal-Dual Method for. SDP on a Shared Memory Parallel Architecture

A Conversion of an SDP Having Free Variables into the Standard Form SDP

ADDENDUM TO THE SEDUMI USER GUIDE VERSION 1.1

The State-of-the-Art in Conic Optimization Software

SDPA Project: Solving Large-scale Semidefinite Programs

Parallel implementation of a semidefinite programming solver based on CSDP on a distributed memory cluster

YALMIP. Yet another LMI parser. Version 1.1. Johan Löfberg

A Parallel Primal-Dual Interior-Point Method for Semidefinite Programs Using Positive Definite Matrix Completion

IMPLEMENTATION OF A CUTTING PLANE METHOD FOR SEMIDEFINITE PROGRAMMING

USER S GUIDE FOR TOMLAB /PENOPT 1

Conic Optimization via Operator Splitting and Homogeneous Self-Dual Embedding

Lecture 9. Introduction to Numerical Techniques

Research Interests Optimization:

Linear and Integer Programming :Algorithms in the Real World. Related Optimization Problems. How important is optimization?

Some Advanced Topics in Linear Programming

SDPA (SemiDefinite Programming Algorithm) User s Manual Version 6.2.0

Parallel Computing on Semidefinite Programs

Linear Programming. Linear programming provides methods for allocating limited resources among competing activities in an optimal way.

New Directions in Linear Programming

1 Introduction This package contains software for solving the second-order cone programming (SOCP) problem minimize f T x subject to ka i x + b i kc T

SDPLR 1.03-beta User s Guide (short version)

Shiqian Ma, MAT-258A: Numerical Optimization 1. Chapter 2. Convex Optimization

arxiv: v1 [math.oc] 6 Nov 2016

Introduction to Mathematical Programming IE496. Final Review. Dr. Ted Ralphs

SDLS: a Matlab package for solving conic least-squares problems

Contents. I Basics 1. Copyright by SIAM. Unauthorized reproduction of this article is prohibited.

Introduction. Linear because it requires linear functions. Programming as synonymous of planning.

Math Models of OR: The Simplex Algorithm: Practical Considerations

A PRIMAL-DUAL EXTERIOR POINT ALGORITHM FOR LINEAR PROGRAMMING PROBLEMS

Extensions of Semidefinite Coordinate Direction Algorithm. for Detecting Necessary Constraints to Unbounded Regions

High Performance Grid and Cluster Computing for Some Optimization Problems

MATLAB Solution of Linear Programming Problems

Disciplined Convex Programming and CVX

3 Interior Point Method

Detecting Infeasibility in Infeasible-Interior-Point. Methods for Optimization

Dense matrix algebra and libraries (and dealing with Fortran)

PARDISO Version Reference Sheet Fortran

A Few Numerical Libraries for HPC

Code Generation for Embedded Convex Optimization

Lesson 11: Duality in linear programming

Solving Large Scale Optimization Problems via Grid and Cluster Computing

Linear programming and duality theory

DM545 Linear and Integer Programming. Lecture 2. The Simplex Method. Marco Chiarandini

The Affine Scaling Method

FOR Loop. FOR Loop has three parts:initialization,condition,increment. Syntax. for(initialization;condition;increment){ body;

Modeling Cone Optimization Problems with COIN OS

SDLS: a Matlab package for solving conic least-squares problems

Linear Programming MT 4.0

AM 121: Intro to Optimization Models and Methods Fall 2017

A new library of structured semidefinite programming instances

COMPARISON BETWEEN AN INFEASIBLE INTERIOR POINT ALGORITHM AND A HOMOGENEOUS SELF DUAL ALGORITHM FOR SEMIDEFINITE PROGRAMMING

Programming Languages

SECTION 1: INTRODUCTION. ENGR 112 Introduction to Engineering Computing

A primal-dual Dikin affine scaling method for symmetric conic optimization

Conic Duality. yyye

Lec13p1, ORF363/COS323

16.410/413 Principles of Autonomy and Decision Making

Programs. Introduction

Linear Programming. Course review MS-E2140. v. 1.1

LECTURE 13: SOLUTION METHODS FOR CONSTRAINED OPTIMIZATION. 1. Primal approach 2. Penalty and barrier methods 3. Dual approach 4. Primal-dual approach

Solving Linear Programs Using the Simplex Method (Manual)

6 Randomized rounding of semidefinite programs

LAPACK. Linear Algebra PACKage. Janice Giudice David Knezevic 1

1 Introduction to MATLAB

Appendix A MATLAB s Optimization Toolbox Algorithms

Module 19.1: nag ip Integer Programming. Contents

PACKAGE SPECIFICATION HSL 2013

Matrix Multiplication

FreeMat Tutorial. 3x + 4y 2z = 5 2x 5y + z = 8 x x + 3y = -1 xx

AMath 483/583 Lecture 22. Notes: Another Send/Receive example. Notes: Notes: Another Send/Receive example. Outline:

Towards a practical simplex method for second order cone programming

Tutorial on Convex Optimization for Engineers

Nonlinear Programming

A High Performance C Package for Tridiagonalization of Complex Symmetric Matrices

Section Notes 5. Review of Linear Programming. Applied Math / Engineering Sciences 121. Week of October 15, 2017

Linear Programming: Introduction

Fast ADMM for Semidefinite Programs with Chordal Sparsity

Sequential Coordinate-wise Algorithm for Non-negative Least Squares Problem

Symbolic Subdifferentiation in Python

LECTURE 6: INTERIOR POINT METHOD. 1. Motivation 2. Basic concepts 3. Primal affine scaling algorithm 4. Dual affine scaling algorithm

How to use Farkas lemma to say something important about linear infeasible problems MOSEK Technical report: TR

Using the NAG C Library in C/C++

1 Introduction to MATLAB

CS 473: Algorithms. Ruta Mehta. Spring University of Illinois, Urbana-Champaign. Ruta (UIUC) CS473 1 Spring / 36

Matrix Multiplication

CME307/MS&E311 Theory Summary

Isothermal Batch Reactor Modeling

Mathematical Programming and Research Methods (Part II)

Convex Optimization M2

Qualifying Exam in Programming Languages and Compilers

(Refer Slide Time 01:41 min)

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #43. Multidimensional Arrays

Matlab and Octave: Quick Introduction and Examples 1 Basics

Stat 579: Objects in R Vectors

Transcription:

CSDP User s Guide Brian Borchers August 5, 6 Introduction CSDP is a software package for solving semidefinite programming problems. The algorithm is a predictor corrector version of the primal dual barrier method of Helmberg, Rendl, Vanderbei, and Wolkowicz [3]. A more detailed, but now somewhat outdated description of the algorithms in CSDP can be found in []. CSDP is written in C for efficiency and portability. The code is designed to make use of highly optimized linear algebra routines from the LAPACK and BLAS libraries. CSDP also has a number of features that make it very flexible. CSDP can work with general symmetric matrices or with matrices that have defined block diagonal structure. CSDP is designed to handle constraint matrices with general sparse structure. The code takes advantage of this structure in efficiently constructing the system of equations that is solved at each iteration of the algorithm. In addition to its default termination criteria, CSDP includes a feature that allows the user to terminate the solution process after any iteration. For example, this feature can be used within a cutting plane scheme to terminate the solution process as soon as cutting planes have been identified. The CSDP library contains routines for writing SDP problems and solutions to files and reading problems and solutions from files. A stand alone solver program is included for solving SDP problems that have been written in the SDPA sparse format []. An interface to MATLAB is also provided. The MATLAB routine can be used to solve problems that are in the format used by the SeDuMi [5]. This document describes how to use the stand alone solver, MATLAB interface, and library routines after CSDP has been installed. For detailed instructions on how to compile CSDP see the INSTALL file in the main directory.

The SDP Problem CSDP solves semidefinite programming problems of the form max tr (CX) A(X) = a X () where A(X) = tr (A X) tr (A X)... tr (A m X). () Here X means that X is positive semidefinite. All of the matrices A i, X, and C are assumed to be real and symmetric. The dual of this SDP is where min a T y A T (y) C = Z Z A T (y) = (3) m y i A i. (4) Other semidefinite programming packages use slight variations on this primal dual pair. For example, the primal dual pair used in SDPA interchanges the primal and dual problems. Users of CSDP can specify their own termination criteria. However, the default criteria are that i= tr(xz) + a T y <. 8 A(x) a + a <. 8 A T (y) C Z F + C F <. 8 X, Z. Note that for feasible primal and dual solutions, a T y tr(cx) = tr(xz). Thus the first of these criteria insures that the relative duality gap is small. In practice, there are sometimes solutions which satisfy our primal and dual feasibility tolerances but have duality gaps which are not close to tr(xz). In some cases, the duality gap may even become negative. Because of this ambiguity, we use the tr(xz) gap instead of the difference between the objective functions. An option in the param.csdp file allows CSDP to use the difference of the primal objective functions instead of the tr(xz) gap. The matrices X and Z are considered to be positive definite when their Cholesky factorizations can be computed. In practice, this is somewhat more conservative than simply requiring all eigenvalues to be nonnegative.

The Seventh DIMACS Implementation Challenge used a slightly different set of error measures [4]. For convenience in benchmarking, CSDP includes these DIMACS error measures in its output. To test for primal infeasibility, CSDP checks the inequality a T y A T (y) Z F >. 8. If CSDP detects that a problem is primal infeasible, then it will announce this in its output and return a dual solution with a T y =, and A T (y) Z very small. This acts as a certificate of primal infeasibility. Similarly, CSDP tests for dual infeasibility by checking tr(cx) A(X) >. 8. If CSDP detects that a problem is dual infeasible, it announces this in its output and returns a primal solution with tr(cx) =, and A(X) small. This acts as a certificate of the dual infeasibility. The tolerances for primal and dual feasibility and the relative duality gap can be changed by editing CSDP s parameter file. See the following section on using the stand alone solver for a description of this parameter file. Using the stand alone solver CSDP includes a program which can be used to solve SDP s that have been written in the SDPA sparse format. Usage is csdp <problem file> [<final solution>] [<initial solution>] where <problem file> is the name of a file containing the SDP problem in SDPA sparse format, final solution is the optional name of a file in which to save the final solution, and initial solution is the optional name of a file from which to take the initial solution. The following example shows how CSDP would be used to solve a test problem. >csdp theta.dat-s Iter: Ap:.e+ Pobj:.464466e+4 Ad:.e+ Dobj:.e+ Iter: Ap: 9.3e- Pobj: 5.753865e+3 Ad:.e+ Dobj: 8.73e+ Iter: Ap: 9.e- Pobj:.374e+ Ad:.e+ Dobj: 8.74935e+ Iter: 3 Ap: 9.3e- Pobj:.59e+ Ad:.e+ Dobj: 8.44477e+ Iter: 4 Ap:.e+ Pobj:.54765e+ Ad:.e+ Dobj: 7.648e+ Iter: 5 Ap:.e+ Pobj: 7.5846337e+ Ad:.e+ Dobj: 4.853659e+ Iter: 6 Ap:.e+ Pobj:.58936e+ Ad:.e+ Dobj: 3.77869e+ Iter: 7 Ap:.e+ Pobj:.98874e+ Ad:.e+ Dobj:.458866e+ Iter: 8 Ap:.e+ Pobj:.6333e+ Ad:.e+ Dobj:.34657e+ 3

Iter: 9 Ap:.e+ Pobj:.6983e+ Ad:.e+ Dobj:.39749e+ Iter: Ap:.e+ Pobj:.939498e+ Ad:.e+ Dobj:.398e+ Iter: Ap:.e+ Pobj:.99659e+ Ad:.e+ Dobj:.3637e+ Iter: Ap:.e- Pobj:.999835e+ Ad:.e+ Dobj:.3e+ Iter: 3 Ap:.e+ Pobj:.999993e+ Ad:.e+ Dobj:.999999e+ Iter: 4 Ap:.e+ Pobj:.3e+ Ad:.e+ Dobj:.3e+ Success: SDP solved Primal objective value:.3e+ Dual objective value:.3e+ Relative primal infeasibility: 4.45e-9 Relative dual infeasibility: 3.93e-9 Real Relative Gap: 7.e-9 XZ Relative Gap: 7.8e-9 DIMACS error measures: 4.45e-9.e+.e-7.e+ 7.e-9 7.8e-9 One line of output appears for each iteration of the algorithm, giving the iteration number, primal step size (Ap), primal objective value (Pobj), dual step size (Ad), and dual objective value (Dobj). The last eight lines of output show the primal and dual optimal objective values, the XZ duality gap, the actual duality gap, the relative primal and dual infeasibility in the optimal solution. CSDP searches for a file named param.csdp in the current directory. If no such file exists, then default values for all of CSDP s parameters are used. If there is a parameter file, then CSDP reads the parameter values from this file. A sample file containing the default parameter values is given below. axtol=.e-8 atytol=.e-8 objtol=.e-8 pinftol=.e8 dinftol=.e8 maxiter= minstepfrac=.9 maxstepfrac=.97 minstepp=.e-8 minstepd=.e-8 usexzgap= tweakgap= affine= printlevel= perturbobj= fastmode= The first three parameters, axtol, atytol, and objtol are the tolerances for primal feasibility, dual feasibility, and relative duality gap. The parameters pinftol and dinftol are tolerances used in determining primal and dual infeasibility. The maxiter parameter is used to limit the total number of iterations that CSDP may use. The minstepfrac and maxstepfrac parameters determine how close to 4

the edge of the feasible region CSDP will step. If the primal or dual step is shorter than minstepp or minstepd, then CSDP declares a line search failure. If parameter usexzgap is, then CSDP will use the objective function duality gap instead of the tr(xz) gap. If tweakgap is set to, and usexzgap is set to, then CSDP will attempt to fix negative duality gaps. If parameter affine is set to, then CSDP will take only primal dual affine steps and not make use of the barrier term. This can be useful for some problems that do not have feasible solutions that are strictly in the interior of the cone of semidefinite matrices. The printlevel parameter determines how much debugging information is output. Use printlevel= for no output and printlevel= for normal output. Higher values of printlevel will generate more debugging output. The perturbobj parameter determines whether the objective function will be perturbed to help deal with problems that have unbounded optimal solution sets. The fastmode parameter determines whether or not CSDP will skip certain time consuming operations that slightly improve the accuracy of the solutions. If fastmode is set to, then CSDP may be much faster, but also somewhat less accurate. Calling CSDP from MATLAB or Octave An interface to the stand alone solver from MATLAB or Octave is included in CSDP. This requires MATLAB 6.5 or later) or Octave.9.5 or later. The interface accepts problems in the format used by the MATLAB package SeDuMi.5. The usage is [x,y,z,info]=csdp(at,b,c,k,pars) Uses CSDP to solve a problem in SeDuMi format. Input: At, b, c, K SDP problem in SeDuMi format. pars CSDP parameters (optional parameter.) Output: x, y, z solution. info CSDP return code. info= indicates a failure in the MATLAB interface, such as inability to write to a temporary file. Note: This interface makes use of temporary files with names given by the tempname function. This will fail if there is no working temporary directory or there isn t enough space available in this directory. 5

Note: This code writes its own param.csdp file in the current working directory. Any param.csdp file already in the directory will be deleted. Note: It is assumed that csdp is the search path made available through the system or dos command. Typically, having the csdp executable in current working directory will work, although some paranoid system administrators keep. out of the path. In that case, you ll need to install csdp in one of the directories that is in the search path. A simple test is to run csdp from a command line prompt. The following example shows the solution of a sample problem using this interface. To make the example more interesting, we ve asked CSDP to find a solution with a relative duality gap smaller than.e-9 instead of the usual.e-8. >> load control.mat >> whos Name Size Bytes Class At 5x 8488 double array (sparse) K x 4 struct array ans x 6 double array b x 68 double array c 5x 8 double array (sparse) Grand total is 73 elements using 889 bytes >> pars.objtol=.e-9 pars = objtol:.e-9 >> [x,y,z,info]=csdp(at,b,c,k,pars); Transposing A to match b Number of constraints: Number of SDP blocks: Number of LP vars: Iter: Ap:.e+ Pobj: 3.63796e+ Ad:.e+ Dobj:.e+ Iter: Ap: 9.56e- Pobj: 3.757534e+ Ad: 9.6e- Dobj: 6.4836e+4 Iter: Ap: 8.55e- Pobj: 4.344779e+ Ad: 9.67e- Dobj: 6.958e+4 Iter: 3 Ap: 8.77e- Pobj:.49498e+ Ad:.e+ Dobj: 6.4539e+4 Iter: 4 Ap: 7.4e- Pobj: 8.8948e+ Ad:.e+ Dobj:.96534e+4 Iter: 5 Ap: 8.3e- Pobj: 4.74688e+ Ad:.e+ Dobj: 4.945e+3 Iter: 6 Ap: 7.97e- Pobj:.63e+ Ad:.e+ Dobj:.467743e+3 Iter: 7 Ap: 7.e- Pobj:.55577e+ Ad:.e+ Dobj: 4.5686e+ 6

Iter: 8 Ap: 8.73e- Pobj: 7.595e+ Ad:.e+ Dobj:.74875e+ Iter: 9 Ap: 9.87e- Pobj: 5.37658e+ Ad:.e+ Dobj: 5.973e+ Iter: Ap:.e+ Pobj: 7.859467e+ Ad:.e+ Dobj:.7435e+ Iter: Ap: 8.33e- Pobj:.56737e+ Ad:.e+ Dobj:.47584e+ Iter: Ap:.e+ Pobj:.757e+ Ad:.e+ Dobj:.8875e+ Iter: 3 Ap:.e+ Pobj:.778e+ Ad:.e+ Dobj:.78469e+ Iter: 4 Ap: 9.99e- Pobj:.77796e+ Ad:.e+ Dobj:.77877e+ Iter: 5 Ap:.e+ Pobj:.7783579e+ Ad:.e+ Dobj:.778575e+ Iter: 6 Ap:.e+ Pobj:.7784494e+ Ad:.e+ Dobj:.778478e+ Iter: 7 Ap:.e+ Pobj:.77846e+ Ad:.e+ Dobj:.778467e+ Iter: 8 Ap:.e+ Pobj:.778466e+ Ad:.e+ Dobj:.77846e+ Iter: 9 Ap:.e- Pobj:.778467e+ Ad:.e+ Dobj:.778467e+ Iter: Ap: 9.6e- Pobj:.778467e+ Ad: 9.6e- Dobj:.778467e+ Success: SDP solved Primal objective value:.778467e+ Dual objective value:.778467e+ Relative primal infeasibility:.8e-9 Relative dual infeasibility: 3.e- Real Relative Gap: -3.5e- XZ Relative Gap: 6.5e- DIMACS error measures:.8e-9.e+ 7.e-.e+ -3.5e- 6.5e-.u.s :. 5. +k +io 34pf+w >> info info = The writesdpa function can be used to write out a problem in SDPA sparse format. This function takes a problem in SeDuMi MATLAB format and writes it out in SDPA sparse format. Usage: ret=writesdpa(fname,a,b,c,k,pars) fname Name of SDPpack file, in quotes A,b,c,K Problem in SeDuMi form pars Optional parameters. pars.printlevel= No printed output pars.prinlevel= (default) Some printed output. pars.check= (default) Do not check problem data for symmetry. 7

pars.check= Check problem data for symmetry. ret ret= on success, ret= on failure. Problems in the SeDuMi format may involve free variables. A free variable can be converted into the difference of two non negative variables using the convertf function. [A,b,c,K]=convertf(A,b,c,K) converts free variables in a SeDuMi problem into nonnegative LP variables. Using the subroutine interface to CSDP Storage Conventions The matrices C, X, and Z are treated as block diagonal matrices. The declarations in the file blockmat.h describe the block matrix data structure. The blockmatrix structure contains a count of the number of blocks and a pointer to an array of records that describe individual blocks. The individual blocks can be matrices of size blocksize or diagonal matrices in which only a vector of diagonal entries is stored. Individual matrices within a block matrix are stored in column major order as in Fortran. The ijtok() macro defined in index.h can be used to convert Fortran style indices into an index into a C vector. For example, if A is stored as a Fortran array with leading dimension n, element (i,j) of A can be accessed within a C program as A[ijtok(i,j,n)]. The following table demonstrates how a 3 by matrix would be stored under this system. C index Fortran index A[] A(,) A[] A(,) A[] A(3,) A[3] A(,) A[4] A(,) A[5] A(3,) Vectors are stored as conventional C vectors. However, indexing always starts with, so the [] element of every vector is wasted. Most arguments are described as being of size n or m. Since the zeroth element of the vector is wasted, these vectors must actually be of size n+ or m+. 8

The constraint matrices A i are stored in a sparse form. The array constraints contains pointers which point to linked lists of structures, with one structure for each block of the sparse matrix. The sparseblock data structures contain pointers to arrays which contain the entries and their i and j indices. For an example of how to setup these data structures, refer to the example directory in the CSDP distribution. This directory contains a program that solves the very small SDP where C = max A = A = 3 3 tr (CX) tr A X = tr A X = X 3 3 3 4 5 (5) (6) (7). (8) In this problem, the X, Z, A, A and C matrices have three blocks. The first block is a by matrix. The second block is a 3 by 3 matrix. The third block is a diagonal block with entries. Figure shows a graphical representation of the data structure that holds the C matrix. Notice that individual matrix blocks of the C matrix are stored as Fortran arrays and that the diagonal block is stored as a vector, with the entry unused. The data structures for X and Z are similar. Figure shows the overall structure of the constraints. There is a vector of pointers to linked lists of constraint blocks. The th entry in this array is ignored. Blocks that contain only zero entries are not stored in the linked lists. 9

3 MATRIX 3 MATRIX DIAG 3 3 Figure : The C matrix. A A Block Block 3 Block Block 3 Figure : The constraints. Figure 3 shows the detail of the data structure for block of the constraint matrix A. Storage Requirements CSDP requires storage for a number of block diagonal matrices of the same form as X and Z, as well as storage for the Schur complement system that is Cholesky factored in each iteration. For a problem with m constraints and block diagonal matrices with blocks of size n, n,..., n s, CSDP requires approximately Storage = 8(m + (n + n +... + n s)) bytes of storage. This formula includes all of the two dimensional arrays but leaves out the one dimensional vectors. This formula also excludes the storage required to store the constraint matrices, which are assumed to be sparse. In

iindices jindices entries blocknum blocksize constraintnum 3 3 Figure 3: Block of A. practice it is wise to allow for about to more storage to account for the excluded factors. Calling The SDP Routine The routine has parameters which include the problem data and an initial solution. The calling sequence for the sdp subroutine is: int easy_sdp(n,k,c,a,constraints,constant_offset,px,py,pz,ppobj,pdobj) int n; /* Dimension of X */ int k; /* # of constraints */ struct blockmatrix C; /* C matrix */ double *a; /* right hand side vector */ struct constraintmatrix *constraints; /* Constraints */ double constant_offset; /* added to objective */ struct blockmatrix *px; /* X matrix */ double **py; /* y vector */ struct blockmatrix *pz; /* Z matrix */ double *ppobj; /* Primal objective */ double *pdobj; /* Dual objective */ Input Parameters. n. This parameter gives the dimension of the X, C, and Z matrices.. k. This parameter gives the number of constraints. 3. C. This parameter gives the C matrix and implicitly defines the block structure of the block diagonal matrices. 4. a. This parameter gives the right hand side vector a. 5. constraints. This parameter specifies the problem constraints.

6. constant offset. This scalar is added to the primal and dual objective values. 7. px. On input, this parameter gives the initial primal solution X. 8. py. On input, this parameter gives the initial dual solution y. 9. pz. On input, this parameter gives the initial dual solution Z. Output Parameters. px. On output this parameter gives the optimal primal solution X.. py. On output, this parameter gives the optimal dual solution y. 3. pz. On output, this parameter gives the optimal dual solution Z. 4. ppobj. On output, this parameter gives the optimal primal objective value. 5. pdobj. On output, this parameter gives the optimal dual objective value. Return Codes If CSDP succeeds in solving the problem to full accuracy, the easy sdp routine will return. Otherwise, the easy sdp routine will return a nonzero return code. In many cases, CSDP will have actually found a good solution that doesn t quite satisfy one of the termination criteria. In particular, return code 3 is usually indicative of such a solution. Whenever there is a nonzero return code, you should examine the return and the solution to see what happened. The nonzero return codes are. Success. The problem is primal infeasible.. Success. The problem is dual infeasible. 3. Partial Success. A solution has been found, but full accuracy was not achieved. One or more of primal infeasibility, dual infeasibility, or relative duality gap are larger than their tolerances, but by a factor of less than. 4. Failure. Maximum iterations reached. 5. Failure. Stuck at edge of primal feasibility. 6. Failure. Stuck at edge of dual infeasibility. 7. Failure. Lack of progress. 8. Failure. X, Z, or O was singular. 9. Failure. Detected NaN or Inf values.

The User Exit Routine By default, the easy sdp routine stops when it has obtained a solution in which the relative primal and dual infeasibilities and the relative gap between the primal and dual objective values is less than. 8. There are situations in which you might want to terminate the solution process before an optimal solution has been found. For example, in a cutting plane routine, you might want to terminate the solution process as soon as a cutting plane has been found. If you would like to specify your own stopping criteria, you can implement these in a user exit routine. At each iteration of its algorithm, CSDP calls a routine named user exit. CSDP passes the problem data and current solution to this subroutine. If user exit returns, then CSDP continues. However, if user exit returns, then CSDP returns immediately to the calling program. The default routine supplied in the CSDP library simply returns. You can write your own routine and link it with your program in place of the default user exit routine. The calling sequence for the user exit routine is int user_exit(n,k,c,a,dobj,pobj,constant_offset,constraints,x,y,z,params) int n; /* Dimension of X */ int k; /* # of constraints */ struct blockmatrix C; /* C matrix */ double *a; /* right hand side */ double dobj; /* dual objective */ double pobj; /* primal objective */ double constant_offset; /* added to objective */ struct constraintmatrix *constraints; /* Constraints */ struct blockmatrix X; /* primal solution */ double *y; /* dual solution */ struct blockmatrix Z; /* dual solution */ struct paramstruc params; /* parameters sdp called with */ Finding an Initial Solution The CSDP library contains a routine for finding an initial solution to the SDP problem. Note that this routine allocates all storage required for the initial solution. The calling sequence for this routine is: void initsoln(n,k,c,a,constraints,px,py,pz) int n; /* dimension of X */ int k; /* # of constraints */ struct blockmatrix C; /* C matrix */ double *a; /* right hand side vector */ struct constraintmatrix *constraints; /* constraints */ struct blockmatrix *px; /* Initial primal solution */ double **py; /* Initial dual solution */ struct blockmatrix *pz; /* Initial dual solution */ 3

Reading and Writing Problem Data The CSDP library contains routines for reading and writing SDP problems and solutions in SDPA format. The routine write prob is used to write out an SDP problem in SDPA sparse format. The routine read prob is used to read an SDP problem in from a file. The routine write sol is used to write an SDP solution to a file. The routine read sol is used to read a solution from a file. The calling sequence for write prob is int write_prob(fname,n,k,c,a,constraints) char *fname; /* file to write */ int n; /* Dimension of X */ int k; /* # of constraints */ struct blockmatrix C; /* The C matrix */ double *a; /* The a vector */ struct constraintmatrix *constraints; /* the constraints */ The calling sequence for read prob is: int read_prob(fname,pn,pk,pc,pa,pconstraints,printlevel) char *fname; /* file to read */ int *pn; /* Dimension of X */ int *pk; /* # of constraints */ struct blockmatrix *pc; /* The C matrix */ double **pa; /* The a vector */ struct constraintmatrix **pconstraints; /* The constraints */ int printlevel; /* = for no output, = for normal output, > for debugging */ Note that the read prob routine allocates all storage required by the problem. The calling sequence for write sol is int write_sol(fname,n,k,x,y,z) char *fname; /* Name of the file to write to */ int n; /* Dimension of X */ int k; /* # of constraints */ struct blockmatrix X; /* Primal solution X */ double *y; /* Dual vector y */ struct blockmatrix Z; /* Dual matrix Z */ This routine returns if successful and exits if it is unable to write the solution file. The calling sequence for read sol is int read_sol(fname,n,k,c,px,py,pz) char *fname; /* file to read */ int n; /* dimension of X */ int k; /* # of constraints */ 4

struct blockmatrix C; /* The C matrix */ struct blockmatrix *px; /* The X matrix */ double **py; /* The y vector */ struct blockmatrix *pz; /* The Z matrix */ Note that read sol allocates storage for X, y, and Z. This routine returns when successful, and exits if it is unable to read the solution file. Freeing Problem Memory The routine free prob can be used to automatically free the memory allocated for a problem. The calling sequence for free prob is void free_prob(n,k,c,a,constraints,x,y,z) int n; /* Dimension of X */ int k; /* # of constraints */ struct blockmatrix C; /* The C matrix */ double *a; /* The a vector */ struct constraintmatrix *constraints; /* the constraints */ struct blockmatrix X; /* X matrix. */ double *y; /* the y vector. */ struct blockmatrix Z; /* Z matrix. */ References [] B. Borchers. CSDP, a C library for semidefinite programming. Optimization Methods & Software, -(-4):63 63, 999. [] K. Fujisawa, M. Kojima, K. Nakata, and M. Yamashita. SDPA (semidefinite programming algorithm) users manual - version 6.. Technical Report B 38, Tokyo Institute of Technology, 995. [3] C. Helmberg, F. Rendl, R. J. Vanderbei, and H. Wolkowicz. An interiorpoint method for semidefinite programming. SIAM Journal on Optimization, 6():34 36, May 996. [4] H. D. Mittelmann. An independent benchmarking of SDP and SOCP solvers. Mathematical Programming, 95():47 43, February 3. [5] J. F. Sturm. Using SeDuMi., a MATLAB toolbox for optimization over symmetric cones. Optimization Methods & Software, -(-4):65 653, 999. 5