Let me explain some definition before moving on to the problem:
Let's say point A is the coordinates (which can have a double value), say (1,2,3,5,4,3,2,6), the same as point B.
Point A dominates point B, if and only if 1. all coordinates at point A <= all coordinates at point B and 2. one coordinate of point A <corresponding coordinates of point B
For example: Given
A=(2,3,4,5) B=(2,3,4,6)
A dominates B, since condition 1 is satisfied, and for condition 2, the fourth component A <the fourth component B.
Given another example,
A=(2,3,4,5) B=(2,3,4,5)
Neither A dominates B, and vice versa, since condition 2 is not satisfied in both cases.
Now, given the list of n-dimensional coordinates, I want to find a set of coordinates that others don't dominate, these coordinates are called horizon settings.
Say I have coordinates in 5 dimensions
(2,1,2,1,2) (1,2,1,2,1) (3,3,3,3,3) (4,4,4,4,4)
Set horizon
(2,1,2,1,2) (1,2,1,2,1)
Now I want to write a function:
List<double[]> SkylineSet(List<double[]> Coordinates, int dimension)
This example input:
List<double[]> newList=new List<double[]>(); newList.Add(new double[] {2, 1, 2, 1, 2}); newList.Add(new double[] { 1, 2, 1, 2, 1 }); newList.Add(new double[] { 3, 3, 3, 3, 3 }); newList.Add(new double[] { 4, 4, 4, 4, 4 });
SkylineSet(newList,5) prints
(2,1,2,1,2) (1,2,1,2,1)
This can be achieved by comparing each coordinate, but the number of coordinates can be very large, anyone has an idea how to solve this problem effectively?