adding multiple constraints into intlinprog problem

1 次查看(过去 30 天)
Hello,
I built an optimization problem with intlinprog. With basic constraints. I now want to add a few constraints but I have no clue how to do it. I hope someone here can help me.
My A matrix looks like this at the moment (with a lot more columns)
6900 7500 8200 7500 6300 7300 7500 7400
-1 -1 0 0 0 0 0 0
-1 -1 0 0 0 0 0 0
0 0 0 0 -1 -1 0 -1
0 0 0 0 -1 -1 0 -1
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 -1 -1 0 0 -1 0
0 0 -1 -1 0 0 -1 0
my b vector looks like this:
50000
-2
3
-3
4
-2
3
-1
1
in short: every product has a cost (row one) and should be choosen 2-3, 3-4, 2-3 times and the last product needs to be chosen 1 time. I now want to assign categories to every product. the different products get assigned a category from 1-15, and the final solution must consists products from at least 3 or more categories. How can I do this?
secondly i want to enforce a rule that the last product (only chosen one time) is not choosen by another specific category. for example: the solver chooses the third product / column from my example. The product belongs to category 13. category 13 corresponds to category 11. No other product is allowed to be from category 11.
and lastly I want to assign a quality class to every product 1,2 or X. I want the algorithm to enforce that he chooses at least one category where all prodcts from class one are choosen?
I know this are a lot of question, and I dont expect anybody to give my the whole answer, I appreciate every little help, guiding me in the right direction.
Thank you very much.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Linear Programming and Mixed-Integer Linear Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by