Abstract 1 Introduction 2 Model 3 Lower Bounds 4 Crash-tolerant algorithms for two energy-sharing agents in trees 5 Optimal algorithms in lines 6 Conclusion References

Crash-Tolerant Exploration of Trees by Energy-Sharing Mobile Agents

Quentin Bramas ORCID University of Strasbourg, ICUBE, CNRS, France Toshimitsu Masuzawa ORCID Graduate School of Information Science and Technology, Osaka University, Japan Sébastien Tixeuil ORCID Sorbonne University, CNRS, LIP6, Institut Universitaire de France, Paris, France
Abstract

We consider the problem of graph exploration by energy sharing mobile agents that are subject to crash faults. More precisely, we consider a team of two agents where at most one of them may fail unpredictably, and the considered topology is that of connected acyclic graphs (i.e. trees). We consider both the asynchronous and the synchronous settings, and we provide necessary and sufficient conditions about the energy.

Keywords and phrases:
Mobile Agents, Distributed Algorithms, Energy sharing
Funding:
Toshimitsu Masuzawa: This work is supported in part by JSPS KAKENHI 20KK0232.
Sébastien Tixeuil: This work is supported in part by ANR SAPPORO (ANR-19-CE25-0005).
Copyright and License:
[Uncaptioned image] © Quentin Bramas, Toshimitsu Masuzawa, and Sébastien Tixeuil; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Distributed algorithms
; Computing methodologies Mobile agents
Editors:
Silvia Bonomi, Letterio Galletta, Etienne Rivière, and Valerio Schiavoni

1 Introduction

Swarm robotics research has focused on the capabilities of groups of autonomous mobile robots, or agents, with limited individual abilities. These agents collaborate to achieve complex tasks such as pattern formation, object assembly, search, and exploration. Collaboration provides several benefits, including accelerated task completion, fault tolerance potential, reduced construction costs, and energy efficiency compared to larger, more complex agents. This paper investigates the collective exploration of a known edge-weighted graph by mobile agents originating from arbitrary nodes. The objective is to traverse every edge at least once, with edge weights indicating their lengths. Each agent possesses a battery with an initial energy level (that may differ among agents). An agent’s battery is depleted by x when it travels a distance of x.

A recently examined collaboration mechanism among agents is energy sharing, which permits one agent to transfer energy to another upon encountering them. This ability introduces new possibilities for tasks that can be accomplished. Energy-sharing capabilities facilitate graph exploration in scenarios where it would otherwise be unattainable. Conversely, an exploration algorithm incorporating energy sharing must assign trajectories to agents to collectively explore the entire graph and schedule feasible energy transfers, making it more intricate to design. This paper also considers the possibility for an agent to crash, or cease functioning indefinitely and unpredictably. An exploration algorithm must now account for not only the feasibility of energy sharing, but also the feasibility of any plan that considers an agent crashing at any point during its prescribed algorithm.

1.1 Energy-constrained agents

Chalopin et al. [5] study mobile agents with limited energy that must collaboratively deliver data from network sources to a central repository. It turns out that the decision problem is NP-hard for a single source, and they present a 2-approximation algorithm to find the minimum energy assignable to each agent to deliver data. In a follow-up paper, Chalopin et al. [6] study n mobile agents with limited energy on a straight line that must collectively deliver data from source point s to target point t, and show that deciding if agents can deliver data is (weakly) NP-complete. Bärtschi et al. [3] study delivering m messages between source-target pairs in an undirected graph using k mobile agents initially at distinct nodes. Anaya et al. [1] study the problem of broadcast and convergecast with energy aware mobile agents. In the centralized setting, they give a linear-time algorithm to compute optimal battery power and strategy for convergecast and broadcast on a line. Finding the optimal battery power for trees is NP-hard. They also give a polynomial algorithm for 2-approximation for convergecast and 4-approximation for broadcast in arbitrary graphs. Czyzowicz et al. [9] studied broadcast and exploration in trees, and give an O(nlogn) time algorithm to solve the problem in a n-nodes tree T. If the number of agents is at least equal to the number of leaves of T, their approach results in an O(n) time algorithm. Bärtschi et al. [2] consider the possibility of gathering k energy-constrained mobile agents in an undirected edge-weighted graph. The authors study three variants of near-gathering to minimize: (i) the radius of a ball containing all agents, (ii) the maximum distance between any two agents, or (iii) the average distance between agents. They prove that (i) is polynomial-time solvable, (ii) has a polynomial-time 2-approximation with matching NP-hardness lower bound, and (iii) admits a polynomial-time 2(11k)-approximation but no FPTAS unless P=NP. Czyzowicz et al. [11] studied the exit search problem for two robots on an infinite line, starting at the origin. Time-energy trade-offs for this evacuation problem are studied. Contrary to all aforementioned works, the energy consumption of a robot traveling a distance x at speed s is measured as xs2.

1.2 Energy transfer

Energy transfer by mobile agents was previously considered by Czyzowicz et al. [8]. Agents travel and spend energy proportional to distance traversed. Some nodes have information acquired by visiting agents. Meeting agents may exchange information and energy. They consider communication problems where information held by some nodes must be communicated to other nodes or agents. They deal with data delivery and convergecast problems for a centralized scheduler with full knowledge of the instance. With energy exchange, both problems have linear-time solutions on trees. For general undirected and directed graphs, these problems are NP-complete. Then, Czyzowicz et al. [7] consider the gossiping problem in tree networks. In an edge-weighted tree network, agents spend energy while traveling and collect copies of data packets from visited nodes. They deposit copies of possessed data packets and collect copies of data packets present at the node. Czyzowicz et al. [7] prove that gossiping can be solved in O(k2n2) time for an n-node tree network with k agents.

Most related to our paper are the works by Czyzowicz et al. [10], Sun et al. [12], and Bramas et al. [4]. On the one hand, Czyzowicz et al. [10] study the collective exploration of a known n-node edge-weighted graph by k mobile agents with limited energy and energy transfer capability. The goal is for every edge to be traversed by at least one agent. For an n-node path, they give an O(n+k) time algorithm to find an exploration strategy or report that none exists. For an n-node tree with leaves, they provide an O(n+k2) algorithm to find an exploration strategy if one exists. For general graphs, deciding if exploration is possible by energy-sharing agents is NP-hard, even for 3-regular graphs. However, it’s always possible to find an exploration strategy if the total energy of agents is at least twice the total weight of edges; this is asymptotically optimal. Next, Sun et al. [12] examines circulating graph exploration by energy-sharing agents on an arbitrary graph. They present the necessary and sufficient energy condition for exploration and an algorithm to find an exploration strategy if one exists. The exploration requires each node to have the same number of agents before and after. Finally, Bramas et al. [4] considered the problem of exploring every weighted edge of a given ring-shaped graph using a team of two mobile energy-sharing agents. They introduce the possibility for one of the two agents to fail unpredictably and cease functioning permanently (i.e., crashing). In this context, Bramas et al. [4] considered two scenarios: asynchronous (where no limit on the relative speed of the agents is known), and synchronous (where the two agents have synchronized clocks and operate at the same speed).

1.3 Our Contribution

We consider the problem of graph exploration by energy-sharing mobile agents that are subject to crash faults. More precisely, we consider a team of two agents where at most one of them may fail unpredictably, and the considered topology is that of connected acyclic graphs (i.e. trees). We assume that agents initially know the entire topology, as well as their starting locations. Under these strong assumptions, the lower-bounds we provide are interesting, as they also apply to more general case settings. The algorithms we present for the same setting demonstrate that the lower bounds are tight for path graphs, and almost tight for general trees. In the following, en0 and en1 denote the initial energy of the first and second agents, respectively. Also, x denotes the initial distance between the agents.

On the positive side, we show that, two asynchronous agents can explore a weighted tree T with diameter d and total weight W if (Theorem 7):

(en0x)(en1x)(en0+en12W+2dlog3/2W+x+2)

On the negative side, we provide a lower bound (Theorem 1) on the total energy for weighted star graphs (each edge has a weight d/2, d): en0+en1 cannot be in 2W+dlog(o(|E|)).

In the synchronous case, a sufficient condition (Theorem 9) is:

(en0x)(en1x)(en0+en12W+d+x)

On the other hand (Theorem 2), we show that there exists an infinite family of trees such that the required total energy is at least 2W+d23.

We also provide tight bounds for the case of path graphs, regardless of the initial locations of agents. The algorithms we provide when agents are not initially collocated assume that the agents may initially exchange information, and we discuss the trade-off between the amount of information exchanged and the solvability of the problem in this case. Due to space constraints, some proofs are omitted from the conference version of this paper.

2 Model

Our model is similar to that proposed by Bramas et al. [4]. We are given a weighted graph G=(V,E) where V is a set of n nodes, E is a set of m edges, and each edge eiE is assigned a positive integer wi+, denoting its weight (or length). We have k mobile agents (or agents for short) r0,r1,,rk1 respectively placed at some of the nodes s0,s1,sk1 of the graph. We allow more than one agent to be located in the same place. Each agent ri initially possesses a specific amount eni of energy for its moves. An agent has the ability to travel along the edges of graph G in any direction. It can pause its movement if necessary and can change its direction either at a node or while traveling along an edge. The energy consumed by a moving agent is equal to the distance x it moved. An agent can move only if its energy is greater than zero. Now, the distance between two agents (that is, the minimum sum of the weights for all the paths connecting them) is the smallest amount of energy needed for them to meet at some point.

In our setting, agents can share energy with each other. When two agents, ri and rj, meet at a vertex or edge, ri can take some energy from rj. If their energy levels at meeting time are eni and enj, then ri can take an amount of energy 0<enenj from rj. After the transfer, their energy levels are eni+en and enjen, respectively.

Each agent adheres to a pre-established trajectory until encountering another agent. At this point, the agent determines if it acquires energy, and calculates its ensuing trajectory. The definition of a trajectory depends on the synchrony model:

  • In the synchronous model, a trajectory is a sequence of pairs ((u0,t0), (u1,t1), ), where ui is a node, and ti denotes the time at which the agent should reach ui. For each i0, ti<ti+1, and ui+1 is either equal to ui (i.e., the agent waits at ui between ti and ti+1), or is adjacent to ui (i.e., the agent leaves ui at time ti and arrives at ui+1 at time ti+1). For simplicity, we assume in our algorithm that the moving speed is always one (it takes time d to travel distance d, so if uiui+1 and the weight of edge (ui,ui+1) is w, then ti+1ti=w).

  • In the asynchronous model, a trajectory is just a sequence of nodes (u0,u1,u2,), ui+1 being adjacent to ui for each i0, and the times at which it reaches the nodes are determined by an adversary.

In other words, in the synchronous model, the agent controls its speed and its waiting time at nodes, while an adversary decides them in the asynchronous model.

The computation of the trajectory and the decision to exchange energy is based on a deterministic localized algorithm (that is, an algorithm executed by the agent). In a given execution, the configuration, which consists of each agent’s location and remaining energy, at time t is denoted by Ct.

Localized algorithm.

A localized algorithm fi executed by an agent ri at time t takes as input the pasts of ri and its collocated agents, and returns (i) its ensuing trajectory traji and (ii) the amount of energy takei,j taken from each collocated agent rj. The past Pasti(t) of ri at time t corresponds to the path already traversed by ri union the pasts of all the previously met agents. More formally:

Pasti(t)={pathi(t)}{Pastj(t)ri met rj at time tt}

A set of localized algorithms is valid for a given initial configuration c if, for any execution starting from c, agents that are ordered to move have enough energy to do so and when an agent ri takes energy from an agent rj at time t, then rj does not take energy from ri at t.

In this paper, we consider the possibility of agent crashes. At any point in the execution, an agent ri may crash and stop operating forever. However, if ri has remaining energy eni>0, then other agents meeting ri may take energy from ri (and are still able to read its memory without knowing it is crashed). Now, a set of localized algorithms is t-crash-tolerant if it is valid even in executions where at most t agents crash.

We are interested in solving the problem of t-crash-tolerant collaborative exploration:

𝒕-crash-tolerant collaborative exploration.

Given a weighted graph G=(V,E) and k mobile agents r0,r1,,rk1 together with their respective initial energies en0,en1,,enk1 and positions s0,s1,,sk1 in the graph, find a valid set of localized algorithms that explore (or cover) all edges of the graph despite the unexpected crashes of at most t<k agents.

This paper focuses on the 1-crash-tolerant collaborative exploration of trees by two agents.

3 Lower Bounds

In this section, we present two lower bounds, one for the case of asynchronous unweighted stars, and one for the case of synchronous trees. The lower bound for stars is asymptotically tight even considering more general trees, as it matches the complexity of our algorithm solving the exploration in arbitrary asynchronous trees. Only the factor in front of the logarithmic term is different. In the synchronous case, the lower bound is also tight for the factor W, but the coefficient of d in from of the logarithmic term in our algorithm’s complexity is larger by a factor of 2.

3.1 Asynchronous Stars

For asynchronous stars, we first show a lower bound of the total energy consumption.

Theorem 1.

Consider a star of size Δ+1 where the weight of each edge is d/2. If two asynchronous agents start at the center of the star, then the total energy consumption of any algorithm cannot be in 2W+dlog(o(Δ))=2W+dlog(o(W/d)), where W=dΔ/2 (i.e., the total weight).

Proof.

Assume for the purpose of contradiction that there exists an algorithm that explores any such star of degree Δ with 2W+dlog(Δ/g(Δ)) total energy in the worst case, with a non-decreasing function g in ω(1) (also gO(Δ) as we know 2W is a trivial lower bound)111It is equivalent to say that there exists f in O(log(Δ)) and in ω(1) such that the algorithm uses 2Δ+2log(Δ)f(Δ), and then define g(x)=2f(x).

Consider a Δ-star and assume the total amount of energy is 2W+dlog(Δ/g(Δ)). If it is possible for the scheduler to ensure that the two agents, following the paths dictated by the algorithm, never meet, then each agent must have enough energy to explore the whole star, i.e., 2Wd/2. Thus, the total amount of energy is 4Wd, which is a contradiction. This means that the two paths chosen by the algorithm for the two agents correspond to two walks, with opposite directions, on the same cycle C covering a sub-star. The scheduler can ensure that the agents meet at a leaf node. When this happens, then d|C|/2 energy has been spent, where |C| is the number of edges in C. The agents have explored a star of degree at most |C|/2. Since, before they start, they must each have enough energy to explore the entire cycle, it follows that d|C|/2W+dlog(Δ/g(Δ))/2. Before using the complexity of the algorithm recursively on the remaining star, we can ensure that the degree of the star that the agents have explored is close to the upper bound (which is in fact the best case for the agents). This can be done by activating one agent until the degree Δ of the star explored by the agent is (with 1>a0)

Δ=W+dlog(Δ/g(Δ))/2da=Δ+log(Δ/g(Δ))2aΔΔ=Δlog(Δ/g(Δ))2+a (1)

The remaining unexplored edges form a (ΔΔ)-star. The agents must first move towards this new star, which uses 2×d/2=d energy. So the total remaining energy is

R=2W+dlog(Δ/g(Δ)dΔd=W+dlog(Δ/g(Δ)2+d(a1)

Then, by using the same algorithm, this star is explored, in the worst case using

d(ΔΔ)+dlog(ΔΔg(ΔΔ))

energy. We show that there exists a Δ large enough so that the remaining energy is not enough to explore the remaining star in the worst case.

Replace ΔΔ by its computed value (thanks to Equation (1)) and we obtain that in the worst case, the energy required to explore the remaining star is at least (for Δ large enough)

d(Δlog(Δ/g(Δ))2+a)+dlog(Δlog(Δ/g(Δ))+2a2g(Δlog(Δ/g(Δ)+2a)2))
d(Δlog(Δ/g(Δ))2+a)+dlog(Δlog(Δ)2g(Δ/2))

where the a in the denominator can be removed because it is smaller than log(Δ/g(Δ)) when Δ is large enough. Hence, the previous value is equal to

=W+dlog(Δ/g(Δ))2+d(a1)dlog(Δ/g(Δ))+d+dlog(Δlog(Δ)g(Δ/2))+dlog(12)
=W+dlog(Δ/g(Δ))2+d(a1)+dlog(g(Δ)ΔΔlog(Δ)g(Δ/2))
=R+dlog(g(Δ)g(Δ/2)(1log(Δ)Δ))

To show the contradiction, it is sufficient to show that, for a value Δ large enough, the factor inside the logarithm is strictly greater than 1. Indeed, this implies that the amount of energy required in the worst case is strictly more than R, a contradiction. Assume that

g(Δ)g(Δ/2)1(1log(Δ)Δ)

for all Δ, in particular for 2i for all i0. Then,

g(2k)g(1)i=1k1(1i2i)

This is bounded as the product series converges, contradicting that g is in ω(1).

3.2 Synchronous Trees

We now present a lower bound on the total energy for exploring a weighted tree with the total weight W and a diameter d.

Theorem 2.

There exists an infinite family of trees such that the required total energy by two synchronous agents is at least 2W+d24

Proof.

In the proof, we assume trees are unweighted, that is, w(e)=1 for each edge e. The theorem for weighted trees is obtained by setting the weight of each edge to some appropriate value w so that the total cost becomes W.

Let d5 and consider the sequence m5,m6,,md such that mi=3i+12. Let Td be the following tree of diameter d:

Figure 1: Illustration of the tree Td of diameter d. mi=3i+12, so that Td has 6+92(3d81) nodes.

By convention, let T4 be the perfect binary tree of height 2 (visible in the figure as the bottom-sub-tree rooted at v4).

Assume both agents are initially located at vd. We show by induction on d that exploring Td requires a total of 2|E|+d4, where

|E|=6+i=5(mi+2)=6+92(3d81).

If d=4, then one can see that if an agent crashes at a leaf, then the required total energy is 2|E|+44. Indeed, if an agent crashes at a leaf, the energy to reach the leaf where the crashed agent is 2, which has been consumed twice (by the crashed and by the non-crashed agent). Then, all the other edges are explored twice except for the path to the last leaf (of length 2), so in total it is 2+2|E|2=|E|.

Now assume that the result is true for any d such that 4d<d, then we prove the result for d>4.

We consider two cases, depending on whether u is visited before at least one of the md nodes below vd, or if the md nodes below vd are all visited before u (or at the same time as).

If the md=𝟑d+𝟏𝟐 nodes below vd are explored before node u (or at the same time), then, if the total energy is at most 2|E|+d4, we can show that the first bottom-edge of vd has been traversed by the two agents (hence 4 times). Indeed, one agent cannot explore alone the bottom-sub-tree of vd since it requires 2md+2 energy to be visited (and come back to vd) and the other agent needs to keep 2md energy in case the first one crashes. So it requires at least 4md+2=4×(3d+12)+2=4×3d+16 but the total amount of energy available is at most 2|E|+d4=2(9(3d81)/2+6)+d4=3d+2721+d, which is less than 4×3d+16 when d0. So the exploration of the bottom-sub-tree of vd and of the edge vdvd1 costs at least 2md+4+2. The remaining tree is exactly Td1, rooted at vd1, and we know by induction that the exploration of Td1 requires 2(|E|md2)+(d1)/24. The energy consumed to explore the tree Td is at least the sum of the energy consumed to explore each sub-tree so in total, the energy consumed is at least

2(|E|md2)+(d1)/24+2md+4+2=2|E|+d/25/2

Now consider the case where u is visited first, say by r𝟏. If the agents remain together, then the path vdu is traversed 4 times. Otherwise, when the two agents split, r0 is left with EN0 energy and r1 with EN1. Consider for simplicity that split before an agent travels edge vdvd1 (if the agents travel together a path vdvd then in the end this path is traversed four times, and the remaining result holds).

Before the agents meet again, r1 is exploring a subtree T containing u with at most EN1/2 edges, and we know that EN1d2 because T contains u. Let d1 be the smallest index such that the tree below vd1 contains a leaf that is not in T. If r1 does not crash, it has to meet with r0 again, before all the leaves below vd1 are explored, so an agent has to traverse the path vdvd1 again to explore the unexplored leaves below vd1. So in the end, the path vdvd1, of length dd1, is traversed at least three times. In total, at least 2|E|+dd1 energy is consumed when the exploration is complete.

Now consider that r1 crashes at u. When r0 realizes that r1 is crashed, it can explore some edges and it then eventually reaches u (it has to do so, at least to confirm the exploration of the tree). Let d0 be the largest index such that the sub-tree below vd0 contains a leaf that is not explored by r0 before r0 reaches u. After visiting u, r0 has to visit a leaf below vd0 so the path vd0u, of length d02, is traversed at least three times. So in total, at least 2|E|2+d02 energy is consumed when the exploration is complete. So in the worst case, in total, at least Emax=max(2|E|+d04,2|E|+dd1) energy is consumed.

Assume EN0+EN12|E|+d/24 (otherwise the theorem is proved). We now prove that d0d1. Indeed, if we assume for the sake of contradiction that d0<d1, it means that, when r1 crashes while exploring a subtree that includes u, and when r0 realizes that r1 is crashed, then r0 visits all the subtrees below vi, id0, and then has to be able to visit all the subtrees below vi, id1 since r1 can be crashed in any of these nodes. If d0<d1, this means that r0 must be able to visit the entire Td tree, so EN02|E|2. Since EN1d2, we obtain EN0+EN1>2|E|+d/24, a contradiction.

Hence we have d0d1, so either d1d/2, which implies d04d/24 and Emax2|E|+d/24, or d1<d/2, which implies dd1>d/2 and Emax2|E|+d/2. Hence the Theorem is proved.

4 Crash-tolerant algorithms for two energy-sharing agents in trees

Our algorithms are presented as a set of rules. Each rule is composed of a condition (that must be true to execute the rule action) and an action (the rest of the rule, that is executed when the condition is satisfied). Each action can be:

  • A move in a prescribed direction toward a node or an agent. For example, in the line topology, “(v0) ” prescribes the agent to go left until node v0 is reached, while “(r1)” prescribes the agent to go right until agent r1 is met.

  • A sequence of actions, two consecutive actions being separated by a semicolon “;”. Sometimes, a sequence is given a name for brevity. For example, 𝐸𝑢𝑙𝑒𝑟𝑖𝑎𝑛𝐸𝑥𝑝𝑙𝑜𝑟𝑒(T) (resp. 𝑅𝑒𝑣𝑒𝑟𝑠𝑒𝐸𝑢𝑙𝑒𝑟𝑖𝑎𝑛𝐸𝑥𝑝𝑙𝑜𝑟𝑒(T)) performs a clockwise Eulerian (resp. a counter clockwise Eulerian) tour of tree T.

  • An alternation of actions, depending on a Boolean condition. For example, “if c then a1 else a2” prescribes that action a1 should be executed if condition c is satisfied, while action a2 should be executed otherwise. The condition can be related to the topology (e.g., the agent is closer to a point p1 than a point p2) or be related to a collocated agent and its past (e.g., the collocated agent is coming from a given edge). In the line, we consider only three conditions: (i) r returns true if agent r was going left, and false otherwise; (ii) r returns true if agent r was going right, and false otherwise; and (iii) p1p2 returns true if p1 is closer to the observing agent than p2, and false otherwise.

  • When agent are synchronous, a waiting instruction, that is stopped either if the other agent is met, or after a given number of time instants. For example, “wait t time units for r1 then  a1 timeout  a2” prescribes the agent to wait at most t time instants for agent r1 to meet at the current position. If the agent meets r1, then execute a1, otherwise execute a2.

Before presenting our algorithms for trees, we show two general Lemmas that hold regardless of the topology, and give necessary conditions about the initial energy of the agents. The third Lemma presents two general properties of crash-tolerant exploration algorithms on trees.

Lemma 3.

Let G=(V,E) be a connected graph to be explored by two agents r0 and r1. If the initial distance between r0 and r1 is dinit, then en0dinit and en1dinit are necessary for exploring G.

Lemma 4.

Let G=(V,E) be a connected graph to be explored by two agents r0 and r1. If the total weight of G is W, then en0+en1W is necessary for exploring G.

Lemma 5.

In any crash-tolerant exploration algorithm 𝒜 by two agents on a tree T, the following holds:

  1. 1.

    Each agent has to eventually move unless it confirms the completion of exploration.

  2. 2.

    Each agent r confirms the completion of exploration only when, for each leaf u, u is visited by r or r meets the other agent that already visited leaf u.

4.1 Asynchronous trees

We now consider the case of two asynchronous agents in trees. Let T=(V,E) be a weighted tree of n nodes, and let d be the weighted diameter of T. First, we construct a family of k connected non-empty subtrees of T named T1,T2,,Tk, where Ti=(Vi,Ei) and (Ei)1ik forms a partition of E. At the beginning, the agents meet to share energy. Then the agents repeat a procedure explore(Ti) for all i{1,,k} from 1 to k. The procedure assumes that the agents are initially at the same location (possibly on an edge), and ensure that after execution the agents are at the same location (not necessarily the same as the initial one) if i<k (when i=k the agents can terminate anywhere on completion of the exploration).

Agent r0 (resp. r1) executing explore(Ti) first moves to the closest node vi of Ti, executes 𝐸𝑢𝑙𝑒𝑟𝑖𝑎𝑛𝐸𝑥𝑝𝑙𝑜𝑟𝑒(Ti) (resp. 𝑅𝑒𝑣𝑒𝑟𝑠𝑒𝐸𝑢𝑙𝑒𝑟𝑖𝑎𝑛𝐸𝑥𝑝𝑙𝑜𝑟𝑒(Ti)), and moves back to its initial location, until it meets the other agent, and Ti is explored. If the agents meet before ending this sequence of moves and Ei is explored, then the procedure terminates. This occurs during the exploration of the Eulerian tour from vi, or when one of the agents r comes back from vi to its initial location after completing its Eulerian tour while the other has not started it (it is still moving towards vi from the location where it started executing explore(Ti)).

Since the length of the Eulerian tour is 2w(Ti) (where w(Ti) denotes the weight of Ti) and the distance to vi from their initial location is d in the worst case, each agent must have, at the beginning of the procedure, the energy of at least 2d+2w(Ti) if i<k (to terminate even when the other agent remains at the initial location), at least d+2w(Ti) if i=k. When the procedure terminates the total energy consumed during the procedure is at most 2d+2w(Ti) (because every edge traversed in the procedure is traversed exactly twice if i<k, and at most twice if i=k).

Consequently, to complete all explore(Ti), for every i, sequentially, our algorithm requires that the total remaining energy ENi at the beginning of the procedure explore(Ti) is as follows, where x is the initial distance between the agents:

  • ENk2d+4w(Tk)

  • ENimax(2d+2w(Ti)+ENi+1,4d+4w(Ti))(2ik1)

  • EN1x+max(2d+2w(T1)+EN2,4d+4w(T1)) where x is the initial weighted distance between the agents.

Moreover, the total energy consumption for exploring T is at most x+i=1..k(2d+2w(Ti))=2W+2kd+x.

We now have to construct the partition T1,T2,,Tk of T so that k should be small to reduce the number of calls to explore(), but each w(Ti) should not be too large to avoid increasing the energy required at the beginning of explore(Ti). A good partition could be to have w(Tk)=1 and w(Ti)=2w(Ti+1), which results in k=logW. In general trees, such a partition does not exist, but we can obtain a similar result using the centroid-based partition recursively.

Let T=(V,E) be a weighted tree with total weight W. The centroid of T is defined as follows. In the following, for a tree T and a node u of T, T can be regarded as a rooted tree, denoted by Tu, rooted at u. For the root u and its neighbor v, let Tvu be the subtree of Tu rooted at v.

  1. 1.

    When there exists an edge (u,v)E satisfying w(Tvu)<W/2 and w(Tuv)<W/2, the centroid of T is the point p on edge (u,v) such that w(Tvu)+w(v,p)=w(Tuv)+w(u,p)=W/2. We call p the edge centroid.

  2. 2.

    When there exists a node uV satisfying w(Tvu)+w(u,v)W/2 for each neighbor v of u, the centroid of T is node u. We call u the node centroid.

Lemma 6.

Any weighted tree T=(V,E) has a unique centroid.

We now construct a new tree T=(V,E) from T by inserting nodes onto edges when necessary to simplify the construction of the partition. Observe that exploring the edges of T is equivalent to exploring the edges of T, as exploring the two edges obtained after adding a node is equivalent to exploring the initial edge.

To construct T=(V,E) and obtain T1,T2,,Tk of subgraphs of T, we recursively use the centroid-based partition of a tree. Let T=T temporally and c be the centroid of T. If c is an edge centroid on an edge e, T is updated by inserting a node at c to partition e into two edges. We denote the inserted node as c. So now, c is the node centroid of T. Consider the subtrees Tuc for each neighbor u of c.

We can show that there exists a subset N(c)N(c) of neighbors of c such that W/3uN(c)(w(Tuc)+w(c,u))W/2. Let T1 be the connected subtree of T consisting of nodes uN(c)V(Tuc){c} and edges among them, where V(Tuc) denotes the set of nodes in Tuc. Hence T1 satisfies

W/3w(T1)W/2 (2)

Temporary tree T is further updated (if necessary) and T2 is obtained by applying the same method to the remaining tree consisting of the node set VuN(c)V(Tuc). Trees T3,T4, are obtained by recursively applying the same method until the weight of the remaining tree becomes one or smaller, where the last subtree Tk is the remaining tree. Each time the method is applied, the weight of the remaining tree is reduced by at least 2/3, which implies the method is applied at most k=log3/2W times. Thus, the initial amount of the total energy should be at least 2W+2dlog3/2W+x. Actually, we can derive the following sufficient condition on the initial amount of the energy.

ct1

: (en0x)(en1x)(en0+en12W+2dlog3/2W+x)

The following shows the actions of the agents. It is assumed that subtrees T1,T2,Tk (klog3/2W) are a priori determined by the recursive centroid-based partitions.

Step 0:

The agents meet on the shortest path between their initial locations. (This is executed only once at the beginning of the execution.) Set i=1.

Step 1:

When they meet at a point, say p (possibly on an edge), they evenly share the remaining energy.

Step 2

Agent r0 (resp. r1) performs the following sequence of moves: move to the nearest node vi of Ti; traverse Ti along a Eulerian tour of Ti in the clockwise direction (resp. the counter-clockwise direction) until the agent (i) meets the other, or (ii) completes the Eulerian tour traversal without meeting the other; move toward p until the agent meets the other in case of ii) if i<k; If i<k, set p be the meeting point, set i=i+1, and continue from Step 1.

Theorem 7.

If condition ct1 holds, then if at most one agent crashes, two asynchronous agents executing the localized algorithms prescribed above explore the entire tree.

Notice that in unweighted stars of degree Δ, hence with W=Δ, we have k=logΔ holds for the number of the subtrees T1,T2,,Tk and the closest node vi of Ti is the center node of the star graph for each i(1ik). Consequently, the sufficient condition is refined and becomes tight.

Corollary 8.

The prescribed algorithm explores the entire unweighted star of degree Δ when the following condition is satisfied:

(en0x)(en1x)(en0+en12Δ+2logΔ+x)

4.2 Synchronous trees

We now present an upper bound for synchronous tree exploration. Our proof is constructive, as we present an algorithm to solve the problem. Our strategy for exploring T is as follows. First, the two agents meet at the initial location v0 of agent r0, then they execute SyncTreeExplore(T) that orders one agent to explore all the subtrees T1,,Tk1, rooted at the children of v0, except Tk with the largest weight. When only Tk is unexplored, the agents both move towards its root and execute recursively SyncTreeExplore(Tk). If the exploring agent crashes, the other one can reach it to retrieve the remaining energy and explore the remaining edges on its own. The pseudo-code of SyncTreeExplore is given in Algorithm 1 and is illustrated by Figure 2.

Algorithm 1 SyncTreeExplore(T), executed by collocated agents.
r0 and r1 evenly share their energy ;
Let T1,,Tk be the subtrees rooted at the children of the current node ;
for i=1,,k1 do
  r0 executes 𝐸𝑢𝑙𝑒𝑟𝑖𝑎𝑛𝐸𝑥𝑝𝑙𝑜𝑟𝑒(Ti) in time 2wi;
  if r0 is crashed then
     r1 executes 𝑅𝑒𝑣𝑒𝑟𝑠𝑒𝐸𝑢𝑙𝑒𝑟𝑖𝑎𝑛𝐸𝑥𝑝𝑙𝑜𝑟𝑒(Ti) until it meets r0 and Ti is explored, takes all the energy from r0, then explores the remaining unexplored edges on its own ;
     return
  end if
 r0 and r1 share their energy ;
 
end for
Move to the root of Tk ;
if ri is crashed, i{0,1} then
  r1i takes all the energy from ri, then explores the remaining unexplored edges on its own;
  return
end if
Execute SyncTreeExplore(Tk) ;

We now give a more formal description of the algorithm. First, the two agents meet at the node v0 where agent r0 is initially located. If x is the initial distance between the two agents, r0 waits for r1 until the time x, the time r1 should take to reach v0 without crashing. If r1 does not reach v0 by the time, r0 moves toward the initial location of r1 until it meets r1. When the agents are collocated, a total of x energy is consumed. If r1 is crashed, r0 retrieves all the energy from r1 and explores the entire tree using at most 2W energy.

If both agents are in v0, then the agents execute SyncTreeExplore as follows. Consider T as a tree rooted at v0 and let Ti(1ik) be the subtree rooted at a child vi of v0, and let wi=w(Ti)+w(v0,vi) . Without loss of generality, assume that wk is the largest among all wi(1ik). Then, we explain how to explore T1,T2,,Tk1 (subtrees except for Tk) one by one, followed by the exploration of Tk in a recursive way.

To explore Ti(1ik1), the agents first evenly share energy so that each has the energy of at least 2wi, which is sufficient to solely complete the exploration of Ti and come back to v0. Agent r0 moves to the root of Ti, traverses Ti along an Eulerian tour, and then comes back to v0. While r0 explores Ti, r1 is waiting at v0. If r0 does not come back to v0 in time 2wi after leaving v0 for Ti (which implies r0 crashes during the traversal), r1 explores Ti along the same Eulerian tour of Ti but in the opposite direction until it meets r0 and Ti is completely explored. When r1 meets r0, it gets all the remaining energy from r0, comes back at v0 and explores all the remaining part Ti+1,Ti+2,,Tk by itself. The energy consumption for exploring Ti is 2wi with additionally at most d (the diameter) if r0 crashes during the exploration (but this can occur at most once). If r0 does not crash and completes the exploration of Ti, then the agents share their energy and r0 explores Ti+1 in a similar way. If agent r0 explores T1,T2,,Tk1, then the agents evenly share the remaining energy, move to the root of Tk, and explore Tk using the same algorithm SyncTreeExplore(Tk).

The remarkable point is that the edge between v0 and the root of Tk is traversed by the two agents together but is never traversed afterward. Hence each edge is traversed exactly twice if no crash occurs. If a crash occurs, each edge is traversed at most twice, except for a path of length at most d that is traversed three times. Thus, the total energy consumption for exploring T is at most 2W+d+x; x moving to v0 and 2W+d for exploring the tree.

The condition for the above method is as follows.

ct2

: (en0x)(en1x)(en0+en12W+d+x)

Figure 2: (left) Exploration of T1 while r1 is waiting at v0, then r0 and r1 move to the root of T2 to execute the same algorithm recursively. (right) If r0 crashes during the exploration of T1, r1 explore T1 using the same Eulerian path but in the opposite direction until it reaches r0, then it moves to v0 and explores T2 on its own.
Theorem 9.

If condition ct2 holds, then if at most one agent crashes, two synchronous agents executing the localized algorithms prescribed above explore the entire unweighted tree.

5 Optimal algorithms in lines

5.1 Asynchronous Lines

Let G=(V,E) be a path graph (called line thereafter) such that V={v0,v1,,vn1} and E={ei=(vi,vi+1)| 0i<n1}. We consider that vi is on the left of vi+1 and says, for example, “an agent moves left”. Let wi be the weight of edge ei. For each node vi, let 𝑑𝑖𝑠(vi) be the weighted distance from v0 to vi, that is, 𝑑𝑖𝑠(vi)=j=0..i1wj, and let be the total weight of G, that is, =𝑑𝑖𝑠(vn1). Consider that agents r0 and r1 are initially located at nodes s0 and s1 respectively. For convenience, we assign x=𝑑𝑖𝑠(s0) and y=𝑑𝑖𝑠(s1), and assume without loss of generality that xy and xy 222If x>y, one can reverse the order of the nodes on the line, exchange the positions of r0 and r1, and the condition is satisfied in the new graph.. Figure 3 illustrates these notations.

Figure 3: A line of n nodes with two agents r0 and r1 hosted by nodes s0 and s1, respectively.

Let en0 and en1 be the initial energy of agents r0 and r1 respectively. The four conditions for the rules are:

c1

: (en0x+y)(en1y)(en0+en12+x+y)

c2

: (en0x)(en12(x+y))(en0+en14(x+y))

c3

: (en0+x)(en12y)

c4

: (en0yx)(en1yx)(en0+en1min(3+yx,2x+3y))

The corresponding actions are denoted by ai, i{1,,4}.

a1

:

r0

: (v0); (vn1)

r1

:

(r0) ; if r0 then  (v0) ; (vn1) else  (vn1)
a2

:

r0

:

(r1) ; if r1 then  (vn1) ; (v0) else  (v0)
r1

: (vn1); (v0)

a3

:

r0

: (v0); (vn1);

r1

: (vn1); (v0)

a4

:

r0

:

(r1) ; if v0vn1 then  (v0) ; (vn1) else  (vn1) ; (v0)
r1

:

(r0) ; if v0vn1 then  (v0) ; (vn1) else  (vn1) ; (v0)

In the above algorithms, when two agents meet, they share energy equally. In more detail, if the energy levels when meeting are eni and enj with eni<enj, then ri takes an amount of energy (enjeni)/2 from rj. After the transfer, their energy levels are both (eni+enj)/2.

Lemma 10.

For i{1,,4}, if ci is satisfied and ai is executed, then asynchronous exploration completes if at most one agent crashes.

In the following, we show that satisfying at least one of the conditions c1,c2,c3 or c4 is necessary for two asynchronous agents to complete exploration of lines. We first state some general facts about asynchronous line exploration in the following Lemma.

Lemma 11.

Any line exploration algorithm for two asynchronous agents satisfies:

  1. 1.

    Consider the configuration that two agents meet. Suppose v0 (resp. vn1) is unvisited although vn1 (resp. v0) is already visited by either of the agents, each agent has to have enough energy to visit v0 (resp. vn1).

  2. 2.

    Consider the configuration that two agents meet and both v0 and vn1 are unvisited by either of the agents. Then each agent has to have enough energy to visit v0 and vn1 (the amount of energy required is plus the distance to the closest extremity).

Lemma 12.

If for every i{1,,4}, ci is not satisfied, then asynchronous exploration assuming at most one agent crashes is impossible.

For two agents without energy sharing, the following lemma shows the amounts of the initial energy of the agents necessary and sufficient for exploration of lines.

Lemma 13.

If r0 and r1 don’t share energy, then exploring the line assuming at most one crash is possible if and only if en0x+ and en1min{x,y}+ hold.

5.2 Synchronous Lines

In this subsection, we consider synchronous lines. We assume that two agents start execution at the same time, and it takes time d for each agent to travel distance d. A remarkable feature of synchronous lines is that an agent can detect the crash of the other when it does not show up as scheduled. This feature enables energy saving with respect to the asynchronous case. We consider four possible conditions that enable exploration:

c1

: (en0x+y)(en1y)(en0+en1max(+x+y,2+xy))

c2

: (en0x)(en12(x+y))(en0+en13xy)

c3

: (en0+x)(en12y)

c4

: (en0yx)(en1yx)(en0+en12x+y)

The corresponding actions are denoted by ai, i{1,,4} in Figure 4.

Figure 4: Actions for synchronous line exploration.

In the synchronous setting, when two agents meet, each agent can detect whether the other agent is crashed or not (the other agent is considered crashed if a timeout occurs). Upon meeting, if the other agent is not crashed (yet), the agents share energy so that both have the same amount. Otherwise, if an agent r crashes, then the other agent takes all the remaining energy from r.

As for the asynchronous line, we now prove that the four conditions are necessary and sufficient for the synchronous line in the two following Lemmas.

Lemma 14.

For i{1,,4}, if ci is satisfied and ai is executed, then synchronous exploration completes if at most one agent crashes.

Lemma 15.

If for every i{1,,4}, ci is not satisfied, then synchronous exploration assuming at most one agent crashes is impossible.

6 Conclusion

We characterized the solvability of exploration with two crash-prone energy-sharing mobile agents in the case of tree topologies, both in the synchronous and in the asynchronous settings. Obvious open questions include further closing the gap between necessary and sufficient conditions for the initial amounts of energy in the case of trees that are not reduced to a line, solving the problem with more than two agents, and considering other topologies, such as grid, tori, and general graphs.

Also, our model for energy transfer is very simple (all energy can be transferred instantaneously between two agents, at no cost). It would be interesting to study non-linear battery models (where the capacity decreases faster if more instantaneous current is drawn, and the capacity increases less if faster charge is executed) in this context.

References

  • [1] Julian Anaya, Jérémie Chalopin, Jurek Czyzowicz, Arnaud Labourel, Andrzej Pelc, and Yann Vaxès. Convergecast and broadcast by power-aware mobile agents. Algorithmica, 74(1):117–155, 2016. doi:10.1007/s00453-014-9939-8.
  • [2] Andreas Bärtschi, Evangelos Bampas, Jérémie Chalopin, Shantanu Das, Christina Karousatou, and Matús Mihalák. Near-gathering of energy-constrained mobile agents. Theor. Comput. Sci., 849:35–46, 2021. doi:10.1016/j.tcs.2020.10.008.
  • [3] Andreas Bärtschi, Jérémie Chalopin, Shantanu Das, Yann Disser, Daniel Graf, Jan Hackfeld, and Paolo Penna. Energy-efficient delivery by heterogeneous mobile agents. In Heribert Vollmer and Brigitte Vallée, editors, 34th Symposium on Theoretical Aspects of Computer Science, STACS 2017, March 8-11, 2017, Hannover, Germany, volume 66 of LIPIcs, pages 10:1–10:14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2017. doi:10.4230/LIPIcs.STACS.2017.10.
  • [4] Quentin Bramas, Toshimitsu Masuzawa, and Sébastien Tixeuil. Brief announcement: Crash-tolerant exploration by energy sharing mobile agents. In Shlomi Dolev and Baruch Schieber, editors, Stabilization, Safety, and Security of Distributed Systems – 25th International Symposium, SSS 2023, Jersey City, NJ, USA, October 2-4, 2023, Proceedings, volume 14310 of Lecture Notes in Computer Science, pages 380–384. Springer, 2023. doi:10.1007/978-3-031-44274-2_28.
  • [5] Jérémie Chalopin, Shantanu Das, Matús Mihalák, Paolo Penna, and Peter Widmayer. Data delivery by energy-constrained mobile agents. In Paola Flocchini, Jie Gao, Evangelos Kranakis, and Friedhelm Meyer auf der Heide, editors, Algorithms for Sensor Systems – 9th International Symposium on Algorithms and Experiments for Sensor Systems, Wireless Networks and Distributed Robotics, ALGOSENSORS 2013, Sophia Antipolis, France, September 5-6, 2013, Revised Selected Papers, volume 8243 of Lecture Notes in Computer Science, pages 111–122. Springer, 2013. doi:10.1007/978-3-642-45346-5_9.
  • [6] Jérémie Chalopin, Riko Jacob, Matús Mihalák, and Peter Widmayer. Data delivery by energy-constrained mobile agents on a line. In Javier Esparza, Pierre Fraigniaud, Thore Husfeldt, and Elias Koutsoupias, editors, Automata, Languages, and Programming – 41st International Colloquium, ICALP 2014, Copenhagen, Denmark, July 8-11, 2014, Proceedings, Part II, volume 8573 of Lecture Notes in Computer Science, pages 423–434. Springer, 2014. doi:10.1007/978-3-662-43951-7_36.
  • [7] Jurek Czyzowicz, Dariusz Dereniowski, Robert Ostrowski, and Wojciech Rytter. Gossiping by energy-constrained mobile agents in tree networks. Theor. Comput. Sci., 861:45–65, 2021. doi:10.1016/j.tcs.2021.02.009.
  • [8] Jurek Czyzowicz, Krzysztof Diks, Jean Moussi, and Wojciech Rytter. Communication problems for mobile agents exchanging energy. In Jukka Suomela, editor, Structural Information and Communication Complexity – 23rd International Colloquium, SIROCCO 2016, Helsinki, Finland, July 19-21, 2016, Revised Selected Papers, volume 9988 of Lecture Notes in Computer Science, pages 275–288, 2016. doi:10.1007/978-3-319-48314-6_18.
  • [9] Jurek Czyzowicz, Krzysztof Diks, Jean Moussi, and Wojciech Rytter. Energy-optimal broadcast and exploration in a tree using mobile agents. Theor. Comput. Sci., 795:362–374, 2019. doi:10.1016/j.tcs.2019.07.018.
  • [10] Jurek Czyzowicz, Stefan Dobrev, Ryan Killick, Evangelos Kranakis, Danny Krizanc, Lata Narayanan, Jaroslav Opatrny, Denis Pankratov, and Sunil M. Shende. Graph exploration by energy-sharing mobile agents. In Tomasz Jurdzinski and Stefan Schmid, editors, Structural Information and Communication Complexity – 28th International Colloquium, SIROCCO 2021, Wrocław, Poland, June 28 – July 1, 2021, Proceedings, volume 12810 of Lecture Notes in Computer Science, pages 185–203. Springer, 2021. doi:10.1007/978-3-030-79527-6_11.
  • [11] Jurek Czyzowicz, Konstantinos Georgiou, Ryan Killick, Evangelos Kranakis, Danny Krizanc, Manuel Lafond, Lata Narayanan, Jaroslav Opatrny, and Sunil M. Shende. Time-energy tradeoffs for evacuation by two robots in the wireless model. Theor. Comput. Sci., 852:61–72, 2021. doi:10.1016/j.tcs.2020.11.014.
  • [12] X. Sun, N. Kitamura, T. Izumi, and T. Masuzawa. Circulating exploration of an arbitrary graph by energy-sharing agents. In Proc. of the 2023 IEICE General Conference, pages 1–2, 2023.