Integer Values in a Quadratic Optimization Problem

Hi everyone,
I am currently trying to solve an optimization problem with quadprog. My solution has to be an integer.
So far I have only seen options for linear programming, like the intlinprog solver.
Is it possible to set the solution to be integer values in the quadprog solver? And if not, how can I adress/sidestep this issue?
Best Regards
Sean

 Respuesta aceptada

Matt J
Matt J el 26 de Abr. de 2021
Editada: Matt J el 26 de Abr. de 2021

0 votos

You can use ga() instead of quadprog(), if you have the Global Optimization Toolbox.

4 comentarios

Sean Shugar
Sean Shugar el 26 de Abr. de 2021
Thanks for your quick reply Matt!
I just checked the ga() function. The examples show the ga() function giving a scalar solution for each variable.
In my case, the solution should be a trajectory/ vector with multiple values (battery state of energy over a certain amount of time).
How can I apply that to the ga() function?
Best Regards
Sean Shugar
Matt J
Matt J el 26 de Abr. de 2021
Editada: Matt J el 26 de Abr. de 2021
The examples show the ga() function giving a scalar solution for each variable.
So you agree that the solutions in the ga documentation examples are array-valued, but the problem is that each variable in the array is a scalar? But that is the very definition of an array... How is your problem any different?
Hi Matt,
I was looking for a way to formulate a vectorized form of a quadratic program in the ga() function.
At the moment my cost functions looks like this
fun = @(x) x(:)'*H*x(:) + f'*x(:)
Where H is my quadratic cost matrix and f my linear cost vector. The vector x(:) is my solution.
With equality constraits and inequality constraints defined, I set up the ga() function as following
sol = ga(fun,2*N + 1,A,b,Aeq,beq,lb,ub,[],options);
At the moment I'm trying to solve other problems but this should be the correct way to define a quadratic program in the ga() function, correct?
Best Regards
Sean Shugar
Matt J
Matt J el 26 de Abr. de 2021
It could be, except you haven't included integer constraints in the code you've shown, which was the whole point of abandoning quadprog. Note that ga() cannot directly handle both integer and equality constraints. You would have to eliminate the equality constraints for this to work, see,

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Quadratic Programming and Cone Programming en Centro de ayuda y File Exchange.

Productos

Versión

R2020b

Etiquetas

Preguntada:

el 26 de Abr. de 2021

Comentada:

el 26 de Abr. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by