From 32f879b51c75dc2143b24093f48dece3d057ee56 Mon Sep 17 00:00:00 2001 From: odow Date: Mon, 3 Apr 2023 14:49:09 +1200 Subject: [PATCH 1/6] Update README --- README.md | 96 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 61 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index c9d2697..8f7605b 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,21 @@ -# COIN-OR SemiDefinite Programming Interface (CSDP.jl) - ![](https://www.coin-or.org/wordpress/wp-content/uploads/2014/08/COINOR.png) +s +# CSDP.jl + [![Build Status](https://github.com/jump-dev/CSDP.jl/workflows/CI/badge.svg?branch=master)](https://github.com/jump-dev/CSDP.jl/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/jump-dev/CSDP.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/jump-dev/CSDP.jl) -`CSDP.jl` is a wrapper for the [COIN-OR SemiDefinite Programming](https://projects.coin-or.org/Csdp) +[`CSDP.jl`](https://github.com/jump-dev/CSDP.jl) is a wrapper for the [COIN-OR SemiDefinite Programming](https://projects.coin-or.org/Csdp) solver. The wrapper has two components: * a thin wrapper around the low-level C API * an interface to [MathOptInterface](https://github.com/jump-dev/MathOptInterface.jl) -*Note: This wrapper is maintained by the JuMP community and is not a COIN-OR -project.* +## Affiliation + +This wrapper is maintained by the JuMP community and is not a COIN-OR project. The original algorithm is described by B. Borchers. _CSDP, A C Library for Semidefinite Programming_. @@ -21,11 +23,19 @@ Optimization Methods and Software 11(1):613-623, 1999. DOI [10.1080/10556789908805765](http://dx.doi.org/10.1080/10556789908805765). [Preprint](http://euler.nmt.edu/~brian/csdppaper.pdf). +## License + +`Clp.jl` is licensed under the [MIT License](https://github.com/jump-dev/CSDP.jl/blob/master/LICENSE.md). + +The underlying solver, [coin-or/Csdp](https://github.com/coin-or/Csdp), is +licensed under the [Eclipse public license](https://github.com/coin-or/Csdp/blob/master/LICENSE). + ## Installation Install CSDP using `Pkg.add`: ```julia -import Pkg; Pkg.add("CSDP") +import Pkg +Pkg.add("CSDP") ``` In addition to installing the CSDP.jl package, this will also download and @@ -33,18 +43,57 @@ install the CSDP binaries. (You do not need to install CSDP separately.) ## Use with JuMP -We highly recommend that you use the *CSDP.jl* package with higher level -packages such as [CSDP.jl](https://github.com/jump-dev/CSDP.jl). - To use CSDP with [JuMP](https://github.com/jump-dev/JuMP.jl), use `CSDP.Optimizer`: ```julia using JuMP, CSDP - model = Model(CSDP.Optimizer) -set_optimizer_attribute(model, "maxiter", 1000) +set_attribute(model, "maxiter", 1000) ``` +## MathOptInterface API + +The CSDP optimizer supports the following constraints and attributes. + +List of supported objective functions: + + * [`MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}`](@ref) + +List of supported variable types: + + * [`MOI.Nonnegatives`](@ref) + * [`MOI.PositiveSemidefiniteConeTriangle`](@ref) + +List of supported constraint types: + + * [`MOI.ScalarAffineFunction{Float64}`](@ref) in [`MOI.EqualTo{Float64}`](@ref) + +List of supported model attributes: + + * [`MOI.ObjectiveSense()`](@ref) + +## Options + +The CSDP options are listed in the table below. + +Name | | Default Value | + ------------ | ----------------------------------- | -------------- | +`axtol` | Tolerance for primal feasibility | `1.0e-8` | +`atytol` | Tolerance for dual feasibility | `1.0e-8` | +`objtol` | Tolerance for relative duality gap | `1.0e-8` | +`pinftol` | Tolerance for determining primal infeasibility | `1.0e8` | +`dinftol` | Tolerance for determining dual infeasibility | `1.0e8` | +`maxiter` | Limit for the total number of iterations | `100` | +`minstepfrac` | The `minstepfrac` and `maxstepfrac` parameters determine how close to the edge of the feasible region CSDP will step | `0.90` | +`maxstepfrac` | The `minstepfrac` and `maxstepfrac` parameters determine how close to the edge of the feasible region CSDP will step | `0.97` | +`minstepp` | If the primal step is shorter than `minstepp` then CSDP declares a line search failure | `1.0e-8` | +`minstepd` | If the dual step is shorter than `minstepd` then CSDP declares a line search failure | `1.0e-8` | +`usexzgap` | If `usexzgap` is `0` then CSDP will use the objective duality gap `d - p` instead of the XY duality gap `⟨Z, X⟩` | `1` | +`tweakgap` | If `tweakgap` is set to `1`, and `usexzgap` is set to `0`, then CSDP will attempt to "fix" negative duality gaps | `0` | +`affine` | If `affine` is set to `1`, 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 | `0` | +`perturbobj` | The `perturbobj` parameter determines whether the objective function will be perturbed to help deal with problems that have unbounded optimal solution sets. If `perturbobj` is `0`, then the objective will not be perturbed. If `perturbobj` is `1`, then the objective function will be perturbed by a default amount. Larger values of `perturbobj` (e.g. `100`) increase the size of the perturbation. This can be helpful in solving some difficult problems. | `1` | +`fastmode` | 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 `1`, then CSDP may be somewhat faster, but also somewhat less accurate | `0` | +`printlevel` | The `printlevel` parameter determines how much debugging information is output. Use a `printlevel` of `0` for no output and a `printlevel` of `1` for normal output. Higher values of printlevel will generate more debugging output | `1` | ## CSDP problem representation The primal is represented internally by CSDP as follows: @@ -108,27 +157,4 @@ If the `printlevel` option is at least `1`, the following will be printed: * the relative primal/dual infeasibility, * the objective duality gap `⟨a, y⟩ - ⟨C, X⟩` and objective relative duality gap `(⟨a, y⟩ - ⟨C, X⟩) / (1 + |⟨a, y⟩| + |⟨C, X⟩|)`, * the XY duality gap `⟨Z, X⟩` and XY relative duality gap `⟨Z, X⟩ / (1 + |⟨a, y⟩| + |⟨C, X⟩|)` - * and the DIMACS error measures. - -## Options - -The CSDP options are listed in the table below. - -Name | | Default Value | - ------------ | ----------------------------------- | -------------- | -`axtol` | Tolerance for primal feasibility | `1.0e-8` | -`atytol` | Tolerance for dual feasibility | `1.0e-8` | -`objtol` | Tolerance for relative duality gap | `1.0e-8` | -`pinftol` | Tolerance for determining primal infeasibility | `1.0e8` | -`dinftol` | Tolerance for determining dual infeasibility | `1.0e8` | -`maxiter` | Limit for the total number of iterations | `100` | -`minstepfrac` | The `minstepfrac` and `maxstepfrac` parameters determine how close to the edge of the feasible region CSDP will step | `0.90` | -`maxstepfrac` | The `minstepfrac` and `maxstepfrac` parameters determine how close to the edge of the feasible region CSDP will step | `0.97` | -`minstepp` | If the primal step is shorter than `minstepp` then CSDP declares a line search failure | `1.0e-8` | -`minstepd` | If the dual step is shorter than `minstepd` then CSDP declares a line search failure | `1.0e-8` | -`usexzgap` | If `usexzgap` is `0` then CSDP will use the objective duality gap `d - p` instead of the XY duality gap `⟨Z, X⟩` | `1` | -`tweakgap` | If `tweakgap` is set to `1`, and `usexzgap` is set to `0`, then CSDP will attempt to "fix" negative duality gaps | `0` | -`affine` | If `affine` is set to `1`, 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 | `0` | -`perturbobj` | The `perturbobj` parameter determines whether the objective function will be perturbed to help deal with problems that have unbounded optimal solution sets. If `perturbobj` is `0`, then the objective will not be perturbed. If `perturbobj` is `1`, then the objective function will be perturbed by a default amount. Larger values of `perturbobj` (e.g. `100`) increase the size of the perturbation. This can be helpful in solving some difficult problems. | `1` | -`fastmode` | 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 `1`, then CSDP may be somewhat faster, but also somewhat less accurate | `0` | -`printlevel` | The `printlevel` parameter determines how much debugging information is output. Use a `printlevel` of `0` for no output and a `printlevel` of `1` for normal output. Higher values of printlevel will generate more debugging output | `1` | + * and the DIMACS error measures.s From 985c377ebb15eb09ed9d25dca65f6684e911b994 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Mon, 3 Apr 2023 19:58:24 +1200 Subject: [PATCH 2/6] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Benoît Legat --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8f7605b..288d609 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ ![](https://www.coin-or.org/wordpress/wp-content/uploads/2014/08/COINOR.png) -s # CSDP.jl @@ -25,7 +24,7 @@ DOI [10.1080/10556789908805765](http://dx.doi.org/10.1080/10556789908805765). ## License -`Clp.jl` is licensed under the [MIT License](https://github.com/jump-dev/CSDP.jl/blob/master/LICENSE.md). +`CSDP.jl` is licensed under the [MIT License](https://github.com/jump-dev/CSDP.jl/blob/master/LICENSE.md). The underlying solver, [coin-or/Csdp](https://github.com/coin-or/Csdp), is licensed under the [Eclipse public license](https://github.com/coin-or/Csdp/blob/master/LICENSE). @@ -157,4 +156,4 @@ If the `printlevel` option is at least `1`, the following will be printed: * the relative primal/dual infeasibility, * the objective duality gap `⟨a, y⟩ - ⟨C, X⟩` and objective relative duality gap `(⟨a, y⟩ - ⟨C, X⟩) / (1 + |⟨a, y⟩| + |⟨C, X⟩|)`, * the XY duality gap `⟨Z, X⟩` and XY relative duality gap `⟨Z, X⟩ / (1 + |⟨a, y⟩| + |⟨C, X⟩|)` - * and the DIMACS error measures.s + * and the DIMACS error measures. From 9124482b0c4f0bc5364f4099cefc4b8aff9c0d66 Mon Sep 17 00:00:00 2001 From: odow Date: Tue, 4 Apr 2023 13:21:52 +1200 Subject: [PATCH 3/6] Update --- README.md | 123 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 68 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 288d609..db0eb5b 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ [![Build Status](https://github.com/jump-dev/CSDP.jl/workflows/CI/badge.svg?branch=master)](https://github.com/jump-dev/CSDP.jl/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/jump-dev/CSDP.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/jump-dev/CSDP.jl) -[`CSDP.jl`](https://github.com/jump-dev/CSDP.jl) is a wrapper for the [COIN-OR SemiDefinite Programming](https://projects.coin-or.org/Csdp) -solver. +[`CSDP.jl`](https://github.com/jump-dev/CSDP.jl) is a wrapper for the +[COIN-OR SemiDefinite Programming](https://projects.coin-or.org/Csdp) solver. The wrapper has two components: * a thin wrapper around the low-level C API @@ -38,12 +38,11 @@ Pkg.add("CSDP") ``` In addition to installing the CSDP.jl package, this will also download and -install the CSDP binaries. (You do not need to install CSDP separately.) +install the CSDP binaries. You do not need to install CSDP separately. ## Use with JuMP -To use CSDP with [JuMP](https://github.com/jump-dev/JuMP.jl), use -`CSDP.Optimizer`: +To use CSDP with JuMP, use `CSDP.Optimizer`: ```julia using JuMP, CSDP model = Model(CSDP.Optimizer) @@ -75,25 +74,26 @@ List of supported model attributes: The CSDP options are listed in the table below. -Name | | Default Value | - ------------ | ----------------------------------- | -------------- | -`axtol` | Tolerance for primal feasibility | `1.0e-8` | -`atytol` | Tolerance for dual feasibility | `1.0e-8` | -`objtol` | Tolerance for relative duality gap | `1.0e-8` | -`pinftol` | Tolerance for determining primal infeasibility | `1.0e8` | -`dinftol` | Tolerance for determining dual infeasibility | `1.0e8` | -`maxiter` | Limit for the total number of iterations | `100` | -`minstepfrac` | The `minstepfrac` and `maxstepfrac` parameters determine how close to the edge of the feasible region CSDP will step | `0.90` | -`maxstepfrac` | The `minstepfrac` and `maxstepfrac` parameters determine how close to the edge of the feasible region CSDP will step | `0.97` | -`minstepp` | If the primal step is shorter than `minstepp` then CSDP declares a line search failure | `1.0e-8` | -`minstepd` | If the dual step is shorter than `minstepd` then CSDP declares a line search failure | `1.0e-8` | -`usexzgap` | If `usexzgap` is `0` then CSDP will use the objective duality gap `d - p` instead of the XY duality gap `⟨Z, X⟩` | `1` | -`tweakgap` | If `tweakgap` is set to `1`, and `usexzgap` is set to `0`, then CSDP will attempt to "fix" negative duality gaps | `0` | -`affine` | If `affine` is set to `1`, 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 | `0` | -`perturbobj` | The `perturbobj` parameter determines whether the objective function will be perturbed to help deal with problems that have unbounded optimal solution sets. If `perturbobj` is `0`, then the objective will not be perturbed. If `perturbobj` is `1`, then the objective function will be perturbed by a default amount. Larger values of `perturbobj` (e.g. `100`) increase the size of the perturbation. This can be helpful in solving some difficult problems. | `1` | -`fastmode` | 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 `1`, then CSDP may be somewhat faster, but also somewhat less accurate | `0` | -`printlevel` | The `printlevel` parameter determines how much debugging information is output. Use a `printlevel` of `0` for no output and a `printlevel` of `1` for normal output. Higher values of printlevel will generate more debugging output | `1` | -## CSDP problem representation +| Name | Default Value | Explanation | +| ------------- | -------------- | -------------------------------------------------------------------------------------------------------------------- | +| `axtol` | `1.0e-8` | Tolerance for primal feasibility | +| `atytol` | `1.0e-8` | Tolerance for dual feasibility | +| `objtol` | `1.0e-8` | Tolerance for relative duality gap | +| `pinftol` | `1.0e8` | Tolerance for determining primal infeasibility | +| `dinftol` | `1.0e8` | Tolerance for determining dual infeasibility | +| `maxiter` | `100` | Limit for the total number of iterations | +| `minstepfrac` | `0.90` | The `minstepfrac` and `maxstepfrac` parameters determine how close to the edge of the feasible region CSDP will step | +| `maxstepfrac` | `0.97` | The `minstepfrac` and `maxstepfrac` parameters determine how close to the edge of the feasible region CSDP will step | +| `minstepp` | `1.0e-8` | If the primal step is shorter than `minstepp` then CSDP declares a line search failure | +| `minstepd` | `1.0e-8` | If the dual step is shorter than `minstepd` then CSDP declares a line search failure | +| `usexzgap` | `1` | If `usexzgap` is `0` then CSDP will use the objective duality gap `d - p` instead of the XY duality gap `⟨Z, X⟩` | +| `tweakgap` | `0` | If `tweakgap` is set to `1`, and `usexzgap` is set to `0`, then CSDP will attempt to "fix" negative duality gaps | +| `affine` | `0` | If `affine` is set to `1`, 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 | +| `perturbobj` | `1` | The `perturbobj` parameter determines whether the objective function will be perturbed to help deal with problems that have unbounded optimal solution sets. If `perturbobj` is `0`, then the objective will not be perturbed. If `perturbobj` is `1`, then the objective function will be perturbed by a default amount. Larger values of `perturbobj` (e.g. `100`) increase the size of the perturbation. This can be helpful in solving some difficult problems. | +| `fastmode` | `0` | 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 `1`, then CSDP may be somewhat faster, but also somewhat less accurate | +| `printlevel` | `1` | The `printlevel` parameter determines how much debugging information is output. Use a `printlevel` of `0` for no output and a `printlevel` of `1` for normal output. Higher values of printlevel will generate more debugging output | + +## Problem representation The primal is represented internally by CSDP as follows: ``` @@ -101,8 +101,7 @@ max ⟨C, X⟩ A(X) = a X ⪰ 0 ``` -where `A(X) = [⟨A_1, X⟩, ..., ⟨A_m, X⟩]`. -The corresponding dual is: +where `A(X) = [⟨A_1, X⟩, ..., ⟨A_m, X⟩]`. The corresponding dual is: ``` min ⟨a, y⟩ A'(y) - C = Z @@ -114,8 +113,6 @@ where `A'(y) = y_1A_1 + ... + y_mA_m` CSDP will terminate successfully (or partially) in the following cases: -* If CSDP finds `y` and `Z ⪰ 0` such that `-⟨a, y⟩ / ||A'(y) - Z||_F > pinftol`, it returns `1` with `y` such that `⟨a, y⟩ = -1`. -* If CSDP finds `X ⪰ 0` such that `⟨C, X⟩ / ||A(X)||_2 > dinftol`, it returns `2` with `X` such that `⟨C, X⟩ = 1`. * If CSDP finds `X, Z ⪰ 0` such that the following 3 tolerances are satisfied: * primal feasibility tolerance: `||A(x) - a||_2 / (1 + ||a||_2) < axtol` * dual feasibility tolerance: `||A'(y) - C - Z||_F / (1 + ||C||_F) < atytol` @@ -123,37 +120,53 @@ CSDP will terminate successfully (or partially) in the following cases: * objective duality gap: If `usexygap` is `0`, `gap = ⟨a, y⟩ - ⟨C, X⟩` * XY duality gap: If `usexygap` is `1`, `gap = ⟨Z, X⟩` then it returns `0`. -* If CSDP finds `X, Z ⪰ 0` such that the following 3 tolerances are satisfied with `1000*axtol`, `1000*atytol` and `1000*objtol` but at least one of them is not satisfied with `axtol`, `atytol` and `objtol` and cannot make progress then it returns `3`. - -**Remark:** In theory, for feasible primal and dual solutions, `⟨a, y⟩ - ⟨C, X⟩ = ⟨Z, X⟩` so the objective and XY duality gap should be equivalent. However, in practice, there are sometimes solution which satisfy primal and dual feasibility tolerances but have objective duality gap which are not close to XY duality gap. In some cases, the objective duality gap may even become negative (hence the `tweakgap` option). This is the reason `usexygap` is `1` by default. - -**Remark:** CSDP considers that `X ⪰ 0` (resp. `Z ⪰ 0`) is satisfied when the Cholesky factorizations can be computed. -In practice, this is somewhat more conservative than simply requiring all eigenvalues to be nonnegative. - -## Status - -The table below shows how the different CSDP status are converted to [MathOptInterface (MOI)](https://github.com/jump-dev/MathOptInterface.jl) status. - -CSDP code | State | Description | MOI status | ---------- | --------------- | ------------------------------------------------------------- | --------------- | -`0` | Success | SDP solved | OPTIMAL | -`1` | Success | The problem is primal infeasible, and we have a certificate | INFEASIBLE | -`2` | Success | The problem is dual infeasible, and we have a certificate | DUAL_INFEASIBLE | -`3` | Partial Success | A solution has been found, but full accuracy was not achieved | ALMOST_OPTIMAL | -`4` | Failure | Maximum iterations reached | ITERATION_LIMIT | -`5` | Failure | Stuck at edge of primal feasibility | SLOW_PROGRESS | -`6` | Failure | Stuck at edge of dual infeasibility | SLOW_PROGRESS | -`7` | Failure | Lack of progress | SLOW_PROGRESS | -`8` | Failure | `X`, `Z`, or `O` was singular | NUMERICAL_ERROR | -`9` | Failure | Detected `NaN` or `Inf` values | NUMERICAL_ERROR | - -If the `printlevel` option is at least `1`, the following will be printed: +* If CSDP finds `y` and `Z ⪰ 0` such that `-⟨a, y⟩ / ||A'(y) - Z||_F > pinftol`, + it returns `1` with `y` such that `⟨a, y⟩ = -1`. +* If CSDP finds `X ⪰ 0` such that `⟨C, X⟩ / ||A(X)||_2 > dinftol`, it returns + `2` with `X` such that `⟨C, X⟩ = 1`. +* If CSDP finds `X, Z ⪰ 0` such that the following 3 tolerances are satisfied + with `1000*axtol`, `1000*atytol` and `1000*objtol` but at least one of them is + not satisfied with `axtol`, `atytol` and `objtol` and cannot make progress, + then it returns `3`. + +In addition, if the `printlevel` option is at least `1`, the following will be +printed: * If the return code is `1`, CSDP will print `⟨a, y⟩` and `||A'(y) - Z||_F` -* if the return code is `2`, CSDP will print `⟨C, X⟩` and `||A(X)||_F` -* otherwise, CSDP will print +* If the return code is `2`, CSDP will print `⟨C, X⟩` and `||A(X)||_F` +* Otherwise, CSDP will print * the primal/dual objective value, * the relative primal/dual infeasibility, * the objective duality gap `⟨a, y⟩ - ⟨C, X⟩` and objective relative duality gap `(⟨a, y⟩ - ⟨C, X⟩) / (1 + |⟨a, y⟩| + |⟨C, X⟩|)`, * the XY duality gap `⟨Z, X⟩` and XY relative duality gap `⟨Z, X⟩ / (1 + |⟨a, y⟩| + |⟨C, X⟩|)` * and the DIMACS error measures. + +**Remark:** In theory, for feasible primal and dual solutions, +`⟨a, y⟩ - ⟨C, X⟩ = ⟨Z, X⟩` so the objective and XY duality gap should be +equivalent. However, in practice, there are sometimes solution which satisfy +primal and dual feasibility tolerances but have objective duality gap which are +not close to XY duality gap. In some cases, the objective duality gap may even +become negative (hence the `tweakgap` option). This is the reason `usexygap` is +`1` by default. + +**Remark:** CSDP considers that `X ⪰ 0` (resp. `Z ⪰ 0`) is satisfied when the +Cholesky factorizations can be computed. In practice, this is somewhat more +conservative than simply requiring all eigenvalues to be nonnegative. + +## Status + +The table below shows how the different CSDP statuses are converted to the +MathOptInterface statuses. + +| CSDP code | State | Description | MOI status | +| --------- | --------------- | ------------------------------------------------------------- | --------------------- | +| `0` | Success | SDP solved | `MOI.OPTIMAL` | +| `1` | Success | The problem is primal infeasible, and we have a certificate | `MOI.INFEASIBLE` | +| `2` | Success | The problem is dual infeasible, and we have a certificate | `MOI.DUAL_INFEASIBLE` | +| `3` | Partial Success | A solution has been found, but full accuracy was not achieved | `MOI.ALMOST_OPTIMAL` | +| `4` | Failure | Maximum iterations reached | `MOI.ITERATION_LIMIT` | +| `5` | Failure | Stuck at edge of primal feasibility | `MOI.SLOW_PROGRESS` | +| `6` | Failure | Stuck at edge of dual infeasibility | `MOI.SLOW_PROGRESS` | +| `7` | Failure | Lack of progress | `MOI.SLOW_PROGRESS` | +| `8` | Failure | `X`, `Z`, or `O` was singular | `MOI.NUMERICAL_ERROR` | +| `9` | Failure | Detected `NaN` or `Inf` values | `MOI.NUMERICAL_ERROR` | From 12be185b7d6af5dfdbafd415acce00703eb4e73f Mon Sep 17 00:00:00 2001 From: odow Date: Tue, 4 Apr 2023 13:22:20 +1200 Subject: [PATCH 4/6] Tweak --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index db0eb5b..501dcb3 100644 --- a/README.md +++ b/README.md @@ -137,8 +137,10 @@ printed: * Otherwise, CSDP will print * the primal/dual objective value, * the relative primal/dual infeasibility, - * the objective duality gap `⟨a, y⟩ - ⟨C, X⟩` and objective relative duality gap `(⟨a, y⟩ - ⟨C, X⟩) / (1 + |⟨a, y⟩| + |⟨C, X⟩|)`, - * the XY duality gap `⟨Z, X⟩` and XY relative duality gap `⟨Z, X⟩ / (1 + |⟨a, y⟩| + |⟨C, X⟩|)` + * the objective duality gap `⟨a, y⟩ - ⟨C, X⟩` and objective relative duality + gap `(⟨a, y⟩ - ⟨C, X⟩) / (1 + |⟨a, y⟩| + |⟨C, X⟩|)`, + * the XY duality gap `⟨Z, X⟩` and XY relative duality gap + `⟨Z, X⟩ / (1 + |⟨a, y⟩| + |⟨C, X⟩|)` * and the DIMACS error measures. **Remark:** In theory, for feasible primal and dual solutions, From c56214a8e0546185b108909415ece516a14dbd80 Mon Sep 17 00:00:00 2001 From: odow Date: Tue, 4 Apr 2023 13:43:57 +1200 Subject: [PATCH 5/6] Update --- README.md | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 501dcb3..5e523ab 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,10 @@ The wrapper has two components: This wrapper is maintained by the JuMP community and is not a COIN-OR project. -The original algorithm is described by B. Borchers. -_CSDP, A C Library for Semidefinite Programming_. -Optimization Methods and Software 11(1):613-623, 1999. -DOI [10.1080/10556789908805765](http://dx.doi.org/10.1080/10556789908805765). -[Preprint](http://euler.nmt.edu/~brian/csdppaper.pdf). +The original algorithm is described by B. Borchers (1999). _CSDP, A C Library +for Semidefinite Programming_. Optimization Methods and Software. 11(1), 613-623. + [[doi]](http://dx.doi.org/10.1080/10556789908805765) + [[preprint]](http://euler.nmt.edu/~brian/csdppaper.pdf) ## License @@ -89,9 +88,9 @@ The CSDP options are listed in the table below. | `usexzgap` | `1` | If `usexzgap` is `0` then CSDP will use the objective duality gap `d - p` instead of the XY duality gap `⟨Z, X⟩` | | `tweakgap` | `0` | If `tweakgap` is set to `1`, and `usexzgap` is set to `0`, then CSDP will attempt to "fix" negative duality gaps | | `affine` | `0` | If `affine` is set to `1`, 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 | -| `perturbobj` | `1` | The `perturbobj` parameter determines whether the objective function will be perturbed to help deal with problems that have unbounded optimal solution sets. If `perturbobj` is `0`, then the objective will not be perturbed. If `perturbobj` is `1`, then the objective function will be perturbed by a default amount. Larger values of `perturbobj` (e.g. `100`) increase the size of the perturbation. This can be helpful in solving some difficult problems. | +| `perturbobj` | `1` | The `perturbobj` parameter determines whether the objective function will be perturbed to help deal with problems that have unbounded optimal solution sets. If `perturbobj` is `0`, then the objective will not be perturbed. If `perturbobj` is `1`, then the objective function will be perturbed by a default amount. Larger values of `perturbobj` (for example, `100`) increase the size of the perturbation. This can be helpful in solving some difficult problems. | | `fastmode` | `0` | 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 `1`, then CSDP may be somewhat faster, but also somewhat less accurate | -| `printlevel` | `1` | The `printlevel` parameter determines how much debugging information is output. Use a `printlevel` of `0` for no output and a `printlevel` of `1` for normal output. Higher values of printlevel will generate more debugging output | +| `printlevel` | `1` | The `printlevel` parameter determines how much debugging information is output. Use a `printlevel` of `0` for no output and a `printlevel` of `1` for normal output. Higher values of `printlevel` will generate more debugging output | ## Problem representation @@ -117,8 +116,8 @@ CSDP will terminate successfully (or partially) in the following cases: * primal feasibility tolerance: `||A(x) - a||_2 / (1 + ||a||_2) < axtol` * dual feasibility tolerance: `||A'(y) - C - Z||_F / (1 + ||C||_F) < atytol` * relative duality gap tolerance: `gap / (1 + |⟨a, y⟩| + |⟨C, X⟩|) < objtol` - * objective duality gap: If `usexygap` is `0`, `gap = ⟨a, y⟩ - ⟨C, X⟩` - * XY duality gap: If `usexygap` is `1`, `gap = ⟨Z, X⟩` + * objective duality gap: if `usexygap` is `0`, `gap = ⟨a, y⟩ - ⟨C, X⟩` + * XY duality gap: if `usexygap` is `1`, `gap = ⟨Z, X⟩` then it returns `0`. * If CSDP finds `y` and `Z ⪰ 0` such that `-⟨a, y⟩ / ||A'(y) - Z||_F > pinftol`, it returns `1` with `y` such that `⟨a, y⟩ = -1`. @@ -143,17 +142,16 @@ printed: `⟨Z, X⟩ / (1 + |⟨a, y⟩| + |⟨C, X⟩|)` * and the DIMACS error measures. -**Remark:** In theory, for feasible primal and dual solutions, -`⟨a, y⟩ - ⟨C, X⟩ = ⟨Z, X⟩` so the objective and XY duality gap should be -equivalent. However, in practice, there are sometimes solution which satisfy -primal and dual feasibility tolerances but have objective duality gap which are -not close to XY duality gap. In some cases, the objective duality gap may even -become negative (hence the `tweakgap` option). This is the reason `usexygap` is -`1` by default. - -**Remark:** CSDP considers that `X ⪰ 0` (resp. `Z ⪰ 0`) is satisfied when the -Cholesky factorizations can be computed. In practice, this is somewhat more -conservative than simply requiring all eigenvalues to be nonnegative. +In theory, for feasible primal and dual solutions, `⟨a, y⟩ - ⟨C, X⟩ = ⟨Z, X⟩`, +so the objective and XY duality gap should be equivalent. However, in practice, +there are sometimes solution which satisfy primal and dual feasibility +tolerances but have objective duality gap which are not close to XY duality gap. +In some cases, the objective duality gap may even become negative (hence the +`tweakgap` option). This is the reason `usexygap` is `1` by default. + +CSDP considers that `X ⪰ 0` (resp. `Z ⪰ 0`) is satisfied when the Cholesky +factorizations can be computed. In practice, this is somewhat more conservative +than simply requiring all eigenvalues to be nonnegative. ## Status From 69c2d225299d50fa8398973710a9ed5b7a0c556f Mon Sep 17 00:00:00 2001 From: odow Date: Tue, 4 Apr 2023 15:43:25 +1200 Subject: [PATCH 6/6] Upate --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 5e523ab..b524b51 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,7 @@ This wrapper is maintained by the JuMP community and is not a COIN-OR project. The original algorithm is described by B. Borchers (1999). _CSDP, A C Library for Semidefinite Programming_. Optimization Methods and Software. 11(1), 613-623. - [[doi]](http://dx.doi.org/10.1080/10556789908805765) - [[preprint]](http://euler.nmt.edu/~brian/csdppaper.pdf) +[[preprint]](http://euler.nmt.edu/~brian/csdppaper.pdf) ## License