CodePlexProject Hosting for Open Source Software

There are 10 different convergence criteria that can be added to your optimization method.

**DeltaFConvergence**: Given a value D (minimum difference), this criteria will return true, if the distance (absolute value of the difference) between f_{current}and f_{last}is less than or equal to D.**DeltaGradFConvergence**: Given a value D (minimum difference), this criteria will return true, if the norm (1-norm sum of absolute values) of the gradient less than or equal to D.**DeltaXConvergence**: Given a value D (minimum difference), this criteria will return true, if the norm of the difference between x_{current}and x_{last}is less than or equal to D.**MaxAgeConvergence**: Internally keeps track of the age of the best candidate. If it exceeds the given MaxAge value, the criteria will return true. This is to say, if no better candidate is found in MaxAge iterations, return true.**MaxIterationsConvergence**: Given a value K_{max}, this criteria will return true if the process reaches this many iterations.**MaxFnEvalsConvergence**: Given a value K_{max}, this criteria will return true if the process reaches this many function evaluations.**MaxTimeConvergence**: Given a value for maxTime, this criteria will return true, when the process reaches this length of time. It does not use any of the convergence arguments, but it may be regarded as the most user-friendly criteria. Use wisely. Use often.**ToKnownBestFConvergence**: Given a value for f_{AtOptimal}and a tolerance on either side. The criteria returns true when the value of f_{Best}is within the range of f_{AtOptimal}+/- tolerance. One is welcome to set the tolerance to 0. The default of infinity is fine if it is on the opposite side of the optimization direction.**ToKnownBestXConvergence**: Given a value for x_{AtOptimal}and a minimum difference, D. The criteria returns true when the norm of the difference between x_{Best}and x_{AtOptimal}is less than or equal to D.**MaxDistanceInPopulationConvergence**: Given a minimum span, S, this criteria returns true when the span is equal to or less than S. This is probably the slowest criteria (p*log(p)) given that it must check the distance between every pair of solutions in the population. But, probably not an significant increase for p < 1000.

Within the optimization method these convergence criteria are added in a list which is typically checked at the end of every iteration. The default is that the iterative process completes when any of the criteria are true. However, the property,
** numConvergeCriteriaNeeded**, may be set to any integer greater than or equal to one. If it is set to a value greater than or equal than the number of criteria added, then all of the loaded criteria must return true for the process to
stop. After the process has completed, one can check the optimization property,

In the example, note the use of convergence in the following lines of code.

optMethod.Add(new MaxIterationsConvergence(500)); /* stop after 500 iteration (i.e. generations) */

optMethod.Add(new MaxAgeConvergence(20, 0.000000001)); /*stop after 20 generations of the best not changing */

optMethod.Add(new MaxDistanceInPopulationConvergence(1)); /*stop if the largest distance is only one unit. */

optMethod.NumConvergeCriteriaNeeded = 2; /* two of these three criteria are needed to stop the process. */

Last edited Oct 21, 2010 at 12:05 PM by mattica, version 2