Manuscript Offprint
arXiv:2610.28932Solving problems in RDV Graphs faster and easier
Abstract
In interval graphs and many generalizations thereof, problems such as MATCHING, INDEPENDENTSET and DOMINATINGSET can be solved with simple greedy algorithms in linear (i.e., ) time. However, it is sometimes possible to improve on this runtime if a suitable representation as intersection graph is given; for example it is possible to find a minimum dominating set in an interval graph in time. We study RDV graphs, a generalization of interval graphs, namely, the intersection graphs of directed paths in a rooted tree. It was known that the above three problems can be solved in time if a suitably small representation is given. In this paper, we reduce the runtime to . Furthermore, while the previous results used non-trivial operations such as range-minimum queries and ray-shooting queries, we need nothing more complicated than lists and (for MATCHING) a UNION-FIND data structure.
2012 ACM Subject Classification Mathematics of computing → Graph algorithms
Keywords and phrases RDV graph, Dominating Set, Independent Set, Matching, Linear Time
Funding Therese Biedl: Supported by NSERC, FRN RGPIN-2020-03958. Research done while the first author visited Freie Universität Berlin during her sabbatical in the winter term 2025/26.
1 Introduction
We study efficient algorithms for graphs that are RDV graphs, i.e., vertex-intersection graphs of directed paths in a rooted tree. (Formal definitions are given in Section 2.) This graph class contains interval graphs and is a subclass of the chordal graphs; so any problem that can be solved efficiently in chordal graphs (such as INDEPENDENTSET, which is NP-hard in general but can be solved with a linear-time greedy algorithm in chordal graphs [10]) can also be solved efficiently in RDV graphs. In fact, RDV graphs are a subclass of so-called strongly chordal graphs. In strongly chordal graphs, problems such as DOMINATINGSET and MATCHING can be solved in linear time with a greedy algorithm [6, 8], while no linear-time algorithms are known for chordal graphs (and in fact DOMINATINGSET is NP-hard in chordal graphs [4]).
In the above algorithms, “linear” refers to the input size, i.e., the runtime is for a graph with vertices and edges. In contrast to this, later papers considered algorithms whose runtime depends only on , assuming that a suitably small representation of the graph as intersection graph of objects is given. Of particular interest to the current work is a recent string of papers where the first author and Gokhale argued that the runtime of the above greedy algorithms can be reduced to in RDV graphs [1, 3, 2, 13].
Specifically, the runtime of these algorithms is , where is the tree used for the representation of . There always exists a representation with , and so the runtime is if the given representation is small enough (an assumption that we will make throughout).
MATCHING is addressed in the conference paper [1], and in its journal version [3] with a simplified approach. DOMINATINGSET is addressed in [2], while INDEPENDENTSET is addressed only in Gokhale's Master's thesis [13], which summarizes all these results.
Solving Problems in RDV Graphs Faster and Easier
The crucial idea for these algorithms with runtime depending only on n and not on m is to reframe a given tree representation in geometric terms, namely as an intersection graph of T-shapes. Biedl and Gokhale define for every vertex of G a horizontal and a vertical segment whose union forms a T such that two vertices are adjacent if and only if their Ts intersect. One can then express the operations needed by the greedy algorithm as queries among these segments, and the authors showed that it suffices to use range-maximum queries and orthogonal ray-shooting queries in a (dynamically changing) subset of the segments. Prior results allow these queries to be implemented with runtime : McCreight's priority search trees support range-maximum queries [17], and Giyora and Kaplan gave data structures for orthogonal ray-shooting queries [12]. However, neither of these data structures is straightforward to implement, especially in a dynamic setting.
In this paper, we improve on these algorithms for RDV graphs in three ways. First, we show that the detour into the T-intersection representation is not necessary: everything can be done directly with a bottom-up traversal of the tree T of the tree representation.
Second, the runtimes are better: we achieve runtime for all three problems, compared to the previous bound of [2, 3, 13]. For MATCHING, our runtime even beats the best previously known result for interval graphs, which was (Moitra and Johnson [18] with an improvement pointed out by Rhee and Liang [20, Section 5]).
Finally, and this is what we view as our most important contribution, our algorithms are very simple. There is no need for complicated data structures; all the required information can be obtained by storing at each node of T a few integers or lists or vertex references. (For MATCHING we also use a UNION-FIND data structure, but this is easy to implement if we relax the runtime bound from to ).
Organization of the paper. Section 2 introduces RDV representations and our notation, and Section 3 describes the bottom-up traversal of T on which our algorithms are based. Sections 4, 5, and 6 give our algorithms for INDEPENDENTSET, DOMINATINGSET, and MATCHING, respectively, each with a small example, and Section 7 mentions open problems. Appendix A contains streamlined pseudocode for all three algorithms, and Appendix B proves that the two greedy algorithms for MATCHING that we build on produce the same matching, and that this matching is maximum.
The class of graphs with such a representation is known as the path graphs. We study here a graph class that is a proper subclass of the path graphs; it was named by Monma and Wei [19], though studied even earlier e.g. by Gavril [11] and Booth and Johnson [4]:
They called RDV graphs directed path graphs, but this later came to mean a different graph class, where the edges of T can be oriented independently without regard to a common root.
▶ Definition 1. A rooted directed path graph (or RDV graph [19]) is a graph that has an RDV representation, i.e., a representation as vertex-intersection graph of directed paths in a rooted tree T in which all edges are directed towards the root.
G:

T:

Figure 1 An RDV graph G with an RDV representation T. The bags are written in the nodes of T. (Picture taken from [2].)
depth
0
1
2
3
4
5
6

Figure 2 The running example: an RDV representation of the graph G of Figure 1 that satisfies our assumptions. Each node shows its bag; top nodes are marked by overlining and bottom nodes by underlining the corresponding vertex. The top nodes are distinct, the bottom nodes are distinct, and the root is a top node. The depths of the nodes are shown on the left. Since every node is a top node or a bottom node, we refer to the nodes as and . The small numbers give the order in which the nodes are processed in the examples.
Figure 1 illustrates an RDV graph and its RDV representation. RDV graphs can be recognized in polynomial time [11], and along the way, an RDV representation of size is produced. We use and for the top node and bottom node of the path of a vertex z, respectively. We may without loss of generality assume that for any two vertices z, y; if this is violated (say node a is both and ) then we can subdivide the edge from a to its parent (or add a parent if a is the root) and extend the path of z upward into the new node without affecting the represented graph. Similarly we can require that for any two vertices z, y, by adding a new child to if required. Finally we may assume that the root is a top node, for if it is not then no path uses it, and so we can simply contract one of its children with the root without affecting the represented graph.
Solving Problems in RDV Graphs Faster and Easier
These assumptions make the statements of the algorithms more convenient. Figure 2 shows an RDV representation of the graph of Figure 1 that satisfies all of them; we will use it as a running example.
We assume that every vertex can look up nodes and in constant time. We also prepare such that each node can do the following in constant time:
-
Look up depth(a), which is the distance of a from the root of T.
-
Test whether is the top node of some , and if so, look up this (unique) vertex .
-
Test whether is the bottom node of some , and if so, look up this (unique) vertex .
For any , we write for the set of vertices whose paths contain , i.e., . We call the bag of , a name inspired by the fact that and the assignment of paths is a special case of a so-called tree decomposition (see e.g. [7]) where the corresponding concept is called a bag. We will need a simple observation.
▶ Observation 2. Consider a vertex z and its top node . Every neighbor w of z either is in , or is a strict descendant of a.
Proof. Assume that , so does not contain a. But must share a node with the path , say node . This must be a descendant of a since a is the top node of , and it is a strict descendant since . So contains strict descendants of a, but does not contain a; thus must be a strict descendant of a.
We will use the common notation for the closed neighborhood of a vertex , consisting of together with its adjacent vertices. For a set of vertices , denotes the union of over all . We study the following three problems:
INDEPENDENTSET: Given a graph G, find a maximum vertex set I that is independent, i.e., no edge connects two vertices in I.
DOMINATINGSET: Given a graph G, find a minimum vertex set D that is dominating, i.e., each vertex of G that is not in D has a neighbor in D, or more formally, .
MATCHING: Given a graph G, find a maximum edge set M such that no two edges of M have a common endpoint.
We will not review the extensive history of these three problems, and what is known in terms of algorithms and/or NP-hardness, except for graph classes that are closely related to RDV graphs, where such a review will be given in the relevant section below.
3 The Common Structure of Our Algorithms
Our algorithms for INDEPENDENTSET and DOMINATINGSET have a common basic structure: They perform a bottom-up traversal of the tree T. At each node, the same 4-step procedure is used. Our algorithm for MATCHING also processes the nodes of T from the leaves to the root, but it deviates from this scheme: it does not work with the bags, but with a UNION-FIND data structure on the nodes of T (Section 6). We illustrate this paradigm with a skeleton that makes the bags available when needed.
We could also stipulate that no node is both a top node and a bottom node, but we do not need this. A degenerate path consisting of a single node is also permitted.
Processing node a. We assume that all strict descendants of a have already been processed.
- (Accumulate the data from the children.)
If a is a leaf, initialize an empty list .
Otherwise, let be the concatenation of lists over all children c of a.
- (Update if a path starts.) If a is a bottom node, say :
= Add z to .
- (Make decisions.)
... [At this point, ]
- (Update if a path ends.) If a is a top node, say :
= Remove z from .
▶ Lemma 3. For any node , the set is always a subset of , and at the beginning of Step 3 when is processed, .
Proof. In fact, the manipulations of in Steps 1, 2, and 4 play together to ensure that the correct set is built inductively. In Step 4, a vertex with is removed from in preparation for building the set for the parent. Thus in Step 1 the set at each child contains all those vertices whose paths contain the child and continue upward. So all these paths continue into , hence the vertices are in . Clearly the vertex added in Step 2 (if any) is also in . Vice versa, any vertex in corresponds to a path that contains . This path either had its bottom node at (such vertices are added in Step 2), or it contains one of the children (and hence the vertex is added in Step 1).
As it happens, the later algorithms will not actually need the sets , but they will compute subsets of , and we shall use for their correctness arguments.
Leaf-to-root order. The only required condition on the order of processing is that a child comes before its parent. Any order that is consistent with this can be used in our algorithms, for example postorder or reverse level-order.
Optimality. Our three algorithms establish optimality in different ways. For INDEPENDENTSET, the algorithm computes, along with the independent set, a clique cover of the same size, which certifies optimality. For DOMINATINGSET, we show that our algorithm computes the same set as the greedy algorithm of Booth and Johnson [4], and rely on their optimality proof. For MATCHING, we show that our algorithm computes the same matching as a known greedy algorithm, whose optimality follows from the general results of Dahlhaus and Karpinski [6] about strongly chordal graphs; Appendix B.1 gives an independent self-contained proof for our setting.
4 Maximum Independent Set I
It is well known that in a chordal graph, a maximum independent set can be found with a simple linear-time greedy algorithm executed on a perfect elimination order (see Gavril's original paper [10] or Golumbic's monograph [14] for details). In an RDV graph, the runtime can be reduced to by employing suitable data structures [13, Thm. 5.2.2]. For interval graphs where the interval endpoints are given in sorted order (this corresponds to our assumption that the tree representation T is given), a maximum independent set I can be found by a simple greedy algorithm in time [15].
In this section we give an algorithm that solves INDEPENDENTSET in an RDV graph in time. Our algorithm will perform the same steps as the greedy algorithm, but rather
Solving Problems in RDV Graphs Faster and Easier
than showing this we will argue directly that it computes a maximum independent set. In accordance with the paradigm in Section 3, the algorithm performs a bottom-up traversal of T and incrementally builds an independent set I.
We maintain a label state(z) for every vertex z with the following meaning:
(11) Every vertex in has ; all other vertices have . We also maintain a list for every node , with the following invariant:
(12) ,
where is the set introduced in Section 3; recall in particular that during Step 3 when a is processed. For reference, we include the manipulations of the sets from the algorithm of Section 3 as comments.
As an optimality certificate, we store for each a vertex set clique(z) with the following property (as the name suggests):
(13) clique(z) forms a clique.
Initialization. Initialize an empty set of vertices. For every vertex , initialize .
Processing node a. We assume that all strict descendants of a have already been processed.
- (Accumulate the data from the children.)
// Form by concatenating the lists of the children c of a.
Form by concatenating the lists of the children c of a.
- (Update if a path starts.) If a is a bottom node, say :
// Add z to
Add z to // state(z) = free at this point.
- (Add to solution if possible.) If a is a top node, say , and :
Add z to I.
// At this point, .
For every vertex w in , set . // This includes the vertex z.
Set clique(z) := L(a), and clear L(a) to be empty.
- (Update if a path ends.) If a is a top node, say :
// Remove z from . // No update is needed for .
After processing the root node, we return I as the maximum independent set.
Correctness. Invariant (I2). In Steps 1 and 2, the set is constructed and updated in accordance with the defining condition of that the state should be free. In fact, in Step 2, must be free, because the state has not changed since initialization. Hence the addition of z to is correct. In Step 4, it would be necessary to remove z from in case . However, in this case, has already been emptied in Step 3. Consequently, Step 4 is not necessary.
We make an easy but important observation.
(14) All vertices for which has been processed completely have . Proof: When processing , the state of is either free or blocked. If is free, Step 3 adds it to , which makes it blocked; so either way afterwards.
We now prove the crucial property that the state labels are maintained correctly (Invariant (I1)): We mark vertices as blocked if and only if they were in during Step 3 and we added the vertex to . Since forms a clique, all these vertices are now in , and therefore their classification as blocked is correct.
We still have to show that every vertex is blocked after Step 3 adds z to I:
■ If , then by Observation 2 its top node is a strict descendant of a and has been processed before; by (I4) this means that w is already blocked.
■ If and is still free when processing , then by (I2) is in , and we mark it as blocked.
We now turn to the sets clique(z) (Invariant (I3)): We set clique(z) = L(t(z)) when processing . This is a clique since , and forms a clique.
We make an additional observation, which will be important for the optimality proof: (I5) Every vertex w with state(w) = blocked is in clique(z) for a unique .
Proof: Inspection of Step 3 shows that a vertex y is added to some clique(z) exactly when its state changes from free to blocked. Since states never change back to free, y will never be added to another set clique(z').
Runtime. We represent the lists by linked lists, and form list in Step 1 by concatenation in constant time per child. The lists of the children are no longer available afterwards, but are also no longer needed. The transfer of the list to clique(z) in Step 3 can also be carried out in constant time since is simultaneously emptied.
▶ Theorem 4. Let G be an n-vertex RDV graph with a given RDV representation of size . Then the algorithm computes a maximum independent set I of G together with a clique cover of size in time.
Proof. We only add a vertex to if , and by Invariant (I1) this means that is not adjacent to any vertex in . Hence is an independent set.
By property (I4), all vertices are blocked at the end of the algorithm, and Invariant (I5) in connection with Invariant (I3) implies that the family forms a clique cover, i.e., it consists of vertex-disjoint cliques that together cover all vertices of . By construction, the clique cover has size .
A clique cover is a certificate of optimality for : No independent set can contain more than one vertex in a clique, so no independent set can be larger than any clique cover. So is a maximum independent set. The existence of a clique cover of size is in line with the fact that RDV graphs are perfect graphs.
The runtime is since we spend constant time per node and per child and .
A streamlined version of the algorithm (without the clique cover) is shown in Algorithm 5 in Appendix A.1.
Example. Consider the running example of Figure 2, with the nodes processed in the order , , , , , , , , , , , , . The first top node to be processed is , where ; so is added to , all three vertices become blocked, and . At , vertex is blocked, and nothing happens. At , we have , so is added to with . At and , the vertices and are blocked. At , we have , so is added to with ; at the root , vertex is already blocked. The result is , together with the clique cover , , of the same size.
Solving Problems in RDV Graphs Faster and Easier
5 Minimum Dominating Set D
Booth and Johnson [4] appear to have been the first to study DOMINATINGSET in RDV graphs. They gave an algorithm (repeated in Algorithm 1) that is a bottom-up traversal of the tree T of the representation. They argue that it finds a minimum dominating set, and that it can be implemented with linear (meaning ) runtime. Gokhale restated this algorithm as a greedy algorithm based on a vertex ordering, which then works whenever this ordering is a so-called strong perfect elimination order [13]. With this reframing, the algorithm can then be implemented with runtime in RDV graphs [2]. Cheng, Kaminski and Zaks [5] claimed an time algorithm for DOMINATINGSET in a subclass of path graphs unrelated to RDV graphs. For this, they used as a subroutine an time algorithm for DOMINATINGSET in interval graphs. Unfortunately, none of the references that they give seems to contain such an algorithm; but runtime for interval graphs can also be achieved by modifying the techniques for RDV graphs slightly [2].
Algorithm 1 Greedy algorithm for DOMINATINGSET from [4]
Input: RDV graph G with RDV representation (T, t, b)
1 initialize , mark all vertices as undominated
2 for each node a of T, in leaf-to-root order do
3 if for some vertex z and z is undominated then
4 let be the vertex with highest top node, i.e., minimizing depth( )
5 add y to D and mark all its neighbors as dominated
Result: D
The algorithm that we give below for DOMINATINGSET in RDV graphs is the same in spirit as Algorithm 1, but we pre-compute some of the information so that the runtime is reduced from the (obvious) to . Like Algorithm 1, the algorithm performs a bottom-up traversal of T and incrementally builds a dominating set. To facilitate the correctness argument, we distribute this dominating set among the nodes, and associate with every node a “local” dominating set ; eventually these will all get merged into one set that we return. Additionally the algorithm keeps track of three vertices , and three integers h, d, u at each node a of T. The intended meaning is that the following hold at the entry to Step 3 of processing a:
(D1) is the vertex in bag whose top node is highest, i.e., minimizes the depth of the top node.
(D2) is a dominating vertex in the bag (i.e., ), and among those, the one whose top node is highest.
(D3) is an undominated vertex in the bag (i.e., ), and among those, the one whose top node is lowest.
(D4) , , and are the depths of the top nodes of , and , respectively.
If any of these vertices does not exist, we set , , or to nil, and accordingly set , , or .
Processing node a. We assume that all strict descendants of a have already been processed.
We write for convenience; it suffices to use values outside the range of depths of nodes of T.
- (Accumulate the data from the children.) If a is a leaf:
= Initialize as an empty set.
= Set , and .
Otherwise (a has children):
h. Let . Set and .
D. Form by concatenating the lists of the children c of a.
d. Let . Set and .
u. If ,
set , , .
Otherwise set .
- (Update if a path starts.) If a is a bottom node, say :
h. If depth(t(z)) < h(a) update , .
D. // No update is necessary for .
d. // No update is necessary for and .
u. If and depth(t(z)) > u(a) update , .
- (Add to output if needed.) If :
(In this case, has and is not dominated by .)
h. // No update is necessary for and .
D. Add to .
d. Update , .
u. Update .
- (Update if a path ends.) If a is a top node:
h. If then set .
D. // No update is necessary for .
d. If then set .
u. // No update is necessary for and .
After processing the root node a, we return as the minimum dominating set.
Clearly the time to process a node of is proportional to its number of children, so the runtime of this algorithm is .
Correctness. The proof that the invariants are maintained is straightforward. Directly from the algorithm it is clear that Invariant (D4) holds, i.e., , , and are the depths of the top nodes of , and , respectively. To prove the other invariants, we use again the set defined in Section 3, which equals during Step 3 (Lemma 3).
Invariant (D1): It suffices to show that at all times. We add to during Steps 1 and 2, by either combining the sets of the children or adding a vertex whose bottom node is . During both steps we update , if needed, to take into account the vertices that were newly added to . Step 3 does not change the bag. During Step 4, if we had any vertex left in after removing the one whose path ends, then would be above since top nodes are distinct. So implies that is now empty, justifying that we set .
Invariant (D2): It suffices to show that at all times. We add to during Steps 1 and 2. During Step 1 we take all added vertices into account. During Step 2, the newly added vertex is not in , so no update is needed.
In particular this implies that no path in the subtree rooted at a intersects a path in the rest of T. Thus in a connected graph this update step is used only when we have processed the entire graph, and could be omitted.
Solving Problems in RDV Graphs Faster and Easier
During Step 3, since some vertex in was undominated, none of the vertices in were in previously, so the newly added is the only candidate for . During Step 4, as for (D1) one argues that implies that is now empty, justifying that we set .
Invariant (D3): During Steps 1 and 2, if then we must have at least one dominating vertex in . This dominates all vertices in and is in , so is undefined. The same argument applies to Step 3, where holds always. We claim that during Step 4, no update is needed to . To see this, assume that is a top node and , so that the removal of z from would necessitate finding a new vertex . This means that . But then we would have acted in Step 3, ensuring that z becomes dominated and updating accordingly.
Finally, we prove that our algorithm computes the same dominating set as Algorithm 1. More specifically, we claim that we add a vertex to in Step 3 if and only if Algorithm 1 adds a vertex to . (In this case, both algorithms obviously add the same vertex, .)
We shall show that the following four statements are equivalent:
-
Our algorithm adds a vertex to in Step 3.
-
The vertex z with is not dominated by .
-
The vertex z with is not dominated by the global set D.
-
Algorithm 1 adds a vertex to D when processing a.
The equivalence between 3 and 4 follows directly from the description of Algorithm 1. However, the equivalence between 1 and 2 is not immediately apparent from the test in Step 3. It can be seen as follows:
A vertex is added to when we are processing and . Since , the vertex exists, and since we have by (D4). By (D3) we conclude that is undominated by . Conversely, if with is undominated by , it follows immediately from (D3) and (D4) that and , and hence the test in Step 3 will be positive.
For this, we need another observation:
(D5) For every vertex , the path contains nodes in the subtree rooted at . Inductively, this holds after concatenating from the sets of the children in Step 1. The only vertex added to is in Step 3, which is in by (D1). Its path therefore contains .
To prove the equivalence between 2 and 3, we assume inductively that of our algorithm equals for Algorithm 1. What remains to prove is that if is undominated by , it is also undominated by the global set . If were dominated by, say, , then for some node that is neither an ancestor nor a descendant of . By (D5), contains nodes in the subtree rooted at . But no such vertex can be adjacent to , where , due to Observation 2. This contradiction proves our claim.
So the two algorithms compute the same dominating set, and since Algorithm 1 finds a minimum dominating set [4], so does ours.
▶ Theorem 5. Let G be an n-vertex RDV graph with a given RDV representation of size . Then we can find a minimum dominating set of G in time.
We note that our algorithm can be slightly simplified: the vertex references and are not needed as long as we store the depths of their top nodes, i.e., d and u. See also Appendix A.2.
Example. Table 1 shows the run of the algorithm on the running example of Figure 2, with the nodes processed in the same order as in the example for INDEPENDENTSET. At , the bag contains the undominated vertex itself, so , and the vertex , whose top node is highest in the bag, is added to . Similarly, is added at . At , the dominating vertex leaves the bag, so Step 4 resets to nil and to . Hence, at , the vertex is undominated, and is added. The result is . It is a minimum dominating set: the closed neighborhoods , , and are pairwise disjoint, so every dominating set has at least three vertices.
| iteration | node a | depth(a) | bag | h(a) | d(a) | u(a) | added to D |
|---|---|---|---|---|---|---|---|
| 1 | 2 | 1 () | 1 () | ||||
| 2 | 6 | 4 () | 4 () | ||||
| 3 | 6 | 2 () | 2 () | ||||
| 4 | 5 | 2 () | 5 () | ||||
| 5 | 4 | 2 () | 2 () | ||||
| 6 | 6 | 3 () | 3 () | ||||
| 7 | 5 | 3 () | 4 () | ||||
| 8 | 4 | 3 () | 4 () | ||||
| 9 | 4 | 0 () | 0 () | ||||
| 10 | 3 | 0 () | 2 () | ||||
| 11 | 2 | 0 () | 2 () | ||||
| 12 | 1 | 0 () | 1 () | ||||
| 13 | 0 | 0 () | 0 () |
Table 1 The algorithm for DOMINATINGSET on the running example of Figure 2. The values , , and are those at the beginning of Step 3; the corresponding vertices , , and are given in parentheses.
6 Matching
There is a well-known greedy algorithm for MATCHING (repeated below as Algorithm 2). It uses the notion of a free vertex, which is any vertex that is not incident to any edge in the (current) matching. In an RDV graph, the greedy algorithm computes a maximum matching. (In fact, it does so in any strongly chordal graph if one uses a strong perfect elimination order as vertex ordering [6].) In an interval graph, the runtime can be improved to by reformulating the algorithm a bit [18]. By replacing 'binary search tree' in this reformulation with 'van Emde Boas tree', the runtime can be reduced further to [20]. A runtime of can also be achieved (with a different approach) for circular arc graphs [16] and permutation graphs [20]. For RDV graphs, the greedy algorithm can be implemented with runtime [3].
In this section, we give a faster algorithm for MATCHING in RDV graphs. At first glance, one might be tempted to do this by “translating” Algorithm 2 into a traversal in : Traverse the nodes in leaf-to-root order, act on when we reach , and search for among the free vertices of . However, searching through this entire set would take too long. Pre-computation of (similar to what we did with ) does not work either, because once is matched, we would need to update this reference (for passing to the parent), and
Solving Problems in RDV Graphs Faster and Easier
Algorithm 2 Classic greedy algorithm for MATCHING (see e.g. [6])
Input: RDV graph G with RDV representation (T, t, b)
1 let be any leaf-to-root ordering of
2 initialize the matching
3 for do
4 if is free and has free neighbors then
5 among all free neighbors of , let be the one that minimizes
6 add to M
Result: M
for this would again have to inspect all free vertices of . With a priority queue this could be done in time per node (details omitted), but we want to be faster than that.
We therefore use an entirely different approach based on a reformulation of the greedy algorithm that delays adding a matching edge until we have seen the second endpoint of it. See Algorithm 3 for this reformulation, which was given for an interval representation by Liang and Rhee [16] and stated using a vertex ordering by Biedl and Gokhale [1]. Neither reference formally proved that the two algorithms produce the same matching; for completeness we give such a proof in Appendix B, together with a self-contained optimality proof.
Algorithm 3 The delayed greedy algorithm for MATCHING [16]
Input: RDV graph G with RDV representation (T, t, b)
1 let be any leaf-to-root ordering of
2 initialize the matching
3 for do
4 if has free neighbors with then
5 among such neighbors of , let be the one that minimizes
6 add to the matching M
Result: M
The crucial operation for carrying out Algorithm 3 is to find, among the free neighbors of , the neighbor with the smallest , i.e., with the top node as low as possible, or to detect that there are no such neighbors with . In terms of the tree , this operation can be interpreted as follows: We start from and walk upwards until we hit the first node that is a top node of a free vertex. We denote this operation of “searching for the first top node of a free vertex, starting from a node and going upward” by .
If this walk reaches without finding such a node, then has no free neighbor with since the top node of such a would have to be a strict descendant of by Observation 2, but an ancestor of since is an edge. Vice versa, if has no free neighbor with , then will stop at itself, because is free and thus is a candidate node for stopping. On the other hand, if the walk stops at a top node of some free vertex with , then this must be the desired matching partner according to Algorithm 3, since the top nodes along the path from to appear
This was not a problem in our algorithm for DOMINATINGSET, because the vertex added to D dominates every vertex in the bag and hence the updated is simply nil.
in increasing order of i. In summary, Algorithm 3 is equivalent to Algorithm 4 given below.
Algorithm 4 The delayed greedy algorithm for MATCHING in terms of the search-operation
Input: RDV graph G with RDV representation (T, t, b) 1 initialize the matching M := 0 2 for each node , in leaf-to-root order do 3 if for some vertex z then 4 compute 5 if then 6 let y be the vertex with 7 add edge yz to M Result: M
So we now need a data structure that facilitates search(a). An idea for this is illustrated in Figure 3. Here the top nodes of free vertices are marked as thick bullets. Severing the edges between these nodes and their parent nodes (dashed edges) splits the tree into connected components. For any node a in a given component, search(a) yields the same result, namely the bulleted node at the root of the component. The task is thus reduced to identifying the component in which node a lies.

Figure 3 A tree T in which the top nodes of free vertices are marked as thick bullets.
Every addition of an edge to means that two vertices are no longer free, so two bullets disappear, and the corresponding components are merged with their parents. This calls for a UNION-FIND data structure. Recall that this is a data structure that maintains a partition of a ground set, which, in our case, is . Each set has a representative, and the operation (for any node ) retrieves the representative of the set containing . Initially, the partition contains for every node a singleton set whose representative is . The operation forms the union of the set containing and the set containing ; the new common representative is the one of set . We will only perform this when we know that .
We will use the UNION-FIND data structure to perform operation search efficiently. All our unions will be of the form , where denotes the parent of . Recall that we assumed that the root is a top node, so is well-defined when is not a top node.
We will maintain the following invariants.
Solving Problems in RDV Graphs Faster and Easier
(M1) As long as the root of has not yet been processed, the set of nodes for which the operation has been performed is .
(M2) As long as the root of has not yet been processed, for all nodes .
Our algorithm stores no significant helper information other than the UNION-FIND data structure and is just a few lines long. (For reference, Algorithm 8 in Appendix A.2 gives the complete pseudocode.)
Initialization. Initialize .
Initialize a UNION-FIND data structure where every node of forms a singleton set. For every node of that is not a top node, perform UNION(parent( ) ).
Processing node a. We assume that all strict descendants of a have already been processed. If for some :
Compute
If :
• Let y be the vertex with , and add edge yz to M.
• UNION (parent(c) c).
• If a is not the root of then perform UNION (parent(a) a).
After processing the root node, we return M as the maximum matching.
Correctness. Invariant (M1) is obviously satisfied: Initially, all vertices are free, and the initialization step performs the unions for all nodes that are not top nodes. Whenever a vertex becomes matched, the union operations are performed for the corresponding top node. The only exception is that we do not apply the UNION(parent(a) a) when a is the root of T (for obvious reasons). But this happens only in the last iteration, when the root is processed, an exception that is provided for in Invariant (M1).
To derive Invariant (M2) from (M1), we use the following statement:
▶ Proposition 6. Let be a tree rooted at node . Let be a set of nodes that contains the root , and let be its complement. Assume we have initialized a UNION-FIND data structure with each as a singleton set. After performing UNION(parent(a) a) for all nodes in any order, FIND(c) will report for any node c the first node in F on the path from c to the root .
Proof. See Figure 3 for an illustration. The operation UNION(parent(a) a) unites the set containing a with the set containing its parent. It follows by induction on that the sets are the connected components of the subgraph of T consisting of the edges from the nodes of U to their parents. Also (again by induction) each component forms a rooted tree, whose root is the representative of the set. By construction the set of roots is F.
Thus FIND(c) can be described as walking upwards in the tree to the root of the component, which equals the first node in F on the path to the root of the tree.
Since is precisely the operation of reporting the first node in F on the path from c to the root , Invariant (M2) follows as long as the root is free. This implies that our algorithm creates the same matching as Algorithm 4. Invariant (M2) does not apply after the root is processed, but then the algorithm is about to terminate anyway, and there will be no further FIND operations.
Runtime. Every UNION operation is between a node and its parent in the tree T. This is exactly the static tree set union scenario, for which there is a tailor-made data structure [9]: In this situation, on a random-access machine with unit cost measure and word length, for a universe of size N, a sequence of UNION operations and k FIND operations can be carried out in time and space. (The algorithm precomputes the answers to FIND operations on small sets, and then uses table look-up on small sets combined with a conventional UNION-FIND algorithm on a universe of size .) We perform at most two FIND operations for every node. With this, the UNION-FIND operations take time in total, and the rest of the algorithm can be implemented with runtime as well.
Since the greedy algorithm is known to find a maximum matching in an RDV graph [6], we have our result for MATCHING; see Appendix B.1 for a self-contained proof.
▶ Theorem 7. Let G be an n-vertex RDV graph with a given RDV representation of size . Then we can find a maximum matching of G in time.
Example. On the running example of Figure 2, the top nodes are processed in the order , , , , , , . At , we have , since is free and its path consists of a single node; so nothing happens. At , , so the edge is added to , and and are united with their parents. At , nothing happens, and at , , so the edge is added. At and , the search returns the node itself: the neighbors , , of whose top nodes lie below are already matched, and has no neighbor whose top node is lower than . Figure 4 shows the components of the UNION-FIND data structure at this point, before the root is processed. Finally, , and the edge is added. The resulting matching is maximum, since has only seven vertices.

Figure 4 The UNION-FIND components for the running example of Figure 2 just before the root is processed by the algorithm for MATCHING. The free vertices are , , and ; their top nodes are drawn as bullets, and the edges from these nodes to their parents (dashed) have not been united. returns , the root of the component containing .
Solving Problems in RDV Graphs Faster and Easier
7 Outlook
An obvious question is whether we really need the UNION-FIND data structure for MATCHING. (This is the most complicated part of our algorithm, especially if we want runtime rather than .) Can we achieve runtime while storing only elementary data at each node?
Another open problem concerns transferring the results to other graph classes that have intersection representations with restricted types of objects. As mentioned, -time algorithms are known for MATCHING in circular arc graphs [16] and permutation graphs [20]. These graph classes are unrelated to RDV graphs, and they are not even chordal. Can techniques like ours be used to reduce the runtime in these graph classes to as well, or at least to avoid the use of van Emde Boas trees?
The AI assistant Claude (Anthropic) was used during the preparation of this paper for proofreading (consistency of notation and terminology, typos, wording, and style), for suggestions on the organization of the presentation, and for drafting the worked examples, including Figures 2 and 4 and Table 1; the values in the examples were checked by running implementations of the algorithms. The algorithms, proofs, and results are the work of the authors, who have checked all suggested changes and take full responsibility for the content of the paper.
References
1 T. Biedl and P. Gokhale. Finding maximum matchings in RDV graphs efficiently. In Rahnuma Islam Nishat, editor, Canadian Conference on Computational Geometry (CCCG 2024), pages 309–316, 2024.
2 T. Biedl and P. Gokhale. Using ray-shooting queries for sublinear algorithms for dominating sets in RDV graphs. In Jakub Kozik and Alexander Wolff, editors, SOFSEM 2026: Theory and Practice of Computer Science, Lecture Notes in Computer Science, pages 216–230. Springer, 2026. doi:10.1007/978-3-032-17801-5_16.
3 Therese Biedl and Prashant Gokhale. Finding maximum matchings in RDV graphs efficiently. Computing in Geometry and Topology, 5(2):4:1–4:14, 2026. Special issue for CCCG'24. doi:10.57717/cgt.v5i2.72.
4 K. Booth and J.H. Johnson. Dominating sets in chordal graphs. SIAM Journal on Computing, 11(1):191–199, 1982. doi:10.1137/0211015.
5 S. W. Cheng, M. Kaminski, and S. Zaks. Minimum dominating sets of intervals on lines. Algorithmica, 20(3):294–308, Mar 1998. doi:10.1007/PL00009197.
6 E. Dahlhaus and M. Karpinski. Matching and multidimensional matching in chordal and strongly chordal graphs. Discrete Applied Mathematics, 84(1):79–91, 1998. doi:10.1016/S0166-218X(98)00006-7.
7 R. Diestel. Graph Theory, volume 173 of Graduate texts in mathematics. Springer, 2012.
8 M. Farber. Domination, independent domination, and duality in strongly chordal graphs. Discrete Appl. Math, 7(2):115–130, 1984. doi:10.1016/0166-218X(84)90061-1.
9 H. Gabow and R. Tarjan. A linear-time algorithm for a special case of disjoint set union. J. Comput. Syst. Sci., 30(2):209–221, 1985. doi:10.1016/0022-0000(85)90014-5.
10 F. Gavril. Algorithms for minimum coloring, maximum clique, minimum covering by cliques, and maximum independent set of a chordal graph. SIAM J. Comput., 1(2):180–187, 1972. doi:10.1137/0201013.
11 F. Gavril. A recognition algorithm for the intersection graphs of directed paths in directed trees. Discret. Math., 13(3):237–249, 1975. doi:10.1016/0012-365X(75)90021-7.
12 Y. Giyora and H. Kaplan. Optimal dynamic vertical ray shooting in rectilinear planar subdivisions. ACM Trans. Algorithms, 5(3):28:1–28:51, 2009. doi:10.1145/1541885.1541889.
13 P. Gokhale. Efficient algorithms for RDV graphs. Master's thesis, David R. Cheriton School of Computer Science, University of Waterloo, 2025. URL: https://hdl.handle.net/10012/21770.
14 M. C. Golumbic. Algorithmic Graph Theory and Perfect Graphs. Academic Press, New York, 1980.
15 U. I. Gupta, D. T. Lee, and J. Y.-T. Leung. Efficient algorithms for interval graphs and circular-arc graphs. Networks, 12(4):459–467, 1982. doi:10.1002/net.3230120410.
16 Y. Liang and C. Rhee. Finding a maximum matching in a circular-arc graph. Information Processing Letters, 45(4):185–190, 1993. doi:10.1016/0020-0190(93)90117-R.
17 E.M. McCreight. Priority search trees. SIAM Journal on Computing, 14(2):257–276, 1985. doi:10.1137/0214021.
18 A. Moitra and R. Johnson. A parallel algorithm for maximum matching on interval graphs. In Proceedings of the International Conference on Parallel Processing, ICPP '89, pages 114–120. Penn State University Press, 1989.
19 C. Monma and V. Wei. Intersection graphs of paths in a tree. J. Comb. Theory, Ser. B, 41(2):141–181, 1986. doi:10.1016/0095-8956(86)90042-0.
20 C. Rhee and Y. Liang. Finding a maximum matching in a permutation graph. Acta Informatica, 32(8):779–792, 1995. doi:10.1007/BF01178659.
A Streamlined Pseudocode for our Three Algorithms
A.1 Streamlined Algorithm for INDEPENDENTSET
Algorithm 5 Streamlined algorithm for INDEPENDENTSET
Input: RDV graph G with RDV representation (T, t, b)
1 initialize I := 0, set state(z) := free for all , for all
2 for , in leaf-to-root order do
3 for all children c of a do append to (this empties )
4 if for some then add z to
5 if for some and state(z) = free then
6 add z to I
7 for all do delete y from and set state(y) := blocked
Result: I
A.1.1 A Numeric Abstraction for INDEPENDENTSET
We can reduce the algorithm even more: Instead of storing a list we store only the lowest top node of a vertex in :
For any empty list, we take the maximum to be the sentinel value -1 (which has the same effect as the logically sounder value -∞). The value allows us to find out when a vertex should be added to I. The reason is that all vertices have depth( ) depth( ), by definition. Thus, if , it means that there must be some free vertex with depth( ) = depth( ), and hence .
Solving Problems in RDV Graphs Faster and Easier
Processing node a. We assume that all strict descendants of a have already been processed.
-
(Accumulate the data from the children.) Set .
-
(Update if a path starts.) If a is a bottom node, say :
= Set .
- (Add to solution.) If , then a must be a top node, say .
= Add z to I. // z was free until now.
= Set . // Empty the list .
Algorithm 6 summarizes the complete algorithm in streamlined form.
Algorithm 6 An even more streamlined algorithm for INDEPENDENTSET
Input: RDV graph G with RDV representation (T, t, b)
1 initialize I := 0
2 for , in leaf-to-root order do
3 set
4 if for some then set
5 if for some and then
6 add z to I
7 set // Empty the list .
Result: I
A.2 Streamlined Algorithm for DOMINATINGSET and MATCHING
Algorithm 7 shows a streamlined version of the algorithm for DOMINATINGSET from Section 5, which uses a global set D.
Algorithm 7 Streamlined algorithm for DOMINATINGSET
Input: RDV graph G with RDV representation (T, t, b)
1 initialize D := 0
2 for , in leaf-to-root order do
3 set
4 if then
5 let be the child of a with , and set
6 set
7 set
8 if then set
9 if for some then
10 if then update ,
11 if then update
12 if for some then
13 if then
14 add to D, set , set
15 if then set
16 if then set
Result: D
Algorithm 8 shows the algorithm for MATCHING from Section 6 in terms of UNION-FIND operations.
Algorithm 8 Streamlined algorithm for MATCHING in terms of UNION-FIND operations
Input: RDV graph G with RDV representation (T, t, b)
1 initialize the matching
2 initialize a UNION-FIND data structure where every node of T forms a singleton set
3 for every node a of T that is not a top node do UNION(parent(a) a)
4 for each node , in leaf-to-root order do
5 if for some vertex z then
6 compute
7 if then
8 let y be the vertex with
9 add edge yz to M
10 UNION(parent(c) c)
11 if a is not the root of T then UNION (parent(a) a)
Result: M
B Equivalence of Algorithms 2 and 3
In this section, we argue that the greedy algorithm for MATCHING (Algorithm 2) produces exactly the same output as the delayed greedy algorithm (Algorithm 3). Both algorithms were stated with a vertex ordering specifically designed for RDV graphs, but they can in fact be applied to any vertex ordering (as long as optimality of the result is not required), and we argue equivalence even in this situation.
▶ Lemma 8. For any graph G (not necessarily an RDV graph) and any fixed vertex ordering , Algorithm 3 produces the same matching as Algorithm 2 when both are applied with this ordering.
Proof. The proof is by induction on the number of vertices. If is an isolated vertex, it is left unmatched by both algorithms, and the removal of does not change anything for either algorithm.
Otherwise, we first argue that is matched to the same vertex by both algorithms: Initially, all vertices are free. Suppose that Algorithm 2 matches to because is the lowest-numbered neighbor of . Then, when Algorithm 3 successively considers the vertices , none of these vertices is adjacent to ; hence is still free when is considered, and the algorithm will of course choose the edge .
We then observe that the removal of and does not affect the decisions about the remaining vertices. This is obvious for Algorithm 2, because and are matched in the first round, and then the vertices and are no longer free and out of the game.
In Algorithm 3, none of the vertices is adjacent to , and hence the absence of is not noticed. Neighbors with such as do not play a role. Later, when the vertices are considered, and are no longer free in the first place, and hence their removal makes no difference.
Thus, we can remove and (or only , in case is isolated) from the input without changing the course of the algorithms on the remaining vertices. Thus, by induction, the remaining matching edges are also the same.
◀
Solving Problems in RDV Graphs Faster and Easier
B.1 Optimality Proof for Algorithms 2 and 3
Extending the arguments in the proof of Lemma 8, optimality for Algorithms 2 and 3 can be established by an easy exchange argument. For convenience, we include this self-contained proof here. In contrast to Lemma 8, we must now of course insist that the ordering places before whenever is a child of .
As mentioned in the main text, optimality of the greedy algorithm is known for a strong perfect elimination order in a strongly chordal graph, due to Dahlhaus and Karpinski [6]. For RDV graphs, it is not hard to show that such a strong perfect elimination order is obtained with the leaf-to-root order of top nodes that we assumed in Algorithms 2 and 3. (For the reverse level order of T, this has been shown in [3, 13].) However, instead of deriving optimality from the results on strongly chordal graphs [6], our proof considers RDV graphs directly.
▶ Theorem 9. The greedy Algorithms 2 and 3 compute a maximum matching.
Proof. The argument is based on the following claim:
▷ Claim 10. If the algorithm matches with then there is a maximum matching that matches with .
From this, optimality follows by induction on , along the lines of the proof of Lemma 8: If is matched with , then the algorithm, when restricting our attention to the remaining vertices, behaves as if and were never present, and thus, by induction, it computes a maximum matching on . By the claim, that matching together with the edge is a maximum matching for .
If is an isolated vertex, then again, the algorithm behaves as if were never present, and the argument is analogous.
Proof of Claim 10. Let be the neighbors of , in the order in which they appear in the list . Thus, the algorithm matches with .
We apply Observation 2 to the vertices : Let . Then either , or its top node is a strict descendant of . However, there are no top nodes that are strict descendants of , because the corresponding vertices would have to come before .
We conclude that all neighbors are in . Their top nodes lie on the path from to the root. This has an important consequence: When checking adjacency with , only the path from to matters, and the path below can be ignored. The reason is that there are no top nodes below .
By our assumption on the ordering, the top nodes appear in this order on the path from to the root, and consequently, the paths from to (which determine the neighbors of ) are nested. From this we conclude that the neighborhoods are nested as well: . Intuitively, this means that the best matching partner to choose greedily for is , because all other have more neighbors and thus more possibilities to be matched in the remaining graph.
Formally, we prove the claim as follows. Let be a maximum matching. Since it is a maximum matching, it cannot leave both and unmatched.
If matches only one of the vertices and , we can always include the edge , at the expense of removing the matching edge incident to or , and we get a matching that is no smaller than before.
Finally, suppose that matches with some vertex with , and is matched with some vertex . Then we can replace these two edges by the edges and . The edge must exist, since .