Distributed computation of coverage in sensor networks by homological methods

Recent work on algebraic-topological methods for verifying coverage in planar sensor networks relied exclusively on centralized computation: a limiting constraint for large networks. This paper presents a distributed algorithm for homology computation over a sensor network, for purposes of verifying coverage. The techniques involve reduction and coreduction of simplicial complexes, and are of independent interest. Verification of the ensuing algorithms is proved, and simulations detail the improved network efficiency and performance.


Introduction
Sensors -devices which return data tied to a location -are ubiquitous [13].Although many sensors commonly used are stand-alone or global devices, there 3. Most crucially, the algorithm computes homology in an arbitrary coefficient system.This allows for computations over finite fields, which avoids the roundoff errors present in R-coefficients.4. Simulations seem to indicate that for a unit-disc graph network of points in the plane, all complexes are completely reducible, indicating that homology computation is of linear algorithmic complexity.
The last point leads us to the following: Conjecture 1 For a Vietoris-Rips complex of points N in the plane R 2 , the S-complex K f remaining after applying Algorithm 8 is always boundaryless.
If this conjecture is true, there is no need for any additional computations to ascertain the homology.This would be beneficial as regards theoretical complexity bounds, since the reduction algorithm in a non-distributed setting and bounded amount of neighbors has complexity O(N ), where N is the number of simplices (see [23]).However, even if in some situations the conjecture fails, in practice the size of the remaining complex is very small: one node would easily compute the homology of the remaining complex.
Our work compares most closely to the recent approach of Jadbabaie and Tahbaz-Salehi [29].They also derive a distributed algorithm for homology computation with the goal of satisfying the homological coverage criterion, determining the existence/location of holes, and generating optimal coverage.Their methods involve passing to homology with R coefficients and setting up the problem as a dynamical system -in essence, they use simplicial Laplacians and their connection to homology via Hodge theory [12] to solve a heat equation over the network.This can be done in a distributed manner, using message-passing and gossip algorithms [18].The paper [29] is very creative in that they also apply compressive-sensing perspectives to the problem of provably and quickly determining optimal generators for homology classes.
There are a few detriments to their methods that the present paper complements.The reduction/coreduction scheme of this paper has several advantages.1.It greatly reduces the communication complexity demanded by a dynamical systems approach as in [29]: waiting for a large network to asymptotically converge to a solution is nontrivial in time and in energy drain from communication. 2. It is applicable to arbitrary coefficient systems.The Hodge-theoretic approach of [29] cannot avoid the use of R coefficients and the ensuing roundoff errors, which can accumulate to frustrate answers in settings where homology generators are not well-separated.Our approach works well with finite field coefficients (e.g., mod-2 arithmetic) or integer coefficients, avoiding roundoff altogether.
Moreover, the methods developed in this paper may be adapted to speed up general-purpose homology computations in the context of parallel architecture, in particular in multi-core processors and GPU's (work in progress).Finally, more flexible local coefficient systems (as in [15]) may be adaptable; if so, the techniques of this paper may be extended to give a distributed computation of the cohomology of simplicial sheaves, a problem whose relevance to networks is emerging [27,28,16].We understand that an independent method for distributed homology computation is being investigated by Carlsson, de Silva, and Morozov, using the technique of zigzag persistence, as initiated in [4] and [5].

Sensor and network assumptions
For our applications of distributed homology computation to coverage problems, we operate under the following assumptions.
1. Sensors are modeled as a collection of nodes N ⊂ R 2 .2. Each sensor is assumed to have a unique identification which it broadcasts; certain neighbors detect the transmission and establish a communication link.3. Communication links are symmetric, stable, and generate a well-defined communications graph G on N .4. Sensor coverage regions are correlated to communications: the convex hull of any subset of sensors S ⊂ N which pairwise communicate is contained in the union of coverage regions of S. 5.One fixes a cycle C ⊂ G whose image in R 2 is a simple closed curve bounding a simply connected domain D ⊂ R 2 .
Under these assumptions, one wants to know whether D is contained in the coverage region of the network.These assumptions are chosen to be weak enough to be applicable in realistic systems; however, some important considerations -e.g., time-variability, node failure, false echoes, communications errors -are not modeled.

Homological coverage
This paper builds on a homological criterion for coverage in sensor networks described and explored in [9,11].This section reviews that criterion, with details on homology theory placed in Appendix A. The reader for whom homology is foreign will want to make a brief excursion to Appendix A.

Simplicial complexes for networks
This paper uses as its basic data structure simplicial complexes based on a set of nodes (sensors) N .A finite family X of nonempty finite subsets of N is an (abstract) simplicial complex if for every σ ∈ X and τ ⊂ σ we have τ ∈ X.The elements σ ∈ X are simplices whose dimension equals the cardinality minus one: dim σ = |σ| − 1.The 0-simplices of X are vertices and the 1-simplices are edges, as in graph theory.A face of a simplex σ in a simplicial complex X is a simplex τ ⊂ σ with dim τ = dim σ − 1.For τ a face Fig. 1 The geometric realization of a simplicial complex.
of σ one says that σ is a coface of τ .Every simplicial complex has a natural geometric realization -also denoted X -as a topological space obtained by gluing disjoint copies of the standard k-simplex, ∆ k , along faces, as in Figure 1.
Simplicial complexes are natural to networks.Any communications network on nodes N has the structure of a simplicial complex with all simplices of dimension zero or one.In several applied contexts, higher dimensional simplicial complexes are natural data structures.Examples include the following.Assume a set of nodes N in Euclidean R n : 1.The size ϵ Čech complex is the simplicial complex C ϵ on N whose ksimplices are generated by k + 1 nodes about which the diameter ϵ balls have a mutually nonempty intersection.2. The size ϵ Vietoris-Rips complex is the simplicial complex R ϵ on N whose k-simplices are generated by k + 1 nodes about which the diameter ϵ balls have pairwise nonempty intersections.Namely, simplices are tuples of nodes with pairwise distance less that or equal to ϵ. 3. Given a network of edges based on N , the flag complex of the network is the simplicial complex F whose k simplices are generated by pairwiseconnected k + 1-tuples of nodes in the network.
Thus, the Vietoris-Rips complex R ϵ is the flag complex of the size ϵ unit disc graph.This simple model of connectivity for a sensor or communications network is widely used [14,22,32] and widely disparaged [3,8,20].Our results hold in the context of more general flag complexes associated to network communication graphs, whether they are unit disc graphs or not.
In this paper, we restrict attention to simplicial complexes.There is a broader notion of a cell complex having as building blocks not merely simplices, but cubes or other polyhedral cells.These can sometimes be useful in modeling the geometry underlying a sensor network.The methods described in this paper extend to these as well but are not detailed explicitly.Fig. 2 Coverage regions are assumed to be correlated to communication distances: the convex hull of a triple of communicating nodes is assumed covered.

The homological coverage criterion
Recall our standing assumption linking coverage to communication: any triple of nodes in pairwise communication has its convex hull in R 2 contained in the coverage region, as in Figure 2. We emphasize that this neither assumes localization nor an unrealistic assumption about round balls, symmetry, or the like: this is a very flexible model.As stated, it is explicitly simplicial, and motivates the use of the flag complex F of the communications graph G to model the topology of the sensed region.
The second important assumption is that a cycle C in the network is chosen whose image in R 2 is a simple closed curve bounding a polygonal domain D. This cycle acts as a fence for the coverage problem.(Criteria for guaranteeing that a cycle in a non-localized network has simple image in the plane are simple to derive [9,6] -it suffices to have no 'shortcuts' between cycle nodes.)The following theorem gives a criterion for coverage based on (relative) homology of the flag complex F of the communications network modulo the fence cycle C.It is a slight modification of Theorem 3.3 of [9].[9]) Given a planar sensor network with G, C, and D as above, then all of D is completely covered by the sensors if, equivalently:

Theorem 1 (Homological coverage criterion
In practice, the second form of the criterion is more useful, since, if an explicit relative cycle ζ ∈ Z 2 (F, C) is computed, then it provides a guarantee of coverage even when the nodes not implicated in ζ are removed (or 'powered down' for conservation reasons): see [9].

S-complexes and reduction algorithms.
This paper introduces a distributed homology computation that suffices to check the criterion of Theorem 1.To describe this algorithm, it is necessary to modify the relevant simplicial and chain complexes.Our approach is explicitly simplicial.Though the reductions and coreductions used to simplify a simplicial complex have geometric motivation, it is best to pass to an more algebraic framework in the form of a modification of the usual complexes used in basic homology theory.Recall from Appendix A that in homology theory, a simplicial complex (a fundamentally topological object) is replaced with a chain complex (a fundamentally algebraic device).Our technique is based on simplifying the simplicial and chain complexes simultaneously.

S-complexes
We review the concept of an S-complex introduced in [23] as a reformulation of a chain complex, convenient for algorithmic purposes.Let K be a finite set partitioned according to a grading K = (K q ) q∈Z .For every element σ ∈ K there exists a unique q ∈ Z such that σ ∈ K q .This is the dimension of σ, denoted dim σ.Let R be a ring with unity and R[K] the graded free module over R generated by the graded set K. We refer to the elements of R[K] as chains and to the generators as elementary chains.Let κ : K × K → R be a map satisfying We say that (K, κ) is an S-complex if (R[K], ∂ κ ) with defined on generators σ ∈ K by is a free chain complex with basis K.For example, every simplicial complex K has a natural gradation (K q ) q∈Z , where K q consists of simplices of dimension q.Assume an ordering of the vertices of K is given and every simplex σ in K q is coded as [v 0 , v 1 , . . ., v q ], where v 0 , v 1 , . . ., v q are listed according to the prescribed ordering.By putting we obtain an S-complex (K, κ).An S-complex generalizes simplicial complexes.The homology of an S-complex (K, κ), H(K), is defined as the homology of the chain complex (R[K], ∂ κ ).In the sequel the value κ(σ, τ ) will be referred to as the coincidence index of σ and τ and the map κ as the coincidence map.
We say that (K, κ) is boundaryless if ∂ κ = 0. Note that if (K, κ) is boundaryless, then there is no need to compute its homology, because H(K) = R[K].Note: a boundaryless complex is highly desirable from the point of view of computation of homology, as no further computation is necessary!For any A ⊂ K we define the boundary set and the coboundary set of A in the S-complex K as follows: When A = {σ} we simplify the above notation by writing bd K σ and cbd K σ.
We say that The following proposition is straightforward.

Proposition 1
The family of open subsets as well as the family of closed subsets of an S-complex K are closed under the operations of finite union and finite intersection.
Theorem 2 [23,Theorem 3.1] Let (K, κ) be an S-complex and let K ′ ⊂ K be a subset.If for all σ, σ ∈ K ′ and τ ∈ K A subset K ′ ⊂ K satisfying the assumptions of Theorem 2 is called regular.Note that for a regular subset K ′ of an S-complex K and a subset A ⊂ K ′ it makes sense to consider the boundary and coboundary of A in K ′ .The following proposition is straightforward.
From Proposition 2 we easily obtain the following proposition.The parallelized reduction process of an S-complex K consists of removing certain pairs of elements of K. We first introduce some notation concerning such pairs.Given a pair α = (τ, σ) ∈ K 2 , we refer to the doubleton {τ, σ} as the support of the pair α and denote it |α|.We extend the concept and notation of support to sequences We now explain the concepts of pairs crucial in the reduction process.A pair α = (τ, σ) ∈ K 2 is a reduction pair if κ(σ, τ ) is invertible in R. It is called an elementary reduction pair in K if cbd K {τ } = {σ}.It is called an elementary coreduction pair in K if bd K {σ} = {τ }.We will use the term S-reduction pair in K to denote a pair which is either an elementary reduction pair or an elementary coreduction pair in K. Whenever the S-complex K is clear from the context, we will refer to an S-reduction pair in K simply as an S-reduction pair.S-reduction pairs are algebraic generalizations of pairs of simplices related by boundaries or coboundaries: see Figure 3.
Note that a pair α ∈ K 2 which is not necessarily an S-reduction pair in K may be an S-reduction pair in a subcomplex of K. We call such an Sreduction pair a potential S-reduction pair in K. Whenever potential Sreduction pairs exist, the reduction process may be self-feeding: removing some S-reduction pairs may give rise to new S-reduction pairs.On the other hand, if the supports of two S-reduction pairs in a given S-complex have non-empty intersection, performing one of these reductions kills the other reduction.But, if the supports are disjoint, both reductions may be performed.Moreover, they may be performed independently, hence, in parallel.We say that a collection B = {β 1 , β 2 , . . ., β n } of potential S-reduction pairs in K is free if all elements of B are S-reduction pairs in the same subcomplex of K and any two different elements of B have disjoint supports.
Let L be a subcomplex of K. We say that a sequence φ = (φ 1 , φ 2 , . . ., φ n ) of potential S-reduction pairs in L is a reduction sequence in L if for each j = 1, 2, . . ., n the pair φ j is an S-reduction pair in L \ ∪ j−1 i=1 |φ i |.Note that a straightforward recursive argument shows that the definition in meaningful, i.e., L \ ∪ j−1 i=1 |φ i | is an S-complex.A reduction sequence is said to be free if the elements of the sequence form a free collection of S-reduction pairs.Two reduction sequences are said to be interchangeable if they differ only by a permutation.We use S-reduction pairs to selectively simplify an S-complex.
The salient points of the theory, developed in full in Appendix B, are as follows: 1.Each S-reduction pair α in a subcomplex L of K induces an isomorphism Moreover, the following is shown in Appendix B and used in the second half of this paper to prove correctness of our algorithms:

Theorem 4 Any full ordering of a free collection of S-reduction pairs forms a reduction sequence. Two interchangeable reduction sequences φ, φ ′ give rise to the same isomorphism
A consequence of Theorem 4 which makes a distributed reduction process possible is the fact that the reductions in a free reduction sequence may be performed independently, so in parallel.This is because the order in which they are performed does not matter.{A, B, C, D, E, F, G, H, J} whose communication graph consists of eighteen edges (see Figure 4)

{ AB, AE, AG, BC, BE, BF, CD, CE, CF, DF, DJ, EF, EG, EH, F H, F J, GH, HJ}.
After removing the fence consisting of edges {AB, BC, DJ, HJ, GH, AG}, we obtain an S-complex composed of two vertices, eleven 1-simplices, eleven 2simplices and one 3-simplex.A search for S-reduction pairs reveals elementary coreduction pairs (F, DF ) and (E, CE).These form a free collection and may be removed in parallel.Continuing, we obtain the following reduction sequence, in which free collections are written in separate lines.
In the case of this reduction sequence the resulting S-complex is boundaryless.It consists only of the (open) 2-simplex EF H, which becomes the generator of the second homology group of the S-complex.
Fig. 4 From top left, to bottom right, following the arrows: a collection of sensors and the associated S-complex, the S-complex after removing the fence, the fence complex after removing the consecutive free collections of S-reduction pairs, the final reduced S-complex.

Construction of the Flag Complex
In this section we describe the distributed algorithms for the construction of the flag complex as a simplicial approximation of the sensor network.Henceforth we assume a fixed enumerative ordering of the sensor nodes N , as per unique identification numbers.We denote the total order by ▹.Moreover, we assume that all algorithms described in this section are executed separately on every node.Following the conventions of object oriented programming, we write s. alg() to indicate that node s is requested to execute alg().In every algorithm we denote the node running the algorithm by the word this.We drop the prefix "this" in this.alg(), assuming that by default the node supposed to execute the called algorithm is the node making the call.We assume that every node stores the set of its neighbors in variable neighbors.
To store simplex σ of the flag complex F associated with sensor network N we use a data structure Simplex with the following fields and methods: -σ. vert -the set of the vertices (nodes) in σ, -σ.neighb -the set of the neighbors of σ, -σ.faces() -returns the set of the faces of σ, -σ.cofaces() -returns the set of the cofaces of σ.
In course of running the reduction algorithm we also need some auxiliary fields.In particular, when a simplex is removed by the reduction algorithm, instead of deleting it from the data structure we only mark a flag indicating that the simplex is to be treated as deleted.We use another flag to lock a simplex when a node is negotiating its removal with its neighbors.Here is the list of all auxiliary fields: -σ.deleted -a boolean variable marking that σ is deleted, -σ.locked -a boolean variable marking that σ is locked.
In order to construct a simplex we use Algorithm 1.It returns a simplex with vertex set V and the neighbors set N .
Algorithm 2 is the algorithm for building the flag complex F of the network as expressed locally in terms of vertex-neighbor data.The algorithm is executed on each node.In the sequel, by s.Simp we mean the set of simplices created by node s in the course of running Algorithm 2. The subset of s.Simp consisting of simplices of dimension i is denoted by s.Simp [i].We say that node s controls simplex σ if simplex σ is created in course of running Algorithm 2 on node s.Theorem 5 Assume Algorithm 2 has been initiated on each node.Then it terminates on each node.Moreover, once the algorithm has completed on all nodes, the following properties hold true.

The only simplices created by Algorithm 2 are the simplices in F.
Since every simplex σ is controlled by at least one and most two nodes, in the sequel we speak about the lower and the upper node controlling σ, assuming that the lower equals the upper if only one node controls σ.We omit the definitions of σ. faces() and σ. cofaces().They may be computed by a node using Simp stored in the lower and in the upper node controlling σ.
Proof To see that the algorithm always terminates, first observe that the loop in line (4) always completes, because S is finite.The only other loop in the algorithm is formed by the conditional jump from line (5) to line (3).Note that whenever the jump takes place, the variable i is increased.However, the value of i may not exceed the number of nodes.Therefore, the jump in line ( 5) may be performed only a finite number of times and consequently the algorithm terminates.
The fact that variable σ. vert stores the vertices of σ is an immediate consequence of Algorithm 1.Let σ ∈ s.Simp be a simplex and let d be its dimension.We will prove by induction on d that variable σ. neighb contains the neighbors of σ.If d = 0, the conclusion is obvious from the construction.Thus, assume that the conclusion holds for all simplices of dimension not exceeding d.The simplex σ is created from a simplex τ and its neighbor t at line (4.b.iii) of Algorithm 2. In particular, we see from the construction that However, by the induction assumption and the conclusion follows from elementary set arithmetic.This proves property (1).
Let us now demonstrate property (2).First consider the case when dim σ = 0. Observe that the only line of the algorithm which contains the construction of a zero dimensional simplex is line (1) of the algorithm.Moreover, it is straightforward to check that this line is executed exactly once in each node.Therefore, a zero dimensional simplex τ 0 is constructed by node s and only by node s.There remains to consider the case dim σ > 0. Let Observe that the only line of Algorithm 2 which contains a construction of a simplex of dimension greater than zero is line (4.b.iv).Let τ denote the simplex selected in line (4) just before the execution of line (4.b.iv).Since line (4.b.iv) is executed, the test in line (4.a)fails, which implies that min(τ.vert) = this . ( The execution of lines (4.b.ii) and (4.b.iii) implies that the difference σ. vert \τ.vert contains exactly one element t and, by the execution of line (4.b.i), we know that either t▹min(τ.vert) or t◃max(τ.vert).The first case happens when t = v 0 , τ = { v 1 , v 2 , . . ., v n } and the other case when Therefore, by (1), the node running the algorithm is either v 0 or v 1 .It follows that if dim σ > 0, then σ is represented in the memory of the two minimal elements of σ. vert.
To prove property (3) suppose by contrary, that there exists a simplex σ ∈ F which has not been created by the algorithm in any node.From line (2) of the algorithm it follows that dim σ > 0. Let σ be the simplex of minimal dimension with the described property.It follows that all the faces τ of σ have been created by the algorithm.From line (4) of the algorithm it follows, that σ must have been created by the algorithm, a contradiction.
In the similar way one can show that if σ ̸ ∈ F then it cannot be created by the algorithm.Suppose by contrary, that such a σ has been created and σ is of minimal dimension among such simplices.Therefore, σ has been constructed in line (4.b.iv) of the algorithm from a simplex τ by adding a vertex t ∈ τ. vert.By the minimality assumption, τ ∈ F, and since t ∈ τ. vert, we get σ ∈ F, a contradiction.

⊓ ⊔
The following Lemma is used in the Algorithm 6.
Lemma The parallel reduction procedures used in the algorithm will now be presented.

Fence reduction
We assume that Algorithm 5 is executed on each node.Definitions of the auxiliary procedures delete and canDelete are presented as Algorithm 3 and Algorithm 4. Since C is a closed subset of F in the sense of definition in Section 4, it follows from Theorem 3 that F \ C, together with the usual boundary map, is an S-complex.

Distributed S-reductions
By Lemma 4 S-reduction pairs may be removed from an S-complex without changing the homology groups of the complex.We present now how the reduc- tions may be performed in a distributed manner.We perform the reduction process in such a way that simplex σ may be reduced only by the lower node controlling it.

Elementary coreduction
On each node Algorithm 6 is executed to find and delete elementary coreduction pairs.

Elementary reduction
On each node Algorithm 7 is executed to find and delete an elementary reduction pair.

Parallel reduction algorithm.
Algorithm 8 is executed in a loop on every node.The algorithm terminates when no node in the network is able to find an S-reduction pair.The stop criterion of Algorithm 8 requires global information from the network.In consequence, the criterion cannot be implemented on the basis of purely local information as in the case of the other algorithms presented in the paper.However, the stop criterion may be easily implemented via broadcasts.

Correctness
In this section we prove that the algorithm presented in the previous section correctly reduces the flag complex in the sense that the homology of the original flag complex considered as an S-complex and the homology of the reduced S-complex are the same.Let A be the set of all S-reduction pairs reduced by Algorithm 8 in all nodes and let In other words, K is the S complex resulting from removing the fence cycle from the flag complex of the sensor network, G r is the subset of K consisting of generators removed from K in elementary reductions, G c is the subset of K consisting of generators removed from K in elementary coreductions and K f is the S-complex resulting from K after applying all S-reductions reduced by Algorithm 8 in all nodes.
Theorem 6 Given a network communication graph with simple cycle C, Algorithm 8 terminates in every node.When all copies of the algorithm complete in all nodes, the S-complex K f satisfies Proof Since the number of nodes is finite, also the number of all possible reductions is finite.It is clear, that in Algorithm 6 and Algorithm 7 either an S-reduction pair is reduced, or false is returned.Consequently either some S-reduction pair is reduced in the sensor network, or according to point (2) of Algorithm 8 the algorithm terminates in the whole sensor network.Therefore the algorithm must terminate.By [23,Theorem 3.4] We need to prove that Observe that if (τ, σ) ∈ A is a pair reduced as an elementary coreduction pair, then bd K σ ⊂ |A|.(7) Indeed, if there were an element τ ∈ bd K σ\|A|, then (τ, σ) could never become an elementary coreduction pair.A similar argument shows that if (τ, σ) ∈ A is a pair reduced as an elementary reduction pair, then For α = (τ, σ) ∈ A put In the course of running the reduction calls throughout the network a function λ : A → is defined recursively as follows.The value λ(α) is 1 for α ∈ A such that A(α) = ∅.Such pairs are S-reduction pairs in the original complex, form a free collection and may be reduced immediately.However, if A(α) ̸ = ∅, then the reduction may be performed only after all elements in A(α) are already reduced.This, in particular, means that the value of λ is already assigned to all elements of A(α).Therefore, we may put

Now, put
and define We claim that for each n ∈ N (i) A n is a free collection of S-reduction pairs in K n−1 , (ii) K n is an S-complex.
We will prove both properties by induction on n.Since A 0 = ∅ and K 0 = K, both (i) and (ii) are obvious for n = 0. Thus assume that the properties are satisfied for all n < k.To prove that property (i) holds for n = k take (τ, σ) ∈ A c k .We get from Proposition 2 and ( 7) Hence, cbd K k−1 τ = σ, i.e. (τ, σ) is an elementary reduction pair in K k−1 .Thus (i) holds for n = k.To prove that also (ii) is satisfied: observe that for each Algorithm 9 checkIfBoundaryless 1. for every σ ∈ Simp (a) if σ.deleted == f alse then i. for every τ ∈ σ.f aces() if τ.deleted == f alse then return false; 2. return true; It follows from Theorem 2 and Theorem 3 that Now, let φ n be any sequence ordering the S-reduction pairs in A n .Since by (i) A n is free, it follows from Theorem 4 that φ n is a reduction sequence.Therefore, we have a well defined isomorphism I φn : H(K n−1 ) → H(K n ) and the composition of all the isomorphism I φn gives the isomorphism required in (6).

⊓ ⊔
To check if the S-complex resulting from the reduction process is boundaryless, one can use Algorithm 9.One easily verifies that if the resulting S-complex is boundaryless, then all the sensors return a value of true from this algorithm.
In case Conjecture 1 does not hold and the final complex is not boundaryless, we expect it to be very small so that we can easily transfer it to a single selected sensor via the communication channels available in the network.For this, we first create a spanning tree of the network using standard techniques for a distributed setting as in [2].This may be achieved in O(V 1.6 + E), where V is a number of sensors, E is a number of edges in the flag complex.Then, we move the information along the spanning tree to its root and use the root sensor to compute the generators of the homology of the remaining complex, for instance using homology algorithm available in [33] or [34].Finally, we use the spanning tree again to send the homology generators back to the respective simplices.

Verifying coverage
In this section we present an algorithm verifying the assumptions of Theorem 1.For the sake of simplicity, we assume that Conjecture 1 holds and that after applying Algorithm 8 there is left only one boundaryless 2-simplex ω.Let ω denote the associated elementary chain which sends ω to one and everything else to zero.The nodes need to verify whether there exists a homology class [c] ∈ H(F, C) whose boundary is nonzero.By applying Algorithm 8 the nodes know the homology of H(F, C) but only via the isomorphic homology of K f , where K f is given by (5).Therefore, it is necessary to find the isomorphic counterpart of [ω] in H(F, C).To achieve this it is sufficient to apply formula (15) in Proposition 5 repetitively in proper order, for every S-reduction pair reduced by Algorithm 8.The respective algorithm is Algorithm 10.We make the following two assumptions concerning this algorithm: -To store the resulting chain an extra field coef is added to the data structure Simplex and the field is initially set to undefined.-The nodes remember not only simplices which were reduced but also whether they were reduced in an elementary reduction or coreduction.
In the sequel we use the natural pairing of the elements of G r and G c coming from S-reduction pairs in the form of a bijection which sends an element σ ∈ G r ∪ G c to its companion in the respective Sreduction pair.
The following proposition is straightforward.
Proof Assume σ 0 ∈ Simp [2] is such that (c) if s ̸ = 0 report "coverage verified" and exit; Proof First we will show that the algorithm sets σ. coef for each σ ∈ Simp [2].
By Proposition 4 we need to consider only the case when σ ∈ G c and dim σ * = 1.However, this case follows immediately from Lemma 3 by induction with respect to n := N − λ(σ * , σ), where Observe that whenever σ. coef is set in line (3.a.i.C), then σ * is removed from L in line (3.a.i.D).Therefore, the loop in line (3) completes and consequently also Algorithm 10 completes in every node.
It is now straightforward to verify that after completing loop (3), the fields σ. coef for σ ∈ Simp [2] store a chain c ω ∈ K whose homology is the image of [ω] under the isomorphism established in Theorem 6.Now, the variable s evaluated in loop (4) stores ⟨∂c ω , τ ⟩ for some 1−simplex τ of the fence.Therefore, if at least one node reports "coverage verified", then the assumptions of Theorem 1 are satisfied and the coverage is indeed archived.If the assumptions are not satisfied, then obviously no node can report "coverage verified".

⊓ ⊔
In case, when there is more then one boundaryless 2-simplex left at the end of the reduction process, the described algorithm may be called for each of the remaining 2-simplices and if at least one of the nodes reports "coverage verified" for at least one of the remaining 2-simplices, the assumptions of Theorem 1 are satisfied.The adaptation of Algorithm 10 to the case when Conjecture 1 does not hold is only slightly more complicated.It requires finding the homology generators of H(K f ) by some algebraic means, for instance by applying the algorithm described in [1] and then starting Algorithm 10 with the chains representing the homology generators of H(K f ) instead of the elementary chain ω.Therefore, the extra assumptions from the beginning of the section are not restrictive.

On complexity
The full complexity analysis of the presented algorithms is not possible; in this paper we consider neither a concrete communication model nor the synchronization methods needed to collate algorithm phases.However, even at the level of generality with which our analysis is performed, some basic remarks toward a more complete analysis are possible.The details of a full complexity analysis, given length and technicality, are to be published elsewhere.
We make the following simplifying assumptions: 1. Every sensor can send an integer to its neighbors without error and in one time unit.2. A global synchronization method which may be used to synchronize in constant time the consecutive steps of the algorithms in the sensors is available.3. The implementation of the algorithm is based on best performing data structures for finding simplices, queues for reduction candidates etc.
One can show that under these assumptions the algorithm constructing the flag complex (Algorithm 2) and the algorithm reducing it (Algorithm 8) may be implemented in such a way that the complexity for one sensor (compare network time defined in Section 10) is O(n 2 + K * (n log K + n 2 )), where: 1. n is the upper bound for the number of sensors in the neighborhood of a given sensor.2. K is the upper bound for the number of simplices which have the given sensor as a vertex.
In other words, the complexity depends only on the local size of the network, and not on the size of the whole network as in the case of centralized computations.This justifies the utility of the presented algorithms in the context of large-scale sensor networks of bounded density.The analysis depends on the Conjecture 1, because the estimate does not include the potential postprocessing of the final S-complex which is not boundaryless, although we expect this cost to be negligible even if nonzero.

Simulations
The parallel reduction algorithms presented in the paper have been implemented in Java programming language [35].The code executes the algorithms  on each node in a separate thread, so that the simulations may be performed with only a few or even one processor unit.The real time of the network is also simulated.
In this section we present the experimental results showing the advantages of the distributed homology computation.In the presented series of experiments, the following configuration, referred to as the base test will be used.The base test is a small network of 23 nodes randomly placed on a 4 × 4 units rectangle with the communication radius fixed at 2 units.This base test will be copied and shifted and new fence cycles created.This process is performed to obtain a reasonably uniform distribution of the nodes on larger networks We first define a family L n of networks on a sequence of 'linear' domains, , where L i is defined recursively as follows: 1. L 0 is the base test case with a rectangular fence cycle C around the network; and 2. L i is created from L i−1 by placing a new copy of the base test on the right side of L i−1 with a new rectangular fence cycle C around the network.
Another family S n = { S i } n i=0 of 'square' networks is defined recursively as follows: 1. S 0 is the base test case with a rectangular fence cycle C around the network; and 2. S i is created from S i−1 by placing new copies of the base test: i-copies on the right, i-copies on the bottom side, and one on the bottom-right.A new rectangular fence C around the network is created.
Let C s denote the CPU time used by node s during the simulation and let R s be the real time used by node s, i.e., the world time passing from the moment the node starts the computations until the moment it completes.We define the network time as max s∈S R s and the running time as ∑ s∈S C s .In other words, the network time is the time required by the real network to do the computation.In the case of the simulations performed on a single machine with a single CPU, the running time is the CPU usage for the whole simulation.We define the network efficiency as the ratio Network Efficiency := Network Time Running Time • 100%.For the families L 53 and S 10 we ran simulations and measured network time, running time and network efficiency.

A Primer on homology theory
This abbreviated introduction to homological tools assumes a knowledge of basics from algebra and topology.From algebra, the notions of rings (algebraic generalizations of Z) and modules (algebraic generalizations of vector spaces) are assumed, as are homomorphisms (algebraic generalizations of linear transformations), kernels, and the like.From topology, only basic notions of simplicial complexes are needed.

A.1 Chain complexes
Homology counts objects with cancelation to provide a topological invariant in algebraic terms.The simplest version of homology is simplicial homology of a simplicial complex.Fix a finite simplicial complex X.The building blocks of a rudimentary homology for X are as follows.
1. Fix a coefficient ring R.
A chain complex is often written out as a diagram: It is notationally simpler to denote the chain complex as a single object C = (C * , ∂ * ) and to write ∂ for the boundary operator acting on any chain of unspecified grading.Chain complexes need not be generated by simplices of a simplicial complex: they are decidedly algebraic devices.The key requirement for a chain complex is that the boundary of a boundary is null: A.
Here, Z k := ker ∂ k is the submodule of cycles in C k , and B k := im ∂ k+1 is the submodule of boundaries.Elements of H k (C) are homology classes.
We write H(C) to denote the full module of graded homologies H k (C).When C is the chain complex generated by a simplicial complex X, we write H(X) for its homology: it is an invariant of the space X up to homotopy.

A.3 Relative homology
Homology is defined for any chain complex C = (C k , ∂ k ).Although taking C k to be a module generated by k-dimensional simplices is common, it is by no means exclusive.Many of the constructs of this paper rely on a modified chain complex giving rise to reduced homology relative to a subcomplex.Let A ⊂ X be a (necessarily closed) subcomplex of a simplicial complex X.Then both X and A define simplicial chain complexes, with the result that C k (A) ⊂ C k (X) is a submodule for all k.Thus, one can take the quotient module C k (X, A) := C k (X)/C k (A), so that a relative chain is an equivalence class of chains relative to simplices in A. The boundary map ∂ k extends naturally to A) in a manner that preserves the ∂ 2 = 0 condition.Therefore, the relative homology H k (X, A) is well-defined and measures relative cycles (chains in X whose boundaries lie in A) modulo relative boundaries.

A.4 Functoriality
A chain map is a map φ : C → C ′ between chain complexes that is a homomorphism on chains respecting the grading and commuting with the boundary maps.This is best expressed in the form of a commutative diagram: Commutativity means that homomorphisms are path-independent in the diagram; e.g., φ • ∂ = ∂ ′ • φ.Chain maps are the analogues of continuous maps, given their respect for the boundary operators: neighbors are sent to neighbors.A chain map φ induces homomorphisms on homology groups, written The reader may check that this is a well-defined homomorphism.We denote by H(φ) the full sequence of induced homomorphisms on homology.Homology is functorial, meaning that induced homomorphisms respect composition of chain maps.Specifically,

A.5 Exact sequences
Homology computations are greatly aided by a theoretical tool called an exact sequence.Any complex =(A k , ϕ k ) of abelian groups and homomorphism is exact when its homology vanishes: ker ϕ n = im ϕ n+1 for all n.An exact chain complex is the chain analogue of a nullhomologous space.Exact sequences are most often used to prove isomorphisms between various homologies by means of zeroing out terms in an exact sequence.For example, if some subsequence of an exact sequence read as: Consider in turn the case when α is an elementary coreduction pair.By Theorem 8 the set |α| is closed in K and a nullset.Therefore, we have the following exact sequence In the sequel, whenever the S-complex K is clear from the context we will write simply γ α instead of γ (K,α) .
The common notation for the two (in principle different) isomorphisms is justified by the following result which is an immediate consequence of [24,Corollary 2.7].
In the sequel it will be convenient to reformulate the concept of a reduction sequence as a path in a graph.A state graph of the S-complex K is a directed graph G K = (V, E) whose set of vertices consists of regular subsets of K and a pair (L, L ′ ) of vertices of G K is an edge in G K if there exist an S-reduction pair α in L such that L ′ = L \ |α|.We then refer to α as the label of the edge.
The reduction process in the context of the state graph takes the form of a reduction path, which is just any directed path in G K .It is straightforward to observe that any reduction path originating in a vertex L ∈ G K defines a reduction sequence in L consisting of the labels of the edges along the path.Similarly, any reduction sequence in a subcomplex L defines a reduction path originating in L, so in the sequel, we will use the concepts of the reduction path and the reducton sequence interchangeably.Given a reduction path ψ in the state graph G K , for i = 1, 2, . . ., n + 1 we denote by K ψ i the ith S-complex (vertex) along the path.
Let K and K ′ , where K ′ ⊂ K, be two nodes in the state graph for which there exists a reduction path ψ from K to K ′ of length n.The isomorphism is defined as the composition H(ψ) := γ ψ1 • γ ψ2 • . . .• γ ψn of isomorphisms γ ψi induced by the S-reduction pairs along the path.It is called the homology of the reduction path.Since every reduction sequence φ in a regular subcomplex L of K defines a reduction path in the state graph G K originating from L, we define H(φ) as the homology of the associated reduction path.
Note that if L is a subcomplex of K and α is an S-reduction pair in L then it need not be an S-reduction pair in K.However, the following proposition is a straightforward consequence of Proposition 2.
Proposition 6 If K ′ is a regular subcomplex of an S-complex K and α is an S-reduction pair in K such that |α| ⊂ K ′ then α is an S-reduction pair in K ′ .
The following lemma is needed to prove Theorem 4.
If both α 1 and α 2 are elementary coreduction pairs in K, then we have the commutative diagram of projections: Similarly, if both α 1 and α 2 are elementary reduction pairs in K, then we have the commutative diagram of inclusions: and when α 1 is an elementary coredution pair and α 2 is an elementary reduction pair in K, we have the following commutative diagram of inclusions and projections: Due to functoriality of homology each of these diagrams induces a commutative diagram in homology and due to the definition ( 14) they all reduce to (16).⊓ ⊔ Lemma 6 Assume ψ is a reduction path in the state graph G K of length n.If the S-reduction pair ψ n in K ψ n is also an S-reduction pair in K ψ 1 , then ψ ′ := (ψ n , ψ 1 , ψ 2 , . . .ψ n−1 ) is a reduction path in K ψ 1 and H(ψ ′ ) = H(ψ).
Proof We proceed by induction in the length of ψ.If the length is one, the conclusion is obvious.Thus, fix n > 1 and assume the conclusion holds for reduction paths of length less than n.It follows from Proposition 6 that ψ n is an S-reduction pair in K ψ n−1 .Hence, both ψ n−1 and ψ n are S-reduction pairs in K ψ n−1 with disjoint supports and, by Lemma 5, (ψ n , ψ n−1 ) is a reduction path in K ψ n−1 and γ ψn • γ ψn−1 = γ ψn−1 • γ ψn .Again using Proposition 6, we see that ψ ′ is a reduction sequence in K ψ 1 and we get from the induction hypothesis that

⊓ ⊔
We are now ready to give the proof of Theorem 4.
Proof (of Theorem 4) In order to prove the first statement of the theorem take a free collection of potential S-reduction pairs in a subcomplex L of K and fix some it ordering (φ 1 , φ 2 , . . ., φ n ).We need to show that for each j = 1, 2, . . ., n the pair φ j is an S-reduction pair in L \ ∪ j−1 i=1 |φ i |.However, this follows immediately from Proposition 6.
Assume in turn that ψ and φ are two interchangeable reduction paths from K to K ′ .In order to prove that H(ψ) = H(φ) we will proceed by induction in the common length of ψ and φ denoted by n.If n = 1, there is only one path from K to K ′ , hence ψ = φ and H(ψ) = H(φ).Thus, assume the conclusion holds for paths of length less then n.Since ψ and φ differ only by a permutation, there exists a p ≤ n such that Therefore, φ p is an S-reduction pair in K and by Lemma 6 the sequence (φ p , φ 1 , φ 2 , . . ., φ p−1 ) is a reduction path in K and consequently Given two chains c := ∑ σ∈K c σ σ and d := ∑ σ∈K d σ σ we define their inner product via ⟨c, d⟩ := ∑ σ∈K c σ d σ .

Fig. 3
Fig. 3 Simplification of a complex [center] can be performed via elementary coreduction [left] and reduction [right] pairs.

Fig. 5
Fig. 5 Network Time and Running Time for the family L 53 of networks.

Fig. 6
Fig. 6 Efficiency of the network for the family L 53 of networks.

Fig. 7
Fig. 7 Network Time and Running Time for the family S 10 of networks.

Fig. 8
Fig. 8 Efficiency of the network for the family S 10 of networks.

Figure 5
presents the network and running time as the functions of the size of the network for the family L 53 .The network efficiency for the same data is presented in Figure6.Analogous results for the family S 10 are in Figure7and Figure8.The outcome of the experiments clearly indicates the advantage gained through distributed computation.

2 .
Grade the simplices of X by dimension.3. Define k-chains C k as the R-module with basis the k-simplices of X. 4. Consider the boundary maps -the linear transformations ∂ : C k → C k−1 which send a basis k-simplex to its boundary faces (as an abstract sum of basis k − 1-simplices, each with coefficient ±1 depending on parity).The sequence of chains and boundary maps are assembled into a chain complex -a sequence C of R-modules C k and homomorphism ∂

1 .
For every node s and every simplex σ ∈ s.Simp variables σ. vert and σ. neighb store respectively, as expected, the vertices and neighbors of simplex σ. 2. Every σ ∈ F is controlled by at least one and at most two nodes.It is controlled by exactly two nodes if and only if dim σ > 0.Moreover, these two nodes are the two minimal elements of σ. vert.