[Csdp] CVX interface

Brian Borchers borchers at nmt.edu
Mon Oct 20 11:34:19 EDT 2014


I wrote:

> SeDuMi and SDPT3 seem to be quite adequate to work with CVX, and since CVX
> requires MATLAB anyway you don't have any reason to complain that SeDuMi
> and SDPT3 require MATLAB.


I'm sorry- poor choice of words.  Jose has been very reasonable in asking
questions about this.  A better way of phrasing this would be "Since CVX
requires MATLAB anyway, you already have access to SeDuMi and SDPT3 when
you run CVX."    The main use case for CSDP is situations in which MATLAB
is not being used- the MATLAB interface is provided purely as a convenience
for people who are already working in MATLAB.

Since SeDuMi and SDPT3 work quite well with CVX and CSDP probably won't
work well (because of the lack of support for second order cones), it
doesn't make much sense to me to do this.  However, if you want to do this,
it's apparent that you'll have to extend the MATLAB CSDP interface to
convert SOCP's (including "rotated" second order cones?) into SDP form (and
convert the solutions back) and to handle free variables (the convertf.m
code shows you the basic idea, which is simply to write each free variable
as the difference of two nonnegative variables.)

I'm not sure what other features CVX might require of the solver.




On Mon, Oct 20, 2014 at 9:15 AM, Michael C. Grant <mcg at cvxr.com> wrote:

>  Yes! To be clear, Jose has been nothing but gracious :-)
>
>  On Oct 20, 2014, at 10:04 AM, Jose Lopez <lopez.jo at husky.neu.edu> wrote:
>
>  No one is complaining about anything. I'm grateful for the fine software
> that the CSDP and CVX developers have made available to the scientific
> community. As we all know no single solver is perfect. CSDP happens to be
> faster (for my problems) than SeDuMi and SDPT3, perhaps because of its
> parallel processing capabilities and that's why I'm trying to use it with
> CVX. I have a Mosek license and I know it is fast as well but like all
> solvers it's not absolutely perfect and that's why I'm wanting to see how
> CSDP can work. Thank you both for your replies.
>
> On Mon, Oct 20, 2014 at 10:55 AM, Brian Borchers <borchers at nmt.edu> wrote:
>
>> I think that the most important point here is that CVX requires the
>> solver to be able to handle SOCP constraints, and CSDP doesn't do that
>> right now.  As Michael and I have discussed, you could put a wrapper around
>> csdp that takes care of that issue (and the free variables issue), but I
>> doubt it would perform well.
>>
>>  I'm curious why you're trying to do this?  SeDuMi and SDPT3 seem to be
>> quite adequate to work with CVX, and since CVX requires MATLAB anyway you
>> don't have any reason to complain that SeDuMi and SDPT3 require MATLAB.
>>
>>
>> On Mon, Oct 20, 2014 at 8:42 AM, Jose Lopez <lopez.jo at husky.neu.edu>
>> wrote:
>>
>>> Thanks for the tips. I will work with the beta version instead.
>>>
>>> On Mon, Oct 20, 2014 at 10:37 AM, Michael C. Grant <mcg at cvxr.com> wrote:
>>>
>>>> Well, the reordering logic is necessary for two reasons. For one, CVX
>>>> allows the cone variables to be in any order whatsover, while SeDuMi
>>>> expects the free variables first, followed by the nonnegative, second-order
>>>> cone, and then SDP variables. For another, CVX's SDP basis differs from the
>>>> basis used by some solvers by an elementwise scaling.
>>>>
>>>>  In fact, SeDuMI's *solver* doesn't handle free variables, either, but
>>>> its *interface *does. It accepts free variables as input, and *
>>>> internally *converts them to its standard form. It also converts
>>>> rotated Lorentz cones to un-rotated form, and a few other conversions as
>>>> well. The user is not expected to concern himself with such matters. I find
>>>> it unfortunate that CSDP requires calling external code to perform the
>>>> conversion; perhaps it would be a worthwhile investment of your time to
>>>> build a "wrapper" around CSDP's interface that extends its calling sequence
>>>> to include free variables.
>>>>
>>>>  I would suggest, by the way, using CVX 3.0 beta for your shim
>>>> development if you're going to do this. The shims are not back compatible,
>>>> so it would be a shame for you to waste the work. And on the positive side,
>>>> the shims are a lot simpler, because I've moved a lot of solver-agnostic
>>>> conversion logic out of the shims themselves, so the shim can focus on
>>>> handling solver-specific rearrangements.
>>>>
>>>>
>>>>  On Oct 20, 2014, at 9:28 AM, Jose Lopez <lopez.jo at husky.neu.edu>
>>>> wrote:
>>>>
>>>>  Hi Michael,
>>>>
>>>>  Thanks for your reply. I am trying to use the Sedumi calling
>>>> sequence. I'm actually modifying the Sedumi shim file but as CSDP does not
>>>> accept free variables I have to convert the free variables to non-negative
>>>> variables using an M function that comes with the CSDP solver -- and as far
>>>> as I can tell, with the problems I work with (ones without SOCP
>>>> constraints) the conversion does not result in a much larger problem at
>>>> all. It does however change the dimensions of some of the matrices (A and
>>>> c) and when the solution comes back the "reord" variables in the Sedumi
>>>> shim file are no longer size-compatible and the shim logic breaks. I don't
>>>> know what the reordering logic is all about in "cvx_sedumi.m".
>>>>
>>>>  Jose
>>>>
>>>>
>>>> On Mon, Oct 20, 2014 at 10:12 AM, Michael C. Grant <mcg at cvxr.com>
>>>> wrote:
>>>>
>>>>> I certainly do support the development of shims for fully free
>>>>> solvers. CSDP fits into that category nicely. However, I've not supported
>>>>> CSDP to date because it doesn't provide native support for SOCP cones. It's
>>>>> really not practical for CVX to support solvers that can't handle SOCP
>>>>> natively.
>>>>>
>>>>>  It is true that SOCP constraints can always be represented using
>>>>> SDP. But a naïve conversion of SOCP to SDP squares the number of variables;
>>>>> and the most efficient approach (in terms of the number of variables)
>>>>> multiplies them by a factor of 6 or so. And both conversions add quite a
>>>>> few equality constraints as well. I have no idea how either of those
>>>>> conversions impacts accuracy, nor have I examined the empirical performance
>>>>> loss. It's simply not something I can afford the time to investigate or
>>>>> explore. Someone else can do it, but I really cannot support it.
>>>>>
>>>>>  I'm not sure I understand the free variable issue. SeDuMi converts
>>>>> free variables to constrained variables internally as well, but the SeDuMi
>>>>> calling sequence accepts them just fine. Why not use the SeDuMi-compatible
>>>>> calling sequence for CSDP, and let CSDP's own facilities handle the
>>>>> conversion?
>>>>>
>>>>>    On Oct 20, 2014, at 8:46 AM, Brian Borchers <borchers at nmt.edu>
>>>>> wrote:
>>>>>
>>>>>  Jose; I believe that CVX requires a solver than can solve second
>>>>> order cone programming problems (SOCP) as well as SDP.  You could transform
>>>>> SOCP's into SDP's and solve them in that form using CSDP, but the
>>>>> performance would be poor in comparison with a code that directly solves
>>>>> SOCP.
>>>>>
>>>>>  I've included Michael Grant in this reply.  Michael; do you have
>>>>> anything to add?
>>>>>
>>>>>
>>>>> On Mon, Oct 20, 2014 at 7:34 AM, Jose Lopez <lopez.jo at husky.neu.edu>
>>>>> wrote:
>>>>>
>>>>>> Hi list,
>>>>>>
>>>>>>  I'm a new member to the CSDP list. My name's Jose I'm an EE grad
>>>>>> student at Northeastern in Boston. I'm writing to ask if anyone has written
>>>>>> a CVX "solver shim" for CSDP so that it can be called from CVX? (CVX
>>>>>> encourages users to make solver interfaces so long as the solver is free.)
>>>>>> I took a stab at it using the Sedumi solver shim as a starting point but as
>>>>>> I'm not that familiar with the internals of SDP solvers I get tripped up
>>>>>> when handling the free variables; which as you all know CSDP doesn't
>>>>>> accept. I know CSDP has a utility to convert free variable problems but I
>>>>>> get tripped up when converting the solution back to Sedumi form. Anyway, if
>>>>>> someone has a solver shim I would be really, really, grateful if you shared
>>>>>> it. =)
>>>>>>
>>>>>>  Have a great Monday, list.
>>>>>>
>>>>>>  Jose
>>>>>>
>>>>>> _______________________________________________
>>>>>> Csdp mailing list
>>>>>> Csdp at list.coin-or.org
>>>>>> http://list.coin-or.org/mailman/listinfo/csdp
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>  --
>>>>> Brian Borchers                          borchers at nmt.edu
>>>>> Department of Mathematics      http://www.nmt.edu/~borchers/
>>>>> New Mexico Tech                       Phone: (575) 322-2592
>>>>> Socorro, NM 87801                   FAX: (575) 835-5366
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>>
>>  --
>> Brian Borchers                          borchers at nmt.edu
>> Department of Mathematics      http://www.nmt.edu/~borchers/
>> New Mexico Tech                       Phone: (575) 322-2592
>> Socorro, NM 87801                   FAX: (575) 835-5366
>>
>
>
>


-- 
Brian Borchers                          borchers at nmt.edu
Department of Mathematics      http://www.nmt.edu/~borchers/
New Mexico Tech                       Phone: (575) 322-2592
Socorro, NM 87801                   FAX: (575) 835-5366
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/csdp/attachments/20141020/3a58145b/attachment.html>


More information about the Csdp mailing list