A bipartite graph is convex if can be numbered as so that the neighbors of every vertex form an interval , see Figure 1(a). For such graphs, we consider the problem of computing an induced matching (a) of maximum cardinality or (b) of maximum total weight, for graphs with edge weights.
An induced matching is a matching that results as a subgraph induced by some subset of vertices. This amounts to requiring that no edge of connects endpoints of two different edges of , see Figure 1(a). In terms of the line graph, an induced matching is an independent set in the square of the line graph. The square of a graph connects every pair of nodes whose distance is one or two. Accordingly, we call two edges of independent if they can appear together in an induced matching, or in other words, if their endpoints induce a (a disjoint union of two edges) in . Otherwise, they are called dependent.
In convex bipartite graphs, maximum-cardinality induced matchings are dual to minimum chain covers. A chain graph is a bipartite graph that contains no induced matching of more than one edge, i. e., it contains no pair of independent edges. (Chain graphs are also called difference graphs  or non-separable bipartite graphs .) A chain cover of a graph with edge set is a set of chain subgraphs of such that the union of the edge sets of is , see Figure 1(b). A chain cover with chain subgraphs provides an obvious certificate that the graph cannot contain an induced matching with more than edges. We will elaborate on this aspect of a chain cover as a certificate of optimality in Section 5. A minimum chain cover of is a chain cover with a smallest possible number of chain subgraphs. In a convex bipartite graph , the maximum size of an induced matching is equal to the minimum number of chain subgraphs of a chain cover .
We denote the number of vertices by , , , and the number of edges by . If a convex graph is given as an ordinary bipartite graph without the proper numbering of , it can be transformed into this form in linear time . (In terms of the bipartite adjacency matrix, convexity is the well-known consecutive-ones property.) Unweighted convex bipartite graphs have a natural implicit representation  of size , which is often called a compact representation [13, 20]: every interval is given by its endpoints and , see Figure 1(c). Since the numbering of can be computed in time, it is easy to obtain a compact representation in total time [20, 22]. The chain covers that we construct will consist of convex bipartite subgraphs with the same ordering of as the original graph. Thus, we will be able to use the same representation for the chain graphs of a chain cover.
Related Work and Motivation.
The problem of finding an induced matching of maximum size was first considered by Stockmeyer and Vazirani  as the “risk-free marriage problem” with applications in interference-free network communication. The decision version of the problem is known to be -complete in many restricted graph classes [4, 16, 15], in particular bipartite graphs [4, 16] that are -free  or have maximum degree . On the other hand, it can be solved in polynomial time in chordal graphs , weakly chordal graphs , trapezoid graphs, -interval-dimension graphs and co-comparability graphs , amongst others. For a more exhaustive survey we refer to .
The class of convex bipartite graphs was introduced by Fred Glover , who motivates the computation of matchings in these graphs with industrial manufacturing applications. Items that can be matched when some quantity fits up to a certain tolerance naturally lead to convex bipartite graphs. The computation of matchings in convex bipartite graphs also corresponds to a scheduling problem of tasks of discrete length on a single disjunctive resource . The problem of finding a (classic, not induced) matching of maximum cardinality in convex bipartite graphs has been studied extensively [10, 22, 9] culminating in an algorithm when a compact representation of the graph is given . Several other combinatorial problems have been studied in convex bipartite graphs. While some problems have been shown to be -complete even if restricted to this graph class , many problems that are -hard in general can be solved efficiently in convex bipartite graphs. For example, a maximum independent set can be found in time (assuming a compact representation)  and the existence of Hamiltonian cycles can be decided in time . For a comprehensive summary we refer to .
One of the applications given by Stockmeyer and Vazirani  for the induced matching problem can be stated as follows. We want to test (or use) a maximum number of connections between receiver-sender pairs in a network. However, testing a particular connection produces noise so that no other node in reach may be tested simultaneously. We remark that this type of motivation extends very naturally to convex bipartite graphs when we consider wireless networks in which nodes broadcast or receive messages in specific frequency ranges. Further, weighted edges can model the importance of connections.
Yu, Chen and Ma  describe an algorithm that finds both a maximum-cardinality induced matching and a minimum chain cover in a convex bipartite graph in runtime . Their procedure is improved by Brandstädt, Eschen and Sritharan , resulting in a runtime of . Chang  computes maximum-cardinality induced matchings and minimum chain covers in time in bipartite permutation graphs, which form a proper subclass of convex bipartite graphs. Recently, Pandey, Panda, Dane and Kashyap  gave polynomial algorithms for finding a maximum-cardinality induced matching in circular-convex and triad-convex bipartite graphs. These graph classes generalize convex bipartite graphs.
We improve the previous best algorithm  for maximum-cardinality induced matching and minimum chain covers in convex bipartite graphs in several ways. In Section 2 we give an algorithm for finding maximum-weight induced matchings in convex bipartite graphs with runtime. The weighted problem has not been considered before. In Section 3 we specialize our algorithm to find induced matchings of maximum cardinality in runtime, given a compact representation of the graph. In Section 4 we extend this approach to obtain in time a compact representation of a minimum chain cover. If no compact representation is given, our approach is easily adapted to produce a minimum chain cover in time.
All of our algorithms achieve optimal running time for the respective problem and model. Our results for finding a maximum-cardinality induced matching also improve the running times of the algorithms of Pandey et al.  for the circular-convex and triad-convex case, as they use the convex case as a building block.
2 Maximum-Weight Induced Matchings
In this section, we compute a maximum-weight induced matching of a given edge-weighted convex bipartite graph in time . We generally write indices as superscripts and indices as subscripts. We consider as a subset of . We assume that is numbered as described in Section 1 and the interval of each vertex is given by the pair (,) of the left and right endpoint. Each edge has a weight .
Our dynamic-programming approach considers the following subproblems: For an edge , we define as the cost of the maximum-weight induced matching that uses the edge and contains only edges in . The following dynamic-programming recursion computes :
The range over which the maximum is taken is illustrated in Figure 2.
In this recursion, we build the induced matching of weight by adding the edge to some induced matching of weight . We want to be an induced matching: By construction, the edge is independent of , but we have to show that the other edges of are also independent of . In order to prove this (Lemma 2), we use a transitivity relation between independent edge pairs.
Two edges and are independent if and only if and .
Let with . Assume that and are independent, and and are independent. Then and are independent.
By Observation 1, we have and . Thus, and . ∎
The recursion (1) is correct.
We create a table in which we record the entries . We assume that the intervals are sorted in nondecreasing order by , that is, for . The values form the -th row of the table. We fill the table row by row proceeding from to . Each row is processed from left to right.
The only challenge in evaluating (1) is the maximum-expression, for which we introduce the notation .
We discuss the computation of the leftmost entry later. When we proceed from to we want to go incrementally from to . Direct comparison of the respective defining sets leads to
In order to evaluate the maximum of the second set in (2) efficiently, we group intervals with a common right endpoint together. Let be the earliest startpoint of an interval with endpoint . If there are no intervals with endpoint , we set . (It would be more logical to set in this case, but this choice makes the algorithm simpler.) We maintain an array for that is defined as follows:
In a sense, is a provisional version of the expression , which takes into account only the already processed rows. For (2), we need the entry , and we will see that all relevant entries have already been computed whenever we access this entry. Thus, we rewrite (2):
The condition ensures that the array index does not exceed the left boundary of the array . Also, the index never exceeds the right boundary of the array , since , and therefore . Thus, is always defined when it is accessed.
We distinguish three cases.
Case 1: No interval ends at , and accordingly, .
Case 2: There exists an interval ending at , and . The right side of (3) evaluates to . In (2), intervals that end at have . Thus, an edge with and does not exist, and the second set in (2) is empty. Therefore, (2) evaluates to .
After processing row with startpoint and endpoint , we have to update the values in . This is straightforward. Figure 3 illustrates the role of the arrays when processing a row.
It remains to discuss the computation of the first value of the row. An edge and edge are independent if and only if the interval ends before , that is . Since we process the intervals in nondecreasing order by their startpoints, it suffices to maintain a value with the maximum in all finished intervals: those intervals that end before . In other words . This value is easily maintained by updating as increases. The full details are stated as Algorithm 1.
The update of the array in the second loop can be integrated with the computation of in the first loop. When this is done, the values need not be stored at all because they are not used. As stated earlier, when no interval ends at a point , we set . The array consists of a single dummy entry . This way we avoid having to treat this special cases during the algorithm.
We have described the computation of the value of the optimal matching. It is straightforward to augment the program so that the optimal matching itself can be recovered by backtracking how the optimal value was obtained, but this would clutter the program.
A maximum-weight induced matching of an edge-weighted convex bipartite graph can be computed in time.
3 Maximum-Cardinality Induced Matchings
For the unweighted version of the problem, we assume a compact representation of a convex bipartite graph , that is, for each we are given the startpoint and endpoint of its interval . This makes it possible to obtain a linear runtime of .
The recursion (1) can be specialized to the unweighted case by setting .
This recursion has already been stated in  and  in a slightly different formulation. Yu, Chen and Ma  describe it as a greedy-like procedure that “colors” the edges of a bipartite graph with the values . From this coloring, they obtain both a maximum-cardinality induced matching and a minimum chain cover. The original implementation given in  runs in time . Brandstädt, Eschen and Sritharan  give an improved implementation of the coloring procedure with runtime . Our Algorithm 1 from Section 2 obtains the values in total time .
Given a compact representation, we can exploit some structural properties of the filled dynamic-programming table to further improve the runtime to . The following observations were first given in  and .
Lemma 4 ([24, Lemma 5]).
The values are nondecreasing in each row.
This is obvious from (5), since the set over which the maximum is taken increases with . ∎
Lemma 5 ([3, Lemma 3.3, Lemma 3.4]).
Each row contains at most two consecutive values.
Let be the largest value in some row . Then, if we take a corresponding matching of size , it is easy to see that we can remove the last two edges and replace them by an arbitrary edge . This proves that .
The computation of the leftmost entry is exactly as in Algorithm 1.
The position where the entries of row switch from to can be determined from (5): If there is a row containing an entry left of , then must be as soon as . The algorithm determines the threshold position as the smallest right endpoint under these constraints. Then the entries in row start at if these entries are still part of the row.
We do not maintain the whole array for each , but only its last entry ; this is sufficient for updating and thus for computing the leftmost entries in the rows. We call this value .
This leads to Algorithm 2.
We will improve Algorithm 2 by maintaining the values instead of computing them from scratch. We use the fact that the smallest value in the row is known, and hence we can associate with the value instead of the row index , as is already apparent from our chosen notation. We update whenever increases. The details are shown in Algorithm 3. The differences to Algorithm 2 are marked by .
This still does not achieve running time. The final improvement comes from realizing that it is sufficient to update when is the leftmost entry in row . The time when such an update occurs can be predicted when a row is generated. To this end, we maintain a list for that records the updates that are due when becomes . This final version is Algorithm 4.
The runtime of Algorithm 4 is : Processing each interval takes constant time and adds at most two pairs to the lists . Thus, processing the lists for updating the array takes also only time.
Some simplifications are possible: The addition of to the list in the case of two values can actually be omitted, as it leads to no decrease in : is already . The algorithm could be further streamlined by observing that at most two consecutive values of need to be remembered at any time.
Again, it is easy to modify the algorithm to return a maximum induced matching in addition to its size.
Given a compact representation, a maximum-cardinality induced matching of a convex bipartite graph can be computed in time.
4 Minimum Chain Covers
In convex bipartite graphs, the size of a maximum-cardinality induced matching equals the number of chain subgraphs of a minimum chain cover . In this section we use this duality and extend our Algorithm 4 to obtain a minimum chain cover of a convex bipartite graph .
Let be the cardinality of a maximum induced matching of . Accordingly, the values cover the range . We create chain subgraphs of . The edges with will be part of the chain subgraph .
As already observed in , the edges with a fixed value of may contain independent edges and, thus, do not necessarily constitute a chain graph. Accordingly, Yu, Chen, and Ma  describe a strategy to extend the edge set for each value of to a chain graph . Their original implementation runs in time . Brandstädt, Eschen, and Sritharan  give an improved implementation with runtime . We implement their strategy in time, given a compact representation. The correctness was already shown in . We give a new independent proof. The following characterization is often used as an alternative definition of chain graphs:
A bipartite graph is a chain graph if and only if the sets of neighbors of the vertices form a chain in the inclusion order. (Equal sets are allowed.) In other words, among any two sets and , one must be contained in the other.
This is a direct consequence of the fact that edges and are independent if and only if and . ∎
The condition that the neighborhoods must form a chain is apparently the reason for calling these graphs chain graphs, however, we did not find a reference for this.
We use to denote the set of rows that contain entries . For every row , we determine the beginning and ending points with this color, that is, . We extend every such interval to the left by choosing a new starting point according to the formula
We construct the chain graph as the graph with the extended intervals . Figure 4 shows an example.
It is obvious by construction that these intervals satisfy the conditions of a chain graph: By Lemma 6, we have to show that there are no two intervals , with and . But if the last condition holds, (7) ensures that .
The only thing that could go wrong is that becomes too small so that the chain graph is not a subgraph of . The following lemma shows that this is not the case.
for every .
For the sake of contradiction, assume . By (6), there is a row such that and . Setting and in the recursion (5), we conclude that , because otherwise, (5) would imply . Thus, is an edge of . By Lemma 5, . By (5), there is an edge with , and . Again by (5), such an edge would imply that , a contradiction. ∎
Algorithm 5 carries out the computation of (6). It processes the triplets in increasing order of the endpoints . This can be done in linear time, by first sorting the triples into buckets according to the value of . Thus, Algorithm 5 takes linear time . By Lemma 6, the result is a chain cover, which by duality is minimum. Each row belongs to at most two chain subgraphs, and thus the chain cover consists of at most such row intervals in total. It is straightforward to extend Algorithm 4 to compute the sets and the quantities , and thus the cover can be constructed in time in compressed form.
Given a compact representation of a convex bipartite graph, a compact representation of a minimum chain cover can be computed in time.
Given a compact representation of a minimum chain cover, we can list all the edges of its chain subgraphs in time since every edge is contained in at most two chain subgraphs. As mentioned in the introduction, a compact representation of a convex bipartite graph can be computed in time [20, 22, 2]. Thus, Algorithm 4 and Algorithm 5 can also be used to obtain:
A minimum chain cover of a convex bipartite graph can be computed in time.
5 Certification of Optimality
An induced matching together with a chain cover of the same cardinality provides a certificate of optimality, of size . As we will establish in the following discussion, it is easy to check this certificate for validity in linear time. This is easier than constructing the largest induced matching with our algorithm. Thus, it is possible to establish correctness of the result beyond doubt, for each particular instance of the problem, without having to trust the correctness of our algorithms and their implementations, see  for a survey about this concept.
It is trivial to check whether the matching is contained in the graph. To test whether it forms an induced matching, we sort the edges by . This takes time with bucket-sort. Then, by Lemma 1, it is sufficient to test consecutive edges for independence, and each such test takes only constant time according to Observation 1.
To establish the validity of a chain cover , we need to check that the edges of are covered and each is a chain subgraph. The chain subgraphs , for are compactly represented by a set of at most quadruples . The following checking procedure works in linear time for any chain cover as long as it consists of convex bipartite subgraphs. It does not use any special properties of the cover produced by our algorithm.
We sort the quadruples lexicographically. Then it is easy to check the chain graph property using the characterization of Lemma 6: The intervals that belong to a fixed chain graph