Keywords

1 Introduction

We consider the multi-hop radio network model [16] of distributed computing, where a communication network is modeled as a graph \(G=(V,E)\): Each vertex \(v\in V\) is a computing device and each edge \(\{u, v\} \in E\) indicates that u and v are within the transmission range of each other. The graph topology of the underlying network G is initially unknown to all devices, except that two parameters \(n = |V|\) and \(\varDelta = \max _{v \in V} \deg (v)\) are global knowledge.

Communication proceeds in synchronized rounds. All devices agree on the same start time. In each round, each device can choose to do one of the following three operations: (i) listen to the channel, (ii) transmit a message, or (iii) stay idle. We do not allow a device to simultaneously transmit and listen, and we assume that there is no message size constraint.

Each transmitting or idle device does not receive any feedback from the communication channel, so a transmitting device u does not know whether its message is successfully received by any of its neighbors N(u). A listening device v successfully receives a message from a transmitting device \(u \in N(v)\) if u is the only transmitting device in N(v). If the number of transmitting devices in N(v) is zero, then a listening device v hears \(\textsf{silence}\). For the case the number of transmitting devices in N(v) is greater than one, then the feedback that a listening device v receives depends on the underlying model. In the \(\textsf{No}{\text{- }}\textsf{CD}\) model (without collision detection), v still hears \(\textsf{silence}\). In the \(\textsf{CD}\) model (with collision detection), v hears \(\textsf{collision}\). All our algorithms presented in this paper work in the \(\textsf{No}{\text{- }}\textsf{CD}\) model.

We assume that each device has access to an unlimited local random source. We say that an event occurs with high probability (w.h.p.) if the event occurs with probability \(1 - 1/{{\text {poly}}}(n)\). In this paper, we only consider Monte Carlo algorithms that succeed w.h.p. If we let each vertex \(v \in V\) locally assign themselves \(O(\log n)\)-bit identifiers \({\text {ID}}(v)\), then they are distinct with high probability, so we assume that each device has a distinct identifier of length \(O(\log n)\).

Complexity Measures. Time and energy are the two main complexity measures of a distributed algorithm in radio networks. The time complexity of an algorithm is the number of rounds of the algorithm. The energy complexity of an algorithm is the maximum energy cost of a device, where the energy cost of a device v is the number of rounds that v is non-idle. We only consider worst-case time and energy complexities. The motivation for studying energy complexity is that energy is a scarce resource in small battery-powered wireless devices, and such devices can save energy by entering a low-power sleep mode.

1.1 Prior Work

Most of the early work on the energy complexity focused on single-hop radio networks, which is the special case that \(G=(V,E)\) is a complete graph. Over the last two decades, there is a long line of research to optimize the energy complexity of leader election and its related problems in single-hop radio networks [6, 8, 9, 11, 13, 14, 29,30,31,32, 34, 35, 39].

This line of research was recently extended to multi-hop radio networks [10, 12, 19, 20]. Chang et al. [10] considers the problem of broadcasting a message from one device to all other devices in a multi-hop radio network. They showed that broadcasting can be done in \({{\text {poly}}}\log n\) energy. Specifically, they presented randomized broadcasting algorithms for \(\textsf{CD}\) and \(\textsf{No}{\text{- }}\textsf{CD}\) using energy \(O\left( \frac{\log n\log \log \varDelta }{\log \log \log \varDelta }\right) \) and \(O(\log \varDelta \log ^2 n)\) w.h.p., respectively. They also proved that any algorithm transmitting a message from one endpoint to the other endpoint of an n-vertex path costs \(\varOmega (\log n)\) energy in expectation. The lower bound applies even to the \(\textsf{LOCAL}\) model of distributed computing.

Chang et al. [12] showed that breadth-first search can be done w.h.p. using \(2^{O\left( \sqrt{\log n \log \log n}\right) }\) energy in \(\textsf{No}{\text{- }}\textsf{CD}\). Their algorithm is based on a hierarchical clustering using the low-diameter decomposition algorithm of Miller, Peng, and Xu [38]. The energy complexity of breadth-first search was recently improved to \({{\text {poly}}}\log n\) by Dani and Thomas [20]. Combining the polylogarithmic-energy breadth-first search algorithm with the diameter approximation algorithm of Roditty and Williams [41], an approximation \(\tilde{D}\) of the diameter D such that \(\tilde{D} \in \left[ \lfloor 2D/3\rfloor , D\right] \) can be computed with \(\tilde{O}(\sqrt{n})\) energy w.h.p. [12]. The notation \(\tilde{O}(\cdot )\) suppresses any \({{\text {poly}}}\log n\) factor.

Dani et al. [19] showed that a maximal matching can be computed in \(O(\varDelta \log n)\) time and \(O(\log \varDelta \log n)\) energy w.h.p. in \(\textsf{No}{\text{- }}\textsf{CD}\). There exists a family of graphs such that these time and energy bounds are simultaneously optimal up to polylogarithmic factors.

1.2 Our Contribution

Not all problems admit energy-efficient algorithms in multi-hop radio networks. It was shown in [12] that any algorithm that computes a \((1.5-\epsilon )\)-approximation of the diameter requires \(\tilde{\varOmega }(n)\) energy w.h.p. The lower bound holds even on graphs with arboricity \(O(\log n)\) and treewidth \(O(\log n)\).

To improve energy efficiency for diameter computation, we focus on the class of bounded-genus graphs. We show that the diameter of the graph can be computed using \(\tilde{O}(\sqrt{n})\) energy w.h.p. in bounded-genus graphs.

Theorem 1

There is an algorithm that computes the diameter in \(\tilde{O}(n^{1.5})\) time and \(\tilde{O}(\sqrt{n})\) energy w.h.p. for bounded-genus graphs in \(\textsf{No}{\text{- }}\textsf{CD}\).

Our approach is based on a generic framework that divides the vertex set into high-degree and low-degree parts. We then classify the connected components of the subgraph induced by the low-degree part into several types. We will leverage the structural properties of bounded-genus graphs to upper-bound the number of connected components of one type. For the remaining connected components, we will design energy-efficient algorithms that extract all the necessary information from these connected components for the purpose of diameter computation.

Our approach is sufficiently general so that it is applicable to other problems as well. Using the same approach, we show that the exact global minimum cut size and a \((1\pm \epsilon )\)-approximate s-t minimum cut size can also be computed using \(\tilde{O}(\sqrt{n})\) energy w.h.p. in bounded-genus graphs.

Theorem 2

There is an algorithm that computes the minimum cut size in \(\tilde{O}(n^{1.5})\) time and \(\tilde{O}(\sqrt{n})\) energy w.h.p. for bounded-genus graphs in \(\textsf{No}{\text{- }}\textsf{CD}\).

Theorem 3

There is an algorithm that computes an \((1 \pm \epsilon )\)-approximate st minimum cut size in \(\tilde{O}(n^{1.5}) \cdot \epsilon ^{-O(1)}\) time and \(\tilde{O}(\sqrt{n}) \cdot \epsilon ^{-O(1)}\) energy w.h.p. for bounded-genus graphs in \(\textsf{No}{\text{- }}\textsf{CD}\).

To complement these algorithmic results, we show that any algorithm that computes the exact size of an st minimum cut or a global minimum cut requires \(\varOmega (n)\) energy. The lower bound for the st minimum cut holds even for planar bipartite graphs, so it is necessary that we consider approximation algorithms for this problem. These lower bounds apply to both \(\textsf{No}{\text{- }}\textsf{CD}\) and \(\textsf{CD}\).

Theorem 4

For any randomized algorithm that computes the st minimum cut size of a planar bipartite graph w.h.p. in \(\textsf{CD}\), the energy complexity of the algorithm is \(\varOmega (n)\).

Theorem 5

For any randomized algorithm that computes the minimum cut size of a unit-disc graph w.h.p. in \(\textsf{CD}\), the energy complexity of the algorithm is \(\varOmega (n)\).

1.3 Additional Related Work

There are numerous works studying energy-aware distributed computing in multi-hop networks from different perspectives. In radio networks, the power of a signal received is proportional to \(O(1/d^{\alpha })\), where d is the distance to the sender, and \(\alpha \) is a constant related to environmental factors. Kirousis et al. [33] studied the optimization problem of assigning transmission ranges of devices subject to some connectivity and diameter constraints so as to minimize the total power consumption. See [2, 17, 43] for related work.

There are several works [7, 22, 42] on the subject of reducing the number of rounds or transmissions required to complete a specific communication task. In the setting of known network topology, Gasieniec et al. [23] designed a randomized protocol for broadcasting in \(O(D + kn^{1/(k-2)}\log ^2 n)\) rounds such that each device transmits at most k times.

The energy complexity has recently been studied in the well-known \(\textsf{LOCAL}\) and \(\textsf{CONGEST}\) models of distributed computing [3, 5, 15, 21, 27].

There is a large body of research on distributed graph algorithms in planar networks, bounded-genus networks, or more broadly H-minor-free networks: distributed approximation [1, 18, 36, 44], low-congestion shortcuts and its applications [24,25,26, 28], and other planar graph algorithms [37, 40].

1.4 Organization

In Sect. 2, we present the basic tools. In Sect. 3, we present our lower bounds. In Sect. 4, we present our decomposition of bounded-genus networks. In Sect. 5 and Appendix A, we present our algorithm for diameter computation. In Appendix B, we present our algorithm for minimum cut computation. In Appendix C, we present the proof details for our basic tools.

2 Tools

2.1 Communication Between Two Sets of Vertices

Let \(\mathcal {S}\) and \(\mathcal {R}\) be two vertex sets that are not necessarily disjoint. The task \(\textsf{SR}{\text{- }}\textsf{comm}\) [10] is defined as follows. Each vertex \(u \in \mathcal {S}\) holds a message \(m_u\) that it wishes to send, and each vertex \(v \in \mathcal {R}\) wants to receive a message from vertices in \(N^+(v) \cap \mathcal {S}\), where \(N^+(v) = N(v) \cup \{v\}\) is the inclusive neighborhood of v.

Specifically, the task \(\textsf{SR}{\text{- }}\textsf{comm}\) requires that for each vertex \(v \in \mathcal {R}\) with \(N^+(v) \cap \mathcal {S} \ne \emptyset \), vertex v receives a message \(m_u\) from at least one vertex \(u \in N^+(v) \cap \mathcal {S}\) w.h.p. Several variants of \(\textsf{SR}{\text{- }}\textsf{comm}\) are defined as follows.

All messages: \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {all}}}\).:

The task \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {all}}}\) requires that each vertex \(v \in \mathcal {R}\) receives the message \(m_u\) for each \(u \in N^+(v) \cap \mathcal {S}\) w.h.p.

Approximate sum: \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {apx}}}\).:

Suppose the message \(m_u\) sent from each vertex \(u \in \mathcal {S}\) is an integer within the range [W]. The task \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {apx}}}\) requires each vertex \(v \in \mathcal {R}\) computes an \((1 \pm \epsilon )\)-factor approximation of the summation \(\sum _{u \in N^+(v) \cap \mathcal {S}} m_u\) w.h.p.

Minimum and maximum: \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {min}}}\) and \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {max}}}\).:

The message \(m_u\) sent from each vertex \(u \,{\in }\, \mathcal {S}\) contains a key \(k_u\) from the key space \([K] = \{1, 2, \ldots , K\}\). For \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {min}}}\), it is required that w.h.p., each vertex \(v \in \mathcal {R}\) with \(N^+(v) \cap \mathcal {S} \ne \emptyset \) receives a message \(m_u\) from a vertex \(u \in N^+(v) \cap \mathcal {S}\) such that \(k_u = \min _{u' \in N^+(v) \cap \mathcal {S}} k_{u'}\). The task \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {max}}}\) is defined analogously by replacing minimum with maximum.

Multiple messages: \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {multi}}}\).:

Consider the setting where each vertex \(u \in \mathcal {S}\) holds a set of messages \(\mathcal {M}_u\). For each message m, all vertices holding the same message m have access to some shared random bits associated with m. We assume that for each \(v \in \mathcal {R}\), the number of distinct messages in \(\bigcup _{u \in N^+(v) \cap \mathcal {S}} \mathcal {M}_u\) is upper bounded by a number M that is known to all vertices. The task \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {multi}}}\) requires that each vertex \(v \in \mathcal {R}\) receives all distinct messages in \(\bigcup _{u \in N^+(v) \cap \mathcal {S}} \mathcal {M}_u\) w.h.p.

Table 1 summarizes the time and energy complexities of our algorithms for these tasks. For \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {all}}}\), the parameter \(\varDelta '\) can be any known upper bound on \(|\mathcal {S} \cap N(v)|\), for each \(v \in \mathcal {R}\). For example, we may set \(\varDelta ' = \varDelta \) if no better upper bound is known. The proofs for these results are left to Appendix C.

Table 1. The time and energy complexities of \(\textsf{SR}{\text{- }}\textsf{comm}\) and its variants.

2.2 Communication via a Good Labeling

A good labeling is a vertex labeling \(\mathcal {L}: V(G) \mapsto \{0, \ldots , n-1\}\) such that each vertex v with \(\mathcal {L}(v) > 0\) has a neighbor u with \(\mathcal {L}(u)=\mathcal {L}(v)-1\) [10]. A vertex v is called a layer-i vertex if \(\mathcal {L}(v) = i\). Observe that if there is a unique layer-0 vertex r, then \(\mathcal {L}\) represents a tree T rooted at r, so we call r the root of the good labeling \(\mathcal {L}\). Since a vertex might have multiple choices of the parent, the tree T is not unique in general. The following lemma was proved in [10].

Lemma 1

([10]). A good labeling \(\mathcal {L}\) with a unique layer-0 vertex can be constructed in \(O(n \log \varDelta \log ^2 n)\) time and \(O(\log \varDelta \log ^2 n)\) energy w.h.p.

The following lemma shows that a good labeling allows the vertices in the graph to broadcast messages in an energy-efficient manner.

Lemma 2

Suppose that we are given a good labeling \(\mathcal {L}\) with a unique layer-0 vertex. Then we can achieve the following.

  1. 1.

    It takes \(O(n \varDelta \log n)\) time and \(O(\varDelta \log n)\) energy for each vertex to broadcast a message to the entire network w.h.p.

  2. 2.

    It takes \(O(nx \log \varDelta \log ^2 n)\) time and \(O(x \log \varDelta \log ^2 n)\) energy for x vertices to broadcast messages to the entire network w.h.p.

Proof

Let r be the root of \(\mathcal {L}\). For the first task, consider the following algorithm. We relay the message of each vertex to the root r using the following convergecast algorithm. For \(i = n-1\) down to 1, do \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {all}}}\) with \(\mathcal {S}\) being the set of all layer-i vertices and \(\mathcal {R}\) being the set of all layer-\((i-1)\) vertices. For each execution of \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {all}}}\), each vertex in \(\mathcal {S}\) transmits not only its message but also all other messages that it has received so far. Although we perform \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {all}}}\) \(n-1\) times, each vertex only participates at most twice. By Lemma 22, the cost of the convergecast algorithm is \(O(n \varDelta \log n)\) time and \(O(\varDelta \log n)\) energy.

At the end of the convergecast algorithm, the root r has gathered all messages sent during the algorithm. After that, the root r then broadcasts this information to all vertices via the following divergecast algorithm. For \(i = 0\) to \(n - 2\), do \(\textsf{SR}{\text{- }}\textsf{comm}\) with \(\mathcal {S}\) being the set of all layer-i vertices and \(\mathcal {R}\) being the set of all layer-\((i+1)\) vertices. Similarly, although we perform \(\textsf{SR}{\text{- }}\textsf{comm}\) for \(n-1\) times, each vertex only participates at most twice. By Lemma 21, the cost of the divergecast algorithm is \(O(n \log \varDelta \log n)\) time and \(O(\log \varDelta \log n)\) energy. At the end of the divergecast algorithm, all vertices have received all messages.

For the rest of the proof, we consider the second task. Let X be the set of x vertices that attempt to broadcast a message. We solve this task similarly in two steps:

  • We first do a convergecast, using \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {multi}}}\) with \(M=x\), to gather all x messages to the root. By Lemma 23, \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {multi}}}\) costs \(O(x\log \varDelta \log ^2 n)\) time, so the convergecast costs \(O(nx \log \varDelta \log ^2 n)\) time and \(O(x \log \varDelta \log ^2 n)\) energy.

  • After that, we do a divergecast based on \(\textsf{SR}{\text{- }}\textsf{comm}\) to broadcast these messages from root to everyone. The divergecast costs \(O(n \log \varDelta \log n)\) time and \(O(\log \varDelta \log n)\) energy.

In order to use \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {multi}}}\), the initial holder of each message m needs to first generate a sufficient number of random bits and attach them to the message. These random bits serve as the shared randomness associated with the message m, which is needed in the definition of \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {multi}}}\).   \(\square \)

Lemma 3

There is an algorithm that lets all vertices learn the entire graph topology in \(O(n \varDelta \log n)\) time and \(O(\varDelta \log n)\) energy w.h.p.

Proof

We first let each vertex v learn the list of identifiers in N(v) by doing \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {all}}}\) with \(\mathcal {S}=\mathcal {R}=V\), where the message of each vertex v is \({\text {ID}}(v)\). By Lemma 22, this step takes \(O(\varDelta \log n)\) time and energy. After that, we apply Lemma 1 to construct a good labeling with a unique layer-0 vertex, and then we apply Lemma 2(1) to let all vertices learn the entire network topology by having each v broadcasting \({\text {ID}}(v)\) and the list of identifiers in N(v). This step takes \(O(n \varDelta \log n)\) time and \(O(\varDelta \log n)\) energy.    \(\square \)

3 Lower Bounds

In this section, we prove the two lower bounds: Theorems 4 and 5.

Theorem 4

For any randomized algorithm that computes the st minimum cut size of a planar bipartite graph w.h.p. in \(\textsf{CD}\), the energy complexity of the algorithm is \(\varOmega (n)\).

Proof

Suppose that there is a randomized algorithm \(\mathcal {A}\) that computes the exact st minimum cut size of any planar bipartite graph with high probability and using o(n) energy. Let G be a complete bipartite graph \(K_{2,\varDelta }\) with the bipartition \(\{s, t\}\) and \(\{v_1, \ldots , v_{\varDelta }\}\). Set \(X = \varDelta /5\). We select \(\varDelta \) to be sufficiently large so that it is guaranteed that both s and t use at most X unit of energy in an execution of \(\mathcal {A}\) on G.

Let \(G'\) be the result of removing \(v_{\varDelta }\) from G. The size of a st minimum cut of G is \(\varDelta \), and the size of a st minimum cut of \(G'\) is \(\varDelta - 1\). Therefore, \(\mathcal {A}\) lets s correctly distinguish between G and \(G'\) with high probability.

Consider an execution of \(\mathcal {A}\) on G. Let S be the subset of \(\{v_1, \ldots , v_{\varDelta }\}\) such that \(v_i \in S\) if there is a time slot \(\tau \) where (i) \(v_i\) transmits, (ii) the number of vertices in \(\{v_1, \ldots , v_{\varDelta }\}\) that transmit is at most 2, and (iii) at least one of s and t listens.

We claim that \(|S| \le 4X = 4\varDelta /5\). Let T be the set of all time slots \(\tau \) such that the above conditions (i), (ii), and (iii) hold for at least one \(v_i \in \{v_1, \ldots , v_{\varDelta }\}\). In view of condition (ii), we must have \(|T| \ge |S|/2\). In view of condition (iii), if \(\tau \in T\), then at least one of s and t must listen at time \(\tau \), so the energy cost of one of s and t must be at least \(|T|/2 \ge |S|/ 4\), which implies \(X \ge |S|/4\).

Let \(\mathcal {E}\) be the event that \(v_{\varDelta } \notin S\) in an execution of \(\mathcal {A}\) on G. Whether or not \(\mathcal {E}\) occurs depends only on the local randomness stored in the vertices \(\{s, t\}\) and \(\{v_1, \ldots , v_{\varDelta }\}\). Since \(|S| \le 4\varDelta /5\), at least 1/5 fraction of the vertices in \(\{v_1, \ldots , v_{\varDelta }\}\) are not in S. Since the probability that \(v_{i} \notin S\) is identical for all \(v_i \in \{v_1, \ldots , v_{\varDelta }\}\), we have \({\text {Pr}}[\mathcal {E}] \ge 1/5\).

Consider the following scenario. All vertices in \(\{s, t\}\) and \(\{v_1, \ldots , v_{\varDelta }\}\) have decided their random bits in advance. With probability 1/2, we run \(\mathcal {A}\) on G. With probability 1/2, we run \(\mathcal {A}\) on \(G'\). If \(\mathcal {E}\) occurs, then the execution of \(\mathcal {A}\) on both G and \(G'\) is completely identical from the point of view of each vertex, except for \(v_{\varDelta }\). Therefore, conditioning on event \(\mathcal {E}\), the probability that vertex s correctly decides whether the underlying graph is G or \(G'\) is at most 1/2, as s can only guess randomly.

Since \({\text {Pr}}[\mathcal {E}] \ge 1/5\), the probability that vertex s fails to correctly decide whether the underlying graph is G or \(G'\) is at least \((1/2) \cdot (1/5) = 1/10\), so s fails to correctly calculate the st minimum cut with probability at least 1/10 in the above scenario. This contradicts the assumption that \(\mathcal {A}\) is able to compute the st minimum cut with high probability.   \(\square \)

Theorem 5

For any randomized algorithm that computes the minimum cut size of a unit-disc graph w.h.p. in \(\textsf{CD}\), the energy complexity of the algorithm is \(\varOmega (n)\).

Proof

Consider the case where the underlying graph is \(K_n\) with probability 1/2, and is \(K_n - e\) with probability 1/2, where the edge e is chosen uniformly at random from the set of all edges in \(K_n\). Let \(\mathcal {A}\) be any randomized algorithm that computes the size of a minimum cut exactly with high probability. Observe that the size of a minimum cut of \(K_n\) is \(n-1\) and the size of a minimum cut of \(K_n - e\) is \(n-2\), so \(\mathcal {A}\) is able to distinguish between \(K_n\) and \(K_n - e\) with high probability. It was shown in [12] that any algorithm that distinguishes between \(K_n\) and \(K_n - e\) with success probability at least 3/4 necessarily has energy cost \(\varOmega (n)\) in both \(\textsf{CD}\) and \(\textsf{No}{\text{- }}\textsf{CD}\), so the energy complexity of \(\mathcal {A}\) is \(\varOmega (n)\).   \(\square \)

4 Graph Partitioning

The genus of a graph G is the minimum number g such that G can be drawn on an oriented surface of g handles without crossing. For example, planar graphs are the graphs with genus zero, and the graphs that can be drawn on a torus without crossing are the graphs with genus at most one. A class of graphs is called bounded-genus if the genus of all graphs in the class can be upper bounded by some constant \(g = O(1)\). In this section, we consider a classification of the connected components of the subgraph induced by the low-degree vertices in a bounded-genus graph. Our algorithms, which will be presented in subsequent sections, make use of the classification.

Let \(G = (V,E)\) be any bounded-genus graph. Let \(V_H\) be the set of vertices that have degree at least \(\sqrt{n}\). Let \(V_L = V \setminus V_H\). Since bounded-genus graphs have arboricity O(1), we have \(|E| = O(n)\), which implies \(|V_H| = O(\sqrt{n})\).

From now on, we assume \(|V_H| \ge 1\), since otherwise G has maximum degree \(\varDelta \le \sqrt{n}\), so we can already solve all problems using \(O(n \varDelta \log \varDelta \log n)) = \tilde{O}(n^{1.5})\) time and \(O(\varDelta \log \varDelta \log n)) = \tilde{O}(\sqrt{n})\) energy by learning the entire graph topology using the algorithm of Lemma 3.

Given a set of vertices S, we write G[S] to denote the subgraph of G induced by S and write \(G^+[S]\) to denote the subgraph of G induced by all edges that have at least one endpoint in S. We divide the connected components of \(G[V_L]\) into three types.

Type 1.:

A connected component S of \(G[V_L]\) is of type-1 if \(|S| < \sqrt{n}\) and \(|\bigcup _{w \in S} N(w) \cap V_H| = 1\). For each vertex \(u \in V_H\), we write C(u) to denote the set of type-1 components S such that \(\bigcup _{w \in S} N(w) \cap V_H = \{u\}\).

Type 2.:

A connected component S of \(G[V_L]\) is of type-2 if \(|S| < \sqrt{n}\) and \(|\bigcup _{w \in S} N(w) \cap V_H| = 2\). For each pair of two distinct vertices \(\{u,v\} \subseteq V_H\), we write C(uv) to denote the set of type-2 components S such that \(\bigcup _{w \in S} N(w) \cap V_H = \{u,v\}\).

Type 3.:

A connected component S of \(G[V_L]\) is of type-3 if it is neither of type-1 nor of type-2.

A connected component S of \(G[V_L]\) is of type-3 if \(|S| \ge \sqrt{n}\) or \(|\bigcup _{w \in S} N(w) \cap V_H| \ge 3\). The number of type-3 components S with \(|S| \ge \sqrt{n}\) is clearly at most \(|V|/\sqrt{n} = \sqrt{n}\). We will show that the number of type-3 components with \(|\bigcup _{w \in S} N(w) \cap V_H| \ge 3\) is also \(O(\sqrt{n})\).

Lemma 4

Let \(G=(V,E)\) be a bipartite graph of genus at most g. Let \(V = X \cup Y\) be the bipartition of G. If \(\deg (v) \ge 3\) for each \(v \in X\), then \(|X| \le 2|Y| + 4(g-1)\).

Proof

Consider any embedding of G into a surface of genus g, and let F be set of faces. In a bipartite graph, each face has at least four edges, and each edge appears in at most two faces, so \(|E| \ge 2|F|\). Combining this inequality with Euler’s polyhedral formula \(|V|-|E|+|F| \ge 2 - 2g\), we obtain that

$$\begin{aligned} 2\,V| - |E| \ge 4(1-g). \end{aligned}$$

Since \(\deg (v) \ge 3\) for each \(v \in X\), we have \(|E| \ge 3|X|\), so

$$\begin{aligned} 2\,V| - |E| = 2(|X| +|Y|) - |E| \le 2(|X| +|Y|) - 3|X| = 2|Y| - |X|. \end{aligned}$$

Combining these upper and lower bounds of \(2|V| - |E|\), we obtain that \(2|Y| - |X| \ge 4(1-g)\), so \(|X| \le 2|Y| + 4(g-1)\), as required.   \(\square \)

Note that Lemma 4 is precisely the reason that our algorithms only apply to bounded-genus graphs and do not work on an arbitrary H-minor-free graph. Consider a complete bipartite graph with the bipartition X and Y such that \(|Y| = 3\). Such a graph does not contain \(K_5\) as a minor, regardless of the size of X. Therefore, \(K_5\)-minor-freeness does not allow us to upper bound |X| by any function of |Y|. Therefore, the bounded-genus requirement in Lemma 4 cannot be relaxed to H-minor-freeness for an arbitrary H.

Lemma 5

If G is a bounded-genus graph, then the number of type-3 components is \(O(\sqrt{n})\).

Proof

A connected component S of \(G[V_L]\) is of type-3 if \(|S| \ge \sqrt{n}\) or \(|\bigcup _{w \in S} N(w) \cap V_H| \ge 3\). As discussed earlier, the number of type-3 components S with \(|S| \ge \sqrt{n}\) is at most \(\sqrt{n}\), so we just need to prove that the number of type-3 components S with \(|\bigcup _{w \in S} N(w) \cap V_H| \ge 3\) is also \(O(\sqrt{n})\). Consider a bipartite graph \(G^*=(V^*, E^*)\) with the bipartition \(V^*= X^*\cup Y^*\) defined as follows.

  • \(X^*\) is the set of all type-3 components S such that \(|\bigcup _{w \in S} N(w) \cap V_H| \ge 3\).

  • \(Y^*= V_H\).

  • For each component \(S \in X^*\) and each vertex \(v \in Y^*\), \(\{S,v\} \in E^*\) if \(v \in \bigcup _{w \in S} N(w)\).

Alternatively, \(G^*\) can be constructed from G by the following steps.

  • Remove all type-1, type-2, and type-3 components S with \(|\bigcup _{w \in S} N(w) \cap V_H| \le 2\).

  • For each type-3 component S with \(|\bigcup _{w \in S} N(w) \cap V_H| \ge 3\), contract S into a vertex.

As \(G^*\) can be obtained from G via a sequence of edge contractions and vertex removals, \(G^*\) is a bounded-genus graph. Observe that \(\deg (S) \ge 3\) for each \(S \in X^*\) in \(G^*\), so we may apply Lemma 4, which shows that the number \(|X^*|\) of type-3 components S such that \(|\bigcup _{w \in S} N(w) \cap V_H| \ge 3\) satisfies \(|X^*| \le 2|Y^*| + O(1) = 2|V_H| + O(1) = O(\sqrt{n})\).   \(\square \)

We write \(G_H\) to denote the graph defined by the vertex set \(V_H\) and the edge set \(\{\{u,v\} \, : \, |C(u,v)| > 0\}\). The following observation is useful.

Lemma 6

If G is a bounded-genus graph, then \(G_H\) is also a bounded-genus graph, so the number of edges in \(G_H\) is \(O(\sqrt{n})\) and there exists an edge orientation of \(G_H\) such that each vertex has outdegree O(1).

Proof

The graph \(G_H\) can be obtained from G via a sequence of edge contractions and vertex removals, so \(G_H\) is a bounded-genus graph. As bounded-genus graphs have arboricity O(1), and so the number of edges in \(G_H\) is at most linear in the number of vertices in \(G_H\), which is \(O(\sqrt{n})\), and we can orient the edges of \(G_H\) in such a way that each vertex has outdegree O(1).   \(\square \)

5 Diameter

In this section, we show that for bounded-genus graphs, the diameter can be computed using \(\tilde{O}(\sqrt{n})\) energy. We begin with discussing the high-level proof idea. First of all, using Lemma 2, learning the entire graph topology of the subgraph induced by \(V_H\) and all type-3 components is doable using \(\tilde{O}(\sqrt{n})\) energy. Intuitively, this is due to the following facts: (i) \(|V_H| = O(\sqrt{n})\), (ii) \(\deg (v) = O(\sqrt{n})\) for each \(v \in V_L\), and (iii) the number of type-3 components is \(O(\sqrt{n})\).

The main difficulty in the diameter computation is dealing with type-1 and type-2 components. For example, a vertex \(u \in V_H\) can be connected to \(\Theta (n)\) type-1 components in that \(|C(u)| = \Theta (n)\). Since we aim for an algorithm with energy complexity \(\tilde{O}(\sqrt{n})\), throughout the entire algorithm, u can only receive messages from at most \(\tilde{O}(\sqrt{n})\) components in C(u). The challenge here is to show that the diameter can still be calculated with a limited amount of information about type-1 and type-2 components and show that such information can be extracted in an energy-efficient manner in the radio network model.

We will define a set of parameters of type-1 and type-2 components and show that with these parameters, the exact value of the diameter can be calculated. Based on this result, we will define a subgraph \(G^\star \) of G such that the diameter of G equals the diameter of \(G^\star \), and then in Appendix A we will design an energy-efficient algorithm to learn the graph topology of \(G^\star \).

In the subsequent discussion, we write \({\text {eccentricity}}(u,S)\) to denote \(\max _{v \in S} {\text {dist}}(u,v)\). By default, all distances are measured in the underlying network G. We use subscripts to describe distances that are measured in a vertex set, an edge set, or a subgraph.

Parameters for Type-1 Components. We first consider the type-1 components in C(u), for any vertex \(u \in V_H\).

\((A_i[u], a_i[u])\).:

Let \(A_1[u]\) be a component \(S \in C(u)\) that maximizes \({\text {eccentricity}}(u,S)\), and let \(A_2[u]\) be a component \(S \in C(u) \setminus \{A_1[u]\}\) that maximizes \({\text {eccentricity}}(u,S)\). For \(i \in \{1,2\}\), we write \(a_i[u] = {\text {eccentricity}}(u,A_i[u])\).

(B[u], b[u]).:

Let B[u] be a component \(S \in C(u)\) that maximizes \(\max _{s, t \in S \cup \{u\}} {\text {dist}}(s,t)\), and we write \(b[u] = \max _{s, t \in B[u] \cup \{u\}} {\text {dist}}(s,t)\).

In the above definitions, ties can be broken arbitrarily if there are multiple choices. Some of the above definitions become undefined when |C(u)| is too small. For example, if \(|C(u)| = 1\), then \(A_2[u]\) and \(a_2[u]\) are undefined. In such a case, we set these parameters to their default values: zero or an empty set. For example, if \(|C(u)| = 1\), then we set \(A_2[u] = \emptyset \) and \(a_2[u] = 0\).

Any path connecting a vertex in \(\bigcup _{S \in C(u)} S\) to the rest of the graph must pass the vertex \(u \in V_H\), so the amount of information we can afford to extract from \(\bigcup _{S \in C(u)} S\) is limited. Intuitively, for the purpose of calculating the diameter, we only need the following information from \(\bigcup _{S \in C(u)} S\):

  • The longest distance between two vertices in \(\bigcup _{S \in C(u)} S \cup \{u\}\), which is \(\max \{b[u], a_1[u]+a_2[u]\}\).

  • The longest distance between u and a vertex in \(\bigcup _{S \in C(u)} S\), which is \(a_1[u]\).

Regardless of the size of C(u), we only need to learn \(a_1[u]\), \(a_2[u]\), and b[u] from the components of C(u). Later we will show that these parameters can be learned efficiently via \(\textsf{SR}{\text{- }}\textsf{comm}^{{\text {max}}}\).

Parameters for Type-2 Components. Next, we consider the type-2 components in C(uv), for any two distinct vertices \(u, v \in V_H\).

(R[uv], r[uv]).:

Let R[uv] be a component \(S \in C(u,v)\) that minimizes \({\text {dist}}_{G^+[S]}(u,v)\), and we write \(r[u,v] = {\text {dist}}_{G^+[R[u,v]]}(u,v)\). In other words, R[uv] is a component that contains a shortest path between u and v, among all uv paths via the vertices in \(\bigcup _{S \in C(u,v)} S\).

\((A_i^k[u,v], a_i^k[u,v])\).:

For each component \(S \in C(u,v)\), we write \(S^{u,k}\) to denote the set of vertices \(\{w \in S \, : \, {\text {dist}}_{G^+[S]}(w,v) - {\text {dist}}_{G^+[S]}(w,u) \ge k\}\). In other words, \(S^{u,k}\) is the set of all vertices in S whose distance to u in \(G^+[S]\) is shorter than that to v by at least k.

Let \(A_1^k[u,v]\) be a component \(S \in C(u,v)\) that maximizes \({\text {eccentricity}}_{G^+[S]}(u, S^{u,k})\), and let \(A_2^k[u,v]\) be a component \(S \!\in \! C(u,v){\setminus } \{A_1^k[u,v]\}\) that maximizes \({\text {eccentricity}}_{G^+[S]}(u, S^{u,k})\). We write \(a_i^k[u,v] ={\text {eccentricity}}_{G^+[A_i^k[u,v]]} (u,A_i^k[u,v])\). We only consider \(k \in \{-\sqrt{n}, \ldots , \sqrt{n}\}\).

\((B^l[u,v], b^l[u,v])\).:

For a component \(S \in C(u,v)\), we write \(G^{l}[S]\) to denote the graph resulting from adding to \(G^+[S]\) a path of length l connecting u and v, and we write \(\phi ^{l}(S)\) to denote the maximum value of \({\text {dist}}_{G^{l}[S]}(s,t)\) among all pairs of vertices \(s, t \in S \cup \{u,v\}\). A useful observation here is that if \({\text {dist}}_{V \setminus S}(u,v) = l\), then \(\phi ^{l}(S)\) equals the maximum value of \({\text {dist}}_G(s,t)\) among all pairs of vertices \(s, t \in S \cup \{u,v\}\).

Let \(B^l[u,v]\) be a component \(S \in C(u,v) \setminus \{ R[u,v] \}\) that maximizes \(\phi ^{l}(S)\), and we write \(b^l(u,v) = \phi ^{l}(B^l[u,v])\). We only consider \(l \in \{1, \ldots , \sqrt{n}\}\).

Similar to the parameters of type-1 components, all the above parameters are set to their default values if they are undefined. Note that the definitions of \(a_i^k[u,v]\) and \(A_i^k[u,v]\) are asymmetric in the sense that we might have \(a_i^k[u,v] \ne a_i^k[v,u]\) and \(A_i^k[u,v] \ne A_i^k[v,u]\). All remaining parameters for type-2 components are symmetric.

We briefly explain how the above parameters can be used in the diameter calculation. Let \(P=(s, \ldots , t)\) be an st shortest path in G whose length equals the diameter. There are three possible ways that P intersects the vertex set \(\bigcup _{S \in C(u,v)} S\).

  • Suppose s and t are within \(G^+[S]\), for a component \(S \in C(u,v)\). In this case, if \({\text {dist}}_{V \setminus S}(u,v) = l\), then the length of P equals \(\phi ^{l}(S) = b^l[u,v]\).

  • Suppose there is a subpath \(P' = (u, \ldots , v)\) of P whose intermediate vertices are all in \(\bigcup _{S \in C(u,v)} S\). In this case, the length of \(P'\) equals r[uv].

  • Suppose there is a component \(S \in C(u,v)\) such that \(s \in S\) and \(t \notin S \cup \{u,v\}\). Suppose u is the first vertex of P that is not in S. Consider the subpath \(P' = (s, \ldots , u)\) of P. If \({\text {dist}}(t,v) - {\text {dist}}(t,u) = k\), then we must have \(s \in S^{u,k}\), since otherwise \({\text {dist}}(s,v) + {\text {dist}}(v,t)\) is smaller than the length of P, violating the assumption that P is an st shortest path. If \(t \notin A_1^k[u,v]\), then the length of \(P'\) equals \(a_1^k[u,v]\). If \(t \in A_1^k[u,v]\), then the length of \(P'\) equals \(a_2^k[u,v]\).

Intuitively, the above discussion shows that the parameters described above capture all the necessary information needed to be extracted from the type-2 components for the purpose of diameter computation. We have \(O(\sqrt{n})\) parameters for each C(uv). We will later show that all these parameters can be learned using \(O(\sqrt{n})\) energy.

The graph \(G^\star \). We define \(G^\star \) as the subgraph induced by the union of (i) \(V_H\), (ii) all type-3 components, (iii) \(A_1[u]\), \(A_2[u]\), and B[u], for each \(u \in V_H\), and (iv) \(A_i^k[u,v]\), \(A_i^k[v,u]\), \(B^l[u,v]\), and R[uv], for each pair of distinct vertices \(\{u,v\} \subseteq V_H\), \(i \in \{1,2\}\), \(k \in \{-\sqrt{n}, \ldots , \sqrt{n}\}\), and \(l \in \{1, \ldots , \sqrt{n}\}\). In the subsequent discussion, we prove that the diameter of G equals the diameter of \(G^\star \), so the task of computing the diameter of G is reduced to learning the topology of \(G^\star \). We will show that the following two statements are correct.

(S1):

For each pair of vertices \(\{s,t\}\) in graph \(G^\star \), we have \({\text {dist}}_G(s,t) = {\text {dist}}_{G^\star }(s,t)\).

(S2):

For each pair of vertices \(\{s,t\}\) in graph G, there exists a pair of vertices \(\{s',t'\}\) in graph \(G^\star \) satisfying \({\text {dist}}_G(s,t) \le {\text {dist}}_{G}(s',t')\).

These statements imply that G and \(G^\star \) have the same diameter. We first prove that (S1) is true.

Lemma 7

For any two vertices s and t in \(G^\star \), we have \({\text {dist}}_{G}(s,t) = {\text {dist}}_{G^\star }(s,t)\).

Proof

We choose P to be an st path in G whose length is \({\text {dist}}_{G}(s,t)\) that uses the minimum number of vertices not in \(G^\star \). If P is entirely in \(G^\star \), then we are done. For the rest of the proof, we assume that P is not entirely in \(G^\star \). Then P contains a subpath \(P' = (u, \ldots , v)\) whose intermediate vertices are all within a type-2 component \(S \in C(u, v)\) that is not included to \(G^\star \). By the definition of R[uv], the length of \(P'\) is at least r[uv], which is the shortest path length between u and v via R[uv]. Therefore, replacing \(P'\) with a shortest uv path in \(R_j[u,v]\), which is entirely in \(G^\star \), does not increase the path length. This contradicts our choice of P. Hence P is entirely in \(G^\star \).   \(\square \)

Lemma 8

Let S be a type-1 or type-2 component that is not included in \(G^\star \). Let \(s \in S\). Let t be any vertex in G that does not belong to \(G^+[S]\). Then there exists a vertex \(s'\) in \(G^\star \) such that \({\text {dist}}_{G}(s',t) \ge {\text {dist}}_{G}(s,t)\).

Proof

Let P be an st shortest path in G. Suppose that \(S \in C(u)\) is of type-1. Because S is not included in \(G^\star \), we must have \(|C(u)| \ge 3\), so both \(A_1[u] \ne S\) and \(A_2[u] \ne S\) are not \(\emptyset \). Let \(i \in \{1,2\}\) be an index such that t is not in \(A_i[u]\). Consider the subpath \(\tilde{P} = (s, \ldots , u)\) of P. By the definition of \(a_i[u]\) and \(A_i[u]\), the length of \(\tilde{P}\) is at most \(a_i[u]\), and there exists a vertex \(s' \in A_i[u]\) such that the length of the shortest path between \(s'\) and u equals \(a_i[u]\). Thus, we have

$${\text {dist}}_{G}(s',t) = {\text {dist}}_{G}(s',u) + {\text {dist}}_{G}(u,t) \ge {\text {dist}}_{G}(s,u) + {\text {dist}}_{G}(u,t) = {\text {dist}}_{G}(s,t).$$

Next, consider the case that \(S \in C(u,v)\) is of type-2. The path P must contain at least one of u and v. Without loss of generality, assume that u is the first vertex of P that is not in S, so there is a subpath \(\tilde{P} = (s, \ldots , u)\) of P such that all vertices in \(\tilde{P}\) other than u are in S. The length of P equals \({\text {dist}}_{G^+[S]}(s,u) + {\text {dist}}_{G}(u,t)\).

Let \(k = {\text {dist}}_{G^+[S]}(s,v) - {\text {dist}}_{G^+[S]}(s,u)\), so \(S^{u,k} \supseteq \{s\} \ne \emptyset \). Since S is not of type-3, \(|S| < \sqrt{n}\), so \(k \in \{-\sqrt{n}, \ldots , \sqrt{n}\}\). Because S is not included in \(G^\star \), both \(A_1^k[u,v] \ne S\) and \(A_1^k[u,v] \ne S\) are not \(\emptyset \). At least one of \(A_1^k[u,v]\) and \(A_2^k[u,v]\) does not contain t. We choose \(S' = A_i^k[u,v]\) as any one of them that does not contain t. We choose \(s' \in S'\) as a vertex such that \({\text {dist}}_{G^+[S']}(s',u) = a_i^k[u,v]\) and \({\text {dist}}_{G^+[S']}(s',v) - {\text {dist}}_{G^+[S']}(s',u) \ge k\). The existence of such a vertex \(s'\) is guaranteed by the definition of \(A_i^k[u,v]\).

Our plan is to show that (i) \(a_i^k[u,v] + {\text {dist}}_{G}(u,t) \ge {\text {dist}}_{G}(s,t)\) and (ii) \({\text {dist}}_{G}(s',t) = a_i^k[u,v] + {\text {dist}}_{G}(u,t)\). Combining these two inequalities give us the desired result: \({\text {dist}}_{G}(s',t) \ge {\text {dist}}_{G}(s,t)\).

Proof of (i). By the definition of \(A_i^k[u,v]\), we must have

$$\begin{aligned} {\text {dist}}_{G^+[S']}(s',u) = a_i^k[u,v] \ge {\text {dist}}_{G^+[S]}(s,u), \end{aligned}$$

so we have

$$\begin{aligned} a_i^k[u,v] + {\text {dist}}_{G}(u,t) \ge {\text {dist}}_{G^+[S]}(s,u) + {\text {dist}}_{G}(u,t) = {\text {dist}}_{G}(s,t). \end{aligned}$$

Proof of (ii). Suppose that (ii) is not true. Then any shortest path between \(s'\) and t must contain a subpath \(P' = (s', \ldots , v)\) such that u is not in \(P'\), and so we have:

$${\text {dist}}_{G}(s',t) = {\text {dist}}_{G^+[S']}(s',v) + {\text {dist}}_{G}(v,t) < {\text {dist}}_{G^+[S']}(s',u) + {\text {dist}}_{G}(u,t).$$

Combining this inequality with the known fact \({\text {dist}}_{G^+[S']}(s',v) - {\text {dist}}_{G^+[S']} (s',u) \ge k\), we have:

$${\text {dist}}_{G}(u,t) - {\text {dist}}_{G}(v,t) > {\text {dist}}_{G^+[S']}(s',v) - {\text {dist}}_{G^+[S']}(s',u) \ge k,$$

which implies that \({\text {dist}}_{G}(v,t) < {\text {dist}}_{G}(u,t) - k\) (\(\star \)). We calculate an upper bound of \({\text {dist}}_{G}(s,t)\):

$$\begin{aligned} {\text {dist}}_{G}(s,t)&\le {\text {dist}}_{G^+[S]}(s,v) + {\text {dist}}_{G}(v,t)\\&= (k + {\text {dist}}_{G^+[S]}(s,u)) + {\text {dist}}_{G}(v,t)&\text {by definition of }k.\\&< (k + {\text {dist}}_{G^+[S]}(s,u)) + ({\text {dist}}_{G}(u,t) - k)&\text {by }(\star ).\\&= {\text {dist}}_{G^+[S]}(s,u) + {\text {dist}}_{G}(u,t). \end{aligned}$$

This contradicts the assumption that P is a shortest path between s and t in G, as the length of P equals \({\text {dist}}_{G^+[S]}(s,u) + {\text {dist}}_{G}(u,t)\).   \(\square \)

The following lemma shows that (S2) is true.

Lemma 9

For any two vertices s and t in graph G, there exist two vertices \(s'\) and \(t'\) in graph \(G^\star \) such that \({\text {dist}}_G(s,t) \le {\text {dist}}_{G}(s',t')\).

Proof

If both s and t are already in \(G^\star \), then we are done by setting \(s' = s\) and \(t' = t\). In the subsequent discussion, we focus on the case that at least one of s and t is not in \(G^\star \). By symmetry, we will assume that s is not in \(G^\star \), so there is a type-1 or a type-2 component S that is not included in \(G^\star \) such that \(s \in S\).

Case 1: t belongs to \(G^+[S]\). If \(S \in C(u)\) for some \(u \in V_H\), then there exist two vertices \(s'\) and \(t'\) in the component \(B[u] \in C(u)\) such that \({\text {dist}}_G(s',t') = b[u] \ge {\text {dist}}_G(s,t)\) by the definition of B[u].

The remaining case is that \(S \in C(u,v)\) for some \(u,v \in V_H\). Let \(l = {\text {dist}}_{V \setminus S}(u,v)\). We observe that \(l \le r[u,v]\). The reason is that the existence of a component \(S \ne R[u,v]\) guarantees that \(R[u,v] \ne \emptyset \), which implies that \(l = {\text {dist}}_{V \setminus S}(u,v) \le {\text {dist}}_{G^+[R[u,v]]}(u,v) = r[u,v]\), as \(G^+[R[u,v]]\) is a subgraph of \(G[V \setminus S]\).

Since R[uv] is of type-2, we have \(r[u,v] \le |R[u,v]|+1 \le \sqrt{n}\), so \(l \in \{1, \ldots , \sqrt{n}\}\) Consider the component \(B^l[u,v] \in C(u,v)\). We observe that \(l = {\text {dist}}_{V \setminus B^l[u,v]}(u,v)\), since the shortest uv path length via R[uv] is at most the length of any uv path via S or \(B^l[u,v]\), by our choice of R[uv]. More precisely, we have \(l = {\text {dist}}_{V \setminus S}(u,v) = {\text {dist}}_{V}(u,v) = {\text {dist}}_{V \setminus B^l[u,v]}(u,v)\), as the above discussion implies that including S and excluding \(B^l[u,v]\) in the subscript does not change the shortest uv path length. Here we use the fact that \(B^l[u,v] \ne R[u,v]\), which is due to the definition of \(B^l[u,v]\).

Since \(l = {\text {dist}}_{V \setminus B^l[u,v]}(u,v)\), by the definition of \(B^l[u,v]\), there exist two vertices \(s'\) and \(t'\) in \(G^+[B^l[u,v]]\) such that \({\text {dist}}_{G}(s',t') \ge {\text {dist}}_{G}(s,t)\), since otherwise we would have selected \(B^l[u,v] = S\).

Case 2: t does not belong to \(G^+[S]\). We apply Lemma 8 to find a vertex \(s'\) in \(G^\star \) such that \({\text {dist}}_G(s,t) \le {\text {dist}}_{G}(s',t)\). If t is already in \(G^\star \), then we are done. Otherwise, there is a type-1 or a type-2 component \(S'\) that is not included in \(G^\star \) such that \(t \in S'\). There are two sub-cases.

  • Suppose \(s'\) belongs to \(G^+[S']\). Then we may apply the same argument for Case 1 above to find two vertices \(s''\) and \(t''\) in \(G^\star \) such that \({\text {dist}}_G(s,t) \le {\text {dist}}_{G}(s',t) \le {\text {dist}}_G(s'', t'')\).

  • Suppose \(s'\) does not belong to \(G^+[S']\). Then we may apply Lemma 8 again to find a vertex \(t'\) in \(G^\star \) such that \({\text {dist}}_G(s,t) \le {\text {dist}}_{G}(s',t) \le {\text {dist}}_{G}(s',t')\).

In both sub-cases, we can find two vertices in \(G^\star \) whose distance in G is at least \({\text {dist}}_G(s,t)\).   \(\square \)

Lemma 10

The diameter of G equals the diameter of \(G^\star \).

Proof

Lemma 7 shows that (S1) is true. Lemma 9 shows that (S2) is true. These two results together imply that G and \(G^\star \) have the same diameter. Statement (S1) implies that the diameter of \(G^\star \) is at most the diameter of G. For the other direction, let s and t be two vertices in G such that \({\text {dist}}(s,t)\) equals the diameter of G. By (S2), there exist two vertices \(s'\) and \(t'\) in \(G^\star \) such that \({\text {dist}}_G(s,t) \le {\text {dist}}_{G}(s',t')\). By (S1), \({\text {dist}}_G(s',t') = {\text {dist}}_{G^\star }(s',t')\), so the diameter of \(G^\star \) is at least the diameter of G.   \(\square \)

In Appendix A, we will design an energy-efficient algorithm to learn the graph topology of \(G^\star \). This algorithm, combined with Lemma 10, allows us to prove Theorem 1.