# "Relaxation" Action Control

The program gives “Inf” in the first run, but if it is run for the next time, it gives the expected answer.

In the report section of the first run, it says no “relaxation” is applied in the run, but in the second run, it shows 1 relaxation is applied in it. It is worth mentioning that for the second run, it has the workspace of the first run, meaning that it uses the same assumptions of the first run for the second run and also has the result of the first run.

If I am not mistaken, and that difference regards the relaxation action applied in the program, is there any way to manually set the program to always apply the relaxation?

P. S.: The cvx program uses MOSEK solver.

I have no idea what you are talking about. I have no idea what relaxation you are talking about, or how it is applied and by what program or code.I have no idea what the difference is between your two runs.

Can you post your code, preferably with all input data, as well as all CVX and solver output, pointing out exactly which results are not satisfactory to you?

The two constraints that the relaxation might be applied on are:

V*L=(P_L)^2+(Q_L)^2
V and L are non-negative variables and P_L is Q_L are variables.

(S_G)^2=(P_G)^2+(Q_G)^2
S_G, P_G, and Q_G are variables.

The other constraints are linear.
I applied these versions of the two above constraints like the following way in cvx:

{ [ P_L ; Q_L] , L , V} == rotated_lorentz(2);
{ [ P_G ; P_G ], s } == lorentz(2);

(I excluded the indices of the variables in showing them here for simplicity)

This is the result of the first run:

## Calling Mosek 9.1.9: 137585 variables, 18650 equality constraints

MOSEK Version 9.1.9 (Build date: 2019-11-21 11:34:40)
Copyright (c) MOSEK ApS, Denmark. WWW: mosek.com
Platform: Windows/64-X86

MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (2) at variable ‘’ (0).
MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (3) at variable ‘’ (0).
MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (4) at variable ‘’ (0).
MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (5) at variable ‘’ (0).
MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (6) at variable ‘’ (0).
MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (7) at variable ‘’ (0).
MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (8) at variable ‘’ (0).
MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (9) at variable ‘’ (0).
MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (10) at variable ‘’ (0).
MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (11) at variable ‘’ (0).
Warning number 62 is disabled.
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (2).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (2).
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (3).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (3).
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (4).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (4).
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (5).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (5).
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (6).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (6).
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (7).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (7).
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (8).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (8).
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (9).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (9).
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (10).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (10).
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (11).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (11).
Warning number 52 is disabled.
Warning number 53 is disabled.
Problem
Name:
Objective sense: min
Type: CONIC (conic optimization problem)
Constraints: 18650
Cones: 3498
Scalar variables: 137585
Matrix variables: 0
Integer variables: 3

Optimizer started.
Mixed integer optimizer started.
Pre-solve started.
Pre-solve terminated. Time = 0.03
Clique table size: 0
BRANCHES RELAXS ACT_NDS DEPTH BEST_INT_OBJ BEST_RELAX_OBJ REL_GAP(%) TIME

Objective of best integer solution: Not available.
Best objective bound: Not available.
Construct solution objective: Not employed
User objective cut value: Not employed
Number of cuts generated: 0
Number of branches: 0
Number of relaxations solved: 0
Number of interior point iterations: 0
Number of simplex iterations: 0
Time spend pre-solving the root: 0.03
Time spend optimizing the root: 0.00
Mixed integer optimizer terminated. Time: 0.23

Optimizer terminated. Time: 0.31

Integer solution summary
Problem status: PRIMAL_INFEASIBLE
Solution status: UNKNOWN
Primal. obj: 0.0000000000e+00 nrm: 0e+00 Viol. con: 5e+13 var: 0e+00 cones: 0e+00 itg: 0e+00
Optimizer summary
Optimizer - time: 0.31
Interior-point - iterations: 0 time: 0.00
Basis identification - time: 0.00
Primal - iterations: 0 time: 0.00
Dual - iterations: 0 time: 0.00
Clean primal - iterations: 0 time: 0.00
Clean dual - iterations: 0 time: 0.00
Simplex - time: 0.00
Primal simplex - iterations: 0 time: 0.00
Dual simplex - iterations: 0 time: 0.00
Mixed integer - relaxations: 0 time: 0.23

Status: Infeasible
Optimal value (cvx_optval): +Inf

And this is the result of the second run:

## Calling Mosek 9.1.9: 137585 variables, 18650 equality constraints

MOSEK Version 9.1.9 (Build date: 2019-11-21 11:34:40)
Copyright (c) MOSEK ApS, Denmark. WWW: mosek.com
Platform: Windows/64-X86

MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (2) at variable ‘’ (0).
MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (3) at variable ‘’ (0).
MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (4) at variable ‘’ (0).
MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (5) at variable ‘’ (0).
MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (6) at variable ‘’ (0).
MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (7) at variable ‘’ (0).
MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (8) at variable ‘’ (0).
MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (9) at variable ‘’ (0).
MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (10) at variable ‘’ (0).
MOSEK warning 62: The A matrix contains a large value of 1.0e+12 in constraint ‘’ (11) at variable ‘’ (0).
Warning number 62 is disabled.
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (2).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (2).
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (3).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (3).
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (4).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (4).
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (5).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (5).
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (6).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (6).
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (7).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (7).
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (8).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (8).
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (9).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (9).
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (10).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (10).
MOSEK warning 52: A numerically large lower bound value 1.3e+13 is specified for constraint ‘’ (11).
MOSEK warning 53: A numerically large upper bound value 1.3e+13 is specified for constraint ‘’ (11).
Warning number 52 is disabled.
Warning number 53 is disabled.
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 18650
Cones : 3498
Scalar variables : 137585
Matrix variables : 0
Integer variables : 3

Optimizer started.
Mixed integer optimizer started.
Presolve started.
Presolve terminated. Time = 0.20
Presolved problem: 8769 variables, 8688 constraints, 27421 non-zeros
Presolved problem: 0 general integer, 0 binary, 8769 continuous
Clique table size: 0
BRANCHES RELAXS ACT_NDS DEPTH BEST_INT_OBJ BEST_RELAX_OBJ REL_GAP(%) TIME
0 1 1 0 3.6732611796e+05 3.6732611796e+05 0.00e+00 3.5
An optimal solution satisfying the relative gap tolerance of 1.00e-02(%) has been located.
The relative gap is 0.00e+00(%).
An optimal solution satisfying the absolute gap tolerance of 0.00e+00 has been located.
The absolute gap is 0.00e+00.

Objective of best integer solution: 3.673261179618e+05
Best objective bound: 3.673261179618e+05
Construct solution objective: Not employed
User objective cut value: Not employed
Number of cuts generated: 0
Number of branches: 0
Number of relaxations solved: 1
Number of interior point iterations: 26
Number of simplex iterations: 0
Time spend pre-solving the root: 0.20
Time spend optimizing the root: 1.70
Mixed integer optimizer terminated. Time: 3.46

Optimizer terminated. Time: 3.60

Integer solution summary
Problem status: PRIMAL_FEASIBLE
Solution status: INTEGER_OPTIMAL
Primal. obj: 3.6732611796e+05 nrm: 5e+13 Viol. con: 4e-03 var: 1e-05 cones: 0e+00 itg: 0e+00
Optimizer summary
Optimizer - time: 3.60
Interior-point - iterations: 0 time: 0.00
Basis identification - time: 0.00
Primal - iterations: 0 time: 0.00
Dual - iterations: 0 time: 0.00
Clean primal - iterations: 0 time: 0.00
Clean dual - iterations: 0 time: 0.00
Simplex - time: 0.00
Primal simplex - iterations: 0 time: 0.00
Dual simplex - iterations: 0 time: 0.00
Mixed integer - relaxations: 1 time: 3.46

Status: Solved
Optimal value (cvx_optval): +367326

I do not have much experience of working with cvx and MOSEK, but theoretically, the result of the second run, plus checking the solved optimization values of the variables, are normal and make sense.

I still have absolutely no idea what you did. But Mosek warned about large magnitude lower and upper bounds - I don’t know whether that degrades confidence iMosek’s conclusion of infeasibility. if you can make those bounds smaller magnitude, such as perhaps no more than 1e3, try that. Otherwise, try omitting the bounds and see what happens.

And I still have no idea what the difference was between your runs, so I certainly can’t diagnose why they differ.

Those are good ideas. I will check them. Thank you for that.

The interesting part is there is no difference between the two runs. But almost in the end of the result, it shows it used 1 relaxation for the second run.

If we consider the program to be divided into two main parts, in the first part I used:
clc; clear all; close all;
For the second run, I just run the second part of the program, which does not use any random values that make difference between the two run.

I don’t think anyone other than you who reads this topic will have any idea what you did, other than trigger warning messages from Mosek.

If those huge numbers are from Big M values, you shouldn’t be using such values. The Big M values should be as small as possible consistent with being logically correct, and I would say not bigger than 1e4 in any case.

Your second run has a very large optimal objective value. That is indicative of bad numerical scaling. You should choose units to try to make all non-zero input data be within s small number of orders of magnitude of 1, and hopefully the objective value as well.