Dear Johan,
Thank you for your work and for YALMIP. I have a question that I assume it is trivial for experienced researchers on this topic, but I am looking a bit more in the "theory" behind it. I also searched in the group and YALMIP website but I could not find a proper answer. I think a simple code is self explanatory:
YALMIP_x=binvar(1,1,'full');
YALMIP_H=sdpvar(1,1,'full');
YALMIP_cons_H_bounds= [(0 <= YALMIP_H):'LB_H', (YALMIP_H <= 1):'UB_H'] ;
YALMIP_cons2=[implies(YALMIP_x, YALMIP_H >= 0.5 )]:'implies_x1';
YALMIP_cons3=[implies(YALMIP_x == 0, YALMIP_H <= 0.5 )]:'implies_x2';
YALMIP_cons4=[(YALMIP_H == 0.5)]:'cons_H';
YALMIP_Constraints=[YALMIP_cons_H_bounds,YALMIP_cons2,YALMIP_cons3,YALMIP_cons4];
YALMIP_options = sdpsettings('verbose',2,'solver','gurobi','debug',1);
YALMIP_Objective1= -YALMIP_x;
YALMIP_solution1=optimize(YALMIP_Constraints,YALMIP_Objective1,YALMIP_options);
Sol_x1=value(YALMIP_x);
Sol_H1=value(YALMIP_H);
Sol_Objective1=value(YALMIP_Objective1);
YALMIP_Objective2= YALMIP_x;
YALMIP_solution2=optimize(YALMIP_Constraints,YALMIP_Objective2,YALMIP_options);
Sol_x2=value(YALMIP_x);
Sol_H2=value(YALMIP_H);
Sol_Objective2=value(YALMIP_Objective2);
I understand that since the solver is working with finite precision numbers, it is unlikely that cons2 and cons3 are being mutually violated. However, in this problem I am forcing H to be equal to the "interface" value.
How is the value of x selected? Based on the most favorable value for the objective?
I would have assumed that the solver tries to satisfy both cons2 and cons3 (with the same finite precision value for H) and it should result in an infeasible problem.
Thank you in advance for the answer. Any reference is also very appreciated.
Kind regards
Luca