About absolute robust optimization(MIP)

84 views
Skip to first unread message

Jingle Li

unread,
Jun 8, 2018, 9:16:34 AM6/8/18
to YALMIP

The objective function of the original problemmin Y,S max X(sum(sum((c+q.*X).*Y))+p'*S)],it's about cost.

If z= max X(sum(sum((c+q.*X).*Y))+p'*S)], I think I can model it in the following ways :

f=z

F=[];

F=[F,z>=(sum(sum((c+q.*X1).*Y))+p'*S)];

F=[F,z>=(sum(sum((c+q.*X2).*Y))+p'*S)];

F=[F,z>=(sum(sum((c+q.*X3).*Y))+p'*S)];

Where X1 X2 X3 represents three scenarios, I modeled it this way but found that the results were wrong.


eg:

If I do X1,

f=z

F=[ ];

F=[F,z>=(sum(sum((c+q.*X1).*Y))+p'*S)];

 

The answer is 38.

If I do X2,

f=z

F=[ ];

F=[F,z>=(sum(sum((c+q.*X2).*Y))+p'*S)];

The answer is 62.

If I do X3,

f=z

F=[ ];

F=[F,z>=(sum(sum((c+q.*X3).*Y))+p'*S)];

The answer is 32.


But if I do X1, X2, X3, the answer is 67, and I think the answer should be 62.

And I don’t know why. Am I adding constraints or modeling in the wrong way??

Johan Löfberg

unread,
Jun 8, 2018, 11:32:08 AM6/8/18
to YALMIP
Adding the constraint alone, and solving the problem and looking at the optimal cost, will not give the same as adding all three cases and minimizing the cost. That is the whole idea with a robust, the solution should not be able to cope with just X1, or just X2, or just X3, but it has to cope with all three cases, and the optimal solution then will be worse than the individually best solutions (since it has to be able to cope with three different cases, it will not be optimal in any of the indivdual cases where the two other can be disregarded)








Jingle Li

unread,
Jun 8, 2018, 12:30:33 PM6/8/18
to YALMIP
Thank you professor,I think your means is that ---F=[F,z>=(sum(sum((c+q.*Xi).*Y))+p'*S)],where i=1,2,...,n; Assume that n is known, eg, n=100.
If A{i}=Xi, how do I model this constraint----"F=[F,z>=(sum(sum((c+q.*A{i}).*Y))+p'*S)],where i=1,2...,n."

Johan Löfberg

unread,
Jun 8, 2018, 1:16:28 PM6/8/18
to YALMIP
I don't see the problem really, you simply add all those constraints to the model,

Jingle Li

unread,
Jun 8, 2018, 9:56:54 PM6/8/18
to YALMIP
I don't know how to use the Yalmip to add this constraint--“z>=(sum(sum((c+q.*A{i}).*Y))+p'*S   i=1,2…,100”. Could you please tell my how to do it ?  Here, A{i}=Xi, e.i. A{1}=X1, A{2}=X2, ect.
I'm sorry to bother you again, thank you, Sir.

Johan Löfberg

unread,
Jun 9, 2018, 2:16:11 AM6/9/18
to YALMIP
constraints = [];
for i = 1:100
constraints = [constraints, z>=(sum(sum((c+q.*A{i}).*Y))+p'*S];
end

Jingle Li

unread,
Jun 9, 2018, 5:58:39 AM6/9/18
to YALMIP
Thank you very much. And I finally realized my mistake. This is a bit like a game between two parties, so I can't solve the problem simply by adding all the constraints.
Thank you for solving my confusion.

Jingle Li

unread,
Jun 9, 2018, 10:37:36 AM6/9/18
to YALMIP

Another question, if scenarios X1, X2, X3 are known, A{i}=Xi, and their optimal solutions are 38, 62, and 32 respectively. How do I add constraints so that the optimal solution min (z) is equal to 62 rather than 67?

And I try to do that:

 

  k=intvar(1);

  W=[z>=(sum(sum((c+q.*A{k}).*Y))+p'*S),1<=k<=3,uncertain(k)];

 

    But the Matlab prompt :

    Error using subsindex

    There is no function 'subsindex' defined for the value of class 'sdpvar'.

    

    How can I solve this problem? How do I get to 62? Or for The objective function of the original problemmin Y,S max X(sum(sum((c+q.*X).*Y))+p'*S)],where Y,S are decision variables.

How do I model this by using the Yalmip?

Johan Löfberg

unread,
Jun 9, 2018, 10:44:08 AM6/9/18
to YALMIP
That is a very weird setup, what are you really trying to do? Why would you know the optimal solutions already, and then waste energy on trying to find the case which led to a specific value (you just solved the problems, so you already have that info)



Jingle Li

unread,
Jun 9, 2018, 12:15:36 PM6/9/18
to YALMIP

Dear professor,

This is a question of grid attack - scheduling, and we know all the possible attack scenarios of the grid, and I look for the best scheduling solution when the grid is under attack(we consider the minimum loss in the worst case scenario).

So this is a robust problem or a game problem.

Therefore, Xi represents the attack scenarios, and I will try to find the optimal scheduling scheme under the premise of knowing all possible attack scenarios. But I don't know how to solve this problem by using Yalmip. And I tried to enumerate all the attack scenarios to get the optimal scheduling solution. i.e. If I knew the losses in each scenario, I would know the losses in the worst case scenario.(It's a stupid way to do it,.)


So, I knew the result of every situation, and the question is how to use Yalmip to automatically minimize the worst case loss.


The model is a typical network flow problem.

s.t. ......


Yij : flow;   xij :1 if edge [i, j] E damaged, 0 otherwise;   c,p,q is known


Johan Löfberg

unread,
Jun 9, 2018, 12:18:29 PM6/9/18
to YALMIP
I already told you, to solve the worst-case problem, min_y max_x, you simple concatenate all the constraints (assuming minmax means y does not know x but has to be able cope wtih any scenario)

Jingle Li

unread,
Jun 9, 2018, 12:43:58 PM6/9/18
to YALMIP
Thank you very much, Professor. I will think about this again. Thank you for your guidance and help.
Reply all
Reply to author
Forward
0 new messages