Skip to contents

Find extreme points of a nondominated set of points

Usage

classifyNDSetExtreme(pts, direction = 1)

Arguments

pts

A set of non-dominated points. It is assumed that ncol(pts) equals the number of objectives ($p$).

direction

Ray direction. If i'th entry is positive, consider the i'th column of the pts plus a value greater than on equal zero (minimize objective $i$). If negative, consider the i'th column of the pts minus a value greater than on equal zero (maximize objective $i$).

Value

The classification is extreme (se), supported non-extreme (sne) and unsupported us nondominated points. Return the ND set with classification columns se (true/false), sne (true/false), us (true/false) and cls (se, sne or us).

Note

It is assumed that pts are nondominated. This algorithm is faster than classifyNDSet(), since only check for extreme points.

See also

Examples

# \donttest{
pts <- matrix(c(0,0,1, 0,1,0, 1,0,0, 0.5,0.2,0.5, 0.25,0.5,0.25), ncol = 3, byrow = TRUE)
ini3D(argsPlot3d = list(xlim = c(min(pts[,1])-2,max(pts[,1])+2),
  ylim = c(min(pts[,2])-2,max(pts[,2])+2),
  zlim = c(min(pts[,3])-2,max(pts[,3])+2)))
plotHull3D(pts, addRays = TRUE, argsPolygon3d = list(alpha = 0.5), useRGLBBox = TRUE)
#> Warning: edge not found:1 2
#> Warning: edge not found:1 2
pts <- classifyNDSetExtreme(pts[,1:3])
plotPoints3D(pts[pts$se,1:3], argsPlot3d = list(col = "red"))  # extreme
plotPoints3D(pts[is.na(pts$cls),1:3], argsPlot3d = list(col = "yellow"))  # unclassified
finalize3D()


pts
#>     z1  z2   z3    se   sne    us  cls
#> 1 0.00 0.0 1.00  TRUE FALSE FALSE   se
#> 2 0.00 1.0 0.00  TRUE FALSE FALSE   se
#> 3 1.00 0.0 0.00  TRUE FALSE FALSE   se
#> 4 0.50 0.2 0.50 FALSE    NA    NA <NA>
#> 5 0.25 0.5 0.25 FALSE    NA    NA <NA>

pts <- matrix(c(0,0,1, 0,1,0, 1,0,0, 0.2,0.1,0.1, 0.1,0.45,0.45), ncol = 3, byrow = TRUE)
di <- -1 # maximize
ini3D(argsPlot3d = list(xlim = c(min(pts[,1])-1,max(pts[,1])+1),
  ylim = c(min(pts[,2])-1,max(pts[,2])+1),
  zlim = c(min(pts[,3])-1,max(pts[,3])+1)))
plotHull3D(pts, addRays = TRUE, argsPolygon3d = list(alpha = 0.5), direction = di,
           addText = "coord")
#> Warning: edge not found:1 2
#> Warning: edge not found:1 2
pts <- classifyNDSetExtreme(pts[,1:3], direction = di)
plotPoints3D(pts[pts$se,1:3], argsPlot3d = list(col = "red"))
plotPoints3D(pts[is.na(pts$cls),1:3], argsPlot3d = list(col = "yellow"))  # unclassified
finalize3D()


pts
#>    z1   z2   z3    se   sne    us  cls
#> 1 0.0 0.00 1.00  TRUE FALSE FALSE   se
#> 2 0.0 1.00 0.00  TRUE FALSE FALSE   se
#> 3 1.0 0.00 0.00  TRUE FALSE FALSE   se
#> 4 0.2 0.10 0.10 FALSE    NA    NA <NA>
#> 5 0.1 0.45 0.45 FALSE    NA    NA <NA>

pts <- matrix(c(0,0,1, 0,0,1, 0,1,0, 0.5,0.2,0.5, 1,0,0, 0.5,0.2,0.5, 0.25,0.5,0.25), ncol = 3,
              byrow = TRUE)
classifyNDSetExtreme(pts)
#>     z1  z2   z3    se   sne    us  cls
#> 1 0.00 0.0 1.00  TRUE FALSE FALSE   se
#> 2 0.00 1.0 0.00  TRUE FALSE FALSE   se
#> 3 0.50 0.2 0.50 FALSE    NA    NA <NA>
#> 4 1.00 0.0 0.00  TRUE FALSE FALSE   se
#> 5 0.25 0.5 0.25 FALSE    NA    NA <NA>
#> 6 6.00 0.0 1.00 FALSE    NA    NA <NA>
#> 7 6.00 1.0 0.00 FALSE    NA    NA <NA>

pts <- genNDSet(3,15)[,1:3]
ini3D(argsPlot3d = list(xlim = c(0,max(pts$z1)+2),
  ylim = c(0,max(pts$z2)+2),
  zlim = c(0,max(pts$z3)+2)))
plotHull3D(pts[, 1:3], addRays = TRUE, argsPolygon3d = list(alpha = 0.5))
#> Warning: edge not found:1 2
#> Warning: edge not found:1 2
pts <- classifyNDSetExtreme(pts[,1:3])
plotPoints3D(pts[pts$se,1:3], argsPlot3d = list(col = "red"))
plotPoints3D(pts[is.na(pts$cls),1:3], argsPlot3d = list(col = "yellow"))  # unclassified
finalize3D()


pts
#>    z1 z2 z3    se   sne    us  cls
#> 1  23 18 24  TRUE FALSE FALSE   se
#> 2  67 21 14  TRUE FALSE FALSE   se
#> 3  16 30 22  TRUE FALSE FALSE   se
#> 4   6 41 32  TRUE FALSE FALSE   se
#> 5  69 58  5  TRUE FALSE FALSE   se
#> 6  28 14 75 FALSE    NA    NA <NA>
#> 7   8 49 26  TRUE FALSE FALSE   se
#> 8  12 67 25 FALSE    NA    NA <NA>
#> 9  37  6 32  TRUE FALSE FALSE   se
#> 10 21 69 15  TRUE FALSE FALSE   se
#> 11  8 25 57  TRUE FALSE FALSE   se
#> 12 49 81 12 FALSE    NA    NA <NA>
#> 13 48 10 22  TRUE FALSE FALSE   se
#> 14 10 29 32  TRUE FALSE FALSE   se
#> 15 75 39  9  TRUE FALSE FALSE   se

pts <- genNDSet(3, 15, keepDom = FALSE, argsSphere = list(below = FALSE, factor = 10))[,1:3]
ini3D(argsPlot3d = list(xlim = c(0,max(pts$z1)+2),
  ylim = c(0,max(pts$z2)+2),
  zlim = c(0,max(pts$z3)+2)))
plotHull3D(pts[, 1:3], addRays = TRUE, argsPolygon3d = list(alpha = 0.5))
#> Warning: edge not found:1 2
#> Warning: edge not found:1 2
pts <- classifyNDSetExtreme(pts[,1:3])
plotPoints3D(pts[pts$se,1:3], argsPlot3d = list(col = "red"))
plotPoints3D(pts[is.na(pts$cls),1:3], argsPlot3d = list(col = "yellow"))  # unclassified
finalize3D()


pts
#>    z1 z2 z3    se   sne    us  cls
#> 1  75 91 36 FALSE    NA    NA <NA>
#> 2  77 75 16 FALSE    NA    NA <NA>
#> 3  66 14 80  TRUE FALSE FALSE   se
#> 4  44 95 31 FALSE    NA    NA <NA>
#> 5  48 94 27  TRUE FALSE FALSE   se
#> 6  36 98 46 FALSE    NA    NA <NA>
#> 7  23 64 90 FALSE    NA    NA <NA>
#> 8  18 88 48  TRUE FALSE FALSE   se
#> 9  78 66 13  TRUE FALSE FALSE   se
#> 10 91 24 41  TRUE FALSE FALSE   se
#> 11 95 31 39 FALSE    NA    NA <NA>
#> 12 31 30 91  TRUE FALSE FALSE   se
#> 13 45 19 88  TRUE FALSE FALSE   se
#> 14 14 79 68  TRUE FALSE FALSE   se
#> 15 15 66 81  TRUE FALSE FALSE   se
# }