Optimization problem: how to include binary variables?

Currently I have an optimization problem with linear equality and inequality constraints. The cost function is nonlinear convex and I used matrix forms, function handle and fmincon to solve for the problem. Now I want to extend the model by simply adding a binary variables to the problem. However, fmincon does not support this and intlinprog does not accept nonlinear cost functions and nor does it accept functions as input.
I looked up the GA page, but I saw the following note: "When there are integer constraints, ga does not accept linear or nonlinear equality constraints, only inequality constraints."
Are there alternatives available for this problem?

7 件のコメント

Torsten
Torsten 2016 年 7 月 7 日
Yes. Solve the problem two times - once with binary variable set to 0 and once binary variable set to 1 - and compare the values of the objective function.
Best wishes
Torsten.
jaap ploeg
jaap ploeg 2016 年 7 月 7 日
Thank you for your quick reply. I don't understand this approach. Why would I solve the first time with all binary variables 0 and second time with all ones. My educated guess tells me that the solution I somewhere in the middle (1 0 1 1 0 0 1 1 etc). From my POV using your solution does not bring my to that solution.
Torsten
Torsten 2016 年 7 月 7 日
You were talking about a binary variable.
If there are more than just one you want to include , you will have to solve your problem for all combinations, i.e. 2^n if n binary variables are present.
Best wishes
Torsten.
jaap ploeg
jaap ploeg 2016 年 7 月 7 日
編集済み: jaap ploeg 2016 年 7 月 7 日
Sorry about the confusion. At this very moment I have 2*N+1 decision variables. N = 30; therefore I currently have 61 vars. Now if I include my binary variables, this will lead to 91. Is there really no alternative? Because comparing that many solutions is near impossible. It is possible for me to drop the nonlinearity in the cost function and make it a linear one.
Torsten
Torsten 2016 年 7 月 7 日
For problems of that size use CPLEX.
Best wishes
Torsten.
José-Luis
José-Luis 2016 年 7 月 7 日
And you could also do some sensitivity analysis in order to reduce the dimensionality of your problem beforehand.
Taner Cokyasar
Taner Cokyasar 2016 年 7 月 14 日
If you can linearize your nonlinear obj. function, you could use intlinprog for binary/integer variables.

サインインしてコメントする。

回答 (0 件)

カテゴリ

質問済み:

2016 年 7 月 7 日

コメント済み:

2016 年 7 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by