We have S sets of points in a two-dimensional space. The sets are numbered from 1 to S, and each set i consists of Pi points (x,y). The distance between two sets S1 and S2 is the sum of the distances between pairs of points in S1 and S2 divided by the multiplication of the number of elements of S1 and S2. The distance between points is obtained as the sum of the absolute value of the difference between coordinates: d((x1,y1),(x2,y2))=|x1-x2|+|y1-y2|. From all the distances between pairs of sets, we want to obtain the minimum.
For example, if S=3, with P1=3, P2=4 and P3=2, and the points of the sets are
set 1: (0,1),(1,3),(3,2)
set 2: (1,0),(2,2),(5,3),(3,2)
set 3: (1,3),(3,4)
d(S1,S2)=41/12, d(S1,S3)=17/6, d(S2,S3)=25/8
A number of problems is solved. For each problem the function to parallelize has:
Input parameters:
-int S: number of sets
-int *P: array of size S with the number of points of each set
-int **D: contains the sets. D points to S pointers, and each pointer D[i] points to 2*P[i] integers, where the points of the corresponding set are stored as x1,y1,x2,y2,...
Return float: the minimum distance between pairs of sets
For more instructions: general instructions.