Use Matlab R2019a to solve integer programing , why I get warning that selection function is ignored?

4 views (last 30 days)
Warning: Problem has integer constraints. The following options will be ignored by GA: CreationFcn SelectionFcn

Answers (1)

Walter Roberson
Walter Roberson on 25 May 2020
When you use integer constraints then ga() implements that by using its own creation function and selection function.
If you want to have your own creation and selection functions then you need to turn off integer constraints, and instead have your creation and selection functions just happen to produce values that meet the constraints. You will probably also need to implement your own crossoverfcn.
  3 Comments
John D'Errico
John D'Errico on 25 May 2020
You have 4 variables, that each take on only binary values. Why not just evaluate the objective at each possible value, and then take the best one? Using GA to solve that problem is like using a Mack truck to carry a pea to Boston.
亚清 左
亚清 左 on 25 May 2020
Yeah. You're right! I am just trying to test GA! And I have to use GA for a mixed-integer linear programming problem! But I am trapped here!

Sign in to comment.

Categories

Find more on Quadratic Programming and Cone Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!