Skip to content

Issues with fromsdpa.m handling of badly formed .dat-s files #27

@brianborchers

Description

@brianborchers

I've uncovered a complicated situation involving the SDPA sparse format for semidefinite programming problems and SeDuMi. The issue arises when (most likely due to a problem formulation error), the same entry appears twice in a constraint matrix.

In this toy example the (1,2) entry in constraint 3 is first set to 1.0 and then set to 0.5 in the next line.

3
1
2
1000 900 5
0 1 1 2 3.0
1 1 1 1 1.0
2 1 2 2 1.0
3 1 1 2 1.0
3 1 1 2 0.5

test.txt

Different software packages handle this in different ways:

  1. SDPA replaces the 1.0 coefficient with 0.5. The solution has X(1,2)=X(2,1)=5.0.

  2. CSDP 6.1 adds the 1.0 and 0.5 to make the entry 1.5. The solution has X(1,2)=X(2,1)=1.6667.

  3. SeDuMi's fromsdpa.m function adds 1.0 to 0.5 to make the entry 1.5. The solution has X(1,2)=X(2,1)=1.6667.

  4. CSDP's MATLAB function readsdpa.m replaces the 1.0 coefficient with 0.5. The solution has X(1,2)=X(2,1)=5.0.

You can also fiddle with this by changing the indices from (1,2) to (2,1) in either or both of the entries- none of the results change. I expect that the behavior of duplicate entries in 0th constraint (the objective function matrix) would be similar.

There isn't any clear documentation of how this file should be interpreted and in most cases, the repeated entries are due to user error, so I think it would be best to issue a warning and proceed as SDPA does in this case. An alternative would be to treat it as an error and give up on reading the file.

The fromsdpa.m function uses the sparse function in MATLAB to put the entries into A. The help for sparse notes that "Any elements of s that have duplicate values of i and j are added together." It would
be necessary to identify duplicate entries before calling the sparse function. I don't have any suggestions for how to do that quickly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions