Skip to content

Incorrect SDPA file output #1071

@kibaekkim

Description

@kibaekkim

I think the SDPA file is not correctly written. Here is an example:

using JuMP

m = Model()
@variable(m, x[1:3,1:3], PSD)
@variable(m, 12.34 <= y[1:2] <= 123.4)
@objective(m, Min, x[1,1] + 4*x[1,2] + 6*x[1,3] + 2*x[2,1] + 9*x[2,2] + 3*x[3,1] + 7*x[3,3])
@constraint(m, x[1,1] + 2*x[1,3] + 3*x[2,2] + 14*x[2,3] + 5*x[3,3] + y[1] == 11)
@constraint(m, 4*x[1,2] + 16*x[1,3] + 6*x[2,2] + 4*x[3,3] + y[2] == 19)

JuMP.write_to_file(m, "ex.dat-s", format=MOI.FileFormats.FORMAT_SDPA)

The file ex.dat-s should have

8
9
-1 -1 -1 -1 -1 -1 -1 -1 3
1.0 6.0 9.0 9.0 0.0 7.0 0.0 0.0
0 1 1 1 -12.34
7 1 1 1 1.0
0 2 1 1 -12.34
8 2 1 1 1.0
0 3 1 1 123.4
7 3 1 1 -1.0
0 4 1 1 123.4
8 4 1 1 -1.0
0 5 1 1 -11.0
1 5 1 1 1.0
3 5 1 1 3.0
4 5 1 1 2.0
5 5 1 1 14.0
6 5 1 1 5.0
7 5 1 1 1.0
0 6 1 1 11.0
1 6 1 1 -1.0
3 6 1 1 -3.0
4 6 1 1 -2.0
5 6 1 1 -14.0
6 6 1 1 -5.0
7 6 1 1 -1.0
0 7 1 1 -19.0
2 7 1 1 4.0
3 7 1 1 6.0
4 7 1 1 16.0
6 7 1 1 4.0
8 7 1 1 1.0
0 8 1 1 19.0
2 8 1 1 -4.0
3 8 1 1 -6.0
4 8 1 1 -16.0
6 8 1 1 -4.0
8 8 1 1 -1.0
1 9 1 1 1.0
2 9 1 2 0.5
3 9 2 2 1.0
4 9 1 3 0.5
5 9 2 3 0.5
6 9 3 3 1.0

There are some (not all) findings:

  • The objective coefficients are wrong.
  • The lower bounds of y variable are negated.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions