Genetic algorithm overly restrictive for integer problems
1 次查看(过去 30 天)
显示 更早的评论
I am trying to use MATLAB's ga function to solve a mixed-integer linear programming problem. I first specified the task in the problem-based framework, then used prob2struct to convert this to the solver-based framework. I was able to find a feasible solution for a small problem using intlinprog, but this became infeasible for all but the smallest problems. I am now trying to find a solution with ga, but am struggling as it has not yet successfully satisfied the constraints.
I have three DV vectors (concatenated together):
- X: binary variable representing replacement of an asset
- A: age of an asset
- C: condition of an asset
over three dimensions:
- n: assets
- c: condition ratingss
- t: time (discrete, in years)
and have specified constraints in order to ensure that age and condition in consecutive time periods are correct based on whether or not the asset is replaced.
Based on my understanding of genetic algorithms, the way I would implement a solution would be to apply the genetic operations to the X vector, then update the A and C vectors appropriately and check if other constraints are satisfied. However, for the integer ga solver, MATLAB does not allow custom creation, mutation, crossover or selection functions. What am I missing here? It seems to me like genetic algorithms are a natural fit for combanitoric problems with binary DVs, but the blanket ban on customisation is making the inbuilt ga function all but unusable.
0 个评论
采纳的回答
Walter Roberson
2019-7-31
This restriction is in place because internally ga implements the integer restrictions by providing its own creation and mutation and cross-over functions . There is no special integer algorithms inside ga(): the integer restrictions are enforced by the creation, mutation, cross-over functions.
If you need to go beyond what ga provides when you impose integer conditions, then what you need to do is not tell it that you are using integers for those variables, and instead provide your own creation, mutation, cross-over functions that "just happen" to only result in vectors that obey your integer constraints.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!