Mixed-Integer Linear Programming problem
13 views (last 30 days)
i have to solve the following MILP problem on MATLAB:
I have tried to solve it in this way, but there is something wrong because the are not solutions according to the solver but there should be 2 vectors with 4 solutions each. Can anyone help me?
q = 4
n = length(tickers)
variables x(n) y(n) binary;
sum(y) == q;
sum(x) == 1;
sum(x) <= y';
Pranav Verma on 12 Nov 2020
You can use the MILP solver in MATLAB to solve the problem you have mentioned. The MILP solver solves:
So make sure that you convert your problem from maximize to minimize and accordingly change the signs in the constraints and convert them to A.x <= b.
You can make use of optimproblem to create the optimization problem.