is_nondominated | R Documentation |
Identify nondominated points with is_nondominated
and remove dominated
ones with filter_dominated
.
pareto_rank()
ranks points according to Pareto-optimality,
which is also called nondominated sorting \citepDeb02nsga2.
is_nondominated(data, maximise = FALSE, keep_weakly = FALSE)
filter_dominated(data, maximise = FALSE, keep_weakly = FALSE)
pareto_rank(data, maximise = FALSE)
data |
( |
maximise |
( |
keep_weakly |
If |
pareto_rank()
is meant to be used like rank()
, but it
assigns ranks according to Pareto dominance. Duplicated points are kept on
the same front. When ncol(data) == 2
, the code uses the O(n
\log n)
algorithm by \citetJen03.
is_nondominated
returns a logical vector of the same length
as the number of rows of data
, where TRUE
means that the
point is not dominated by any other point.
filter_dominated
returns a matrix or data.frame with only mutually nondominated points.
pareto_rank()
returns an integer vector of the same length as
the number of rows of data
, where each value gives the rank of each
point.
Manuel López-Ibáñez
path_A1 <- file.path(system.file(package="eaf"),"extdata","ALG_1_dat.xz")
set <- read_datasets(path_A1)[,1:2]
is_nondom <- is_nondominated(set)
cat("There are ", sum(is_nondom), " nondominated points\n")
plot(set, col = "blue", type = "p", pch = 20)
ndset <- filter_dominated(set)
points(ndset[order(ndset[,1]),], col = "red", pch = 21)
ranks <- pareto_rank(set)
colors <- colorRampPalette(c("red","yellow","springgreen","royalblue"))(max(ranks))
plot(set, col = colors[ranks], type = "p", pch = 20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.