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?

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?

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

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

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.
Threads used: 4
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

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.

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.