# register_GA

##### Register a Genetic Algorithm Seriation Method

Register a GA-based seriation metaheuristic.

##### Usage

`register_GA()`

##### Details

Registers the method `"GA"`

for `seriate`

. This method
can be used to optimize any criterion in package seriation.
`control`

for `seriate`

with
method `"GA"`

accepts the following parameters:

`"criterion"`

- criterion to optimize. Default: BAR
`"suggestions"`

- suggestions to warm start the GA.
`NA`

means no warm start. Default: TSP, QAP_LS and Spectral. `"selection"`

- Selection operator (see GA). Default: non-linear rank selection
`"crossover"`

- Crossover operator (see GA). Default: ordered crossover (OX)
`"mutation"`

- Mutation operator (see GA). Default: a mixture of the simple insertion (80% chance) and simple inversion (20% chance) operators.
`"pmutation"`

- proability for permutations. Default: .5
`"pcrossover"`

- probability for crossover. Default: .2
`"popsize"`

- the population size. Default: 100
`"maxiter"`

- maximum number of generations. Default: 1000
`"run"`

- stop after
`run`

generations without improvement. Default: 50 `"parallel"`

- use multiple cores? Default: TRUE
`"verbose"`

- Report progress? Default: TRUE

The GA uses by default the ordered cross-over (OX) operator.
For mutation, the GA uses a mixture of simple insertion and simple inversion
operators. This mixed operator is created using
`seriation::gaperm_mixedMutation(ismProb = .8)`

, where `ismProb`

is
the probability that the simple insertion mutation operator is used.
See package GA for a description of other available
cross-over and mutation operators for permutaitons. The appropriate
operator functions in GA start with `gaperm_`

.

We warm start the GA using `"suggestions"`

given by several
heuristics. Set `"suggestions"`

to `NA`

to start with a purely
random initial population.

**Note:** Package GA needs to be installed.

##### References

Luca Scrucca (2013): GA: A Package for Genetic Algorithms in R.
*Journal of Statistical Software,* **53**(4), 1--37.
URL http://www.jstatsoft.org/v53/i04/.

##### See Also

##### Examples

```
## Not run: ------------------------------------
# register_GA()
# list_seriation_methods("dist")
#
# d <- dist(random.robinson(50, pre=TRUE, noise=.1))
#
# ## use default settings: Banded AR form
# o <- seriate(d, "GA")
# pimage(d, o)
#
# ## optimize for linear sertiation criterion (LS)
# o <- seriate(d, "GA", control = list(criterion = "LS"))
# pimage(d, o)
#
# ## no warm start
# o <- seriate(d, "GA", control = list(criterion = "LS", suggestions = NA))
# pimage(d, o)
## ---------------------------------------------
```

*Documentation reproduced from package seriation, version 1.2-2, License: GPL-3*