# Maximal Exploration of Trees with Energy-Constrained Agents

We consider the problem of exploring an unknown tree with a team of k initially colocated mobile agents. Each agent has limited energy and cannot, as a result, traverse more than B edges. The goal is to maximize the number of nodes collectively visited by all agents during the execution. Initially, the agents have no knowledge about the structure of the tree, but they gradually discover the topology as they traverse new edges. We assume that the agents can communicate with each other at arbitrary distances. Therefore the knowledge obtained by one agent after traversing an edge is instantaneously transmitted to the other agents. We propose an algorithm that divides the tree into subtrees during the exploration process and makes a careful trade-off between breadth-first and depth-first exploration. We show that our algorithm is 3-competitive compared to an optimal solution that we could obtain if we knew the map of the tree in advance. While it is easy to see that no algorithm can be better than 2-competitive, we give a non-trivial lower bound of 2.17 on the competitive ratio of any online algorithm.

## Authors

• 1 publication
• 5 publications
• 8 publications
• 3 publications
• 2 publications
• ### Graph Exploration by Energy-Sharing Mobile Agents

We consider the problem of collective exploration of a known n-node edge...
02/25/2021 ∙ by J. Czyzowicz, et al. ∙ 0

• ### Efficient Dispersion of Mobile Agents without Global Knowledge

We consider the dispersion problem for mobile agents. Initially, k agent...
08/21/2020 ∙ by Takahiro Shintaku, et al. ∙ 0

• ### Tight bounds for undirected graph exploration with pebbles and multiple agents

We study the problem of deterministically exploring an undirected and in...
05/09/2018 ∙ by Yann Disser, et al. ∙ 0

• ### Energy Constrained Depth First Search

Depth first search is a natural algorithmic technique for constructing a...
09/28/2017 ∙ by Shantanu Das, et al. ∙ 0

• ### Online Graph Exploration on Trees, Unicyclic Graphs and Cactus Graphs

We study the problem of exploring all vertices of an undirected weighted...
04/14/2020 ∙ by Robin Fritsch, et al. ∙ 0

• ### Group Evacuation on a Line by Agents with Different Communication Abilities

We consider evacuation of a group of n ≥ 2 autonomous mobile agents (or ...
09/26/2021 ∙ by Jurek Czyzowicz, et al. ∙ 0

• ### Fast and Reliable Dispersal of Crash-Prone Agents on Graphs

We study the ability of mobile agents performing simple local computatio...
07/01/2019 ∙ by Michael Amir, et al. ∙ 0

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

The problem of exploration of an unknown graph by one or more agents is a well known problem with many applications ranging from searching the internet to physical exploration of unknown terrains using mobile sensor robots. Most results on exploration algorithms focus on minimizing the exploration time or memory requirements for the agents. For a brief survey of such results see [5].

We study the exploration problem under the very natural constraint that agents have limited energy resources and movement consumes energy. We model this constraint by bounding the number of edges that an agent can traverse by an integer  (henceforth called the energy budget of the agent). A similar restriction was considered in the piecemeal exploration problem [3], where the agent could refuel by going back to its starting location. Thus, the exploration could be performed by a single agent using a sequence of tours starting and ending at the root vertex. On the other hand, [13] and [6] studied exploration without refueling, using multiple agents with the objective of minimizing the energy budget per agent, or the number of agents needed for a fixed budget.

In this paper, we drop the requirement that the graph needs to be completely explored by the agents and instead focus on exploring the maximum number of nodes with a fixed given number of initially colocated agents with fixed energy budgets . The tree is initially unknown to the agents and its topology is gradually discovered as the agents visit new nodes. We assume that the agents can communicate globally, i.e., an updated map of the tree is transmitted instantaneously to all other agents. We measure the performance of an algorithm for this problem by the standard tool of competitive analysis, i.e., we compare a given online algorithm to an optimal offline algorithm which has a complete map of the tree in advance.

#### Our result.

The challenge in designing a good exploration algorithm for our problem is to balance between sending agents in a depth-first manner to avoid visiting the same set of vertices too often and exploring the tree in a breadth-first manner to make sure that there is no large set of vertices close to the root that was missed by the online algorithm. Our algorithm achieves this by maintaining a set of edge-disjoint subtrees of the part of the tree that is already explored and by iteratively sending an agent from the root to the subtree with the highest root. We prove that the algorithm is 3-competitive, i.e., an optimal offline algorithm which knows the tree in advance can explore at most three times as many vertices as our algorithm. We also show that the analysis is tight by giving a sequence of instances showing that the algorithm is not better than 3-competitive.

We complement this positive result by showing that no online algorithm can be better than -competitive. The proof of this general lower bound is based on an adaptive adversary that forces the online algorithm to spend a lot of energy if it completely wants to explore certain subtrees while preventing it from discovering some vertices close to the root.

#### Further related work.

Graph exploration has received much attention in the literature as it is a basic subtask for solving other more complex problems. For the problem of graph exploration by a single agent a very common optimization objective is to minimize the exploration time or equivalently the number of edges traversed. Depth First Search is a very simple exploration algorithm that requires at most steps for exploring a graph with edges. In [21], Panaite and Pelc improved this result by presenting an algorithm that requires steps for exploring a graph of nodes and edges. Graph exploration has been studied for the case of weighted graphs [19], as well as for the much harder case of directed graphs [1, 8, 15, 16]. The objective of minimizing the memory has been investigated in [2, 10, 18].

For the case of multiple agents Fraigniaud et al. in [17] showed that the problem of minimizing the exploration time of collaborating agents is NP-hard even for tree topologies. The authors also proposed an -competitive algorithm for collaborative graph exploration and gave a lower bound on the competitive ratio of . This lower bound was later improved to in [14]. The lower and upper bounds for the problem of collaborative exploration have been further investigated in [9, 11, 20].

Energy aware graph exploration was first considered by Betke et al. in [4]. The authors studied exploration of grid graphs by an agent who can return to its starting node for refueling (piecemeal exploration). The agent is given an upper bound on the number of edge traversals it can make before returning to , where is some positive constant and is the distance to the furthest node from . They presented an algorithm for exploration of grid graphs with rectangular obstacles. In [3] an algorithm for piecemeal exploration of general graphs was proposed requiring a nearly linear number of edge traversals. Finally, an optimal algorithm for piecemeal exploration of weighted graphs requiring only edge traversals was presented in [12]. In [7] the authors studied the exploration of weighted trees and showed that in this case, the decomposition of any DFS traversal of a weighted tree into a sequence of closed routes of length at most provides a constant-competitive solution with respect to the number of routes as well as the total energy consumption.

When refueling is not allowed, multiple agents may be needed to explore even graphs of restricted diameter. Dynia et al. [13] studied collaborative exploration with return for the case where the number of agents is fixed and the goal is to minimize the amount of energy required by each agent. They presented an -competitive algorithm for trees and showed a lower bound of on the competitive ratio for any deterministic algorithm. The upper bound was later improved to in [14]. The authors in [6] considered tree exploration with no return for the case where the amount of available energy to the agents is fixed and the goal is to minimize the number of agents used. They presented an algorithm with a competitive ratio of for the case that the agents need to meet in order to communicate and showed that this is best possible.

## 2 Terminology and Model

We consider a set of distinct agents initially located at the root  of an undirected, initially unknown tree . The edges at every vertex  in  have locally distinct edge labels , where is the degree of . These edge labels are referred to as the local port numbers at . We assume, without loss of generality, that the local port number of the edge leading back to the root  is  for any vertex  in . Otherwise, every agent internally swaps the labels of the edge leading back to the root and the label for every vertex .

For any vertex  in , we let be the depth of in . The induced subtree with root  containing and all vertices below in is further denoted by . For a subtree of , we write to denote the root of , i.e., the unique vertex contained in having the smallest depth in . Moreover, denotes the number of vertices in .

The tree is initially unknown to the agents, but they learn the map of the tree as they traverse new edges. Each time an agent arrives at a new vertex, it learns the local port number of the edge through which it arrived, as well as the degree of the vertex. We assume that agents can communicate at arbitrary distances, so the updated map of the tree, including all agent positions, is instantaneously available to all agents (global communication). Each agent has limited energy  and it consumes one unit of energy for every edge that it traverses.

The goal is to design an algorithm Alg that maximizes the total number of distinct vertices visited by the agents. For a given instance , where is a tree, is the starting vertex of the agents, is the number of agents, and is the energy budget of each agent, let denote the total number of distinct vertices visited by the agents using algorithm Alg on the instance . We measure the performance of an algorithm Alg by the competitive ratio , where is the maximum number of distinct vertices of that can be explored by the agents using an optimal offline algorithm Opt, i.e., an algorithm with full initial knowledge of the instance . When the considered instance  is clear from the context, we simply write instead of and instead of .

## 3 An Algorithm for Maximal Tree Exploration

Let us assume that we do a depth-first search of the whole tree and always choose the smallest label to an unexplored vertex. We call this algorithm L-DFS. We further denote the sequence of directed edges obtained by directing every undirected edge of that the agent traversed in the direction in which the agent traversed the edge in the L-DFS traversal the L-DFS sequence of . Note that every undirected edge of the tree appears as and in this sequence. Similarly, we call a depth-first search of that always chooses the largest label to an unexplored vertex an R-DFS and the corresponding sequence of directed edges an R-DFS sequence. Note that the R-DFS sequence of the edges in is obtained by reversing the order of edges of the L-DFS sequence and changing every edge to . A concrete implementation of both the algorithm L-DFS and the algorithm R-DFS is given in Appendix A.1.

We call a consecutive subsequence of an L-DFS or R-DFS sequence a substring. For an induced subtree of , the L-DFS sequence of is simply a substring of the L-DFS sequence of . For a subtree we define the leftmost unexplored vertex as the unexplored vertex in which is incident to the first edge in the L-DFS sequence of leading to an unexplored vertex and the rightmost unexplored vertex as the unexplored vertex in which is incident to the first edge in the R-DFS sequence of leading to an unexplored vertex.

We further say that an agent  performing an L-DFS covers at least  edges of the L-DFS sequence of , if consecutively visits in this order and the sequence is a substring of the L-DFS sequence of . Similarly, we say that an agent  performing an R-DFS covers at least edges of the L-DFS sequence of , if consecutively visits in this order and the sequence is a substring of the L-DFS sequence of . Note that two agents and may traverse the same edge in the same direction, but still cover two distinct sets of directed edges of the L-DFS sequence, if one agent performs an L-DFS and the other agent an R-DFS.

With these definitions, we are now ready to explain the idea of the algorithm Divide & Explore: During the run of the algorithm, we maintain a set of edge-disjoint subtrees of , initially just containing . An example is shown in Fig. 1, where the triangles show the subtrees that are currently contained in the set . In every iteration, we consider a subtree which contains an unexplored vertex and has the highest root, i.e., minimizes . As long as the leftmost unexplored vertex in is not too far away from , i.e., is sufficiently small, we send an agent to and let it continue the L-DFS from there. We do the same if is not too deep and then let the agent continue the R-DFS from . The intuition is that the energy spent to reach is unavoidable, but also the agents in the offline optimum Opt need to spend this energy without exploring new vertices after the tree has been explored up to depth . Thus, the agent only potentially wastes energy to reach (or ), but from then on explores many new vertices because an agent doing edge traversals on a DFS visits at least distinct vertices. If both and are sufficiently deep, we split into two edge-disjoint subtrees and , as shown in Fig. 1. In this case both and contain a sufficiently long part of the L-DFS sequence, which has not been covered by any agent. This is important because we want to avoid that an agent is sent to a new subtree which only needs little more exploration. A complete description of Divide & Explore is given in Algorithm 1.

In the remainder of this section, we analyze Algorithm Divide & Explore in order to show that it is -competitive. Note that the first agent in Divide & Explore simply performs a depth-first search and explores at least vertices or completely explores the tree. Consequently, if or if , the algorithm is -competitive, and thus we assume in the following that and .

For the analysis of Divide & Explore, we further need the following notation. For every iteration  of the outer while-loop, we let be the number of agents used by Divide & Explore in this iteration and be the number of agents used before the first iteration of the outer while-loop. Further, let be the set of subtrees at the end of iteration  and let be the unique subtree of that connects the set of roots of all subtrees with the minimum number of edges. Moreover, we denote the subtree with the highest root considered by Divide & Explore in iteration  by and its root by . Finally denotes the total number of iterations of the while-loop.

The crux of our analysis is to show that the amortized amount of energy spent making progress on the L-DFS or R-DFS is for the agents in iteration , as stated in the following lemma.

The algorithm Divide & Explore either completely explores or all agents used by the algorithm together cover at least

 23(|TR¯t|−1)+∑0≤i≤¯t23⋅ki⋅(B−d(ri))

distinct edges of the total L-DFS sequence of .

###### Proof.

Let us assume that Divide & Explore does not completely explore and let be the subset of containing all subtrees with an unexplored vertex. We will show by induction over that all agents used by Divide & Explore up to the end of iteration  together cover at least

 23(|TRt|−1)+∑S∈Ut23(B−d(rS))+∑0≤i≤t23⋅ki⋅(B−d(ri)) (1)

distinct edges of the total L-DFS sequence of . It may happen that in the last iteration  of Divide & Explore the third case occurs, but only one agent is left at the root. We will treat this special case separately at the end of the proof. First, we show the lower bound above for all , for which iteration  is completed, i.e., there are enough agents for Divide & Explore to finish iteration .

For , we have as Divide & Explore does not completely explore by assumption, , , and only contains . Thus the lower bound (1) on the number of edges covered by the first two agents evaluates to . The first agent used by Divide & Explore performs an L-DFS and covers exactly edges of the total L-DFS sequence of . The second agent performs an R-DFS starting at the root of and also covers exactly edges of the total L-DFS sequence of . The edges covered by the second agent are distinct from the edges covered by the first because is not completely explored by the algorithm by assumption. Hence, the lower bound (1) holds for .

Now, assume that the lower bound (1) holds for . We will show it for iteration . Let be the set of subtrees after the for-all loop in iteration  terminated and possibly some roots of the trees in were moved down. We claim that

 23(|TRt−1|−1)+∑S∈Ut−123(B−d(rS))=23(|TRt|−1)+∑S∈U′t−123(B−d(rS)). (2)

For any subtree , let be the corresponding subtree after the root of was possibly moved down. The tree contains all vertices of the tree plus the path from to , i.e., additional vertices, for all . This already implies (2).

Applying (2) on the lower bound (1) for yields that the number of edges of the total L-DFS sequence of covered by the agents up to iteration  is at least

 23(|TRt|−1)+∑S∈U′t−123(B−d(rS))+∑0≤i≤t−123⋅ki⋅(B−d(ri)). (3)

Let now be the subtree with root  considered by the algorithm in iteration  as defined above and , be defined as in the algorithm.

First, assume that we have and let be the only agent used by the algorithm in iteration . Note that if , then once it has reached , agent has either one or two energy left. In the first case, only explores and makes a progress of on the total L-DFS sequence. In the second case, makes a progress of on the total L-DFS sequence: it goes to and then either it visits a child of , or it goes back to . Consequently, if , makes a progress of at least on the total L-DFS sequence.

Suppose now that . Agent  moves to using at most energy and then performs an L-DFS. If does not completely explore , then the set of edges traversed by starting in and directed in the direction the edge is traversed by has not been covered by any other agent. Therefore makes a progress of at least edges on the total L-DFS sequence. Adding this progress of agent  to the lower bound in (3) on the number of edges covered by the agents in the first  iterations and using yields the lower bound (1) for iteration .

Next assume that completely explores the subtree . We then have and the lower bound (1) for iteration  follows directly from the lower bound (3) even if explores only and only covers two new directed edges of the total L-DFS sequence.

The proof when is completely analogous.

Finally, assume that the last case occurs in iteration  and is split into two subtrees and as defined in the algorithm. Further, let and be the agents used in iteration  for performing an R-DFS in and an L-DFS in , respectively.

We first show that and are below different children of . Note that we have and and therefore neither nor are children of . Suppose, for the sake of contradiction, there is a child of such that both and are contained in . By the definition of and , the subtrees below all other children of must be completely explored. This means only has one child leading to an unexplored vertex. We cannot have as and are not children of . But then the root would be moved down to and possible further at the beginning of iteration . This is a contradiction. Therefore, and are edge-disjoint, non-empty trees and is contained in and in .

Agent , which moves according to the call R-DFS(), moves to using energy and starts an R-DFS making a progress of at least on the overall L-DFS sequence, as the part of the L-DFS sequence from to has not been covered by any other agent and has length at least . If does not completely explore , then it makes even a progress of on the overall L-DFS sequence.

The second agent used in iteration , the agent , first moves to using energy and then performs an L-DFS according to the call L-DFS(). We have and hence makes a progress of at least edges on the overall L-DFS sequence, as the part of the sequence from to has not been covered by any other agent. If does not completely explore , then it also makes a progress of on the overall L-DFS sequence.

Let be the number of subtrees among that and do not explore completely. By the above argument, we showed that overall and together make a progress of at least edges on the overall L-DFS sequence of . Adding this progress to the lower bound (3) and using again yields the lower bound (1) for iteration .

In order to show the claim, let us consider the last iteration . If Divide & Explore can complete this iteration, then the claim follows directly from the lower bound (1) because for all as no agent can explore a vertex below depth in . Now assume that iteration  is not completed. But then we have that the number of edges of the total L-DFS sequence of covered by the agents up to iteration  is at least

 23(|TR¯t|−1)+∑S∈U′¯t−123(B−d(rS))+∑0≤i≤¯t−123⋅ki⋅(B−d(ri))

by the lower bound (3). This lower bound already implies the claim, as we have and . ∎

With the lower bound above, we can now prove the main result of this section.

The algorithm Divide & Explore is 3-competitive.

###### Proof.

Assume that the algorithm Divide & Explore terminates after iteration . If it completely explores , then it is clearly optimal. So let us assume that it runs out of agents in iteration .

Let be the sequence of agents used by Divide & Explore in this order and let agent  be used in iteration . We let be the depth of the root of the subtree visited by in iteration . As the algorithm in every iteration chooses the subtree with an unexplored vertex which minimizes , we have .

Note that every undirected edge of the tree appears exactly twice as a directed edge in the total L-DFS sequence of , as and as . Thus dividing the bound given by Lemma 3 by two yields a lower bound on the number of distinct undirected edges traversed by the agents. As is a tree, this number plus 1 is a lower bound on the number of vertices visited by the agents. Thus, using the notation instead of , we obtain

 |\textscAlg|≥13|TR|+∑1≤i≤k13⋅(B−di). (4)

Let now be the agents used by an optimal offline algorithm Opt and let be the maximum depth of a vertex in that is visited by the agent . This is well-defined as every agent at least visits the root  of . We assume without loss of generality that . As the agent  must use at least energy to reach a vertex at depth in , we have

 |\textscOpt|≤|TR|+∑1≤i≤k(B−d∗i). (5)

Consider the maximal index such that . If no such exists, holds for all . This implies and thus also by (4) and (5).

Otherwise, we have . Let be the subtree explored by the first agents used by Divide & Explore. We claim that all vertices explored by the agents are contained in . Assume, for the sake of contradiction, that there is such that agent explores a vertex which is not contained in

. At the moment when the agent

is used by Divide & Explore, the root of every subtree is contained in and it has depth at least . Let be the subtree containing . This means that the agent must also visit to reach . But is a subtree of and thus visits a vertex in of depth . This implies contradicting the initial assumption that . Consequently, the agents in Opt only visit vertices in . But then the first agents in Opt visit a strict subset of the vertices visited by the first agents in Divide & Explore. In this case, we can just replace the agents and their paths by the agents and their paths in Divide & Explore and does not decrease. By construction and by maximality of , we then have for all which again implies the claim. ∎

Note that the analysis of Divide & Explore is tight as shown in Appendix A.2.

## 4 A General Lower Bound on the Competitive Ratio

We first present an easy example showing a lower bound of 2 on the competitive ratio of any online algorithm.

###### Proposition .

There exists no -competitive online exploration algorithm with .

###### Proof.

Given positive integers  and , where is even, consider the star with center , rays of length  and rays of length . For every algorithm, the adversary can ensure that no agent that starts at ever enters a long ray: Whenever an agent is at and decides to follow an unexplored edge, the adversary directs it to a short ray. Therefore, every agent can explore at most  edges and all agents together at most  edges as is even. On the other hand, the offline optimum sends all agents in the long rays and explores  edges. ∎

Note that this lower bound only requires that is even and otherwise works for any choice of parameter and . For the lower bound of on the competitive ratio, we present a sequence of instances where and become arbitrarily large. We initially construct an instance with general parameters and at the end choose the parameters to maximize the competitive ratio that the online algorithm can achieve. The lower bound instances that we construct are trees that contain very long paths and high degree vertices at certain depth in the tree. The length of the paths is determined by the online exploration algorithm.

[] There exists no -competitive online exploration algorithm with .

For a given online algorithm Alg, we consider a set of agents for with energy each and we let . We now construct a tree , which is shown in Figure 2, depending on the behavior of the algorithm. has a root  with distinct paths, each going from to a vertex  at depth  for . Each vertex  has degree  and is the root of a subtree . There are  paths connected to every  whose length will be determined by the algorithm. Furthermore, depending on the algorithm, there may exist a vertex  at depth  that has degree  and also  paths connected to it whose length will be determined by the algorithm. We call the subtrees with root  and  adaptive subtrees as they depend on the behavior of the online exploration algorithm. We further assume that , , are even and

 d1+Δ

Each of the adaptive trees can be active, i.e., as soon as an agent visits an unexplored vertex on a path another unexplored neighbor is presented, or passive, i.e., all unexplored vertices in the adaptive tree are leaves. Moreover, every subtree has a budget , which limits the total number of non-leaf vertices that are presented to the algorithm, i.e., if vertices that are not leaves have been explored in both adaptive trees in become passive and from now on all unexplored vertices in are leaves. The budget is initially and is increased as described below when agents enter the subtree . Initially every subtree has an active adaptive subtree below . We now present new vertices to the algorithm in every subtree for according to the following rules:

1. When the first agent that has not visited any other tree before enters for the first time:

The budget of is increased by , the adaptive tree below is active and has not been discovered. The first vertex at depth discovered by is , i.e., it has degree and is the root of another adaptive tree which is active. Additionally, if explores a new vertex at depth in (below  or on any branch below ) and the remaining energy of is , then we stop presenting new vertices on the current path of , i.e., is a vertex without further unexplored neighbors.

2. When the second agent that has not visited any other tree before enters for the first time:

1. If has explored at most vertices in :
The adaptive trees both at and at become passive. In all following cases below, we assume that explored more than vertices in .

2. If has explored the vertex or still has enough energy left to reach a vertex at depth via an unexplored vertex:

If has been discovered, the adaptive tree at becomes passive, but the adaptive tree at remains active. If has not visited a vertex at depth , then the adaptive tree at becomes passive except for the path via an unexplored vertex to at depth , which can reach with its remaining energy. From now on, if any agent is at depth , then we stop presenting new vertices on the current path of as soon as the remaining energy is .

3. If has not visited a vertex at depth and has not enough energy to reach a vertex at depth via an unexplored vertex:

From now on if any agent is at depth , we stop presenting new vertices on the current path of if the remaining energy of is .

3. Whenever an agent which before has visited a tree enters for the first time with remaining energy :

The budget of is increased by . If discovers a vertex below at depth and the remaining energy of is , then we stop presenting new vertices on this path. Similarly, if discovers a vertex below at depth (but not on a branch containing ) and the remaining energy of is , then we also stop presenting new vertices on that path.

Note that in every tree , if Case 2b does not occur in , and the adaptive subtree below exist if and only if discovers a vertex at depth .

The full proof of the lower bound of on the competitive ratio is quite technical and given in Appendix B. Here we want to give some intuition by looking at two special cases and making some simplifying assumptions, which do not hold in general. The adaptive trees are constructed in a way that a path ends exactly when the agent currently exploring that path has just enough energy to return to or respectively. So let us make the simplifying assumption that the final position of every agent is either at or for some . The online algorithm has to balance between sending each agent to only one subtree  to completely explore it or to move to a second subtree later to explore more vertices which are close to the root . We will consider instances with increasing values of and in such a way that . Note that this implies that .

Let us consider the special case that the algorithm first sends one agent to each of the subtrees and then a second agent to every subtree except (there are agents and subtrees). For sake of simplification, assume that visits and Case 2b occurs in each subtree when the second agent enters . Note that in this case, cannot visit another subtree as it visits at depth and by (6). We further assume that for each subtree , , either the second agent entering helps to explore completely, or it goes to to explore new vertices.

The first agent in each subtree can explore at most vertices in if its final position is at (it traverses at most edges once and all other edges are traversed an even number of times) and less vertices if its final position is at . Note that of the vertices explored by are on the path from to and thus can only explore at most vertices in . But by construction the budget is increased by when enters so that alone cannot deplete the whole budget and completely explore .

As the subtree below becomes passive when enters , can only explore at most vertices that are not below . Therefore if and completely explore , has to go to depth and then it cannot visit any other subtree as by (6). In this case, agents and together then explore at most vertices in plus at most leaves and the path of length leading to , i.e., they explore at most vertices.

Suppose now that and do not completely explore the subtree and that goes to to explore new vertices after having visited . Assume that has energy left when it enters , and note that since went first to before entering . Agent can explore at most new vertices in if its final position is in (every edge it traverses in is traversed an even number of times) and less vertices if its final position is in (since the vertices on the branch from to have already been explored). Note that when enters , the budget of is increased by and thus the budget of is never depleted. As has energy left when it enters and spends energy to first reach and then , it can have explored at most vertices in because traverses every edge in an even number of times. Overall, thus explores at most new vertices and at most vertices in this case.

Recall that for sake of simplification, we consider only two strategies for the online algorithm Alg: either in every tree , , and completely explore , or for every tree , , the second agent entering also visits (and is not completely explored by the algorithm). In the first case, the algorithm explores at most vertices. In the second case, the algorithm explores at most vertices.

Let us now consider an optimal offline algorithm Opt. Whatever the strategy of Alg is, one can show that there is always an unexplored vertex at depth at most in . We can assume that has degree and there are distinct paths of length connected to it.

If Alg completely explores every tree , , then Opt can send all agents to and then each agent explores one of the paths below . In this case, Opt explores at least vertices.

If Alg does not completely explore any , , then there exists an unexplored vertex in each tree , , and we can assume that there is a path of length connected to it. In this case, Opt can send an agent to each , that can then explore the path below . Then, Opt can send the remaining agents to as in the previous case, and each of these agent explores one of the paths below . In this case, Opt explores at least vertices.

Since the algorithm can choose the best strategy among the two, we get

 |\textscOpt||\textscAlg|≥min{4l⋅(B−d