Robust Distributed Cooperative RSS-based Localization for Directed Graphs in Mixed LoS/NLoS Environments

The accurate and low-cost localization of sensors using a wireless sensor network is critically required in a wide range of today's applications. We propose a novel, robust maximum likelihood-type method for distributed cooperative received signal strength-based localization in wireless sensor networks. To cope with mixed LoS/NLoS conditions, we model the measurements using a two-component Gaussian mixture model. The relevant channel parameters, including the reference path loss, the path loss exponent and the variance of the measurement error, for both LoS and NLoS conditions, are assumed to be unknown deterministic parameters and are adaptively estimated. Unlike existing algorithms, the proposed method naturally takes into account the (possible) asymmetry of links between nodes. The proposed approach has a communication overhead upper-bounded by a quadratic function of the number of nodes and computational complexity scaling linearly with it. The convergence of the proposed method is guaranteed for compatible network graphs and compatibility can be tested a priori by restating the problem as a graph coloring problem. Simulation results, carried out in comparison to a centralized benchmark algorithm, demonstrate the good overall performance and high robustness in mixed LoS/NLoS environments.


Introduction
The wide spread of telecommunication systems has led to the pervasiveness of radiofrequency (RF) signals in almost every environment of daily life. Knowledge of the location of mobile devices is required or beneficial in many applications [1], and numerous localization techniques have been proposed over the years [1,2,3,4]. Techniques based on the received signal strength (RSS) are the preferred option when low cost, simplicity and technology obliviousness are the main requirements. In some standards, e.g. IEEE 802.15.4, an RSS indicator (RSSI) is encoded directly into the protocol stack [5]. In addition, RSS is readily available from any radio interface through a simple energy detector and can be modeled by the well-known path loss model [6] regardless of the particular communication scheme. Based on that, RSS can be exploited information to perform localization, non-cooperative algorithms necessitate either long range (and highpower) anchor transmission or a high-density of anchors [17]. In cooperative algorithms, such as [19,20], inter-agent communication removes the need for all agents to be in range of one (or more) anchors [17].
Many existing works on localization using RSS measures, such as [27,28], are based on the assumption that the classical path-loss propagation model is perfectly known, mostly via a calibration process. However, this assumption is impractical for two reasons. Firstly, conducting the calibration process requires intensive human assistance, which may be not affordable, or may even be impossible in some inaccessible areas. Secondly, the channel characteristics vary due to multipath (fading), and non-negligible modifications occur also due to mid-to-long term changes in the environment, leading to non-stationary channel parameters [29]. This implies that the calibration must be performed continuously [29,30] because otherwise the resulting mismatch between design assumptions and actual operating conditions leads to severe performance degradation. These facts highlight the need for algorithms that adaptively estimate the environment and the locations. A further difficulty is due to the existence of Non-Line-of-Sight (NLoS) propagation in practical localization environments. Among various works handling the NLoS effect, a majority of them have treated the NLoS meaures as outliers and tried to neglect or mitigate their effect, including the Maximum Likelihood (ML)-based approach [31,32], the Weighted Least-Squares (WLS) estimator [33,32], the constrained localization techniques [34,35], robust estimators [36,37] and the method based on virtual stations [38]. In contrast to these works, several approaches, including [39,21,22], have proposed specific probabilistic models for the NLoS measures, therewith exploiting the NLoS measures for the localization purpose. In the light of these considerations, our aim is to develop an RSS-based, cooperative localization framework that works in mixed LoS/NLoS environments, requires no knowledge on parameters of the propagation model, and can be realized in a distributed manner.
The following distinction is made: only algorithms that directly use RSS measures as inputs are considered RSS-based in the strict sense, while algorithms such as NBP [23], SPAWN [24], distributed-ECM (D-ECM) [22] and their variants are here called "pseudo-RSS-based", because they use range estimates as inputs. Generally speaking, among these two options, RSS-based location estimators are preferred for the following reasons. Firstly, inferring the range estimates from the RSS measures usually requires knowledge on the (estimated) propagation model parameters. The assumption of a priori known parameters violates the calibration-free requirement. Secondly, even with perfectly known model parameters, there exists no efficient estimator for estimating the ranges from the RSS measures, as proven in [40]. Thirdly, dropping the idealistic assumption of known channel parameters and using their estimates introduces an irremovable large bias, as demonstrated in [41]. Based on these considerations, pseudo-RSS-based approaches do not meet the requirements in this work. Furthermore, Bayesian approaches, including NBP [23] and SPAWN [24,25], do not consider mixed LoS/NLoS environments. As one representative RSS-based cooperative localization algorithm, Tomic et al.'s semidefinite-programming (SDP) estimator in [20] requires no knowledge on the propagation model, but it does not apply to and cannot be readily extended to a mixed LoS/NLoS environment. To the best of our knowledge, the existing works on RSS-based calibration-free localization in a mixed LoS/NLoS environment, is rather limited. Yin et al. have proposed an EM-based estimator in [21], but only for the single agent case. In this paper, we consider a multi-agent case and aim to develop a location estimator that is RSS-based, cooperative, calibration-free and works in a mixed LoS/NLoS environment. To capture the mixed LoS/NLoS propagation conditions, we adopt the mode-dependent propagation model in [21].
The key difference between this work and [21] lies in whether the localization environment is cooperative or not. More precisely, [21] is concerned with the conventional single agent localization while this work studies cooperative localization in case of multi-agent. Furthermore, we develop a distributed algorithm, where model parameters and positions are updated locally by treating the estimated agents as anchors, inspired by the works in [42,43,44]. A succinct characterization of the proposed work and its related works is listed in Tab. 1.
Original Contributions: We address the problem of RSS-based cooperative localization in a mixed LoS/NLoS propagation environment, requiring no calibration. To characterize such a mixed LoS/NLoS environment, we assume a mode-dependent propagation Paper RSS-based Cooperative Calibration-Free LoS/NLoS Distributed NBP [23] No Yes N/A No Yes SPAWN [24] No Yes N/A No Yes D-ECM [22] No  Table 1 Succinct characterization of the related works and the proposed work. The entry "N/A" stands for "Not applicable". The terms "RSS-based", "Cooperative", "Calibration-Free", "LoS/NLoS", and "Distributed" are defined and discussed in Section 1.
model with unknown parameters. We derive and analyze a robust, calibration-free, RSS-based distributed cooperative algorithm, based on the ML framework, which is capable of coping with mixed LoS/NLoS conditions. Simulation results, carried out in comparison with a centralized ML algorithm that serves as a benchmark, show that the proposed approach has good overall performance. Moreover, it adaptively estimates the channel parameters, has acceptable communication overhead and computation costs, thus satisfying the major requirements of a practically viable localization algorithm. The convergence analysis of the proposed algorithm is conducted by restating the problem as a graph coloring problem. In particular, we formulate a graph compatibility test, and show that for compatible network structures, the convergence is guaranteed. Unlike existing algorithms, the proposed method naturally takes into account the (possible) asymmetry of links between nodes. The paper is organized as follows. Section 2 formulates the problem and details the algorithms. Section 3 discusses convergence. Section 4 presents simulations results, while Section 5 concludes the paper. Finally, Appendix A and Appendix B contain some analytical derivations which would otherwise burden the reading of the paper.

Problem Formulation
Consider [1] a directed graph with N a anchor nodes and N u agent nodes, for a total of N = N a + N u nodes. In a 2-dimensional (2D) scenario, we denote the position of node i by x i = [x i y i ] ⊤ ∈ R 2×1 , where ⊤ denotes transpose. Between two distinct nodes i and j, the binary variable o j→i indicates if a measure, onto direction j → i, is observed (o j→i = 1) or not (o j→i = 0). In the case i = j, since a node does not self-measure, [1] Throughout the paper, vectors and matrices will be denoted in bold, v denotes the Euclidean norm of vector v, |A| denotes the cardinality of set A. We denote by E[X] and Var[X] the statistical expectation and variance, respectively, of random variable X. Finally, B = {0, 1} is the Boolean set.
we have o i→i = 0. This allows us to define the observation matrix O ∈ B N ×N with elements o i,j o i→j as above. The aforementioned directed graph has connection matrix O. It is important to remark that, for a directed graph, O is not necessarily symmetric; physically, this models possible channel anisotropies, missdetections and, more generally, link failures. Let m j→i be a binary variable, which denotes if the link j → i is LoS (m j→i = 1) or NLoS (m j→i = 0). Due to physical reasons, m j→i = m i→j . We define the LoS/NLoS Matrix [2] L ∈ B N ×N of elements l i,j m i→j , and we observe that, since m j→i = m i→j , the matrix is symmetric, i.e., L ⊤ = L. We stress that this symmetry is preserved regardless of O, as it derives from physical reasons only. Let Γ(i) be the (open) neighborhood of node i, i.e., the set of all nodes from which node i receives observables (RSS measures), formally: Γ(i) {j = i : o j→i = 1}. We define Γ a (i) as the anchor-neighborhood of node i. We also define Γ u (i) as the agent-neighborhood of node i, i.e., the subset of Γ(i) which contains only agent nodes as neighbors of node i. In general, Γ(i) = Γ a (i) ∪ Γ u (i).

Data Model
In the sequel, we will assume that all nodes are stationary and that the observation time-window is sufficiently short in order to neglect correlation in the shadowing terms. In practice, such a model simplification allows for a more analytical treatment of the localization problem and has also been used, for example, in [12,11]. Following the path loss model and the data models present in the literature [17,21], and denoting by K the number of samples collected on each link over a predetermined time window, we model the received power at time index k for anchor-agent links as if m a→i = 0, [2] The values on the main diagonal are arbitrary. Here we choose mi→i = 1. (1) while, for the agent-agent link, where: • i, u, with u ∈ Γ u (i), are indexes for the unknown nodes; • a ∈ Γ a (i) is an index for anchors; • k = 1, . . . , K is the discrete time index, with K samples for each link; • p 0 LOS/NLOS is the reference power (in dBm) for the LoS or NLoS case; • α LOS/NLOS is the path loss exponent for the LoS or NLoS case; • x a is the known position of anchor a; • x u is the unknown position of agent u (similarly for x i ); • Γ a (i), Γ u (i) are the anchor-and agent-neighborhoods of node i, respectively; • the noise terms w a→i (k), v a→i (k), w u→i (k), v u→i (k) are modeled as serially independent and identically distributed (i.i.d.), zero-mean, Gaussian random variables, independent from each other (see below), with variances: NLOS , and σ 2 NLOS > σ 2 LOS > 0. More precisely, letting δ i,j be Kronecker's delta [3] , the independence assumption is formalized by the following equations for any k 1 , k 2 , i 1 , i 2 , j 1 ∈ Γ(i 1 ), j 2 ∈ Γ(i 2 ). The previous equations imply that two different links are always independent, regardless of the considered time instant. In this paper, we call this property link independence. If only one link is considered, i.e. j 2 = j 1 and i 2 = i 1 , then independence is preserved by choosing different time instants, implying that the sequence {w j→i } k {w j→i (1), w j→i (2), . . . } is white. The same reasoning applies to the (similarly defined) sequence [3] δi,j = 1 if and only if i = j, zero otherwise. {v j→i } k . As a matter of notation, we denote the unknown positions (indexing the agents before the anchors) by x [x ⊤ 1 · · · x ⊤ Nu ] ⊤ ∈ R 2Nu×1 and we define η as the collection of all channel parameters, i.e., η . It is important to stress that, in a more realistic scenario, channel parameters may vary from link to link and also across time. However, such a generalization would produce an under-determined system of equations, thus giving up uniqueness of the solution and, more generally, analytical tractability of the problem. For the purposes of this paper, the observation model above is sufficiently general to solve the localization task while retaining analytical tractability.

Time-Averaged RSS Measures
Motivated by a result given in Appendix A, we consider the time-averaged RSS measures, defined as as our new observables [4] . While it would have been preferable to work with the original data from a theoretical standpoint, several considerations lead to the preference of time-averaged data, most notably: (1) comparison with other algorithms present in the literature, where the data model assumes only one sample per link, i.e. K = 1, which is simply a special case in this paper; (2) reduced computational complexity in the subsequent algorithms; (3) if the RSS measures onto a given link needs to be communicated between two nodes, the communication cost is notably reduced, since only one scalar, instead of K samples, needs to be communicated; (4) formal simplicity of the subsequent equations. Moreover, from Appendix A, it follows that, assuming known L, the ML estimators of the unknown positions based upon original data or time-averaged data are actually the same. To see this, it suffices to choose θ = (x, p 0LOS , p 0NLOS , α LOS , α NLOS ) and for j ∈ Γ(i) and splitting the additive noise term as required. For a fixed link, only one of two cases (LoS [4] For better readability, the notation (m) has not been carried over, as it implicit in the formalism.
or NLoS) is verified, thus, applying (34) of Appendix A yields arg max where σ 2 j→i is either σ 2 LOS or σ 2 NLOS and the general result follows from link independence.
We define R i as the set of all RSS measures that node i receives from anchor neighbors, i.e., R i {r which represents the information available to the whole network.

Single-agent Robust Maximum Likelihood (ML)
We first consider the single-agent case, which we will later use as a building block in the multi-agent case.
The key idea is that instead of separately treating the LoS and NLoS cases, e.g. by hypothesis testing, we resort to a two-component Gaussian mixture model for the time-averaged RSS measures. More precisely, we assume that the probability density function (pdf), p(·), of the time-averaged RSS measures, for anchoragent links, is given by and, for agent-agent links, where: • λ i ∈ (0, 1) is the mixing coefficient for anchoragent links of node i; • ζ i ∈ (0, 1) is the mixing coefficient for agent-agent links of node i. Empirically, we can intuitively interpret λ i as the fraction of anchor-agent links in LoS (for node i), while ζ i as the fraction of agent-agent links in LoS (for node i). As in [21], the Markov chain induced by our model is regular and time-homogeneous. From this, it follows that the Markov chain will converge to a twocomponent Gaussian mixture, giving a theoretical justification to the proposed approach.
Assume that there is a single agent, say node i, with a minimum of three anchors [5] in its neighborhood (|Γ a (i)| ≥ 3), in a mixed LoS/NLoS scenario. Our goal is to obtain the Maximum Likelihood estimator (MLE) of the position of node i. Letr i = [r 1→i · · ·r |Γa(i)|→i ] ⊤ ∈ R |Γa(i)|×1 be the collection of all the time-averaged RSS measures available to node i. Using the previous assumptions and the independency between the links, the joint likelihood function [6] p(r i ; θ) is given by where θ = (x i , λ i , η). Thus, denoting with L(θ;r i ) the log-likelihood, we have The MLE of θ is given bŷ where the maximization is subject to several constraints: In general, the previous maximization admits no closed-form solution, so we must resort to numerical procedures.

Multi-agent Robust ML-based scheme
In principle, our goal would be to have a ML estimate of all the N u unknown positions, denoted by The reason for this is that localizing a node in 2D requires at least three anchors. [6] Hereafter, we omit the conditioning on the set {on→i} of actually observed RSS measures (received by node i) in the joint likelihood function, since it is implicit in the neighborhood formalism.
be the collections of the mixing coefficients. Defining θ = (x, λ, ζ, η), the ML joint estimator is, in general, computationally unfeasible and naturally centralized. In order to obtain a practical algorithm, we now resort to a sub-optimal, but computationally feasible and distributed approach. The intuition is as follows. Assume, for a moment, that a specific node i knows η, λ, ζ and also all the true positions of its neighbors (which we denote by X i ). Then, the ML joint estimation problem is notably reduced, in fact, We now make the sub-optimal approximation of avoiding non-local information in order to obtain a distributed algorithm, thus resorting tô where we made explicit the functional dependence on all the other parameters (which, for now, are assumed known). Due to the i.i.d. hypothesis, the "local" likelihood function has the form where the marginal likelihoods are Gaussian-mixtures and we underline the (formal and conceptual) separation between anchor-agent links and agent-agent links. By taking the natural logarithm, we have The maximization problem in (15) then readŝ We can now relax the initial assumptions: instead of assuming known neighbors positions X i , we will substitute them with their estimates,X i . Moreover, since the robust ML-based self-calibration can be done without knowing the channel parameters η, we also maximize over them. Lastly, we maximize with respect to the mixing coefficients λ i , ζ i . Thus, our final approach is whereΓ u (i) is the set of all agent-neighbors of node i for which estimated positions exist. We can iteratively construct (and update) the setΓ u (i), in order to obtain a fully distributed algorithm, as summarized in Algorithm 1.

Algorithm 1 Robust Distributed Maximum Likelihood (RD-ML)
Initialization: Self-Localization: Every node i with |Γa(i)| ≥ 3 self-localizes by the robust procedure (12); Broadcast: Every node which self-localized broadcasts its position estimatex i ; Iterative scheme: Start with n ← 1; Update position: Every node with |Γa(i)| + |Γ  A few remarks are now in order. First, this algorithm imposes some restrictions on the arbitrariness of the network topology, since the information spreads starting from the agents which were able to self-localize during initialization; in practice, this requires the network to be sufficiently connected. Second, convergence of the algorithm is actually a matter of compatibility: if the network is sufficiently connected (compatible), convergence is guaranteed. Given a directed graph, compatibility can be tested a priori and necessary and sufficient conditions can be found (see Section IV). Third, unlike many algorithms present in the literature, symmetrical links are not necessary, nor do we resort to symmetrization (like NBP): this algorithm naturally takes into account the (possible) asymmetrical links of directed graphs.

Distributed Maximum Likelihood (D-ML)
As a natural competitor of the proposed RD-ML algorithm, we derive here the Distributed Maximum Likelihood (D-ML) algorithm, which assumes that all links are of the same type. As its name suggests, this is the non-robust version of the previously derived RD-ML. As usual, we start with the single-agent case as a building block for the multi-agent case. Using the assumption that all links are the same and the i.i.d. hypothesis, the joint pdf of the time-averaged RSS measures, received by agent i, is given by We can now proceed by estimating, with the ML criterion, first p 0 as a function of the remaining parameters, followed by α as a function of x i and finally x i . We havê Defining s a,i 10 log 10 x i − x a as the log-distance, s i [s 1,i s 2,i · · · s |Γa(i)|,i ] ⊤ ∈ R |Γa(i)|×1 the columnvector collecting them and 1 n = [1 · · · 1] ⊤ ∈ R n×1 an all-ones vector of dimension n, the previous equation can be written aŝ which is a Least-Squares (LS) problem and its solution isp By using this expression, the problem of estimating α as a function of where, given a full-rank matrix A ∈ R m×n , with m ≥ n, P ⊥ A is the orthogonal projection matrix onto the orthogonal complement of the space spanned by the columns of A. It can be computed via P where P A = A(A ⊤ A) −1 A ⊤ is an orthogonal projection matrix and I m is the identity matrix of order m. The solution to problem (24) is given bŷ wherer i = P ⊥ 1 |Γa (i)|r i ands i = P ⊥ 1 |Γa(i)| s i . By using the previous expression, we can finally writê which, in general, does not admit a closed-form solution, but can be solved numerically. After obtaininĝ x i , node i can estimate p 0 and α using (23) and (25).
The multi-agent case follows an almost identical reasoning of the RD-ML. Approximating the true (centralized) MLE by avoiding non-local information and assuming to already have an initial estimate of p 0 and α, it is possible to arrive at where (again) an initialization phase is required and the set of estimated agents-neighborsΓ u (i) is iteratively updated. The key difference with RD-ML is that, due to the assumption of the links being all of the same type, the estimates of p 0 and α are broadcasted and a common consensus is reached by averaging. This increases the communication overhead, but lowers the computational complexity, operating a trade-off. The D-ML algorithm is summarized in Algorithm 2. Similar remarks as for the RD-ML can be made for the D-ML. Again, the network's topology cannot be completely arbitrary, as the information must spread throughout the network starting from the agents which self-localized, implying that the graph must be sufficiently connected. Necessary and sufficient conditions to answer the compatibility question are the same as RD-ML. Secondly, the (strong) hypothesis behind the D-ML derivation (i.e., all links of the same type) allows for a more analytical derivation, up to position estimation, which is a Nonlinear Least-Squares problem. However, it is also its weakness since, as will be shown later, it is not a good choice for mixed LoS/NLoS scenarios.

Centralized MLE with known nuisance parameters (C-MLE)
The centralized MLE of x with known nuisance parameters, i.e. assuming known L and η, is chosen here

Algorithm 2 Distributed Maximum Likelihood (D-ML)
Initialization: Self-Localization: Every node i with |Γa(i)| ≥ 3 self-localizes by solving (26) and estimates α via (25) and p 0 via (23), thus obtaining (p (i) 0 ,α (i) ,x i ); Broadcast: Every node which self-localized broadcasts its local estimates (p (i) 0 ,α (i) ,x i ); Consensus: All the nodes agree on global values of (p 0 ,α) by averaging all the local estimates (p (i) 0 ,α (i) ); Iterative scheme: Start with n ← 1; Update position: Every node i with |Γa(i)| + |Γ  as a benchmark for both RD-ML and D-ML. In the following, this algorithm will be denoted by C-MLE. Its derivation is simple (see Appendix B) and results inx where (p 0j→i , α j→i , σ 2 j→i ) are either LoS or NLoS depending on the considered link. It is important to observe that, if all links are of the same type, the dependence from σ 2 j→i in (28) disappears. From standard ML theory [45], C-MLE is asymptotically (K → +∞) optimal. The optimization problem (28) is computationally challenging, as it requires a minimization in a 2N u -dimensional space, but still feasible for small values of N u .

Convergence Analysis
The convergence test of our proposed algorithm (and also of D-ML) can be restated as a graph coloring problem: if all the graph can be colored, then it is compatible and convergence is guaranteed. As it is common in the literature on graph theory, let G = (V, E) be a directed graph, with V denoting the set of nodes and E the set of directed edges. The set of nodes is such that V = V a ∪ V u , where V a is the (nonempty) set of anchor nodes and V u is the (nonempty) set of agent nodes.

Definition 1 (RDML-initializable) A directed graph G is said to be RDML-initializable if and only if
there exists at least one agent node, say x, such that |Γ a (x)| ≥ 3.
As can be easily checked, the previous statement is a necessary condition: if a graph is not RDMLinitializable, then it is incompatible with RD-ML. To give a necessary and sufficient condition, we introduce the notion of "color". A node can be either black or white; all anchors are black and all agent nodes start as white, but may become black if some condition is satisfied. The RD-ML can be rewritten as a graph coloring problem. In order to do this, we define the set Γ u (i) {j ∈ Γ u (i) : agent j is black}, i.e., the subset of agent-neighbors of node i which contains only black agent nodes. In general,Γ u (i) ⊆ Γ u (i). We also define the set B u {i ∈ V u : agent i is black}, i.e., the set of black agents. In general, B u ⊆ V u . Given a graph G, we can perform a preliminary test by running the following RDML-coloring algorithm (a better test will be derived later): • Initialization (k = 0) 1 All anchors are colored black and all agents white; 2 Every agent i with |Γ a (i)| ≥ 3 is colored black; • Iterative coloring: Start with k = 1 1 Every agent with |Γ a (i)| + |Γ u (i) is the setΓ u (i) at step k, is colored black; 2 Every agent j updates is ownΓ This allows us to formally define compatibility:

Definition 3 (RDML-compatibility) A directed graph G is said to be RDML-compatible if and only if: 1 G is RDML-initializable; 2 the RDML-lifetime of G is finite.
Otherwise, G is said to be RDML-incompatible.
In practice, there are only two ways for which a graph is RDML-incompatible: either G cannot be initialized, or the RDML-lifetime of G is infinite. Testing the first condition is trivial; the interesting result is that testing the second condition is made simple thanks to the following

Theorem 1 An RDML-initializable graph G is RDML-incompatible if and only if there exist an integer h such that
that is, if there is a step h in which no more agents can be colored black and at least one agent is still left white.
Proof (⇐) First, observe that, by construction, u , as black nodes can only be added. Let C G : N → N be the following function Since B u , C G is non-decreasing. An RDML-initializable graph is RDML-compatible if and only if it has finite RDML-lifetime, i.e., there must exist n such that C G (n) = |V u |. But condition (29) implies that there exists h such that C G (h) = C G (h−1) < |V u |. At step h + 1 and all successive steps, C G cannot increase since the set B u . But since no color change happened in V u at step h, the graph G still does not satisfy the conditions for B (k) u to grow for k ≥ h. Thus, C G (k) becomes a constant function for k ≥ h and can never reach the value |V u |.
(⇒) Since G is an RDML-incompatible graph by hypothesis, at least one agent must be white, so |B (h) u | < |V u | is true for any h. Since C G (k) is non-decreasing, it must become constant for some h > k, but this implies that, for some h, |B is called the RDML-depth of G.
A complete graph has h G = 0, as all agents are colored black during the initialization phase of the RDML-coloring algorithm.

Corollary 1 Let G be a directed graph. Then
If G is RDML-initializable, there are two cases: either n is finite or not. In the latter, n = +∞ and h G is finite by previous theorem. If n is finite, The previous corollary proves that h G is always finite, regardless of G. This allows us to write the graph compatibility test, shown in Algorithm 3. Thanks to the previous results, this algorithm always converges and can be used to test a priori if a graph is RDMLcompatible or not. Remark Algorithm 3 can be intuitively explained via a physical metaphor, where, in a metal grid (representing the graph), "heat" (information) spreads out starting from some initial "hot spots" (nodes that are colored black in the first iteration). This spreading is continued, reaching more and more locations on the grid, until the event occurs that further spreading of "heat" does not change the "heat map". If, at this point, there are cold spots (nodes that have not been colored black), the graph is RDML-incompatible. By contrast, if heat spreads throughout the grid, the graph is RDML-initializable. Figs. 1-2 show two examples of RDML-initializable graphs. Fig. 1 illustrates the case of a small (N a = 4, N u = 4) but highly connected network. In contrast, Fig. 2 displays a larger (N a = 15, N u = 20), but weakly connected network (Graph Depth = 7). In particular, only 90 out of 680 possible directed links are connected, where anchors have 3-4 links (out of 20). For

Results and Discussion
In this section, we use standard Monte Carlo (MC) simulation to evaluate the performance of the proposed algorithm and its competitors. As a performance metric, we will show the ECDF (Empirical Cumulative Distribution Function) of the localization error, defined as e i x i − x i for agent i, i.e. an estimate of the probability P{ x i − x i ≤ γ}. The ECDFs are obtained by stacking all the localization errors for every agent in a single vector, in order to give a global picture of the algorithm performances. The simulated scenario is as follows. In a square coverage area of 100×100 m 2 , N a = 11 stationary anchors are deployed, as depicted in Fig. 3. The channel parameters are generated as follows: p 0LOS ∼ U[−30, 0], α LOS ∼ U [2,4], σ LOS = 6, while, for the NLoS case, p 0NLOS ∼ N (0, 25), α NLOS ∼ U [3,6], σ NLOS = 12. Similar settings on the reference power and the path loss exponent can be found in [46] and [47], respectively. At each MC trial, N u = 10 agents are randomly (uniformly) generated in the coverage area. Unless stated otherwise, K = 40 samples per link are used. Finally, each simulation consists of 100 MC trials.
The optimization problems (27) and (19) have been solved as follows. For D-ML, a 2D grid search has been used, while, for RD-ML and C-MLE, the optimization has been performed with the MATLAB solver fmincon.

Gaussian Noise
Here, we validate our novel approach by considering fully-connected networks in three different scenarios. In Fig. 4, all links are assumed to be LoS. As can be seen from the ECDFs, the robust approach has similar performances to the D-ML algorithm, which was designed assuming all links to be of the same type. In Fig. 5, all links are assumed to be NLoS and again we see a similar result. The key difference is in Fig. 6, where a mixed LoS/NLoS scenario is considered and the fraction of NLoS links is random (numerically generated as U[0, 1] and different for each MC trial). Here, the robust approach outperforms D-ML, validating our strategy. Moreover, it has a remarkably close performance to the centralized algorithm C-MLE. As a result, the robust approach is the preferred option in all scenarios.

Non-Gaussian Noise for NLoS
In order to evaluate robustness, we consider a model mismatch on the noise distribution by choosing, for the NLoS links, a Student's t-distribution with ν = 5 degrees of freedom (as usual, serially i.i.d. and independent from the LoS noise sequence). For brevity, we consider only the case of a fully-connected network in a mixed LoS/NLoS scenario. As shown by

Cooperative Gain
The proposed algorithm exhibits the so-called "cooperative gain", i.e., a performance advantage (according to some performance metric, typically localization accuracy) with respect to a non-cooperative approach, where each node tries to localize itself only by self-localization (12). In our case, the cooperative gain is twofold: first, it allows to improve localization accuracy; second, it allows to localize otherwise nonlocalizable agents. To show the first point, we consider a mixed LoS/NLoS environment (for simplicity, with white Gaussian noise) and a network is generated at each Monte Carlo trial, assuming a communication radius R = 70 m, with an ideal probability of detection model [17]. Moreover, the network is generated in a way as to allow all agents to self-localize and, as a consequence, it is RDML-compatible. In Fig. 8, the ECDFs of the localization error are shown. To show the second point, we consider the toy network depicted in Fig. 9. In this example, agent X is not able to self-localize, since no anchors are in its neighborhood, Γ a (X) = ∅. Thus, in a non-cooperative approach, the position of agent X cannot be uniquely determined [7] , while, in a cooperative approach, the position of agent X can actually be obtained by exchanging information, e.g. the estimated positions of its neighbors.

Variable K and NLoS fraction
We next analyze the RD-ML algorithm by varying the number of samples per link, K, and the fraction of NLoS links. In both cases, we consider (for brevity) fully-connected networks with white Gaussian noise; for variable K, the fraction of NLoS is randomized, while, for variable NLoS fraction, K is fixed. In Fig. 10, we observe that the performance increases as K increases, as expected. In Fig. 11, where each point represents 100 MC trials, the median error is chosen as a performance metric [8] and RD-ML shows good performances and is not significantly affected by the actual NLoS fraction, which is evidence for its robustness, while D-ML is clearly inferior and suffers from model mismatch.

Communication and Computational Costs
The communication overhead is evaluated by computing the number of elementary messages sent throughout the network, where an elementary message is simply defined as a single scalar. Sending a d-dimensional message, e.g. (x, y) coordinates, is equivalent to sending d elementary messages. In Fig. 12, the communication overhead of RD-ML and D-ML is plotted with respect to the number of agents, assuming a complete graph: for N u agents, 2N u (N u − 1) scalars, representing estimated 2D positions, are needed for RD-ML, while 4N u (N u − 1) are needed for D-ML, as estimates of (p 0 , α) are also necessary. Viewing (2D) position has the fundamental information of a message (d = 2), in a complete graph, RD-ML achieves the theoretical minimum cost in order for all nodes to have complete information, while D-ML uses auxiliary information. For a general graph, the communication overhead depends on the specific graph topology, but is never greater than the aforementioned value. Thus, for a general graph, the communication cost is upper-bounded by a quadratic function of N u .
Regarding computational complexity, both RD-ML and D-ML scale linearly with N u and they benefit from parallelization, as the main optimization task can be executed independently for each involved node. As already mentioned, D-ML operates a trade-off between communication and computational complexity; in fact, the D-ML optimization problem (27) is easier to solve than the RD-ML optimization problem (19). Both problems are non-convex and may have local minima/maxima, so care must be taken in the optimization procedure.

Conclusions
We have developed a novel, robust ML-based scheme for RSS-based distributed cooperative localization in mixed LoS/NLoS scenarios, which, while not being optimal, has good overall accuracy, is adaptive to the environment changes, is robust to NLoS propagation, including non-Gaussian noise, has communication overhead upper-bounded by a quadratic function of the number of agents and computational complexity scaling linearly with the number of agents, also benefiting from parallelization. The main original contributions are that, unlike many algorithms present in the literature, the proposed approach: (a) does not require calibration; (b) does not require symmetrical links (nor does it resort to symmetrization), thus naturally accounting for the topology of directed graphs with asymmetrical links as a result of miss-detections and channel anisotropies. To the best of the authors' knowledge, this is the first distributed cooperative RSS-based algorithm for directed graphs. The main disadvantage is imposing some restrictions on the arbitrariness of networks' topology, but these restrictions disappear for sufficiently connected networks. We also derive a compatibility test based on graph coloring, which allows to determine whether the given network is compatible. If it is compatible, convergence of the algorithm is guaranteed. Future work may include the consideration of possible approximations, in order to extend this approach to more general networks, and of alternative models, overcoming the limitations of the standard path loss model.

Appendix B: C-MLE Derivation
The MLE of x is given bŷ where p(Υ; x) is the joint likelihood function. Since all other parameters are assumed known, the set of all time-averaged measuresῩ = ∪ Nu i=1Ȳ i is a sufficient statistic for x (see Appendix A), from which it follows that arg max By link independence, where p(r j→i ; x) is the marginal likelihood function. Thus, we havê x ML = arg max