4.83333

4.8 | 6 ratings Rate this file 71 Downloads (last 30 days) File Size: 280.45 KB File ID: #24838
image thumbnail

GODLIKE - A robust single-& multi-objective optimizer

by Rody Oldenhuis

 

24 Jul 2009 (Updated 06 Aug 2009)

GODLIKE combines 4 global optimizers for both single/multi-objective optimizations

| Watch this File

File Information
Description

GODLIKE (Global Optimum Determination by Linking and Interchanging Kindred Evaluators) is a generization of various population-based global optimization schemes. Also, it handles both single- and multi-objective optimization, simply by adding additional objective functions.

GODLIKE solves optimization problems using relatively basic implementations of a genetic algorithm, differential evolution, particle swarm optimization and adaptive simulated annealing algorithms. Its power comes from the fact that these different algorithms run simultaneously (linked), and members from each population are occasionally swapped (interchanged) to decrease the chances of convergence to a local minimizer.

It is primarily intended to increase ROBUSTNESS, not efficiency as it usually requires more function evaluations than any of the algorithms separately. Its also inteded to do away with the need to fine-tune these algorithms each and every time you encounter an optimization problem, AND to generalize optimization itself (it's both a single and multi-objective optimizer), AND to generate simple plots to be used in quick reports etc.

BASIC EXAMPLES:

(single-objective)

% extended rosenbruck function
rosen = @(X) sum( 100*(X(:, 2:2:end) - X(:, 1:2:end-1).^2).^2 + (1 - X(:, 1:2:end-1)).^2, 2);

% call GODLIKE
GODLIKE(rosen, 250, -10*ones(1,10), 10*ones(1,10), 'ms')

will produce a reasonably accurate approximation to the global minimum of the 10-dimensional rosenbruck problem
( sol ~ ([1,1,1,...]), fval ~ 0 )

(multi-objective optimization)

% basic Sin-Cos Pareto front
GODLIKE({@sin;@cos}, 100, 0, 2*pi, [], 'display', 'plot')

will generate a nice plot of the problem's Pareto front. Some more examples are included in the GODLIKE_DEMO.m, included in the ZIP.

======================================
MAJOR CHANGES
(see the changelog for more detailed changes)
======================================
(06/Aug/2009)
- Objective functions can now accept any 2-dimensional input. Your objective function should accept arguments equal in size to either [lb] or [ub], and return a simple scalar.
- I discovered I made some *severe* mistakes in the implementation of the global optimization algorithms. This caused large inefficiencies or inaccurate results. Most (hopefully all) of these mistakes are corrected now.
- Added 2more options for the algorithms: NetWorkTopology & ReHeat (see doc)
- Changed the [MinDescent] criterion to the more MATLAB-style 'TolX' and 'TolFun' options

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
NSGA - II: A multi-objective optimization algorithm

MATLAB release MATLAB 7.7 (R2008b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (17)
03 Aug 2009 AndrĂ©  
02 Sep 2009 Roland Pihlakas

Hi, You can make it orders of magnitude faster if You replace in pop_single.m this:

for i = 1:pop.dimensions
% convert column to decimal representation
temp_pop(:, i) = sum(convert_to_dec.*newpop(:, 1:NumBits), 2);
% delete entries
newpop(:, 1:NumBits) = [];
end

with this:

newpop_startcol = 1;
NumBits2 = NumBits-1;
for i = 1:pop.dimensions
% convert column to decimal representation
temp_pop(:, i) = sum(convert_to_dec.*newpop(:, newpop_startcol : newpop_startcol+NumBits2), 2);
% delete entries
newpop_startcol = newpop_startcol + NumBits;
end

Column/row deletion is very slow operation, its better to avoid it.

There were also some changes I had to make in order for the script to start in Matlab R2007a.

Are You considering to port it to mex file? I am going to do that but we may get the results sooner if we split the task.

02 Sep 2009 Rody Oldenhuis

Roland: Indeed, I overlooked that issue. It works great, thanks!

About the mex-file: I see no real need for it. Most of the time the real computational cost is in the objective functions, not this optimizer (as it should be)...except maybe for the NSGA-II part, but really I only notice that it's N2-complex if I use huge population sizes...that, and I'm really short on time these days :) But of course, you are more than welcome to do it!

So what changes did you make to allow ML2007a to run it? It would be perfect if more users could use GODLIKE! I think it's a great idea if you incorporate those changes, write a mex file and submit it as an improvement upon my version.

Thanks for the feedback.

08 Sep 2009 Daniel

Nice tool! Any plans for adding non-linear constraint handling? I'm messing with a Lagrangian barrier function (the method the original C++ implementation of NSGAII uses) inside a custom objective function, but it would be nice to have that kind of functionality implemented directly in the optimizer.

08 Sep 2009 Rody Oldenhuis

Daniel: I am most certainly planning to implement (non)-linear constraints in GODLIKE, that would be pretty convenient indeed! However, I'm VERY busy the next few weeks, so don't expect this change to come anytime soon :)

You could try my other tool OPTIMIZE (also on the file-exchange); it can also optimize problems globally. Perhaps that can give you some results...

Thanks for the 5 stars ! :)

29 Sep 2009 Roland Pihlakas

A bugfix.
set_options.m, at lines 456-457:

elseif strcmpi(option, 'SkipTest')
    if ~isnumeric(value)

should be:

elseif strcmpi(option, 'SkipTest')
    if ~ischar(value)

15 Oct 2009 John

I would like to implement this code to fit a non-linear equation to a set of data. The non-linear equation takes 8 paramaters which I would like to optomize. Basically, the sum of least squares approach. Will GODLIKE achieve this? I have tried using it and the paramater guesses are all over the place and do not seem to converge. Thank you!

10 Jul 2010 Robert

trade extra cpu cycles for fewer brain cycles.

25 Aug 2010 martin safsadf

Is it possible to add more constraints into the optimization of godlike? for example: x(1)+x(2)-3*x(3)=10
How could I realize that in matlab?
Thanks

03 Sep 2010 Vaibhav

Developed function is very nice, but can i handle equality and inequality constraints in GODLIKE? In user manual, i couldn't find anything related to this.

27 Sep 2010 Davoud Safari

Thanks Rody...But I need the codes for integer programming. How can use these codes for that purpose.. i.e. which part of code, must be changed to achieve my purpose?

07 Dec 2010 Ben

How to pass parameters to the objective function?

28 Jan 2011 Davide

When I try the multi-objective minimization I face some issues.
Let's take as an example this multiobjective function
function a = myfunc(x)
a(1) = sin(x)
a(2) = cos(x)

if I use GODLIKE like this:
GODLIKE({@sin,@cos},...)
it works fine

in this way
optfunc = @(x) myfunc(x)
GODLIKE(optfunc,...)
id does not.

What am I doing wrong in the second case? How should I use it?

22 Jun 2011 Christopher

I've found that this code is quite helpful in generating useful initial conditions for some constrained optimization problems that involve local minima. Are there any plans to handle nonlinear inequality constraints? Also, a useful addition to the code would be an option for a maximum run time. That way I can set it to run over the weekend easily.

23 Jun 2011 Sebastien Paris  
26 Aug 2011 Jeroen van Nugteren  
18 Nov 2011 Joe Ajay

Hello Rody, does this tool solve discrete optimization problems...do you have any update for solving discrete problems

Please login to add a comment or rating.
Updates
06 Aug 2009

Lots of changes (too much to list here). See the changelog.txt file in the ZIP.

Tag Activity for this File
Tag Applied By Date/Time
optimization Rody Oldenhuis 24 Jul 2009 11:02:30
global optimization Rody Oldenhuis 24 Jul 2009 11:02:31
multiobjective Rody Oldenhuis 24 Jul 2009 11:02:31
singleobjective Rody Oldenhuis 24 Jul 2009 11:02:31
genetic algorithm Rody Oldenhuis 24 Jul 2009 11:02:31
simulated annealing Rody Oldenhuis 24 Jul 2009 11:02:31
particle swarm optimization Rody Oldenhuis 24 Jul 2009 11:02:31
classes Rody Oldenhuis 24 Jul 2009 11:02:31
differential evolution Rody Oldenhuis 24 Jul 2009 11:02:31
particle swarm optimization Dhafar 28 Oct 2009 23:17:09
classes Suleman 26 Nov 2010 08:27:10
differential evolution Suleman 26 Nov 2010 08:27:14
genetic algorithm Suleman 26 Nov 2010 08:27:21
global optimization Suleman 26 Nov 2010 08:27:29
optimization MARIO CASTRO GAMA 13 Oct 2011 20:08:17

Contact us at files@mathworks.com