MATLAB Genetic Algorithm : Distance of separation between solution points - matlab

I need to optimize the location of 10 Transmitters and 10 Receivers (modeled as points on an aperture plane) so as to minimize a certain objective scalar using Genetic Algorithm toolbox in MATLAB. My question is: I have (10+10)*2 = 40 variables (optimizing x and y positions of each point). How do I model the constraints in the form Ax <= b, such that each point is separated by a minimum distance in both x and y directions from all other points?

I'd model the objective function as the euclidian distance between the points, which you are trying to minimize. Also the transmitters and receivers must have a minimum distance between them. So this distance should be minimum, but greater than the minimum distance of the equipment. I'd look into the dimensions of the plane to identify all the constraints.

Related

Is there a fast method to calculate the nearest point in a data set under a point-depending distance function

I am searching for a (fast) way to calculate the nearest point y in a dataset to a given point x under a (x,y)-depending distance function.
My distance function has the form: d(x,y) = 1/f(x,y) * |||x-y||^2, where ||x|| denotes the standard Euclidean-norm. The function f(x,y) fulfills all necessary properties such that d(x,y) is a distance measurement i.e. positive, symmetric,...
For a "normal" distance function I could to some transformation on the data itself and use some k-nearest neighbor approaches. But for this case I could not find something useful. Does anyone have an idea?
Right now, I am using Julia for the implementation.
You should be able to use most standard spacial indexes (kd-tree, r-tree, quadtree, and their derivatives) as long as d(x,y) is "convex".
With "convex" I mean that a curve of equidistant points around P is convex. E.g. for Euclidean this is a circle, for Manhatten/Taxi distance it is a square.
This is required because these indexes usually partition the data into squares, rectangles or half-spaces (kd-tree), so they rely on calculating the minimum distance to a group of points by calculating the distance to the corner or sides of a bounding rectangle. As long as your distance function is convex (or at least not concave) then any index of these indexes should work.

Finding the bounds of a region represented by data points in Matlab

For simplicity, I will consider the 2-D case but my question is well applicable to n-dimensions. I have a region S in 2-D that is closed and bounded and has no holes. The only thing I know about S is a bunch of data points that lie in S. Essentially, these points fill-up S; the more points I have, the more accurate my representation of S is. From these data points (x,y) in 2-D, I can easily approximate xL and xU such that all points (x,y) in S satisfy xL <= x <= xU.
I am wondering if there is a function or method in Matlab that enables me, for a particular point (x,y) in S, to give me the bounds of y approximated from these data points. In particular, I am looking for functions yL(x) and yU(x) such that yL(x) <= y <= yU(x) for any x such that xL <= x <= xU.
Now, I am not necessarily looking for a function in matlab like boundary which simply connects the points that are literally on the boundary of the data set. I am rather looking for the "best fit" boundary given the scattered plot that I have.
Suggestions appreciated!

Stability of pose estimation using n points

I am using chessboard to estimate translation vector between it and the camera. Firstly, the intrinsic camera parameters are calculated, then translation vector are estimated using n points detected from the chessboard.
I found a very strange phenomenon: the translation vector is accurate and stable when using more points in the chessboard, and such phenomenon is more obvious when the distance is farer. For instance, the square in the chessboard is 1cm*1cm, when the distance is 3m, translation vector is accurately estimated when using 25 points, while it is inaccurate and unstable using the minimal 4 points. However, when the distance is 0.6m, estimation results of translation vector using 4 points and 25 points are similar, which are all accurate.
How to explain this phenomenon (in theory)? what's the relationship between stable estimation result and distance, and number of points?
Thanks.
When you are using a smaller number of points, the calculation of the translation vector is more sensitive to the noise in coordinates of those points. Point coordinates are noisy due to a finite resolution of the camera (among other things). A that noise only increases with distance. So using a larger number of points should provide for a better estimation.

Find all neighbors within point-specific radius in Matlab

I am implementing Equation 8 from Kraskov et al (2004)'s Estimating Mutual Information paper, and have the following problem:
Given vectors X = [X_1,...,X_N] and r = [r_1,...,r_N], I need to compute A= [A_1,...A_N] where A_i is the number of points in X within a r_i radius of X_i.
If r were a fixed number, that is, if the radius around each point was fixed for all points, I could easily use rangesearch. But because it is a vector (different radius for each point), I am not sure how to do this fast. Exhaustive search (or making any N^2 sized distance arrays) is not good, because N is on the order of a million.

Calculate the maximum euclidean distance from a MST (minimal spanning tree)

Task: I am working in Matlab and I have to construct a dendrogram from maximum values of a matrix of Euclidean distance.
What have I done so far: I have constructed the distance matrix based on the correlation coefficients of returns of prices (this is what I have in my application). I have also built the MST based on these distances. Now I have to construct the ultrametric matrix which is obtained by defining the subdominant ultrametric distance D*ij between i and j as the maximum value of any Euclidean distance Dkl detected by moving in single steps from i to j in the MST.
CorrelMatrix=corrcoef(Returns);
DistMatrix=sqrt(2.*(1-CorrelMatrix));
DG=sparse(DistMatrix);
[ST,pred] = graphminspantree(DG,'Method','Prim');
Z = linkage(DistMatrix);
dendrogram(Z)
I am a newbie in Matlab and I do not know if there is a function or something that I should use to find the maximum distance between two nodes, and to put if after in a matrix.