# MS Location Estimation Based on the Artificial Bee Colony Algorithm
## 4 The Proposed ABC-Based Location Estimation
Avoiding the interference generated from the NLOS error being too large is another problem, i.e., one circle is fully covered by another circle. Therefore, the measured radius would be adjusted so that any two circles can intersect at one point at least. If \(r_{i}>L_{ij}+r_{j}\), we adjust the measured TOA value to \(r_{i}=L_{ij}+r_{j}\) (\(i,j=1,2,3;i\
eq j\)), where \(L_{ij}\) is the distance between BS\({}_{i}\) and BS\({}_{j}\). It is also mentioned in [20] to ensure there is at least one intersection for any two TOA circles and to avoid the condition leads to the proposed location algorithm not being employed. Because of the NLOS error, the circles partially overlap on each other, and the region is formed by the intersections. The true location of MS should be inside the overlap of three circles, which is surrounded by \(U\), \(V\), and \(W\). \(U\), \(V\), and \(W\) are defined as the feasible intersections. Feasible intersections must meet the conditions of the following three inequalities:  
\[x^{2}+y^{2}\leq{r_{1}}^{2}, \tag{10}\]  
\[(x-X_{2})^{2}+y^{2}\leq{r_{2}}^{2}, \tag{11}\]  
Figure 1: Geometric layout of the three circles. \[\left(x-X_{3}\right)^{2}+\left(y-Y_{3}\right)^{2}\leq{r_{3}}^{2}. \tag{12}\]  
The MS location has to satisfy all the above Equations (10)-(12), so that it can be estimated by using the feasible intersections of three circles. The nonlinear objective function was proposed in [27], which can be seen as a cost function in this paper. It is the summation of the Euclidian distances between the MS and the three points intersected by three TOA circles. By solving any two circle equations of (7)-(9), three circles have six intersections. Then, the points of feasible intersections \(U\), \(V\), and \(W\) can be percolated by the inequalities of (10)-(12). The coordinates of \(U\), \(V\), and \(W\) are represented as (\(U_{x}\),\(U_{y}\)), (\(V_{x}\),\(V_{y}\)), and (\(W_{x}\),\(W_{y}\)), respectively. Then, the cost function of the proposed ABC algorithm is as follows:  
\[f(x,y)=\sqrt{\left(x-U_{x}\right)^{2}+\left(y-U_{y}\right)^{2}+\ \left(x-V_{x} \right)^{2}+\left(y-V_{y}\right)^{2}+\left(x-W_{x}\right)^{2}+\left(y-W_{y} \right)^{2}}. \tag{13}\]  
So, the considered positioning problem is reformulated to an optimizing problem. In the best situation, the feasible intersections of \(U\), \(V\), and \(W\) overlap with the minimization of the objective function value. The objective function value is equal to zero at this moment. By minimizing this objective function, the NLOS error can be decreased effectively. The considered optimizing problem can be described as minimizing the cost function with nonlinear constraints. The general constrained optimization problem is to find the MS location (\(x,y\)), so as to:  
\[\text{minimize}\ f(x,y). \tag{14}\]  
With the constraints represented as:  
\[ \begin{array}{l}\min\{U_{x},V_{x},W_{x}\}\leq x\leq\max\{U_{x},V_{x},W_{x} \}\\ \min\{U_{y},V_{y},W_{y}\}\leq y\leq\max\{U_{y},V_{y},W_{y}\}\end{array}  \tag{15}\]  
In this scheme, he ABC algorithm is applied to solve the constrained optimization problem. Each bee represents a horizontal coordinate and each food source is considered as a possible solution. In the ABC algorithm, two control parameters should be set _prior_, including the colony size and the _limit_ value. Because of the differences in the searching range of the \(x\) and \(y\) coordinates, the coordinates of \(x\) and \(y\) cannot be regarded as a parameter with two dimensions. The ABC-based positioning algorithm is completed by operating on two parameters for the \(x\) and \(y\) coordinates to search for the best solution separately and simultaneously. However, the two parameters for the \(x\) and \(y\) coordinates are used together to calculate and compare the objective function value. In this step, the searching range is shown as Equation (15).