フィルターのクリア

Intlinprog - add another constraint

2 ビュー (過去 30 日間)
Christian Schumacher
Christian Schumacher 2019 年 3 月 30 日
編集済み: Matt J 2019 年 3 月 30 日
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!

採用された回答

Matt J
Matt J 2019 年 3 月 30 日
編集済み: Matt J 2019 年 3 月 30 日
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 件)

カテゴリ

Help Center および File ExchangeGet Started with Optimization Toolbox についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by