The Berlin Safe House Puzzle: Spycraft via Interval Graphs
Abstract
We propose a gamified application of the Identifying Code problem on Interval Graphs, framed as a high-stakes Cold War counter-intelligence operation. We present a polynomial-time algorithm to assign “Listening Devices” (bugs) to “Safe Houses” (intervals) so that every safe house is uniquely identifiable by its bug signature. While the problem is NP-hard on several graph classes, including chordal and bipartite graphs, the interval-graph structure allows us to compute a 2-approximate solution efficiently.
Keywords and phrases:
Interval Graphs, Watching-System, Approximate AlgorithmsCopyright and License:
2012 ACM Subject Classification:
Theory of computation Problems, reductions and completeness ; Theory of computation Approximation algorithms analysisFunding:
This work was partially supported by project SERICS (PE00000014) under the MUR National Recovery and Resilience Plan funded by the European Union – NextGenerationEU.Editor:
John IaconoSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction: The Mission
Welcome, Agent X. The year is 196X. You are a spy handler operating in the shadowed streets of Cold War Berlin.
Your network consists of Safe Houses. Due to rigorous security protocols, each safe house is active only during a specific time window. However, a vulnerability exists: Two safe houses are connected if their active times overlap, meaning that agents can move between them without being exposed. Your mission is to secure the network against leaks. To do this, you must plant Listening Devices (Bugs) within the safe houses. These devices are sophisticated; a bug placed in one house can be tuned to listen to any chosen subset of the overlapping (connected) houses.
The Constraint
To succeed, your deployment must satisfy a critical Unique Identification directive: generate a unique “bug signature” – the specific set of bugs that can hear it. If a message is intercepted, you must be able to identify exactly which safe house it came from. If two houses share the same signature, the network is compromised.
The Strategy
The problem challenges us to find the minimum number of bugs required to make the entire network identifiable.
In the following, we declassify the mathematical dossier for this operation. We map the “Safe Houses” to intervals on a real line and the “Spy Network” to an Interval Graph. We then present an algorithm that utilizes a “Timeline Strategy” (Interval Ordering) and a “Suspicion Shuffle” mechanism to secure the network.
2 The Network Architecture
We formalize our spy network using the language of Interval Graphs and establish the following correspondence between our problem and mathematical structures. This correspondence allows us to transfer algorithmic tools, complexity results, and structural properties from the general theory of Watching Systems to the specialized interval-graph surveillance setting developed in this work. The used definitions and the notation are given in sections 2.1-2.3.
| Spycraft Term | Symbol | Mathematical Concept |
|---|---|---|
| Safe House | Interval | |
| Connection (Overlap) | Adjacency / Intersection | |
| Timeline Order | Interval Ordering | |
| Listening Device (Bug) | Watcher | |
| Bug Signature | Code | |
| Surveillance System | Watching System |
2.1 Interval graphs
An interval graph is a graph in which each vertex is associated with an interval on the real line (representing the active time window of a safe house) such that two vertices are adjacent if and only if their associated intervals have a nonempty intersection (i.e., two safe houses are connected if and only if their active times overlap).
From now on, each safe house will be identified with the time interval corresponding to its activation window. Let be a set of intervals on the time line representing our network of safe houses. We now introduce a timeline ordering relation on . For any interval , we denote its leftmost (minimum) and rightmost (maximum) points – corresponding to the start and end times of the safe house activity – by
Definition 1 (Timeline Ordering).
For all ,
| (1) |
If is ordered so that then is called the -th safe house.
2.2 Bug Signatures and Surveillance Systems
According to (1), we define an ordering on the bugs. Bugs located in different safe houses follow the order of their intervals, whereas bugs in the same house may appear in any order.
Let be a set of listening devices on . For bugs located in intervals and , respectively, we set
| (2) |
In what follows, every set of bugs is assumed to be ordered according to (2), with ties broken arbitrarily.
Given a safe house and a listening device (bug) located in safe house , we say that
-
is in the range of (equivalently is able to listen to ) if (the houses’s operation times overlap);
-
is monitored by (equivalently monitors ) if the bug is tuned to listen to .
We denote by the set of safe houses monitored by the bug ,
Given a set of listening devices on , together with the associate monitored set of houses ( with ), a bug signature (or code) of a safe house is
Definition 2 (Surveillance System (SS)).
A set of listening devices , located in is a Surveillance System for if one can determine the monitored sets for , so that there exists signatures , for such that
| (3) |
We can now formally state agent X’s problem.
Surveillance System (SS)
Input: A set of intervals (safe houses) .
Question: Find a minimum size Surveillance System for .
2.3 From Field Intelligence to Graph Theory
Before proceeding to the algorithmic dossier, we highlight the exact correspondence between our spycraft terminology and its graph-theoretic counterpart.
The Underlying Watching-System Framework
Watching systems have been introduced in [1] as a more flexible framework with respect to identifying codes. An Identifying Code (IC) of a graph is a subset such that sets are nonempty and distinct, where denotes the closed neighborhood of the vertex (the set containing and all its neighbours)[15]. The goal is to minimize the size of . For a comprehensive treatment of combinatorial and algorithmic aspects of identifying codes, see also [9].
In a watching system, if a watcher is placed at a vertex , a subset of neighbor vertices (watching zone) can be selected instead of the whole closed neighborhood of . It is also possible to place several watchers at the same vertex, with distinct watching zones.
Formally, a watching set is a collection where each is a location and is the watching zone of watcher . A watcher covers a vertex if . For each , its code is the set
The set is a watching system if all codes are nonempty and pairwise distinct. The goal is to find a watching system of minimum size.
Various properties of watching systems, including structural characteristics and bounds on the watching number across different graph classes, are derived in [3, 1, 2, 13, 14, 17]. For a comprehensive bibliography on identifying, locating-dominating and watching systems, see [16]. We stress that the watching-system framework is strictly more general than identifying codes, and often yields much smaller solutions. Related identification frameworks include locating-dominating sets and their variants [8, 10, 18].
A constrained variant of Watching Systems, called the -Watching System, in which a single vertex can host up to a bounded number of watchers, has been recently introduced. For general graphs, the -Watching System problem remains hard (even when ), but it admits a -approximation algorithm. Moreover, when the underlying graph is a tree, an optimal -Watching System can be computed in polynomial time [7].
Summarizing: The Surveillance System problem defined in the spycraft narrative is a direct instantiation of Watching Systems on an interval graph: Safe houses are the vertices of an interval graph. Each Listening Device (bug) located in a safe house plays exactly the role of a watcher located in vertex in the corresponding interval graph. A safe house is monitored by a bug located in precisely when belongs to the chosen subset of neighbors on which the watcher located in is probing. Thus, the set of bugs that can hear – the bug signature – coincides with the watcher code of the corresponding vertex in a watching system.
In our work, we instantiate this framework on interval graphs induced by time-intervals of safe houses: this specialization both justifies the surveillance (spy) interpretation and allows us to exploit interval-graph structure to design a polynomial-time factor- approximation algorithm for surveillance assignments.General bounds for identifying codes in terms of structural parameters such as maximum degree are studied in [12]. We stress that the identifying code problem remains NP-Hard on interval graphs [11] and a factor- approximation algorithm for interval graphs was presented in [6]; to the best of our knowledge, no specific results were previously known for the Watching System problem.
Our Results
In section 3, we present the Surveillance strategy. More precisely, in section 3.1 we introduce an algorithm that serves as a building block for the proposed Surveillance algorithm, which is then fully described in section 3.2. In section 4, we prove that the Surveillance System problem is NP-hard on chordal and bipartite graphs.
3 The Timeline Deployment Strategy
To secure the spy network with the fewest possible listening devices, Headquarters follows a rigorously codified deployment protocol – part greedy improvisation, part Cold-War bureaucracy carved in stone.
The operation begins by ordering all safe houses according to the Timeline Ordering introduced earlier (increasing right endpoint, with ties broken by decreasing left endpoint). This establishes the sequence in which the intervals are processed.
For each safe house in this order, the following procedure is executed:
-
1.
Attempt Signature Assignment. Look for a bug signature that can receive by using the bugs already deployed; that is, all existing bugs located in intervals overlapping and can, therefore, be tuned to monitor .
If a signature, which is nonempty and distinct from all previously assigned ones, exists, then nothing further is required: the safe house is uniquely identifiable. -
2.
Deploy a New Bug. Otherwise, a new bug must be introduced to guarantee a unique signature for . By operational decree, this new bug must be placed at the rightmost safe house that still intersects . Once positioned, the new bug is tuned to monitor (and potentially other overlapping houses, as needed).
The introduction of a new bug may require a local adjustment of signatures for preceding safe houses: Some safe houses may now be monitored by this bug, others may cease to be monitored by existing ones in order to maintain consistency and injectivity. Whenever such changes occur, the algorithm recomputes the affected signatures – always following the established timeline order.
An example of the Timeline Deployment Strategy is given in figure 2.
This procedure shows that the safe houses can be secured with a number of bugs which is at most twice the optimal.
3.1 A building block: Compute Signatures
In this section, we present an algorithm that serves as the basis for the proposed Surveillance algorithm, used later in section 3.2, namely the algorithm ComputeSignatures.
To describe the algorithm, we introduce an order on signatures, which is essentially the standard lexicographic ordering of subsets of a totally ordered set.
Definition 3 (Lexicographic Order on Bug Signatures).
Let and be two ordered subsets of , that is,
We say that if and only if one of the following holds:
-
1.
and , for some ;
-
2.
for all and .
Definition 4.
Let be a family of intervals (safe houses), and let be a set of bugs. For each , we define as the set of bugs able to listen to
Definition 5 (Partial Surveillance System (PSS)).
A set of listening devices , located in , is a Partial Surveillance System for if one can determine the sets , for , such that the signatures , for satisfy
| (4) |
Clearly, for the above becomes Definition 2.
The following observation will be used to characterize (Partial) Surveillance System by specifying the signatures associated with each safe house.
Observation 6.
Each Surveillance System for is uniquely identified by the signatures associated with each safe house , for every 333For a positive integer , we use to denote the set of integers ..
Indeed, if is located in interval , then must be tuned to listen to the interval in the set , where
The following fact will be useful in the following proofs.
Fact 7.
Consider the ordered intervals . For any such that , if then .
Proof.
Since and , by (1) we have . Furthermore, for each with , it holds . Hence, , implying .
The following lemma states that if a given set of bugs forms a Partial Surveillance System, then one can identify the signatures that certify this property by exploiting the lexicographic order on bug signatures.
Lemma 8.
Let be a family of intervals (safe houses), and let be a Partial Surveillance System for . Let be the list of signatures where, for each , is the lexicographically smallest signature on excluding (e.g. ). Then satisfies condition (4).
Proof.
By hypothesis, is a PSS for . Hence, at least a list of signature satisfying (4) exists. In the following, we transform to match . We proceed by induction on .
Base case: .
If , then there is nothing to prove. If the signature does not appear in , then it is sufficient to set .
Otherwise, appears in as the signature of some interval with , i.e., . We show that the signatures of and can be swapped in that is and , so that and agree on .
Since , it remains to prove that . Suppose, for contradiction, that the signature . This implies that there exists a bug with . Let be located in , we have .
Because is the first signature in the construction of , we know , where bug is the first bug in (according to (2)). Let bug be located in the interval with .
We know that:
-
implies that bug and, consequently,
-
, and consequently . Moreover, , and is the first signature in lexicographic orderon . It follows that and by (2) consequently
We distinguish two cases:
Case I: .
Recalling that and is located in , we have . Using and , we know by Fact 7 that must also intersect , which contradicts .
Case II: .
Using and , we know by Fact 7 that must also intersect which contradicts .
Thus, the contradiction shows that the signature can be assigned to and the swap is feasible.
Inductive step.
Assume that lists and agree on their first entries. Since depends only on the bug placement and both the lists and agree on their first entries, both and belong to the same set that is the set of all the subsets of excluding This set is nonempty because satisfies (4).
If , or if does not appear in , we are done. Otherwise, appears in as the signature of some interval with , i.e., .
We show that the signatures of and can be swapped in that is and , obtaining that and agree on their first entries.
Since , it remains to prove that . Suppose, for contradiction, that the signature . This implies that there exists a bug with . Let be located in , we have .
Let be the first bug (under (2)) in the signature and let it be located in interval .
We know that:
-
Since we have that bug and consequently
-
, and consequently . Moreover, , and is the first signature in lexicographic order taken from the set of all the subsets of excluding . It follows that and by (2) consequently
We distinguish two cases:
Case I: .
Recalling that and is located in , we have . Using and , we know by Fact 7 that must also intersect , which contradicts .
Case II: .
Using and , we know by Fact 7 that must also intersect which contradicts .
The contradiction shows that the signature can be assigned to , and the swap is feasible.
Exploiting the result of Lemma 8, the algorithm ComputeSignatures checks whether a prescribed set of bugs, located in the intervals of , yields a Partial Surveillance System (PSS) for . If so, the algorithm returns the bug-signature list , which coincides with the signature list defined in the statement of Lemma 8.
The input to the procedure ComputeSignatures consists of: a set of intervals (safe houses) ; a vector of integers; and an index . The vector k specifies a candidate set of bugs with the associated locations: specifically, it indicates how many bugs are placed in each safe house.
The algorithm begins by assigning identifiers to the bugs in increasing order (lines 1–4), consistently with the ordering (2). The sets record the bugs located in each interval . Next, for each , the procedure constructs the set of all bugs able to listen to (lines 5–7). Finally, the intervals are processed in timeline order. For each , the algorithm selects the lexicographically smallest signature (according to Definition 3) on with , provided such a signature exists (line 9). If no admissible signature remains (), then no Surveillance System on can be obtained using the multiplicities prescribed by k, and the algorithm returns false. Otherwise, it returns true together with the list of the distinct nonempty bug signatures assigned to the intervals .
It is important to note that the algorithm only needs to look for the first signature in lexicographic order that does not belong to . Since at most signatures are excluded, it suffices to generate up to the first signatures on in lexicographic order.
The signatures constructed by the algorithm exactly match the choice described in Lemma 8, namely, each signature is the lexicographically smallest one (according to Definition 3) on avoiding the previously assigned signatures . As a consequence, Lemma 8 immediately implies the correctness of ComputeSignatures, formally stated in Lemma 9.
Lemma 9.
Given , let be a vector of non-negative integers, which characterizes a set of bugs . The algorithm ComputeSignatures returns true, if and only if yields a Partial Surveillance System for .
3.2 The Timeline Deployment Strategy Algorithm
The algorithm Surveillance computes a Surveillance System for a set of safe houses .
The algorithm initializes the bug vector . It then proceeds iteratively. At step , assuming k provides a Partial Surveillance System (PSS) for , the procedure ComputeSignatures checks if k also covers the new interval (line 3). If it does not, k is extended by adding a single bug within the rightmost interval intersecting (lines 5–6). This update ensures k becomes a PSS for (see Lemma 12). Consequently, after processing all inputs, the final vector k yields a Surveillance System for the entire set . An example of how Algorithm Surveillance works is given in Example 10, while Example 11 shows that Algorithm Surveillance may not be optimal.
Example 10.
The set of intervals depicted in figure 3 is the input of Algorithm Surveillance. At the beginning, vector .
At step , ComputeSignatures() returns false and the vector k is updated so that , (i.e., , the rightmost interval intersecting , must locate the first bug).
At step , ComputeSignatures() again returns false (one bug is not enough to give distinct signatures to and ) and the vector k is updated so that .
At step , ComputeSignatures()
locates bug ① and ② in , and assigns signatures to returning (). The vector k remains unchanged.
At step , ComputeSignatures() returns false and the vector k is updated so that , (i.e., , the rightmost interval intersecting must locate a new bug).
Finally, ComputeSignatures() is called again to assign the final signatures
to the intervals in .
Example 11.
The suboptimality of algorithm Surveillance is depicted in figure 4: for the same family of intervals , the algorithm Surveillance produces a solution with four bugs (left), whereas there exists an optimal solution that uses only three bugs (right).
For each , define as the index of the rightmost interval that intersects . Let we notice that, Algorithm Surveillance places bugs only in safe houses indexed by elements of .
The following lemma shows that starting from a PSS for and adding a single bug located in is sufficient to obtain a PSS for .
Lemma 12.
Given and a vector that yields a PSS for , for some . If k does not yield a PSS for , then yields a PSS for , with
Proof.
We assume that k yields a PSS for . Let be a list of nonempty, pairwise distinct signatures assigned to the intervals of and associated with k. By adding one additional bug to , we obtain the new signature , which is available for and distinct from for every . Therefore, the updated vector yields a PSS for .
Hence, at the end of the for-loop (lines 2–6), we have that the vector k yields a SS for . The procedure ComputeSignatures is then invoked once more (line 7) to compute the signature associated with each interval in .
The following theorem establishes that the Surveillance algorithm is a 2-approximate algorithm.
Theorem 13.
Given a family of intervals (safe houses) , Algorithm Surveillance returns, in polynomial time, a 2-approximate solution Surveillance System for identified by the pair , where specifies the number of bugs located in each safe house and assigns a unique signature to each safe house in .
Proof.
Let be the vector returned by the algorithm, and let denote the corresponding list of signatures (chosen according to lexicographic order). Let be an optimal solution, and let be the list of associated signatures (chosen according to lexicographic order).
We show that o and can be transformed into k and , respectively, by adding some bugs in o. We refer to the bugs present in the optimal solution o as original bugs and to the additional ones as cloned bugs. We show that at the end of the process, there is at most one cloned bug for each original one. This implies that k yields a 2-approximate solution.
We transform o and step by step, starting from , to , . Similarly, we will have , to , . We denote by the set of bugs that can listen to at the current iteration, according to ; we stress that the bugs are identified with integers from to and are ordered according to (2). The following invariants are maintained by each and the list of associated signatures .
Claim 14.
For each , the vector and the corresponding list of associated signatures yields a Surveillance System for such that
-
(a)
-
(b)
.
Base case: .
We recall that by construction, Algorithm Surveillance places bugs only in safe houses indexed by elements of . Moreover, for each we have , and thus , while (because the first bug is placed in ).
Starting from , we shift all bugs located in to . Formally, we define by
| (5) |
The total number of bugs is unchanged.
Feasibility.
We show that still yields a Surveillance System for . Let be bug located in with . For any index such that (i.e., ), we show that , which implies that can be shifted to .
Case I: .
Since , by Fact 7, we obtain .
Case II: .
Since and , Fact 7, we obtain .
Thus, belongs to also after being shifted to . Repeating this argument for all such bugs yields the solution .
Claim 14-(a).
Since for all , Claim 14-(a) holds.
Claim 14-(b).
If , there is nothing to prove and .
If does not appear in , we simply set and for each .
Otherwise, appears in as for some .
We show that the signatures assigned to and can be swapped in .
By signatures construction and (5), ; it then suffices to show that .
We first show that . Since , each bug can listen to both and , and therefore is located in some interval with such that .
Since , all bugs in are now located in . Because , we conclude that . Therefore, the swap is feasible, we set , and for each and Claim 14-(b) holds.
Inductive step .
Consider a Surveillance System satisfying Claim 14 for ; let it be identified by the vector with associated list of signatures .
If , we simply set , moving no bug.
Otherwise, . We first establish that
| (6) |
To see why, note that Algorithm Surveillance introduces a bug only when necessary: specifically, a bug placed at interval must appear in one of the signatures . By the inductive hypothesis, and share the first signatures; consequently, every bug counted in must also be counted in . Moreover, by Claim 14-(a), for all . Inequality (6) follows directly.
We now shift all the bugs located in intervals , together with bugs at , to . Formally, we define as follows:
| (7) |
Clearly, the total number of bugs is preserved. We stress that after the shifts in (7), any bug located in an interval will not be shifted anymore. Recalling that the bugs are numbered from 1 to and ordered according to (2), this also implies that from now
| (8) |
We show now that Claim 14 holds for .
Feasibility: yields a Surveillance System for .
Let be any bug originally located in an interval , with according to . Suppose is one of the bugs that are shifted to . We show that shifting preserves the feasibility of the Surveillance System.
To this aim, consider any index such that (i.e., ).
Case .
By construction, the signatures :
-
do not contain any bug located in intervals with . Indeed, any interval in is disjoint from every interval in ; therefore, bugs located in cannot listen to any interval among ;
-
use at most bugs located in .
Since and coincide on the first signatures, we retain exactly bugs in and shift all the bugs that are not contained in . Summarizing, any shifted bug does not appear in any signature with .
Case .
Since and , by Fact 7, we obtain . Hence, remains in after the shift.
Case .
Since and , by Fact 7, we obtain . Again, remains in after the shift.
Repeating this argument for all shifted bugs yields .
Claim 14-(a).
Claim 14-(b).
By the inductive hypothesis, .
-
1)
If , there is nothing to prove and
-
2)
If does not appear in , we simply set and for all .
-
3)
Otherwise, for some . by (8), we know that . Hence, we can again set and for all . However, we need .
To this aim, denote by the smallest bug in .-
3.1)
If there exists a signature in which the smallest bug is such that and , we assign .
-
3.2)
Otherwise, a new bug (hereafter, the clone of ) is located in the interval . Let be located in the interval , since we know that Recalling that is rightmost interval intersecting , we know that . Moreover, since we have . Hence we have and we set .
We observe that is located in and is located in with . Hence, we may assume that and is still the smallest bug in .
We also notice that for any such that , the interval intersects the interval containing . Because , the interval also intersects . This implies that at any subsequent step , we can still use the clone located in to eventually construct a signature ; that is, Case 3.2) cannot occur again, and no bug cloning is required.
If case 3.2) applied, we added a new bug located in , we have . To maintain the identifiers of the bugs in increasing order according to the ordering (2), we update the bugs identifier and the signatures in consistently. We notice that since is located in this update affects only the identifiers of the bugs located in intervals after and consequently does not affect any signature before with .
-
3.1)
Let be the size of the optimal solution.
Initially, all signatures contain only the original bugs of the optimal solution.
Moreover, we have already observed that, after cloning a bug , any interval containing will not require a new cloned bug, e.g.,
Case 3.2) occurs at most once for each original bug
and consequently, the total number of clones is at most .
In conclusion, when reaching , we have for all ,
and coincide with .
Since uses all and only the bugs described by k and contains at most clones, we conclude that
k yields a 2-approximate solution.
Time complexity.
The algorithm ComputeSignatures needs time.
The initialization of the variables (lines 1–4) takes time.
Computing the neighborhoods requires time.
The computation of all sets , for , also takes time in total.
As observed above, to compute a signature , since at most signatures are excluded, it suffices to generate the first signatures over in lexicographic order and return the first one that is not excluded.
The signatures over can be generated by a straightforward algorithm that performs an iterative depth-first traversal with a preorder visit of the implicit lexicographic tree of subsets of .
Since the size of any signature is at most (a trivial solution, placing one bug in each safe house, each tuned only to its own house, is always feasible), generating and checking a single signature requires time.
Therefore, generating the first signatures over takes time.
Summing over all , the total time spent generating signatures is .
Hence, the total running time of ComputeSignatures is .
The time complexity of Algorithm Surveillance is . Indeed, the algorithm invokes ComputeSignatures a total of times, and the computation of , performed at most times, requires time.
By using appropriate data structures for the generation and checking of signatures or by means of an amortized analysis, this time complexity can be reduced to . Moral of the story: in Cold War Berlin, as in algorithms, a small amount of redundancy along the timeline buys you certainty at only twice the cost.
4 Hardness
In section 2.3, we highlighted the strong connection between the Surveillance System problem and the Watching System problem when the input graph is an interval graph.
In this section, we show that if we slightly enlarge the class of input graphs by considering chordal graphs, the problem becomes NP-hard.
It is known that the Dominating Set (DS) problem is NP-hard even when restricted to chordal and bipartite graphs [4, 5]. Here, we prove that the Watching System (WS) problem remains NP-hard even when restricted to chordal and bipartite graphs, by means of a reduction from DS.
To this end, we consider the decision version of the WS problem, which asks whether there exists a watching system of the input graph of size at most . Recall that, given a graph and an integer , the DS problem asks whether there exists a set such that and for every .
Theorem 15.
The Watching System problem remains NP-hard even on chordal and bipartite graphs.
Proof.
Let be an instance of DS. We construct a graph from as follows. For each vertex , we introduce three new vertices and add edges connecting to , , and .
By construction, if is chordal (respectively, bipartite), then is also chordal (respectively, bipartite). Indeed, for each vertex , we attach a tree to . If is bipartite, attaching a tree to a single vertex preserves bipartiteness; applying this argument to every vertex of implies that is bipartite. Moreover, since the added gadgets are trees, no induced cycle of length greater than three is created. Therefore, if is chordal, then is chordal as well.
In order to complete the proof, we establish the following claim.
Claim 16.
For any integer ,
if and only if
Assume first that is a dominating set of with . We show that
is a watching system for .
By construction, . Moreover, at most one watcher is located in each vertex; hence, we identify a watcher with the vertex where it is placed.
We now show that the codes associated with the vertices of are all nonempty and pairwise distinct. The codes are as follows:
and, for each ,
Hence, every vertex of has a nonempty code. Furthermore, all codes are pairwise distinct. In particular, for each :
-
, since but ;
-
, since is a dominating set and therefore .
Finally, for any two distinct vertices , the codes and are distinguished by and , respectively.
Thus, is a valid watching system for of size .
Conversely, let be a watching system for with . For each vertex , consider the gadget formed by and . At least two watchers must be placed in in order to distinguish and .
Moreover, since two watchers located in are sufficient to distinguish , , and , if three or more watchers are placed in , we can obtain an equivalent watching system by moving two watchers to and relocating any remaining watchers to . Hence, in the remainder of the proof, we may assume that each gadget hosts exactly two watchers, and consequently that at most watchers are located in vertices of .
Let be the set of vertices of hosting a watcher. By the above argument, . We claim that is a dominating set of .
Suppose, for contradiction, that there exists a vertex such that . Since is adjacent to in , and , the watchers placed in the gadget of must distinguish the vertices , , , and . This is impossible unless either or , contradicting the assumption. Therefore, is a dominating set of .
5 Conclusions
In this paper, we sent Agent X on a mission through the timelines of Cold War Berlin and, along the way, studied the Watching System problem on interval graphs. By translating safe houses into intervals and listening devices into watchers, we showed that the temporal structure of interval graphs can be exploited in a surprisingly effective way.
Our main result is a simple polynomial-time 2-approximation algorithm, built around a timeline deployment strategy: whenever the existing bugs cannot uniquely identify a newly activated safe house, one carefully placed extra device suffices. The algorithm is greedy, local, and easy to implement, yet its analysis reveals a subtle global invariant: each optimal bug may need to be duplicated at most once. In short, certainty along the timeline can be bought at twice the optimal cost.
Not all spy networks are so cooperative. We also proved that as soon as the setting is slightly generalized, to chordal or bipartite graphs, the problem becomes NP-hard. This sharply marks interval graphs as a rare safe zone where surveillance remains algorithmically manageable.
Several mysteries remain unsolved. Is the factor 2 approximation the best Agent X can hope for, or is an even more efficient deployment possible? Can similar timeline-based ideas be adapted to other geometric graph classes? We leave these questions for future investigations and future missions.
For now, the lesson is clear: when safe houses line up neatly on a timeline, a small amount of well-placed redundancy is enough to keep every secret uniquely identified.
References
- [1] David Auger, Irène Charon, Olivier Hudry, and Antoine Lobstein. Watching systems in graphs: An extension of identifying codes. Discret. Appl. Math., 161(12):1674–1685, 2013. doi:10.1016/j.dam.2011.04.025.
- [2] David Auger, Irène Charon, Olivier Hudry, and Antoine Lobstein. Maximum size of a minimum watching system and the graphs achieving the bound. Discret. Appl. Math., 164:20–33, 2014. doi:10.1016/j.dam.2012.08.028.
- [3] David Auger and Iiro S. Honkala. Watching systems in the king grid. Graphs Comb., 29(3):333–347, 2013. doi:10.1007/s00373-011-1124-0.
- [4] Alan A. Bertossi. Dominating sets for split and bipartite graphs. Inf. Process. Lett., 19(1):37–40, 1984. doi:10.1016/0020-0190(84)90126-1.
- [5] Kellogg S. Booth and J. Howard Johnson. Dominating sets in chordal graphs. SIAM J. Comput., 11(1):191–199, 1982. doi:10.1137/0211015.
- [6] Nicolas Bousquet, Aurélie Lagoutte, Zhentao Li, Aline Parreau, and Stéphan Thomassé. Identifying codes in hereditary classes of graphs and vc-dimension. SIAM J. Discret. Math., 29(4):2047–2064, 2015. doi:10.1137/14097879X.
- [7] Gennaro Cordasco, Luisa Gargano, and Adele A. Rescigno. Watching systems with bounded probes. In Luca Moscardelli and Francesca Scozzari, editors, Proceedings of the 26th Italian Conference on Theoretical Computer Science, Pescara, Italy, September 10-12, 2025, volume 4039 of CEUR Workshop Proceedings, pages 3–15. CEUR-WS.org, 2025. URL: https://ceur-ws.org/Vol-4039/paper20.pdf.
- [8] Gennaro Cordasco, Luisa Gargano, and Adele Anna Rescigno. Red-blue unshared dominators. In Proceedings of the 25th International Symposium on Fundamentals of Computation Theory (FCT 2025), pages 94–108, 2025.
- [9] Florent Foucaud. Combinatorial and algorithmic aspects of identifying codes in graphs. PhD thesis, Université Sciences et Technologies - Bordeaux, 2012.
- [10] Florent Foucaud, Michael A. Henning, Christian Löwenstein, and Thomas Sasse. Locating-dominating sets in twin-free graphs. Discret. Appl. Math., 200:52–58, 2016. doi:10.1016/j.dam.2015.06.038.
- [11] Florent Foucaud, George B. Mertzios, Reza Naserasr, Aline Parreau, and Petru Valicov. Identification, location-domination and metric dimension on interval and permutation graphs. II. algorithms and complexity. Algorithmica, 78(3):914–944, 2017. doi:10.1007/s00453-016-0184-1.
- [12] Florent Foucaud and Guillem Perarnau. Bounds for identifying codes in terms of degree parameters. Discrete Applied Mathematics, 232:99–114, 2017.
- [13] Mehdi Ghorbani, Matthias Dehmer, Hossein Maimani, Saeid Maddah, Mohammad Roozbayani, and Frank Emmert-Streib. The watching system as a generalization of identifying code. Applied Mathematics and Computation, 380, 2020.
- [14] Modjtaba Ghorbani and Sheyda Maddah. On the watching number of graphs using discharging procedure. J. Appl. Math. Comput., 67(1-2):507–518, 2021. doi:10.1007/s12190-020-01482-w.
- [15] Mark G. Karpovsky, Krishnendu Chakrabarty, and Lev B. Levitin. On a new class of codes for identifying vertices in graphs. IEEE Trans. Inf. Theory, 44(2):599–611, 1998. doi:10.1109/18.661507.
- [16] Antoine Lobstein. Watching systems, identifying, locating-dominating and discriminating codes in graphs: A bibliography. arXiv preprint arXiv:1004.2192, 2010.
- [17] Maryam Roozbayani and Hamidreza Maimani. Identifying codes and watching systems in kneser graphs. Discret. Math. Algorithms Appl., 9(1):1750007:1–1750007:9, 2017. doi:10.1142/S1793830917500070.
- [18] Suk Jai Seo and Peter J. Slater. Open neighborhood locating dominating sets. Australas. J Comb., 46:109–120, 2010. URL: http://ajc.maths.uq.edu.au/pdf/46/ajc_v46_p109.pdf.
