How to solve the min-max problem with mixed integer linear programming(MILP)?

I am trying to solve the MILP problem by referring to the page below.
https://jp.mathworks.com/help/optim/ug/mixed-integer-linear-programming-basics-problem-based.html?lang=en
The problem I want to solve is that the objective function is represented by min-max.
However, I understand that the "optimproblem function" that creates an optimization problem only supports maximization and minimization, not min-max.
https://jp.mathworks.com/help/optim/ug/optimproblem.html?lang=en
So, please tell me how to solve the min-max problem.
thanks in advance.

3 Comments

I do not understand what you mean that you are trying to solve a MILP problem using min-max. MILP by definition has a linear objective function. I do not understand where you can put a linear objective function into a min-max framework.
Can you please write out exactly what you are trying to do in a brief mathematical description? Something like:
where F = (brief description here) subject to constraints (describe constraints here)
Alan Weiss
MATLAB mathematical toolbox documentation
I want to solve an optimization problem to achieve network traffic distribution.
Therefore, the maximum value of the network link utilization rate is set to be minimized as the objective function.
The constraint condition is the calculation of the network link utilization rate.
The only determinant is and I think it's MILP.
Below is a description of the formulas and variables.
V is network node set, E is Network link set, F is network flow set, is link l utilization, is link l capacity, is amount of traffic through link l by flow f, is path set for flow f, is requested traffic volume of flow f, is 1 If route r is assigned to flow f, is 1 if route r is assigned to flow f and route r contains link l.
How did you solve your problem? I am facing the similar challange as you described here.

Sign in to comment.

Answers (1)

Eliminate the inner max problem by rewriting it as,

7 Comments

how to solve minimize z after that? Is there any tool in matlab?
You just set max_l_in_E(u_l) to a new optimization variable z.
The complete problem then reads:
min: z
z >= u_l (l in E)
plus the other constraints from your original problem.
Usually, your problem is linear - thus "linprog" is the solver of choice.
Yes, there is intlinprog. Or you can use the problem-based set-up.
thank you so much for your kind response. I am new to this expression and also learning optimization recently. can you please help me figure out how to code this kinda min max z expression in matlab?
The following is my sample code. I wanted to minimize the maximum of z under nonlinear constarints but cannot figure out how to make matlab understand:
clc; clear; close all;
rowx = 2; colx = 2;
x = optimvar("x",rowx,colx,"LowerBound",0,"UpperBound",2);
rowy = 3; coly = 3;
%x = optimvar(name,n) creates an n-by-1 vector of optimization variables.
y = optimvar("y",rowy,coly,"Type", "integer", "LowerBound",0,"UpperBound",1);
z = optimvar("z","UpperBound",1);
obj = [];
prob = optimproblem('Objective',obj);
prob.Constraints.cons1 = sum(y) == ones(1,coly);
count = 0;
for i = 1:rowx
for j = 1:colx
count = count+1;
prob.Constraints.(['cons', num2str(1+count)]) = z >= (sin(x(i,j)))^2 + y(1)^2/4-(x(i,j)+x(i,j)-x(i,j)/5)^2+exp(y(2));
end
end
for i = 1:rowx
for j = 1:colx
x0.x(i,j) = abs(randn(1,1));
end
end
for i = 1:rowy
for j = 1:coly
x0.y(i,j) = 0;
end
end
for i = 1:coly
x0.y(randi(rowy),i)= 1;
end
x0.z = 0.59;
show(prob)
[sol,fval] = solve(prob,x0)
I also understand that my code is just finding points that meets the constraints only rather than minimizing it.
I wanted to minimize the maximum of z under nonlinear constarints but cannot figure out how to make matlab understand:
The OP had no nonlinear constraints, and our advice was based on that.You do not have a similar problem.
You mean that you want to add
prob.Objective = z;
to your problem formulation ?
The code gives a result, but I wonder why because you try to access y(1) and y(2) although you define y as a 3x3 matrix.
Answer to your question is yes. Thank you so much @Torsten. Perhaps my problem is solved. This code is just a practice sample that I randomly made to learn optimization syntax using MATLAB.
Thanks again for your sincere response @Torsten and @Matt J.

Sign in to comment.

Products

Release

R2021a

Asked:

on 17 Aug 2021

Edited:

on 3 Feb 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!