How to judge the constraint violation when the objective function is 1?

I have an optimization problem with objective=1 and several constraints. This problem can be solved by CVX. However, there are two questions:

(1) I do not know the constraint violation. How to judge that?

(2) What are the meanings of these symbols (pstep dstep pinfeas dinfeas gap prim-obj )?

It would be greatly appreciated if anyone helps me with this. :grinning:

This is the result of running CVX:
Calling SDPT3 4.0: 112 variables, 48 equality constraints
For improved efficiency, SDPT3 is solving the dual problem.

num. of constraints = 48
dim. of sdp var = 42, num. of sdp blk = 21
dim. of socp var = 24, num. of socp blk = 6
dim. of linear var = 25


SDPT3: Infeasible path-following algorithms


version predcorr gam expon scale_data
HKM 1 0.000 1 0
it pstep dstep pinfeas dinfeas gap prim-obj dual-obj cputime

0|0.000|0.000|1.9e+03|3.5e+00|1.8e+06| 4.764233e+03 0.000000e+00| 0:0:00| chol 1 1
1|0.028|0.036|1.9e+03|3.4e+00|1.8e+06| 5.099372e+03 0.000000e+00| 0:0:00| chol 1 1
2|0.092|0.076|1.7e+03|3.2e+00|1.7e+06| 7.170574e+03 0.000000e+00| 0:0:00| chol 1 1
3|0.254|0.190|1.3e+03|2.6e+00|1.5e+06| 1.004438e+04 0.000000e+00| 0:0:00| chol 1 1
4|0.826|0.559|2.2e+02|1.1e+00|7.3e+05| 2.065455e+04 0.000000e+00| 0:0:00| chol 1 1
5|0.882|0.649|2.6e+01|4.0e-01|3.0e+05| 2.536511e+04 0.000000e+00| 0:0:00| chol 1 1
6|0.604|0.814|1.0e+01|7.3e-02|7.8e+04| 2.025467e+04 0.000000e+00| 0:0:00| chol 1 1
7|0.439|0.471|5.8e+00|3.9e-02|5.3e+04| 1.194314e+04 0.000000e+00| 0:0:00| chol 1 1
8|0.400|0.224|3.5e+00|3.0e-02|4.5e+04|-2.511275e+04 0.000000e+00| 0:0:00| chol 1 1
9|0.034|0.039|3.4e+00|2.9e-02|5.2e+04|-1.023130e+05 0.000000e+00| 0:0:00| chol 1 1
10|0.033|0.030|3.3e+00|2.8e-02|7.0e+04|-2.034023e+05 0.000000e+00| 0:0:00| chol 1 1
11|0.022|0.040|3.2e+00|2.7e-02|8.8e+04|-3.344186e+05 0.000000e+00| 0:0:00| chol 1 1
12|0.035|0.034|3.1e+00|2.6e-02|1.4e+05|-5.464022e+05 0.000000e+00| 0:0:00| chol 1 1
13|0.027|0.032|3.0e+00|2.5e-02|2.0e+05|-8.071949e+05 0.000000e+00| 0:0:00| chol 1 1
14|0.027|0.043|2.9e+00|2.4e-02|2.9e+05|-1.109920e+06 0.000000e+00| 0:0:00| chol 1 1
15|0.070|0.075|2.7e+00|2.2e-02|4.9e+05|-2.045076e+06 0.000000e+00| 0:0:00| chol 1 1
16|0.039|0.096|2.6e+00|2.0e-02|7.6e+05|-2.545757e+06 0.000000e+00| 0:0:00| chol 1 1
17|0.044|0.056|2.5e+00|1.9e-02|1.0e+06|-3.300183e+06 0.000000e+00| 0:0:00| chol 1 1
18|0.022|0.075|2.4e+00|1.8e-02|1.3e+06|-3.789364e+06 0.000000e+00| 0:0:00| chol 1 1
19|0.017|0.051|2.4e+00|1.7e-02|1.5e+06|-4.065796e+06 0.000000e+00| 0:0:00| chol 1 1
20|0.123|0.134|2.1e+00|1.5e-02|2.2e+06|-6.148893e+06 0.000000e+00| 0:0:00| chol 1 1
21|0.046|0.072|2.0e+00|1.3e-02|2.8e+06|-7.306738e+06 0.000000e+00| 0:0:00| chol 1 1
22|0.111|0.147|1.8e+00|1.1e-02|4.0e+06|-8.978502e+06 0.000000e+00| 0:0:00| chol 1 1
23|0.071|0.131|1.7e+00|1.0e-02|4.8e+06|-1.011688e+07 0.000000e+00| 0:0:00| chol 1 1
24|0.062|0.282|1.6e+00|7.2e-03|6.4e+06|-1.055614e+07 0.000000e+00| 0:0:00| chol 1 1
25|0.254|0.225|1.2e+00|5.6e-03|6.8e+06|-1.013290e+07 0.000000e+00| 0:0:00| chol 1 1
26|0.172|0.646|9.6e-01|2.0e-03|8.0e+06|-9.021795e+06 0.000000e+00| 0:0:00| chol 1 1
27|0.546|0.845|4.3e-01|3.0e-04|4.6e+06|-3.815237e+06 0.000000e+00| 0:0:00| chol 1 1
28|0.842|0.772|6.9e-02|7.0e-05|9.0e+05|-4.402450e+05 0.000000e+00| 0:0:00| chol 1 1
29|0.387|1.000|4.2e-02|1.3e-05|7.6e+05|-2.029575e+05 0.000000e+00| 0:0:00| chol 1 1
30|0.928|1.000|3.0e-03|1.6e-05|9.5e+04| 1.776968e+04 0.000000e+00| 0:0:00| chol 1 1
31|0.947|1.000|1.6e-04|2.3e-05|1.0e+04| 5.393723e+03 0.000000e+00| 0:0:00| chol 1 1
32|0.915|1.000|1.4e-05|3.1e-05|1.6e+03| 1.055799e+03 0.000000e+00| 0:0:00| chol 1 1
33|0.794|1.000|2.8e-06|2.7e-06|4.4e+02| 3.265540e+02 0.000000e+00| 0:0:00| chol 1 1
34|0.985|1.000|4.1e-08|5.6e-07|6.6e+00| 4.945366e+00 0.000000e+00| 0:0:00| chol 1 1
35|0.989|1.000|4.7e-10|8.3e-09|7.6e-02| 5.667473e-02 0.000000e+00| 0:0:00| chol 1 1
36|0.989|1.000|5.2e-12|9.3e-11|8.4e-04| 6.235071e-04 0.000000e+00| 0:0:00| chol 1 1
37|0.989|1.000|5.7e-14|1.0e-12|9.2e-06| 6.853266e-06 0.000000e+00| 0:0:00| chol 1 1
38|0.576|1.000|2.4e-14|9.6e-13|5.8e-06| 4.254469e-06 0.000000e+00| 0:0:00| chol 1 1
39|0.610|1.000|9.5e-15|9.6e-13|3.6e-06| 2.616596e-06 0.000000e+00| 0:0:00| chol 1 1
40|0.615|1.000|3.6e-15|9.6e-13|2.2e-06| 1.606385e-06 0.000000e+00| 0:0:00| chol 1 1
41|0.623|1.000|1.4e-15|9.6e-13|1.3e-06| 9.818551e-07 0.000000e+00| 0:0:00| chol 1 1
42|0.630|1.000|5.1e-16|9.6e-13|7.9e-07| 5.967216e-07 0.000000e+00| 0:0:00| chol 1 1
43|0.635|1.000|1.9e-16|9.6e-13|4.7e-07| 3.604677e-07 0.000000e+00| 0:0:00| chol 1 1
44|0.639|1.000|6.7e-17|9.6e-13|2.8e-07| 2.165628e-07 0.000000e+00| 0:0:00| chol 1 1
45|0.642|1.000|2.4e-17|9.6e-13|1.6e-07| 1.294345e-07 0.000000e+00| 0:0:00| chol 1 1
46|0.645|1.000|8.5e-18|9.6e-13|9.6e-08| 7.699522e-08 0.000000e+00| 0:0:00| chol 1 1
47|0.647|1.000|3.0e-18|9.6e-13|5.7e-08| 4.561045e-08 0.000000e+00| 0:0:00| chol 1 1
48|0.649|1.000|1.1e-18|9.6e-13|3.3e-08| 2.692256e-08 0.000000e+00| 0:0:00| chol 1 1
49|0.650|1.000|3.7e-19|9.6e-13|1.9e-08| 1.584530e-08 0.000000e+00| 0:0:00| chol 1 1
50|0.652|1.000|1.3e-19|9.6e-13|1.1e-08| 9.304634e-09 0.000000e+00| 0:0:00|
stop: max(relative gap, infeasibilities) < 1.49e-08

number of iterations = 50
primal objective value = 9.30463400e-09
dual objective value = 0.00000000e+00
gap := trace(XZ) = 1.14e-08
relative gap = 1.14e-08
actual relative gap = 9.30e-09
rel. primal infeas (scaled problem) = 1.28e-19
rel. dual " " " = 9.56e-13
rel. primal infeas (unscaled problem) = 0.00e+00
rel. dual " " " = 0.00e+00
norm(X), norm(y), norm(Z) = 2.5e-09, 1.6e+12, 1.6e+12
norm(A), norm(b), norm(C) = 2.6e+02, 1.0e+00, 1.0e+04
Total CPU time (secs) = 0.27
CPU time per iteration = 0.01
termination code = 0
DIMACS: 1.3e-19 0.0e+00 1.3e-12 0.0e+00 9.3e-09 1.1e-08


Status: Solved
Optimal value (cvx_optval): +1

(1) You take the solution, plug into your constraint expressions, evaluate them and then you know by how much they are violated. In other words you can compute the solution quality measures you want yourself once you have the solution.

(2) These are various measures of convergence which are specific to the solver. As an inspiration, for example for Mosek the very similar log output is explained here 13.3 Conic Optimization - Interior-point optimizer โ€” MOSEK Optimization Toolbox for MATLAB 10.0.46

Thanks for your reply.

For (1), I agree that evaluating each constraint violation is a good way. But I wanna obtain the total constraint violation, a single value from CVX. Is it possible?

According to the link in (2), the โ€œpstepโ€ should converge to 1, right? While the โ€œpstepโ€ I obtained is 0.652. Is this acceptable?

(1) I doubt that. How should it produce a single number? You can do it yourself and choose your own way. See for instance 7 Practical optimization โ€” MOSEK Modeling Cookbook 3.3.0 and the section before.

(2) You decide what is acceptable. That is the best thing about convex optimization: the solver gives you the primal and dual solution which mutually certify their respective optimality and then you no longer have to trust the solver on anything, it could have obtained the solution using an interior-point algorithm or by magic, but you have it all and all the mathematical means to evaluate how good it is.