https://github.com/davidasmith/shiny-ga-demo
Interactive example of a simple genetic algorithm in R shiny.
https://github.com/davidasmith/shiny-ga-demo
genetic-algorithm optimisation r-shiny rastrigin
Last synced: 7 months ago
JSON representation
Interactive example of a simple genetic algorithm in R shiny.
- Host: GitHub
- URL: https://github.com/davidasmith/shiny-ga-demo
- Owner: DavidASmith
- License: mit
- Created: 2021-01-05T09:37:44.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-07-22T23:05:28.000Z (11 months ago)
- Last Synced: 2025-07-23T01:08:14.166Z (11 months ago)
- Topics: genetic-algorithm, optimisation, r-shiny, rastrigin
- Language: R
- Homepage:
- Size: 297 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Interactive Genetic Algorithm Example
## Overview
This is a an R Shiny application using Luca Scrucca's [GA package](https://luca-scr.github.io/GA/).
The optimisation example searches for optimum values for two dimensions
to minimise the Rastrigin function. A plot of this function is shown below:
.
Note that optimum value for both dimensions is zero, and that many local
minima are present.
Users can explore the impact of different values for:
- population size
- mutation probability
- crossover probability
- elitism
- number of generations.
## Implementation
The application makes use of the [future](https://cran.r-project.org/web/packages/future/index.html) package to allow the GA to run asynchronously, and the [ipc package](https://cran.r-project.org/web/packages/ipc/index.html) for passing messages between the GA and Shiny.
## Give it a try
This application is deployed at https://shiny-ga-demo.azurewebsites.net (assuming the hosting doesn't cost me too much).