Pattern search with integer decision variable.

12 次查看(过去 30 天)
Hello.
I tried to solve Nonlinear integer programming to minimize using Optimization tool box.
I understand how I input both objective function and nonlinear constraint function.
However, I don't know how I obtain some decision variable are integer and others are real variable. Cuz, there is no option in pattern search tool box and function in matlab.
Are there any method to get integer variable using pattern search in matlab tool box?

采纳的回答

Alan Weiss
Alan Weiss 2016-5-25
If you have mixed (some integer, some continuous) variables, then no, there is currently no patternsearch solution. Use ga for this type of problem.
However, if all your variables are integer-valued, then you might be able to use patternsearch. Start at an integer point, set ScaleMesh off, and set TolMesh to 0.9 or so. I believe that, with those settings, patternsearch will search only integer points.
Alan Weiss
MATLAB mathematical toolbox documentation
  11 个评论
Ryan Potter
Ryan Potter 2019-2-7
Hi, I just wanted to check whether this advice was still valid? I have followed the points above but still generate non-integer values. I'm using the following code:
fun = @computeMagVol;
x0 = [10,25,20,2];
A = [];
b = [];
Aeq = [];
beq = [];
lb = [1, 1, 1,1];
ub = [21,51,41,4];
nonlcon = @combineConstraints;
options = optimoptions('patternsearch', ...
'PollMethod' , 'GPSPositiveBasis2N', ...
'Display' , 'Iter', ...
'ScaleMesh' , 'off', ...
'AccelerateMesh' , false, ...
'TolMesh' , 0.9, ...
'PlotFcn' ,{@psplotbestf,@psplotmeshsize});
[x,fval,exitflag,output] = patternsearch(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon,options);
My objective function use the integer variables to select discrete, non-integer variables from a list. After the following computations:
Iter Func-count f(x) Constraint MeshSize Method
0 1 75615.1 104.4 0.9
1 50 71970.7 0 0.001 Increase penalty
I obtain that x = [1 44.5, 21, 4] which causes my objective function calculation to fail. The same functions work with the ga algorithm, however I was hoping to use patternsearch as it supports having the object function and non-linear constraints in a single function. Any advice would be greatly appreciated.
Alan Weiss
Alan Weiss 2019-2-7
As I said earlier, I am not at all sure that this method works when you have nonlinear constraints. Sorry.
Alan Weiss
MATLAB mathematical toolbox documentation

请先登录,再进行评论。

更多回答(1 个)

Benjamin Duquenne
Hi, I would like to use patternsearch for full integer problems. To do so, I set the ScaleMesh off, and set TolMesh to 0.9. However I still have problems with the TolBind that has to be way too high (~1e3) to make the code work, otherwise I have errors like 'Constraints are dependent at current iterate'. Could you help me? Thanks in advance.

类别

Help CenterFile Exchange 中查找有关 Direct Search 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by