Why problem is feasible with (theoretically) mutually exclusive constraints?

31 views
Skip to first unread message

Luca

unread,
Mar 12, 2019, 9:17:38 AM3/12/19
to YALMIP
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 






Johan Löfberg

unread,
Mar 12, 2019, 10:06:12 AM3/12/19
to YALMIP
Not sure what the question is. 

In the first example you maximize x, hence x=1 and h>=0.5 must hold which with h=0.5 means h=0.5

In the second example you minimize x, hence x=0 and h<=0.5 must hold which with h=0.5 means h=0.5

Luca

unread,
Mar 12, 2019, 10:11:59 AM3/12/19
to YALMIP
Dear Johan,

Thanks for the fast answer.

In the first case, since h<=0.5, shouldn't x also forced to be equal to zero due to cons3? And vice versa, due to cons2, for the second case.

Johan Löfberg

unread,
Mar 12, 2019, 10:15:44 AM3/12/19
to YALMIP
If I travel to Hong-Kong I bring at least $1000
If I travel to Beijing I bring at most $1000

I'm travelling to Hong-Kong and bring $1000

Since I have $1000, am I travelling to Beijing?

Luca

unread,
Mar 12, 2019, 10:48:05 AM3/12/19
to YALMIP
Thanks for the exhaustive example!
My confusion arose from how I was looking at "implies". 


 
Reply all
Reply to author
Forward
0 new messages