Genetic algorithm solves smooth or nonsmooth optimization problems with any types of constraints, including integer constraints. It is a stochastic, population-based algorithm that searches randomly by mutation and crossover among population members.
Optimize | Optimize or solve equations in the Live Editor |
Presents an example of solving an optimization problem using the genetic algorithm.
Coding and Minimizing a Fitness Function Using the Genetic Algorithm
Shows how to write a fitness function including extra parameters or vectorization.
Constrained Minimization Using the Genetic Algorithm
Shows how to include constraints in your problem.
Shows how to choose input options and output arguments.
Effects of Genetic Algorithm Options
Example showing the effect of several options.
Nonlinear Constraints Using ga
An example showing how to use various types of constraints.
Global vs. Local Optimization Using ga
This example shows how setting the initial range can lead to a better solution.
Set Maximum Number of Generations and Stall Generations
TheMaxGenerations
option determines the maximum number of generations the genetic algorithm takes; see Stopping Conditions for the Algorithm.
Shows the importance of population diversity, and how to set it.
Describes fitness scaling, and how it affects the progress ofga
.
Shows the effect of the mutation and crossover parameters inga
.
Hybrid Scheme in the Genetic Algorithm
Shows the use of a hybrid function for improving a solution.
Describes cases where hybrid functions are likely to provide greater accuracy or speed.
Solve mixed integer programming problems, where some variables must be integer-valued.
Solving a Mixed Integer Engineering Design Problem Using the Genetic Algorithm
示例显示如何使用整数programming in ga, including how to choose from a finite list of values.
Shows how to continue optimizingga
from the final population.
显示了如何reproduce results by resetting the random seed.
Provides an example of runningga
using a set of parameters to search for the most effective setting.
Vectorize the Fitness Function
How to gain speed using vectorized function evaluations.
Shows how to create and use a custom plot function inga
.
Custom Output Function for Genetic Algorithm
This example shows the use of a custom output function inga
.
Custom Data Type Optimization Using the Genetic Algorithm
Solve a traveling salesman problem using a custom data type.
Optimizing an objective given by the solution to an ODE usingpatternsearch
orga
in serial or parallel.
What Is the Genetic Algorithm?
Introduces the genetic algorithm.
Explains some basic terminology for the genetic algorithm.
How the Genetic Algorithm Works
Presents an overview of how the genetic algorithm works.
Nonlinear Constraint Solver Algorithms
Explains the Augmented Lagrangian Genetic Algorithm (ALGA) and penalty algorithm.
Describes the options for the genetic algorithm.