MyNixOS website logo
Description

Multi-Objective Optimization in R.

The 'rmoo' package is a framework for multi- and many-objective optimization, which allows researchers and users versatility in parameter configuration, as well as tools for analysis, replication and visualization of results. The 'rmoo' package was built as a fork of the 'GA' package by Luca Scrucca(2017) <DOI:10.32614/RJ-2017-008> and implementing the Non-Dominated Sorting Genetic Algorithms proposed by K. Deb's.

rmoo - R Multi-Objective Optimization

R buildstatus Codecov testcoverage CRANstatus Lifecycle:stable

Overview

A Non-Dominated Sorting based Multi-Objective Optimization package, built upon the ‘GA’ package.

rmoo provides a complete, flexible and modular framework for optimizing multiple supplied objectives. You will have at your disposal a wide range of configuration options for the NSGA, NSGA-II and NSGA-III algorithms, as well as representation of real numbers, permutations and binaries.

Installation

You can install the stable version on R CRAN:

install.packages("rmoo")

Or you can install the development version from GitHub:

# install.packages("devtools")
devtools::install_github("Evolutionary-Optimization-Laboratory/rmoo")

Usage

All the algorithms implemented in rmoo are called throught rmoo function. It will receive all the necessary parameters for execution. In this simple example, we solve the DTLZ1 problem, using the NSGA-III:

library(rmoo)

DTLZ1 <- function (x, nobj = 3, ...) 
{
    if (is.null(dim(x))) {
        x <- matrix(x, 1)
    }
    n <- ncol(x)
    y <- matrix(x[, 1:(nobj - 1)], nrow(x))
    z <- matrix(x[, nobj:n], nrow(x))
    g <- 100 * (n - nobj + 1 + rowSums((z - 0.5)^2 - cos(20 * 
        pi * (z - 0.5))))
    tmp <- t(apply(y, 1, cumprod))
    tmp <- cbind(t(apply(tmp, 1, rev)), 1)
    tmp2 <- cbind(1, t(apply(1 - y, 1, rev)))
    f <- tmp * tmp2 * 0.5 * (1 + g)
    return(f)
}

result <- rmoo(fitness = DTLZ1,
                type = "real-valued",
                strategy = "NSGA-III",
                lower = c(0,0,0),
                upper = c(1,1,1),
                monitor = FALSE,
                summary = FALSE,
                popSize = 92,
                n_partitions = 12,
                maxiter = 300)

The rmoo package has a set of S4 method that can help the user to visualize, analysis, and interpret the results.

We are going to show how use the plot method, since depending on the parameter it will display difference plots, e.g. passing “pcp” as parameter for type, the method displays the Parallel Coordinate Plot:

plot(result, type="pcp")

Another example of plot method is when no parameters are passed, the method by default display the scatter plot. It evaluates the result dimensionality and depending on this, it will display 2-D, 3-D or Pairwise Scatter Plot.

#Scatter without optimal points
plot(result)

When displaying the scatter plot, reference points can be passed as parameters of the optimal argument, allowing the results to be compared to them:

#Scatter with optimal points (Using reference points as optimal points)
plot(result, optimal = result@reference_points)

Other plots available in rmoo are heatmap and polar coordinate, both allow the user to view specific solutions.

#Polar Coordinates
plot(result, type="polar", individual = c(1:3))

#Heatmap Plot
plot(result, type="heatmap", individual = c(1:3))

Other methods available in rmoo that may be of interest are getFitness(), getPopulation(), getMetrics(), print(), summary() and others. We do not show the functionality of all these functions since they will be detailed in depth in the future article and vignettes.

Metadata

Version

0.2.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows