Consider a scenario in which a team of searchers should propose a search strategy, i.e., a sequence of their moves, that results in capturing a fast and invisible fugitive hiding in a graph. This strategy should succeed regardless of the actions of the fugitive and the fugitive is considered captured when at some point it shares the same location with a searcher. In a strategy, the searchers may perform the following moves: a searcher may be placed/removed on/from a vertex of the graph, and a searcher may slide along an edge from currently occupied vertex to its neighbor. The fugitive may represent an entity that does not want to be captured but may as well be an entity that wants to be found but is constantly moving and the searchers cannot make any assumptions on its behavior. There are numerous models of graph searching that have been introduced and studied and these models can be produced by enforcing some properties of the fugitive (e.g., visibility, speed, randomness of its movements), properties of the searchers (e.g., speed, type of knowledge provided as an input or during the search, restricted movements, radius of capture), types of graphs (e.g., simple, directed) or by considering different optimization criteria (e.g., number of searchers, search cost, search time).
One of the central concepts in graph searching theory is monotonicity
. Informally speaking, if a search strategy has the property that once a searcher traversed an edge (and by this action it has been verified that in this very moment the fugitive is not present on this edge) it is guaranteed (by the future actions of the searchers) that the edge remains inaccessible to the fugitive, then we say that the search strategy ismonotone. In most graph searching models, including the edge search recalled above, it is not beneficial to consider search strategies that are not monotone. Such a property is crucial for two main reasons: firstly, knowing that monotone strategies include optimal ones reduces the algorithmic search space when finding good strategies and secondly, monotonicity places the problem in the class NP.
To the best of our knowledge, all searching problems studied to date are considering the searchers to have the same characteristics. More precisely, the searchers may have different ‘identities’ which allows them to differentiate their actions but their properties like speed, radius of capture or interactions with the fugitive are identical. However, there exist pursuit-evasion games in which some additional device (like a sensor or a trap) is used by the searchers [7, 8, 9, 36]. In this work we introduce a searching problem in which searchers are different: each searcher has access only to some part of the graph. More precisely, there are several types of searchers, and for each edge in the graph, only one type of searchers can slide along . We motivate this type of search twofold. First, referring to some applications of graph searching problems in the field of robotics, one can imagine scenarios in which the robots that should physically move around the environment to execute a search strategy may not be all the same. Thus some robots, for various reasons, may not have access to the entire search space. Our second motivation is an attempt to understand the concept of monotonicity in graph searching. In general, the graph searching theory lacks of tools for analyzing search strategies that are not monotone, where a famous example is the question whether the connected search problem belongs to NP . (In a connected search we require that at each point of the strategy the subgraph that is guaranteed not to contain the fugitive is connected; for a formal definition see Section 2.1.) In the latter, the simplest examples that show that recontamination may be beneficial for some graphs are quite complicated . The variant of searching that we introduce has an interesting property: it is possible to construct relatively simple examples of graphs in which multiple recontaminations are required to search the graph with the minimum number of searchers. Moreover, it is interesting that this property holds even for trees.
1.1 Related work
In this work we adopt two models of graph searching to our purposes. Those models are the classical edge search [33, 34], which is historically the first model studied, and its connected variant introduced in . As an optimization criterion we consider minimization of the number of searchers a strategy uses.
The edge search problem is known to be monotone [5, 28] but the connected search is not . See also  for a more unified approach for proving monotonicity for particular graph searching problems. Knowing that the connected search is not monotone, a natural question is what is the ‘price of monotonicity’, i.e., what is the ratio of the minimum number of searchers required in a monotone strategy and an arbitrary (possibly non-monotone) one? It follows that this ratio is a constant that tends to . We remark that if the searchers do not know the graph in advance and need to learn its structure during execution of their search strategy then this ratio is even for trees . An example of recently introduced model of exclusive graph searching shows that internal edge search with additional restriction that at most one searcher can occupy a vertex behaves very differently than edge search. Namely, considerably more searchers are required for trees and exclusive graph searching is not monotone even in trees [6, 30]. Few other searching problems are known not to be monotone and we only provide references for further readings [12, 23, 38]. Also see  for a searching problem for which determining whether monotonicity holds turns out to be a challenging open problem.
Since we focus on trees in this work, we briefly survey a few known results for this class of graphs. An edge search strategy that minimizes the number of searchers can be computed in linear time for trees . Connected search is monotone and can be computed efficiently for trees  as well. However, if one considers weighted trees (the weight of a vertex or edge indicate how many searchers are required to clean or prevent recontamination), then the problem turns out to be strongly NP-complete, both for edge search  and connected search . On the other hand, due to [14, 15] both of these weighted problems have constant factor approximations. The class of trees usually turns out to be a very natural subclass to study for many graph searching problems — for some recent algorithmic and complexity examples see e.g. [1, 16, 18, 24]. See also  for an approximation algorithm for general graphs that performs by adopting optimal search strategies computed for spanning trees of the input graph.
We conclude by pointing to few works that use heterogeneous agents for solving different computational tasks, mostly in the area of mobile agent computing. These include modeling traffic flow , meeting  or rendezvous [17, 19, 20]. We also note that heterogeneity can be introduced by providing weights to mobile agents, where the meaning of the weight is specific to a particular problem to be solved [4, 10, 27], while in  authors consider patrolling by robots with distinct speeds and visibility ranges.
1.2 Our work — a short outline
We focus on studying monotonicity and computational complexity of our heterogeneous graph searching problem that we formally define in Section 2.1. We start by proving that the problem is not monotone in the class of trees (Section 3). Then in Section 4 we show that, also in trees, monotone search with heterogeneous searchers is NP-complete. In Section 5 we prove that the general, non-monotone, searching problem is NP-hard for trees.
Our investigations suggest that the essence of the problem difficulty is hidden in the properties of the availability areas of the searchers. For example, the problem becomes hard for trees if such areas are allowed to be disconnected. To formally argue that this is the case we give, in Section 6, a polynomial-time algorithm that finds an optimal search strategy for heterogeneous searchers in case when each color class induces a connected subtree. This result holds also for the connected version of the heterogeneous graph search problem.
In this work we consider simple edge-labeled graphs , i.e., without loops or multiple edges, where is a function that assigns labels, called colors, to the edges of . Then, if , , then we also say that vertices and have color . Note that vertices may have multiple colors, so by we will refer to the set of colors of a vertex .
2.1 Problem formulation
We will start by recalling the classical edge search problem  and then we will formally introduce our adaptation of this problem to the case of heterogeneous searchers.
An (edge) search strategy for a simple graph is a sequence of moves . Each move is one of the following actions:
placing a searcher on a vertex,
removing a searcher from a vertex,
sliding a searcher present on a vertex along an edge of , which results in a searcher ending up on .
We often write for brevity ‘move ’ in place of ‘move ’.
Furthermore, we recursively define for each a set such that , , is the set of edges that are clean after the move and is the set of edges that are clean prior to the first move of . Initially, we set . For we compute in two steps. In the first step, let for moves 1 and 2, and let for a move 3. In the second step compute to consists of all edges in such that there exists a path in such that no vertex of is occupied by a searcher at the end of move , one endpoint of belongs to and the other endpoint of belong to an edge not in .111We point out that another way of computing the set is possible. Namely, start again with the same set . Then, check if the following condition holds: there exists an edge in that is adjacent to an edge not in and their common vertex is not occupied by a searcher. In such case, remove from . Keep repeating such an edge removal from until there is no such edge . Then, set and . We stress out that it is enough that only one such path exists, and in particular, if a contaminated edge is adjacent to a clean edge , then becomes contaminated when their common vertex is not occupied by a searcher. In such case, consists of the vertex only. Then, set . If , then we say that the edges in become recontaminated (or that recontamination occurs in if it is not important which edges are involved). If is the number of times the edge becomes recontaminated during a search strategy, then the value is referred to as the number of unit recontaminations. Finally, we define to be the set of edges that are contaminated at the end of move , , where again refers to the state prior to the first move. Note that . We require from a search strategy that .
Denote by the vertices occupied by searchers at the end of move . We write to denote the number of searchers used by understood as the minimum number such that at most searchers are present on the graph in each move. Then, the search number of is
If the graph induced by edges in is connected for each , then we say that is connected. We then recall the connected search number of :
We now adopt the above classical graph searching definitions to the searching problem we study in this work. For an edge-labeled graph , a search strategy assigns to each of the searchers used by a search strategy a color: the color of searcher is denoted by . This is done prior to any move, and the assignment remains fixed for the rest of the strategy. Then again, a search strategy is a sequence of moves with the following constraints: in move 1 that places a searcher on a vertex it holds ; move 2 has no additional constraints; in move 3 that uses a searcher for sliding along an edge it holds . Note that, in other words, the above constraints enforce the strategy to obey the requirement that at any given time a searcher may be present on a vertex of the same color and a searcher may only slide along an edge of the same color. To stress out that a search strategy uses searchers with color assignment , we refer to as a search -strategy. We write to refer to the number of searchers with color in a search strategy .
Then we introduce the corresponding graph parameters and called the heterogeneous search number and heterogeneous connected search number of , where (respectively ) is the minimum integer such that there exists a (connected) search -strategy for that uses searchers.
Whenever we write or for an edge-labeled graph we refer to and , respectively, where is isomorphic to .
We say that a search strategy is monotone if no recontamination occurs in . Analogously, for the search numbers given above, we define monotone, connected monotone, heterogeneous monotone and connected heterogeneous monotone search numbers denoted by , , and , respectively, to be the minimum number of searchers required by an appropriate monotone search strategy.
The decision versions of the combinatorial problems we study in this work are as follows:
- Heterogeneous Graph Searching Problem
Given an edge-labeled graph and an integer , does it hold ?
- Heterogeneous Connected Graph Searching Problem
Given an edge-labeled graph and an integer , does it hold ?
In the optimization versions of both problems an edge-labeled graph is given as an input and the goal is to find the minimum integer , a labeling of searchers and a (connected) search -strategy for .
|edge search||arbitrary graphs [33, 34, 32, 31]||P for trees , NPC for weighted trees , NPC for arbitrary graphs |
|connected edge search||trees [2, 3]||arbitrary graphs ||P for trees , NPC for weighted trees , NPH for arbitrary graphs |
|HGS||trees [Theorem 1]||NPH for trees [Theorem 4]|
2.2 Additional notation and remarks
For some nodes in we have , such connecting nodes we will call junctions. Thus a node is a junction if there exist two edges with different colors incident to .
We define an area in to be a maximal subgraph of such that for every two edges of , there exists a path in connecting an endpoint of with and endpoint of such that contains no junctions. We further extend our notation to denote by the color of all edges in area . Note that two areas of the same color may share a junction. Let denote all areas of . Two areas are said to be adjacent if they include the same junction.
If is a tree and is a junction that belongs to some area in , then is a leaf (its degree is one) in . ∎
If is a tree, then any two different areas in have at most one common node which is a junction. ∎
Given a tree and any area in , any search -strategy for uses at least searchers of color .
If there are less than searchers of color , then the area can not be cleaned, as searchers of other colors can only be placed on leafs of . ∎
We now use the above lemma to obtain a lower bound for the heterogeneous search number of a graph . Define
Using Lemma 2.1 for each area we obtain the following:
For each tree it holds . ∎
3 Lack of monotonicity
Restricting available strategies to monotone ones can lead to increase of heterogeneous search number, even in case of trees. We express this statement in form of the following main theorem of this section:
There exists a tree T such that .
In order to prove this theorem we provide an example of a tree , where is an integer, which cannot be cleaned with searchers using a monotone search strategy, but there exists a non-monotone strategy, provided below, which achieves this goal. Our construction is shown in Figure 1.
We first define three building blocks needed to obtain , namely subtrees , and . We use three colors, i.e., . The construction of the tree , starts with a root vertex , which has 3 further children connected by edges of color . Each child of has 3 children connected by edges of color .
For the tree , take vertices that form a path with edges , . We set . We attach one pendant edge with color and one with color to each vertex . Next, we take a path with four edges in which two internal edges are of color 2 and two remaining edges are of color 3. To finish the construction of , identify the middle vertex of , incident to the two edges of color 2, with the vertex of the previously constructed subgraph.
We link two copies of , , by identifying two endpoints of the path with the roots and of and , respectively, obtaining the final tree shown in Fig. 1.
Now, we are going to analyze a potential monotone search -strategy using searchers. Thus, by Lemma 2.1, uses one searcher of each color. We define a notion of a step for to refer to some particular moves of this strategy. We distinguish the following steps that will be used in the lemmas below:
step , equals the minimum index such that at the end of move all searchers are placed on the vertices of (informally, this is the first move in which all searchers are present in );
step , is the maximum index such that at the end of move all searchers are placed on the vertices of (informally, this is the last move in which all searchers are present in );
steps are, respectively, the minimum and maximum indices such that at the end of move all searchers are placed on the vertices in
We skip a simple proof that all above steps are well defined, i.e., for any search strategy using searchers for each of the steps , , must occur (for trees and this immediately follows from for ).
For each monotone -search strategy for it holds: or .
Intuitively, we prove the lemma using the following argument: in the process of cleaning , , all three searchers are required for some steps, and therefore a monotone strategy could not have partially cleaned or prior to this point.
The arguments used to prove this lemma do not use colors, so atomic statements about search strategies for subgraphs can be analyzed using simple and well known results for edge search model. Furthermore, due to the symmetry of , it is enough to analyze only the case when . Note that , follows directly from the definition. The vertices , , have to be guarded at some point between move and move because . Because each step , , uses all searchers, it cannot be performed if a searcher preventing recontamination is required to stay outside of subtree related to the respective step. The subtrees and contain no common vertices, so implies , as stated in the lemma.
Suppose for a contradiction that for each . In move , since neither of moves has occurred, both subtrees contain contaminated edges. Moreover, some of the contaminated edges are incident to vertices . Thus, any edge of that is clean becomes recontaminated in the step . Therefore, as required.
Now we prove that . Suppose for a contradiction that . Consider the move of index . By , contains clean edges. By , is incident to contaminated edges in . Thus, there is a searcher outside of which prevents recontamination of clean edges in . Contradiction with the definition of .
In move there are no spare searchers left to guard any contaminated area outside which bypasses and could threaten recontamination of , so all edges, including the ones in , between those two trees should have been clean already. Therefore step has to have already occurred, which allows us to conclude . ∎
Due to the symmetry of , we consider further only the case .
During each move of index there is a searcher on a vertex of .
By , is incident to some clean edges of . By , is incident to some contaminated edges from . Hence there has to be a searcher on , or a vertex of the path between them to prevent recontamination. ∎
Let , be the index of a move such that one of the edges incident to is clean, one of the edges incident to is being cleaned and and all other edges incident to are contaminated.
Notice that , and therefore an arbitrary search strategy using two searchers to clean a subtree without colors that is isomorphic to follows one of these patterns: either the first searcher is placed, in some move of , on and throughout the search strategy it moves from to or the first searcher starts at and moves from to while proceeds. If for each the edge becomes clean prior to the edge — we say that such cleans from to and if the edge becomes clean after — we say that such cleans from to .
Each move of index , is well defined. Either or .
Consider a move of index which belongs to in a search strategy . By Lemma 3.1 and Lemma 3.2, a searcher is present on a vertex of in the move of index . Hence, only two searchers can be in in the move , so cleans from to or cleans from to . Note that during an execution of such a strategy there occur moves which satisfy the definition of , and therefore there exists well defined . When cleans from to , then is satisfied and when cleans from to , then is satisfied. ∎
There exists no monotone search -strategy that uses searchers to clean when .
We use the following intuition in the proof: whenever a search strategy tries to clean the path composed of the vertices , together with the corresponding incident edges, then it periodically needs searchers of all three colors on this path. While doing this, different vertices of the path need to be guarded. More precisely, when the search moves along the former path, it needs to move along as well. Due to the fact that is large enough, the path is not long enough to avoid recontamination.
The vertex , is incident to edges of colors and , and therefore each move uses both searchers of colors and . By Lemma 3.2, the third searcher, which is of color , stays on .
Consider a sequence . Note that it implies that is cleaned from to . Let us show that it is impossible to place a searcher on the vertices of such that no recontamination occurs in each .
Consider the move of index , where searchers of colors 1 and 3 are in and 2 is on . Before move an edge incident to is clean (by definition of ). No edge incident to is clean and, by Lemma 3.1, has a clean edge, . In order to prevent recontamination of , the searcher is present on , particularly on a vertex of the path from to . It cannot be the vertex , because , so the edge of color 3 incident to is clean, and the searcher is on one of the remaining two vertices. Consider the move of index , in which the searcher of color is on a vertex of . The vertex between and cannot be occupied, due to its colors, and occupying would cause recontamination — only the vertex is available, . Consider the move of index . The vertex cannot be occupied, due to its colors. The edge cannot be clean before is clean, because is cleaned from to . Therefore, the searcher on cannot be moved towards . Monotone strategy fails.
The argument is analogical for a sequence . By Lemma 3.3, is cleaned either from to or the other way, which implies that considering the two above cases completes the proof. ∎
There exists a non-monotone -strategy that cleans using three searchers for each .
The strategy we describe will use one searcher for each of the three colors. The strategy first cleans the subtree (we skip an easy description how this can be done) and finishes by cleaning the path connecting with . Denote the vertex on the path from to as .
Now we describe how the strategy cleans from to . For each , the vertex is incident to edges of colors and therefore each move uses both searchers of colors and . By Lemma 3.2, the third searcher which is of color , stays on . Informally, while progressing along , the strategy makes recontaminations within the path .
We will define , , as a sequence of consecutive moves which clean edges of colors in in and contains the move of index . Similarly, we introduce , , as a minimal sequence of consecutive moves, such that there is a searcher on some vertex of in the first move of and the searcher of color is present on in the last move of . Let be the occupied vertex of after the last move of -th in . Additionally let . Clean by iterating for each (in this order) the following: , followed by , where .
Because determining moves in is straightforward, as they correspond to those in monotone -strategy when , we focus on describing for each . consists of a sliding move from to and a move which places the searcher of color on . consists of a sliding move from to , which causes recontamination, and a move which places the searcher of color on . does not contain any sliding moves and places the searcher of color on . Because and is identical to , thus we can describe a strategy which cleans for any given .
When is clean, the vertex is connected to a clean edge and the remaining edges of path can be searched without further recontaminations. The strategy cleans subtree in the same way as a monotone one.
Note that the proposed strategy requires new recontamination whenever a sequence of of length 3 repeats itself. Thus, this -strategy cleaning has unit recontaminations. Note that the size of the tree is . ∎
There exist trees such that each search -strategy that uses the minimum number of searchers has unit recontaminations.
As a proof we use a tree obtained through a modification of the tree . In order to construct , we replace each edge on the path with a path containing vertices, where each edge between them is in the same color as the replaced edge in . Clearly . Note that we can adjust the number of vertices in and of independently of each other. While the total number of vertices is , we take , in .
In order to clean , we employ the strategy provided in theorem 3.5 adjusted in such a way, that any sliding moves performed on edges of are replaced by sliding moves on the corresponding paths of . As shown previously, the number of times an edge of in , or path in , which contains elements, has to be recontaminated depends linearly on size of . In the later case the -strategy cleaning has unit recontaminations . ∎
4 NP-hardness for trees
We show that the decision problem HGS is NP-complete for trees if we restrict available strategies to monotone ones. Formally, we prove that the following problem is NP-complete:
- Monotone Heterogeneous Graph Searching Problem
Given an edge-labeled graph and an integer , does it hold ?
Thus, the rest of this section is devoted to a proof of the following theorem.
The problem MHGS is NP-complete in the class of trees.
In order to prove the theorem, we conduct a polynomial-time reduction from Boolean Satisfiability Problem where each clause is limited to at most three literals (). The input to consists of variables and a Boolean formula , with each clause of the form , where the literal is a variable or its negation, , . The answer to decision problem is YES if and only if there exist an assignment of Boolean values to the variables such that the formula is satisfied.
Given an input to , we construct a tree which can be searched monotonously by the specified number of searchers if and only if the answer to is YES. We start by introducing the colors and, informally speaking, we associate them with respective parts of the input:
color , , represents the variable ,
color (respectively ), , is used to express the fact that to may be assigned the Boolean value false (true, respectively),
color , , is associated with the clause .
We will also use an additional color to which we refer as R.
We denote the set of all above colors by . Note that . In our reduction we set to be the number of searchers.
The construction of the tree starts with a path of color R consisting of vertices . We add 2 pendant edges of color R to both and . Define a subgraph (see Figure 2(a)) for each color : take a star of color R with three edges, attach an edge of color to a leaf of the star and then attach an edge of color R to , so that the degree of each endpoint of is two.
For each take a subgraph and join it with in such a way that the endpoint of of degree one in is identified with a different vertex in , . For each take two copies of and identify each endpoint of of degree one in with a different vertex in , which has no endpoint of attached to it yet. The above attachments of the subgraphs are performed in such a way that the degree of is three for each (see Figure 3). We note that, except for the requirement that no two subgraphs are attached to the same , there is no restriction as to which is attached to which . The star of color R in the subgraph attached to the vertex is denoted by .
For each color in we define a subtree (see Figure 2(b)). We start with a root having a single child and an edge of color R between them. Then we add an edge of color to this child, where is selected so that it matches which is either or . The leaf of has three further children attached by edges of color . We finish by attaching 2 edges of color R to each of the three previous children. For each color construct a subtree (see Figure 2(c)) in the same shape but colored in a different way. The edges of color different than R in the construction of are replaced by edges of color . We draw attention to the fact that contains an area of color that is a star with four edges. We attach to the path five copies of subtree for each and five copies of for each by unifying their roots with the vertex of (see Figure 3).
We attach five further copies of for each by unifying their roots with the vertex of .
For each variable we construct two subtrees, and , in the following fashion (see Figure 4(a)): take a star of color R with three edges and attach an endpoint of a path with four edges to a leaf in this star of color R; the consecutive colors of the path, starting from the endpoint at the star of color R are: , R, , R in and , R, , R in . For each subtree and , attach the endpoint of its path of degree one to .
The star of color R in attached to is denoted by and the one in by .
For each clause we attach three subtrees , to the vertex , where , one for each literal (see Figure 4(b)). Note that the maximal value of is . We construct by taking an edge of color R and adding three edges to its endpoint: two of color , and one either of color if or of color if . Add two children by the edge of color R to each of these three edges. Then attach the endpoint of degree one of the edge in to . We attach a single edge of color R to . The tree obtained through this construction will be denoted by .
The area of color R which contains the path is denoted by . Notice that all areas of color R have search number two, . For a search strategy for , we denote the index of the first move in which all searchers of color R are in the area as step and the index of the last such move as step , . Let and be the two sets which cover all indices of areas . Note that by definition and , and the path from to contains no vertex . Similarly, the path from to contains no vertex . Informally, we divide the indices in into two sets: to the left of and to the right.
Lemma 4.1 (Color assignment).
A search -strategy using searchers has to color them in the following fashion: one searcher for each color in and two searchers for each color in .
We first compute the lower bound . By Lemma 2.1, at least searchers take colors , and . Recall that contains as a subgraph an area of color that is a star with three edges and hence . Since there are such subtrees , searchers receive colors . The last two searchers have to be of color R in order to clean areas . Thus, we have shown that and this lower bound is met by the assignment of colors to searchers, as indicated in the lemma. Using Lemma 2.2 we complete the proof. ∎
Let and a Boolean formula be an input to . If the answer to is YES, then there exists a search -strategy using searchers for .
We first note the main point as to how a Boolean assignment provides the corresponding search strategy. Whether a variable is true or false, this dictates which searcher, either of color or , is placed in the corresponding variable component. The vertices occupied by these searchers form a separator that disconnects from areas , . The strategy cleans first the latter areas that are protected from recontamination. As a result, all , , become clean. Then, is cleaned with the clause components along the way: here the fact that the initial Boolean assignment was satisfied ensures that searchers of appropriate colors are available to clean the subsequent clause components.
Suppose that a Boolean assignment to the variables satisfies . The strategy is described as a sequence of instructions.
We start by placing a searcher of color dictated by the Boolean assignment in each variable component. For each (respectively ), place a searcher of color (respectively ) on the vertex that is incident to the edge of color and does not belong to if is false (respectively true).
Then, clean (respectively ) and then the edges in (respectively ) that connect this star of color R to the vertex guarded by the searcher of color (respectively ). Note that this cleaning uses two searchers of color R and the searcher of color . Then, place the searcher of color on the vertex that belongs to the edge of color in (respectively ) and area (respectively ). Clean (respectively ).
By repeating the above for each index , we in particular obtain that all areas , are clean. Note that if (respectively ), then the searcher of color (respectively ) stays in (respectively ) and the searcher of color (respectively ) is available. Let denote the colors of available searchers among those in colors and .
Then we start cleaning from the vertex and move towards . Clean copies of attached to . Consider each approached vertex , and its three subtrees separately. We denote the color different than R and in as . Because is satisfied, at least one of the literals in each clause is true and for each there always exists such that matches the color of the searcher not assigned to neither nor , i.e., . Clean each such by using searchers of color , R and . Hence, at this point each for which the literal is satisfied in is clean. Place the two searchers of color in each remaining contaminated on vertex belonging to . Because at least one subtree is clean for each , two searchers of color are sufficient. Then, continue cleaning towards the next .
We now describe the moves of the search strategy performed once a vertex , , is reached while cleaning .
Clean all remaining contaminated edges of and rooted in . Remove the searchers of colors when they are no longer necessary.
Once has been reached, clean all remaining contaminated subtrees (it follows directly from previous steps that searchers of appropriate colors are available) and perform moves as in colorless strategy with the addition of necessary switching of searchers on vertices with multiple colors. Repeat this strategy for each , and