Abstract
Introduction
Nowadays, the availability of the Mobile Terminal (MT) location information in a wireless network system has led to the demand of location-based services (LBSs). 1 Wide adoption of the Global Positioning System in mobile devices, combined with cellular networks, have practically solved the problem of outdoor localization and opened a new market. It is expected that in the near future, we will witness similar trends for indoor scenarios where people spend more than 70% of their lives. However, satellite or cellular signals are sharply degraded or may fail completely in indoor environment where radio signals are interrupted by shadowing effects. 2 Multifarious methodologies and approaches have been proposed to deal with these problems, such as ultra-wide band (UWB), 3 radio frequency identification (RFID), 4 wireless sensor network (WSN), 5 Bluetooth, 6 and wireless local area network (WLAN). 7 Among all of the indoor location technologies, Wi-Fi-based indoor location systems have attracted a lot of attention because Wi-Fi has become a standard infrastructure in most buildings, such as airports, hospital, office buildings, and commercial centers. And as a common personal item, smartphones are now all able to receive and identify the Wi-Fi signals. Because of this, Wi-Fi location is a low-cost, widespread, and easy obtained indoor location method.8,9
The received signal strength indicator (RSSI) has been utilized for Wi-Fi location estimation with the advantage of the absence of extra hardware for implementation. 10 Typically, there are two techniques of algorithms for RSSI positioning. 11 The first technique is defined as position-related categories, which are also called fingerprint methods. 12 The main idea is using information of survey RSSI values. It depends on sample location coordinates to generate radio frequency (RF) map which is called fingerprint map for training and labeling databases after the classifier, by matching algorithms, such as K-Nearest Neighbor (K-NN),13,14 machine-learning-based schemes, 15 Bayesian strategy, 16 neural networks, 17 and data mining based on clustering 18 to estimate MT positions by calculating Euclidean distance between the fingerprint database system and the real-time RSSI values. 19 It can provide a certain accuracy localization; however, building and updating the fingerprint database are expensive and laborious. The other technique is defined as geometric-related categories, which utilizes the empirical path loss models for distance estimation. After that, a trilateration or maximum-likelihood algorithm is performed for position estimation. The trilateration and maximum-likelihood positioning methods use three or more anchor points (APs) to calculate distance using time differences in signal receptions or signal strength, which are then used to estimate the location of the user. 20
However, RSSI is influenced by many parameters, and establishing an appropriate RF propagation loss model is very difficult. As a result, the trilateration and maximum-likelihood-model-based positioning methods are less accurate than the fingerprinting positioning method. Not only that, the situation of trilateration localization based on three circles is diverse, including the position of the three circles and the number of their intersection. Nevertheless, we propose a bilateral greed iteration (BGI) localization method based on greedy algorithm in order to improve the localization accuracy and reduce complexity of localization process. Generally, the basic trilateration model requires three APs to achieve the position estimate of the MT. But it is difficult to find the solution of simultaneous equations. Even if the equation is overdetermined, the probability of solving the equation is still very low. On the other hand, the amount of AP which can be detected by MT is more than three in the real indoor environment. In order to obtain a better positioning accuracy, how to use all the RSSI of these APs and reduce calculating complexity become very important. The BGI based on greedy algorithm we proposed can make full use of these APs step by step to get the better positioning result. Meanwhile, the BGI is a lower complexity algorithm than K-NN which can relieve the use of MT computational resource, so it can dynamically estimate the models that preferably fit the propagation environment present between the MT and each AP by using only the RSSI values obtained at that precise instant.
Related work
RSSI and distance
Let us assume that there is an IEEE 802.11 wireless network in the indoor environment in which we want to implement a localization system. Our aim is to estimate the location of an MT within the Wi-Fi network. This MT can measure RSSI values from all APs in range. At time instants of
where
But how to calculate the value of
Trilateration
Trilateration is a method of calculating the position of MT from the distance between the known positions of three APs and the MT. There are three APs which the MT can communicate with as shown in Figure 1. The principle behind trilateration positioning is to trace out a circle using a line represented by the distance

Illustration of trilateration.
To confirm the localization of MT, with coordinates (
Figure 1 shows the ideal situation in which the three circles can intersect at one point. Usually, due to measurement error in the real indoor environment, the localization of three circles is divided into three cases, intersect with each two circles, intersect but not each two circles, and no intersection, which is shown in Figure 2.

Three intersecting situations for three circles in the real environment: (a) intersect with each two circles, (b) intersect but not each two circles, and (c) no intersection.
There is no solution of equation (3) in the case as shown in Figure 2. Even if the equation is overdetermined (the number of equations is more than the unknown solution), the probability of solving the equation is still very low. The usual method is considering equation (3) as matrix form
where
The solution of equation (5) is obtained by the least square method
A certain optimization algorithms have been done based on equation (8), for instance, a Wi-Fi-based weighted screening method (WSM) is proposed to improve the localization accuracy in trilateration. 20 A signal tendency index (STI) based on Procrustes analysis is presented to match standardized fingerprints in Zou et al. 12 But the position of more circles and the number of their intersection are not considering completely, which is a puzzle without doubt. We propose the BGI localization method using greedy algorithm, which only needs two circles at each calculation, to avoid complication of three or more circles.
BGI localization
The basic concept of the BGI method is based on greedy algorithm which makes the locally optimal choice at each bilateral positioning process. We summarize the BGI algorithm for the two-dimensional (2D) plan localization problem as follows:
In the BGI algorithm, it only needs to distinguish four different position relationships between
Separation
In a separation case, the algorithm sets a line
where
However, there is an ambiguous solution

Two circles are separated without intersection.
It also has an ambiguous solution
After acquiring the coordinates of
Tangency
There is only one intersection between
Comparing equations (14) and (15), the equal one

Two circles are tangent with one intersection.
Intersection
There are two intersections (
where

Two circles are intersectant with two intersections.
Then the following expression can be obtained via
In the right-angled triangle
According to the slope of line
At this point, the coordinate of
Containing
It is similar between the containing case and separation case (see Figure 6). Line

Two circles are containing without intersection.
The coordinates of
After confirming the position of
where the two equations are the expressions of

Confirm the second localization point
The middle point
which is the localization of MT at the second BGI.
Experimental results and discussion
In this section, an experiment is provided to demonstrate the effectiveness of the BGI localization algorithm proposed in this article. We had the experiment in Room 402 of Electronic and Information College, Northwestern Polytechnical University. The room is a typical office environment, including tables, chairs, personal computers, and students. For achieving the real indoor environment, we do all our experiments on weekdays. The target system for our experiments is a wireless LAN using the IEEE802.11b (Wi-Fi) standard. The system is composed by eight TL-WDR5620 access points produced by TP-LINK Technologies, equipped with four external omnidirectional antennas. All presented measurements are taken on 2.4 GHz center frequency. The RSSI value is gathered with a Thunderobot laptop using an TP-LINK wireless network adapter and WirelessMon software. Before testing the BGI algorithm, we first set up the relationship model between RSSI value and distance in the experiment room.
Environmental parameter
The variable quantity

The key parameter measurement model of experiment environment.
We began the test at sampling point
RSSI value (dBm) of four directions at 12 sampling points.
RSSI: receive signal strength indicator.
According to the sampling data above,
and then we can obtain the following equation on the basis of equation (1):
We can calculate out
Test and results
In this section, we discuss the measurement results conducted to establish the effectiveness of BGI method as well as a conventional trilateration method that was used for the localization test in the evaluation as comparison, and the test steps are as follows:
In Room 402, there are eight APs and four test points arranged for the experiment. The distribution and coordinates of these points are shown in Figure 9. All the APs are dispersedly fixed in the room.

The distribution of APs and test points.
At test point 1 (T1), we gathered RSSI from APs from four different directions using the same laptop. RSSI value collection at each direction last 5 min and the acquisition frequency is once per second. After taking the mean, the measurement distance between each AP and T1 is calculated via equation (16). The RSSI and distance are shown in Table 2.
The RSSI (dBm) and distance (m) between T1 and APs.
RSSI: receive signal strength indicator; APs: anchor points.
After figuring out the distance, we first confirm circles

The estimated localization (
Then, we estimate localization

The estimated localization (

The estimated localization (

The estimated localization (
The measurement results of T2, T3, and T4 are obtained with the same steps and methods as T1. If RSSI of AP is too weak, less than −90 dBm in general, for the MT to detect, it will be out of locating action. Therefore, all the APs assigned are effective to the test points, and the minimum RSSI is −55.9675 dBm in the measurement room. The mean RSSI values of eight APs at four test points are shown in Table 3, and the corresponding distances, calculated by formula (27), between APs and test points are shown in Table 4. One location point is confirmed by the first two APs; the follow-up location point is interrelated with the rest of six APs. Hence, the number of location point is seven determined by eight APs. The final location points of four test points in Room 402 are shown in Figure 14.
The mean RSSI (dBm) of eight APs at four test points.
RSSI: receive signal strength indicator; APs: anchor points.
The distance (m) between eight APs and four test points.
APs: anchor points.

Location points of four test points.
At the same time, the trilateration method, fingerprint method using K-NN algorithm, and maximum-likelihood method are also used at all test points as a comparison. In the trilateration method, three circles of trilateration are very critical with regard to each test point. The three APs we choose are not only the nearest to the test point but also surrounding the test point on the plane. The correlations of APs used for locating test points and each test point are (T1, AP1, AP2, AP6), (T2, AP2, AP3, AP4), (T3, AP1, AP2, AP6), and (T4, AP3, AP7, AP8). For each test point, the coordinate of one location point using trilateration method, and seven location points using BGI method are shown in Table 5. In order to achieve the fingerprint method, the testing room is divided into about 96 grids, and each grid is about 100 cm long and 97 cm wide. In the center of the grid, RSSI value was sampled each second and also continued for 3 min. The mean value of 180 RSSI values is the fingerprint data at each grid. Therefore, the whole fingerprint database consists of 96 RSSI mean values. It takes about 5 h to build this database. In the localization phase, K-NN (
The measurement coordinates of location points.
The location error will be acquired by comparing the real coordinate and measurement coordinate. All errors are shown in Figure 15. For each test point, the error using trilateration method is

Location error of BGI, trilateration, fingerprint, and maximum-likelihood method: (a) the error of three methods at T1, (b) the error of three methods at T2, (c) the error of three methods at T3, and (d) the error of three methods at T4.

Standard deviations of four test points using trilateration method and BGI method.
Conclusion
In this article, we propose a BGI localization method based on greedy algorithm that achieves centimeter-level accuracy for indoor localization. The proposed BGI fully utilizes all effective APs in indoor Wi-Fi systems to improve the positioning accuracy. In the beginning of BGI, we analyzed four situations about the relationship of two circles. Four test points are adopted in the real indoor environment to examine the effectiveness of the BGI method. Comparing the traditional trilateration, fingerprint, and maximum-likelihood methods, the positioning accuracy using BGI method is enhanced 63.55%, 9.93%, and 47.85%, averagely. The trilateration method is relatively easy to implement; however, the localization accuracy is obviously lower than the BGI method. In the fingerprint method, the experiment room is divided into 96 grids, and data collection has already been cumbersome enough. Nevertheless, the localization accuracy is even worse than BGI. As can be seen, the method of BGI finds a balance point between the accuracy and the complexity. The structure of the algorithm makes it especially suitable for real indoor office environment.
