Intlinprog - add another constraint
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Christian Schumacher
el 30 de Mzo. de 2019
Hello,
I need some help with an optimization problem, which I am programming in the last few days. I already asked a general question, which helped me a lot, and I was able to program most of my optimization problem. Here is the link for the other question:
The problem I have now, is as follows: I have three columns (Name, Value 1, Value 2) which are optimizied, to yield a maximum sum for column 2, while staying under the sum of 50.000 in column 3. The outcome of the problem are 8 names from column one.
I know want to add categories to the names. I have five categories for the 200 Names.(category 1,2,3,4 or 5). Every name is assigned in one or two categories. I now want to have an optimal solution for my problem, while at least one of the eight names is from every category.
I looked into the documentation, but wasn't able to find a possibility to add the constraint to my problem. Does anyone has an (simple)idea to solve this problem? I am looking forward to your answers!
0 comentarios
Respuesta aceptada
Matt J
el 30 de Mzo. de 2019
Editada: Matt J
el 30 de Mzo. de 2019
You need to construct a 5x200 binary matrix M such that M(i,j)=1 if the j-th name belongs to the i-th category. Your 200x1 binary design vector x must then satisfy the constraints
M*x>=ones(5,1)
You would add this to whatever constraints you had previously.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with Optimization Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!