On adaptive algorithms for maximum matching
Falko Hegerfeld, Stefan Kratsch

TL;DR
This paper demonstrates that phase-based maximum matching algorithms are adaptive to input structure, achieving linear or near-linear time on certain graph classes and graphs close to these classes, while maintaining worst-case bounds.
Contribution
It shows that phase-based algorithms adaptively run faster on structured graphs and graphs close to such classes, without explicit deletion set computation.
Findings
Algorithms run in linear time on specific graph classes.
Algorithms run in O(\u222a k m) for graphs close to these classes.
Phase framework can still require ( n m) time on simple graph classes.
Abstract
In the fundamental Maximum Matching problem the task is to find a maximum cardinality set of pairwise disjoint edges in a given undirected graph. The fastest algorithm for this problem, due to Micali and Vazirani, runs in time and stands unbeaten since 1980. It is complemented by faster, often linear-time, algorithms for various special graph classes. Moreover, there are fast parameterized algorithms, e.g., time relative to tree-width , which outperform when the parameter is sufficiently small. We show that the Micali-Vazirani algorithm, and in fact any algorithm following the phase framework of Hopcroft and Karp, is adaptive to beneficial input structure. We exhibit several graph classes for which such algorithms run in linear time . More strongly, we show that they run in time…
| Dedicated algorithm | Phase framework algorithms | ||
| Parameter / Graph class | Parameter | Parameter | Dist. to parameter |
| Vertex cover number | n.a. | ||
| Star forest | |||
| Bounded tree-depth | |||
| Cluster graph | |||
| Minimum degree | |||
| Independence number | none | ||
| Neighborhood diversity | |||
| Parameter and | |||
| Parameter | Running Time | Reference |
| Matching Number | [8, 33, 35, 48] | |
| Vertex Cover Number | / / | [35, 48] / [45] / [45] |
| Feedback Vertex Number | / | [45] / [46] |
| Feedback Edge Number | / | [45] / [46] |
| [57] | ||
| Tree-width | / | [23] / [37] |
| Tree-depth | [37] | |
| Modular-width | / | [11] / [40] |
| Split-width | [16] | |
| -sparseness | [11] | |
| Genus | [58] | |
| -minor-free | [58] | |
| Dist. to Cocomparability | [47] | |
| Distance to Chain Graph | / | [45] / [46] |
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Humboldt-Universität zu Berlin, [email protected] Humboldt-Universität zu Berlin, [email protected]
\CopyrightFalko Hegerfeld and Stefan Kratsch \ccsdesc[500]Mathematics of computing Matchings and factors \ccsdesc[300]Theory of computation Graph algorithms analysis \ccsdesc[500]Theory of computation Parameterized complexity and exact algorithms
\hideLIPIcs\EventEditorsChristel Baier, Ioannis Chatzigiannakis, Paola Flocchini, and Stefano Leonardi \EventNoEds4 \EventLongTitle46th International Colloquium on Automata, Languages, and Programming (ICALP 2019) \EventShortTitleICALP 2019 \EventAcronymICALP \EventYear2019 \EventDateJuly 9–12, 2019 \EventLocationPatras, Greece \EventLogoeatcs \SeriesVolume132 \ArticleNo66
On adaptive algorithms for maximum matching
Falko Hegerfeld
Stefan Kratsch
Abstract
In the fundamental Maximum Matching problem the task is to find a maximum cardinality set of pairwise disjoint edges in a given undirected graph. The fastest algorithm for this problem, due to Micali and Vazirani, runs in time and stands unbeaten since 1980. It is complemented by faster, often linear-time, algorithms for various special graph classes. Moreover, there are fast parameterized algorithms, e.g., time relative to tree-width , which outperform when the parameter is sufficiently small.
We show that the Micali-Vazirani algorithm, and in fact any algorithm following the phase framework of Hopcroft and Karp, is adaptive to beneficial input structure. We exhibit several graph classes for which such algorithms run in linear time . More strongly, we show that they run in time for graphs that are vertex deletions away from any of several such classes, without explicitly computing an optimal or approximate deletion set; before, most such bounds were at least . Thus, any phase-based matching algorithm with linear-time phases obliviously interpolates between linear time for and the worst case of when . We complement our findings by proving that the phase framework by itself still allows phases, and hence time , even on paths, cographs, and bipartite chain graphs.
keywords:
Matchings, Adaptive Analysis, Parameterized Complexity
1 Introduction
The objective in the fundamental Maximum Matching problem is to find a set of disjoint edges of maximum cardinality in a given undirected graph . Maximum Matching has been heavily studied and was the first problem for which a polynomial-time algorithm has explicitly been established [18]. Several algorithms [8, 26, 33, 48] achieve the best known running time of for graphs with vertices and edges, starting with the algorithm of Micali and Vazirani [48] in 1980. Since then, the time of remains unbeaten.
This state-of-the-art has motivated extensive research into faster algorithms for Maximum Matching on special inputs: Extensive effort went into beating the worst case running time of for Maximum Matching on special graph classes, resulting in a large number of publications [15, 24, 25, 30, 32, 35, 42, 43], often even obtaining linear-time algorithms [10, 13, 47, 52, 56]. Similarly, there is a great variety of algorithms whose running time depends on and but also on some structural parameter of the input graph, like its tree-width, its genus, or its vertex-deletion distance to a certain graph class (summarized in Table 2). As an example, one can solve Maximum Matching in time when the input graph is given together with a set of vertices such that belongs to a class in which Maximum Matching can be solved in linear time (cf. [47]): It suffices to solve the problem on in linear time and to then apply at most augmentation steps to account for vertices in ; each such step can be implemented in linear time.
A caveat of this great number of different algorithms for special cases is that we may have to first find the relevant structure, e.g., a set so that belongs to a certain graph class , and to then decide which algorithm to apply. In some cases, finding the relevant optimal structure is NP-hard and using approximate structure may lead to increase in running time. Moreover, except for time relative to vertex cover number or maximum matching size , which can be seen to follow from the general analysis of Hopcroft and Karp [35], the previously known time bounds improve on only if , at best.
Our results.
We approach the Maximum Matching problem from the perspective of adaptive analysis (of algorithms). Rather than developing further specialized algorithms for special classes of inputs, we prove that a single algorithm actually achieves the best time bounds relative to several graph classes and parameters; in particular, several new or improved time bounds are obtained. Moreover, that algorithm is known since 1980, namely it is the Micali-Vazirani-algorithm [48], and it is oblivious to the actual structure and parameter values. In fact, our analysis does not depend on overly specific aspects of that algorithm and, rather, applies to any algorithm for Maximum Matching that follows the “phase framework” established by Hopcroft and Karp [35] for Bipartite Matching and that implements each phase in linear time, e.g., the algorithms by Blum [8] and Goldberg and Karzanov [33]. In this framework, each phase is dedicated to finding a disjoint and maximal packing of shortest augmenting paths, and it can be shown that phases always suffice (cf. [35]).
We show that algorithms following the phase framework adapt to beneficial structure in the form of inputs from special graph classes or inputs that are few vertex deletions away from such a class, without running a recognition algorithm or computing the deletion distance (i.e., they are obliviously adaptive). Concretely, we show that any such algorithm solves Maximum Matching in linear time on several graph classes such as cluster graphs or graphs of bounded neighborhood diversity. Moreover, for many such classes we also show that any such algorithm takes time on graphs that are vertex deletions away from the class, without explicitly computing such a set of deletions (or even knowing the class in question). Furthermore, this running time interpolates between the worst-case time for and linear time for , hence remaining competitive even in the absence of beneficial input structure. Except for the matching number and the vertex cover number, time bounds of the form are new, even for dedicated algorithms. Besides that, we improve upon the algorithm by Yuster [57] for the special case of minimum degree and we improve upon the algorithm by Kratsch and Nelles [40] for the special case of bounded neighborhood diversity. Our positive results are summarized in Table 1.
We complement our findings by exhibiting several graph classes on which the phase framework still allows the worst-case of phases, and hence time. We prove this for paths, trivially perfect graphs, which are a subclass of cographs, and bipartite chain graphs (and hence their superclasses). This, of course, does not contradict the existence of dedicated linear-time algorithms nor the possibility of tweaking a phase-based algorithm to avoid the obstructions. Nevertheless, these results do rule out the possibility of proving adaptiveness of arbitrary phase-based algorithms, and they showcase obstructions that need to be handled to obtain more general adaptive algorithms for Maximum Matching.
Related work.
Our work fits into the recent program of “FPT in P”111An FPT-algorithm solves a given (usually NP-hard) problem in time where is some problem-specific parameter and is the input size. or efficient parameterized algorithms, initiated independently by Abboud et al. [1] and Giannopoulou et al. [31]. This program seeks to apply the framework of parameterized complexity to tractable problems to obtain provable running times relative to certain parameters that outperform the fastest known algorithms or (conditional) lower bounds obtained in the fine-grained analysis program (see, e.g., [2, 9, 50]). In particular, Mertzios et al. [47] have suggested Maximum Matching as the “drosophila” of FPT in P, i.e., as a central subject of study, similar to the role that Vertex Cover plays in parameterized complexity. Already, there is a large number of publications on parameterized algorithms for Maximum Matching [11, 16, 17, 23, 40, 45], apart from large interest in FPT in P in general [1, 6, 21, 36, 37, 38]. There has also been interest in linear-time preprocessing, which, relative to some parameter , reduces the problem to solving an instance of size and leads to time bounds of the form [46].
Adaptive analysis of algorithms has been most successful in the context of sorting and searching [3, 4, 14, 19]. We are not aware of prior (oblivious) adaptive analysis of established algorithms for the Maximum Matching problem but two works have designed dedicated adaptive algorithms relative to tree-depth [37] and modular-width [40].
Bast et al. [5] analyzed the Micali-Vazirani algorithm for random graphs, obtaining a running time of with high probability.
Organization.
Some preliminaries on graphs and matchings are recalled in Section 2. Section 3 is dedicated to recalling the analysis of Hopcroft and Karp [35] and defining phase-based algorithms. In Section 4 we present the positive results and the lower bounds are presented in Section 5. We conclude in Section 6.
2 Preliminaries
We mostly consider simple graphs, unless stated otherwise, and denote an edge between and as the concatenation of its endpoints, . Let denote a graph. A path in is denoted by listing its vertices in order, i.e., . We use the following notation to refer to subpaths of a path :
[TABLE]
By disjoint paths we will always mean vertex-disjoint paths. For a set of vertices , we define . For two sets their symmetric difference is denoted by .
A set is a vertex cover of if every edge of has at least one endpoint in ; the vertex cover number of is the minimum cardinality of any vertex cover of . An independent set of is a set of pairwise nonadjacent vertices; the independence number of a graph is the maximum cardinality of any independent set of . The maximum degree and minimum degree of are denoted by and respectively. For a class of graphs we define to be the vertex deletion distance of to ; a set such that is called a modulator. E.g., the vertex cover number is the vertex deletion distance of to edgeless graphs, i.e., independent sets.
A matching in a graph is a set of pairwise disjoint edges. Let be a graph and let be a matching in . The matching is maximal if there is no matching in such that and is maximum if there is no matching in such that ; the matching number of is the cardinality of a maximum matching in .
A vertex is called -matched if there is an edge in that contains , and is called -exposed otherwise. We do not mention if the matching is clear from the context. We say that an edge is blue if and is red if . An -alternating path is a path in that alternatingly uses red and blue edges. An -augmenting path is an -alternating path that starts and ends with an -exposed vertex; a shortest -augmenting path is an -augmenting path that uses as few edges as possible.
It is well known that matchings can be enlarged along augmenting paths and that an augmenting path always exists if the matching is not maximum. We say that the matching is obtained by augmenting along .
Lemma 2.1**.**
If is a matching in and is an -augmenting path, then is also a matching in and has size .
Theorem 2.2** ([35]).**
Let and be matchings in with . The subgraph of contains at least vertex-disjoint -augmenting paths.
Corollary 2.3** ([7]).**
A matching is maximum if and only if there is no -augmenting path.
3 Hopcroft-Karp analysis
Many of the fastest algorithms for Maximum Matching make use of a framework introduced by Hopcroft and Karp [35] for the special case of bipartite matching. We give an overview of the framework in this section, mostly following Hopcroft and Karp [35]. The main idea is to search for shortest augmenting paths instead of arbitrary augmenting paths. Exhaustively searching for shortest augmenting paths and augmenting along them leads to Algorithm 1.
Let be the sequence of augmenting paths in the order found during an execution of Algorithm 1. Hopcroft and Karp [35] observed the following properties of the computed shortest augmenting paths.
Lemma 3.1** ([35]).**
Let be a matching, let be a shortest -augmenting path, and let be a -augmenting path, then .
Corollary 3.2** ([35]).**
The sequence is non-decreasing.
Corollary 3.3** ([35]).**
If for some , then and are vertex-disjoint.
Following these observations, we can partition the sequence into maximal contiguous subsequences such that , due to Corollary 3.3 the paths must be pairwise vertex-disjoint. Every such subsequence is called a phase and corresponds to a maximal set of vertex-disjoint shortest augmenting paths due to Corollary 3.3. With the terminology of phases introduced, it is useful to restate Algorithm 1 as follows.
In Algorithm 2 each iteration of the while-loop corresponds to a single phase. If an algorithm implements Algorithm 2 we say that it employs the phase framework. In the following, we will abstract from the implementation details of algorithms employing the phase framework and only bound the number of phases that are required in the worst case. Hopcroft and Karp [35] presented an upper bound in terms of the matching number .
Theorem 3.4** ([35]).**
*Every algorithm employing the phase framework requires at most
phases.*
The next bound is a simple corollary of Theorem 3.4 by noticing that , but we opt to give an independent proof to serve as an instructive example for the proofs to come.
Theorem 3.5** (folklore).**
Every algorithm employing the phase framework requires at most phases.
Proof.
Let denote the matching obtained after performing phases of Algorithm 2. Every further -augmenting path has length at least by Corollary 3.2. This implies that we can pack at most such augmenting paths into and hence by Theorem 2.2, at most augmentations remain. Since we perform at least one augmentation per phase, Algorithm 2 must have terminated after an additional phases. Thus, Algorithm 2 terminates after at most phases. ∎
Several of the fastest Maximum Matching algorithms employ the phase framework [8, 33, 48]. Any one of these algorithms yields the following time bound for a single phase.
Theorem 3.6**.**
There is an algorithm that given a matching computes a maximal set of vertex-disjoint shortest -augmenting paths in time . In particular, each phase of the phase framework can be implemented to run in time .
With Theorem 3.5 and Theorem 3.4 we obtain the following time bounds.
Theorem 3.7**.**
There is an algorithm employing the phase framework that solves Maximum Matching in time and .
4 Adaptive parameterized analysis
In this section we will perform an adaptive analysis for algorithms employing the phase framework by analyzing the required number of phases in terms of various graph parameters. Theorem 3.6 yields an improved running time if the considered parameter is small enough.
Many of the considered parameters are NP-hard to compute, e.g., the vertex cover number. This is not an issue, however, as we only require the parameter value for the running time analysis and not for the execution of the algorithm. In this sense, algorithms employing the phase framework are proved to obliviously adapt to the studied parameters.
4.1 Short alternating paths
Our main lemma relies on bounding the length of shortest augmenting paths. In the interest of simplifying later arguments, we will not only bound the length of shortest augmenting paths, but also of alternating paths that are not necessarily augmenting. The strategy for obtaining such upper bounds is to take a long alternating path and deduce that additional edges must exist in that enable us to find a shorter alternating path in between the endpoints of . Hence, the replacement path will only visit vertices that are also visited by the original path . The following definition formalizes this idea.
Definition 4.1**.**
Given a matching in a graph and an -alternating path . We say that an -alternating path replaces if the following is true:
- •
,
- •
and ,
- •
has the same parity as with respect to , i.e.,
and .
In particular, if replaces , then is at most as long as .
A technicality that arises from considering general alternating paths, as opposed to augmenting paths, is that an alternating path that starts and ends with a blue edge, i.e. an edge not in the matching, might have endpoints that are not exposed. If we want to shortcut by taking a different edge incident to such an endpoint, then this edge might be red which causes our constructions to fail. To avoid this issue, it suffices to consider the subpath resulting from the removal of the first and last edge.
Definition 4.2**.**
A graph is -replaceable if for every matching each -alternating path can be replaced by an -alternating path of length at most . The class of -replaceable graphs is denoted .
We will now show that algorithms employing the phase framework require only few phases for graphs that are close, in the sense of vertex deletion distance, to -replaceable graphs.
Lemma 4.3**.**
Every algorithm employing the phase framework requires at most phases on graphs with . In particular, Maximum Matching can be solved in time for such graphs.
Proof.
Let with , such that and let be the matching obtained after performing phases of Algorithm 2. We claim that every shortest -augmenting path uses at least vertices of ; every such path has a length of at least due to Corollary 3.2. Consider such a path , since is -replaceable, we can assume that every time enters it uses at most vertices of before going back to . Hence, must use at least vertices of to have a length of or more.
Since is of size at most and due to the properties of replacing paths, this implies that we can pack at most -augmenting paths into as
[TABLE]
By Theorem 2.2 at most augmentations remain, which require at most phases. In total, we need phases. Theorem 3.6 implies the time bound. ∎
The following running time bound relative to the vertex cover number follows directly from Theorem 3.7 by the use of the well-known inequality .
Theorem 4.4**.**
Every algorithm employing the phase framework requires at most phases. In particular, Maximum Matching can be solved in time .
Alternatively, observe that if is the class of independent sets, then and hence Theorem 4.4 is implied by Lemma 4.3 as independent sets are trivially -replaceable.
More generally, every graph without paths of length is -replaceable. It is known that a graph class has bounded path length if and only if it has bounded tree-depth (see, e.g., [49, Chapter 6]). As a further special case consider the class of star forests, i.e., graphs where every connected component is a star and therefore must be -replaceable. Hence, we obtain the following corollary of Lemma 4.3.
Corollary 4.5**.**
Let be the class of star forests. Every algorithm employing the phase framework requires at most phases. In particular, Maximum Matching can be solved in time .
4.2 Independence number
A graph with independence number contains many edges in the sense that any set of vertices must induce an edge. We will use this property to shorten long alternating paths.
Theorem 4.6**.**
Suppose that is a graph such that , then is -replaceable.
Proof.
First, fix a matching . We show how to replace alternating paths that begin and end with a blue edge, i.e., an edge not in . By replacing appropriate subpaths of long alternating paths with other parities, the general result will follow.
Suppose that is an alternating path that is longer than and that starts and ends with a blue edge. We can assume that is odd. Distinguishing the vertices of by their parity, we define and . Furthermore, we define the sets and for by
[TABLE]
Note that for all , hence the cannot be independent sets. Thus, there is at least one edge in . We denote the endpoints of by
[TABLE]
We now consider the vertices of that lie between the endpoints of on ; we omit to ensure that the constructed path is shorter than . Concretely, let Equation 1 implies that . Now, we arbitrarily choose a vertex from each and define . Observe that cannot be an independent set as contains vertices; thus, there must exist an edge with . We construct the path that replaces by (see Figure 1)
[TABLE]
using edges and ; note that is a subpath of in reverse order. Note that both edges are blue because and are already incident with red edges on . It can be easily checked that is an alternating path and, in particular, that it is a valid replacement for . We will now show that is strictly shorter than . It suffices to compare the length of and as and agree on the remaining parts. Let and be the indices such that and . The length of is . For the length of we obtain
[TABLE]
where the first inequality follows from Equation 1. ∎
By combining this result with Lemma 4.3 we obtain the following corollary.
Corollary 4.7**.**
Every algorithm employing the phase framework requires at most phases. In particular, Maximum Matching can be solved in time .
Let denote the class of graphs with independence number at most in each connected component. Every algorithm employing the phase framework requires at most phases. In particular, Maximum Matching can be solved in time .
A better analysis in terms of the independence number can be achieved by not using replaceability, but in exchange we lose the square root dependence on the size of the modulator.
Lemma 4.8**.**
Every maximal matching covers at least vertices.
Proof.
If vertices were exposed, they would not be an independent set and hence have an edge between them. Thus, would not be maximal. ∎
Corollary 4.9**.**
Every algorithm employing the phase framework requires at most phases. In particular, Maximum Matching can be solved in time .
Proof.
After the first phase, we know that at most vertices are exposed by Lemma 4.8. Hence, further augmentations suffice. ∎
4.3 -plexes
An -plex, , is an -vertex graph with minimum degree . They were introduced by Seidman and Foster [51] as a generalization of cliques, which are -plexes. Problems related to -plexes have been studied in parameterized complexity before [34, 54]. Let denote the class of graphs that are disjoint unions of -plexes. Given a vertex and a set of size at least in an -plex, we know that there is an edge for some . Thus, -plexes allow for better control than a small independence number as we can guarantee the existence of an edge incident to some specific vertex instead of just getting some edge in a large set of vertices.
Theorem 4.10**.**
If is a -plex, i.e., if , then is -replaceable.
Proof.
Let be a matching in and suppose that is an -alternating path in of length . Let be the smallest integer such that is -exposed or is red, i.e., . Let be the largest integer such that is -exposed or is red. We have and .
Consider the vertices and observe that as . The set contains vertices and since is a -plex there must be some such that . By choice of and the edges and must be blue. Similarly, by choice of , the edge is blue. Hence, as seen in Figure 2, we can replace by the shorter -alternating path with length . ∎
By Lemma 4.3, we obtain the following corollary.
Corollary 4.11**.**
Every algorithm employing the phase framework requires at most phases. In particular, Maximum Matching can be solved in time .
Every algorithm employing the phase framework requires at most phases. Hence, Maximum Matching can be solved in time . In particular, Maximum Matching can be solved in time on graphs that have distance at most to cluster graphs.
4.4 Neighborhood diversity
In this section we consider the parameter neighborhood diversity, which was introduced by Lampis [41] and has seen further investigation in parameterized complexity research [20, 28, 29, 39].
Definition 4.12** ([41]).**
Two vertices and have the same type if . This defines an equivalence relation on the vertices of . The neighborhood diversity of , denoted by , is the number of equivalence classes of this equivalence relation.
Theorem 4.13**.**
If is a graph such that , then is -replaceable.
Proof.
Again, we will only consider alternating paths starting and ending with a blue edge. Let be a matching in and suppose that is an -alternating path starting and ending with a blue edge and of length . Consider the set , which contains vertices. By the pigeonhole principle, there must be three vertices , with , that are of the same type. Define and for .
Now, consider the three edges and . We distinguish between two cases and will construct a shorter alternating path that replaces in either case.
At least two of the edges are red.
Without loss of generality assume that and are red, then
[TABLE]
is shorter than and replaces . The edge must exist because and have the same type, i.e., as clearly and . 2. 2.
At least two of the edges are blue.
Without loss of generality assume that and are blue, then
[TABLE]
is shorter than and replaces . The edge must exist because and have the same type.
Hence, any -alternating path can be replaced by a path of length at most . ∎
Combining the replaceability result, Theorem 4.13, with the main lemma, Lemma 4.3, yields the following corollary.
Corollary 4.14**.**
Every algorithm employing the phase framework requires at most phases. In particular, Maximum Matching can be solved in time .
Let denote the class of graphs such that each connected component has neighborhood diversity at most . Every algorithm employing the phase framework requires at most phases. In particular, Maximum Matching can be solved in time .
4.5 Modular decomposition
The concept of modular decompositions was introduced by Gallai [27] to aid in the recognition of comparability graphs. Several linear time algorithms have been given to compute the modular decomposition of a graph [12, 44, 53]. Several articles have studied problems parameterized by a width measure related to the modular decomposition, called modular-width [11, 22, 40]. On a high level, the modular decomposition recursively partitions the vertex set of a graph into parts that have simple interactions between each other. We will now give the formal definitions.
Let be a graph. A vertex set is a module if for all it holds that . The modules , , and singletons are called trivial. A module is strong if for every other module of we have that , , or ; a graph that only admits trivial modules is called prime. Every non-singleton graph can be uniquely partitioned into a set of maximal strong modules , with , called modular partition. Two modules and are said to be adjacent if there exist with . In this case every vertex of is adjacent to every vertex of . By recursively partitioning the graphs in this way, until every module is a single vertex, one obtains the modular decomposition of .
The modular decomposition of can be represented as a rooted tree, where the root corresponds to and child nodes correspond to the graphs induced by the modules of their parents’ modular partition. There are three possibilities for internal nodes of the modular decomposition: the quotient graph is a prime graph, clique, or independent set. Correspondingly, we call the node a prime node, series node, or parallel node. The modular-width of , denoted , is the largest number of children of a prime node in the modular decomposition, but at least 2. The modular-depth of , denoted , is the depth of the modular decomposition tree.
Inspired by Coudert et al. [11], we analyze the length of shortest augmenting paths with respect to the modular-width. Coudert et al. obtain a length of by replacing each module with a matching. The phase framework does not perform this replacement step, which causes us to be unable to control the augmenting path length with only the modular-width. As seen in Section 5.2, there is a family of cographs, i.e., graphs with modular-width 2, that has unbounded shortest augmenting path length. It is still possible to bound the shortest augmenting path length in terms of an exponential function depending on the modular-width and the modular-depth. Note that this is only interesting due to the exclusion of parallel and series nodes in the definition of modular-width. Otherwise, this bound would be implied by a simple bound on the number of vertices.
We will distinguish between two types of edges on alternating paths and bound them separately. Let be the modular partition of . We say that an edge is internal if there is some so that , if such does not exist then is external.
Lemma 4.15**.**
Let be a matching in and let be its modular partition. Every -alternating path can be replaced by an -alternating path that uses at most 8 edges of for all .
Proof.
Let be an -alternating path and let for some . We say that an edge of enters if and .
First, we show that can have at most 2 red edges entering . If
[TABLE]
are the red edges of that enter , then can be replaced by
[TABLE]
since exists and must be blue. Hence, at most 2 red edges entering remain. This can introduce additional blue edges that enter , these will be bounded in the next step.
In a similar manner, we show that can be replaced by a path that has at most two blue edges entering . Let
[TABLE]
be the blue edges of that enter , then can be replaced by
[TABLE]
The edges and exist due to being a module and at least one of them must be blue. If is red, then we use as replacement path. Hence, we have reduced the number of blue edges entering to at most 2.
By considering in the reverse direction, this also bounds the number of edges of leaving , i.e., with and . Observe that the replacements for entering edges could not have increased the number of leaving edges. In conclusion, we can replace in such a way that the resulting path uses at most 8 edges of .
Notice that performing these replacements for does not increase the number of entering or leaving edges for any other with . Hence, by iterating through all and performing the replacements we obtain the bound of 8 for each . ∎
Lemma 4.16**.**
Let be a series node and be a matching in . Every -alternating path in can be replaced so that it contains at most 4 blue external edges and at most 6 red external edges.
Proof.
Let be an -alternating path and let be the modular partition of . Note that all are pairwise adjacent since is a series node. Fixing an orientation of , an external edge has type if and . To ensure that the edges we use as shortcuts have the correct parity we discard the first and last edge of , hence our upper bounds must be increased by 2.
Let be the remaining blue external edges on in order. If and is of type and of type and , then can be replaced by the direct edge . The edge exists because and lie in different, but adjacent, modules. We also know that has to be blue as is preceeded by a red edge and is succeeded by a red edge. Observe that this replacement removes the blue external edges on and introduces one new blue external edge. As long as , such a situation must occur by the pigeonhole principle and we can decrease by at least one.
Let be the remaining red external edges on in order. If and is of type and of type and , then can be replaced by the direct edge . The edge exists and is blue similar to the previous case. In contrast to the previous case, this replacement does not remove the edges and , but removes at least one red external edge between and . As long as , such a situation occurs and we can decrease by at least one.
When applying the replacements for the red external edges we introduce further blue external edges; to obtain simultaneous bounds on both, we first perform the replacements for the red external edges and afterwards for the blue external edges. ∎
Theorem 4.17**.**
There exists such that every graph is -replaceable.
Proof.
We choose , but we did not make an effort to optimize this constant.
We prove this statement by induction on the modular-depth . If , then must be a prime graph and hence , so is trivially -replaceable.
For , let be the modular partition of . The graphs , have modular-depth at most .
If is a parallel node, then each module corresponds to a connected component and hence is trivially -replaceable by induction.
If is a series node, a matching and an -alternating path, then we invoke Lemma 4.16 on . After this replacement has at most 10 external edges and induces at most subpaths inside the modules . We can bound the length of these subpaths by induction and obtain a replacement path of length at most
[TABLE]
If is a prime node, a matching and an -alternating path, then . Due to Lemma 4.15, we can replace in such a way that it induces at most 8 subpaths inside a module , for each module . By induction, these subpaths can be replaced so that each of them has length at most . Every edge of an alternating path either belongs to some or is inside a module . In total, we can bound the length of the replacement path by
[TABLE]
By Lemma 4.3, we obtain the following time bounds.
Corollary 4.18**.**
Let be the class of graphs that have modular-width at most and modular-depth at most . There exists a constant such that every algorithm employing the phase framework requires at most phases. In particular, Maximum Matching can be solved in time .
5 Lower bounds on the number of phases
In this section, we show that several restrictive graph classes do not admit results such as those obtained in the previous section. To this end, we show that the assumptions made about algorithms that follow the phase framework still allow a worst case of phases. In other words, further assumptions about the behavior of such an algorithm are necessary to avoid these lower bounds and to again get adaptive running times.
5.1 Paths and forests
Lemma 5.1**.**
An algorithm employing the phase framework may choose a sequence of augmentations resulting in at least phases on paths.
Proof.
We will concatenate increasingly long paths where we take every second edge into the matching in such a way that the matching on the newly added path is maximal but not maximum, so that every one of the concatenated paths requires a separate phase. More formally, on we use the matching . This matching is one edge away from the maximum and the only augmenting path has length .
Let be obtained by concatenating two copies of through identification of two endpoints (obtaining a path on vertices). The matching on can be augmented once by an augmenting path of length . There are two augmenting paths on , we always choose to augment along the copy of that is attached to the previously constructed path, i.e., the left copy in Figure 3. Using two copies of in ensures that every requires at least one augmentation. This is not the case if we simply concatenate .
We can now define our desired paths. Let and in this exceptional case we assume that the left edge of is matched. Furthermore, let be obtained from by concatenating at the right. The number of vertices of can be bounded by
[TABLE]
Now, we argue that our choice of augmentations leads to phases for . In the first phase we choose to find the maximal matching that we associated with each . Now, observe that contains augmenting paths of lengths . In phase , we augment along the left copy of in . As this does not affect the augmenting paths in the other , we need phases in total. ∎
Using the parameter values on paths, we obtain the following parameterized lower bounds.
Corollary 5.2**.**
An algorithm employing the phase framework may choose a sequence of augmentations resulting in , , or phases, where is the neighborhood diversity of .
5.2 Cographs
Mertzios et al. [45] devised a Maximum Matching algorithm parameterized by vertex deletion distance to cocomparability graphs and there are several Maximum Matching algorithms parameterized by modular-width [11, 40]. In the interest of showing that these results cannot be replicated or improved by our approach, we give a lower bound result for cographs, i.e., the graphs of modular-width 2 and a subclass of cocomparability graphs.
Definition 5.3**.**
A graph is a cograph if it can be constructed from the following operations:
- •
is a cograph,
- •
the disjoint union of two cographs and is a cograph,
- •
the join of two cographs and is a cograph, where and
Theorem 5.4**.**
There is a family of cographs such that an algorithm employing the phase framework may choose a sequence of augmentations resulting in phases on this family.
Proof.
We will construct appropriate cographs using the cograph operations. Let and and for define as auxiliary graphs. Given , we construct
[TABLE]
Observe that has at most vertices, therefore has vertices. We will now describe a sequence of augmentations in that requires phases.
In each , , there is exactly one vertex of degree one, which we call . For , we fix an arbitrary vertex that is called . Furthermore, the vertex that is joined last in the construction of , , is referred to as , see Figure 4. First, we describe which maximal matchings to associate with the graphs . In there is no edge to choose, in we choose the only possible edge and in we take the edge . Inductively, for , we use the maximal matching of and add the edge . With we associate the union of these matchings and add the edge between the two copies of to the matching. In this way we obtain the matching that is supposed to be found in the first phase.
We now argue that , , has exactly one shortest augmenting path of length . This is true for ; the other cases follow by induction. Let be the shortest augmenting path in starting at , then is an augmenting path of length in . There are no further augmenting paths as there are only two exposed vertices in and one of them is with degree one; starting at , we must first take the edge and then the matched edge , hence we must take the path by induction.
Let denote the vertex in that is joined last in the construction of . The construction of does not create any additional augmenting paths as every maximal alternating path that passes through must have one matched endpoint, namely the vertex in the other copy of . In phase we augment the shortest augmenting path of length in the copy of . By repeating the previous argument, these augmentations cannot introduce any new augmenting paths in the later phases. Hence, we require phases for this sequence of augmentations, thereby proving the claimed lower bound. ∎
The graphs in the previous proof are also -free, therefore these graphs are not only cographs but also trivially perfect graphs.
5.3 Lower bound for bipartite chain graphs
Similar to Section 5.2, Mertzios et al. gave a Maximum Matching algorithm for bipartite graphs parameterized by the vertex deletion distance to chain graphs [45]. We show that such a result does not hold for arbitrary algorithms that follow the phase framework.
Definition 5.5** ([55]).**
A graph is a bipartite chain graph if is bipartite with bipartition and there is an ordering of the vertices of and an ordering of the vertices of such that for all and for all .
The rough idea of the lower bound construction for chain graphs is to encode the directed graph , depicted in Figure 5, as a chain graph, where is given by
[TABLE]
with multiplicities, i.e., how many parallel copies there are of each edge,
[TABLE]
Any -path in of length will correspond to an augmenting path of length in the chain graph. Notice that there is exactly one -path in for each length and by making use of the multiplicities these are all edge-disjoint. The consequence in the corresponding chain graph is that each phase will only find one augmenting path and hence we must perform at least phases. The construction of the chain graph will ensure that by replacing each with multiple vertices and we choose a specific initial matching, i.e., in phase 1, to model the behavior of . Hence we obtain the desired lower bound for chain graphs. We will not make the relation between and the chain graph precise, this paragraph only serves as intuition.
Theorem 5.6**.**
There is a family of bipartite chain graphs such that an algorithm employing the phase framework may choose a sequence of augmentations resulting in at least phases on this family.
Proof.
Fix and set . We define the graph with vertices by
[TABLE]
As and for all , the graph must be a bipartite chain graph, because the inclusions and hold for all .
We partition the index set into intervals as follows
[TABLE]
and
[TABLE]
Observe that for and . Furthermore, we define for . The vertex set roughly corresponds to the vertex of the graph . We can now define the initial matching
[TABLE]
The graphs and are depicted in Figure 6 with their initial matching. The -exposed vertices are , hence must be maximal as for all and .
As is bipartite, we can assume that every augmenting path starts somewhere in , ends somewhere in and is oriented from its endpoint in to its endpoint in .
We will now define vertex-disjoint -augmenting paths , . The path starts at vertex and every time we are at some , , we take the blue edge and every time we are at some , , we take the incident red edge. Since no edge of the form is red, this construction must result in a path. We have partitioned in such a way that if we take a red edge from a with , then we get to an with and . More precisely, if then and otherwise . Using this observation, we see that is an -augmenting path of length that starts at and ends in , because takes edges to reach and then two further edges to reach .
Now, we can define further matchings for . Due to the being vertex-disjoint we see that every is also an -augmenting path, thus the matchings are well-defined. The resulting sequence of matchings for is depicted in Figure 7 and they are explicitly given by
[TABLE]
We claim that can be computed by the phases of an algorithm employing the phase framework. For this we must show that there is no -augmenting path of length at most for all . To see this, notice that the last red edge taken by any -augmenting path is one of the edges in . Hence, we first must go to some with . For going from an with to an with requires at least one red edge and using exactly one red edge we can only get to an with . Hence, getting from to , , requires at least red edges in any -augmenting path and one further red edge to get to , thus any -augmenting path has length at least .
In conclusion, this sequence of matchings leads to phases and due to we obtain the desired lower bound. ∎
6 Conclusion
We have conducted an adaptive analysis that applies to all algorithms for Maximum Matching that follow the phase framework of Hopcroft and Karp [35], such as the algorithms due to Micali and Vazirani [48], Blum [8], and Goldberg and Karzanov [33]. The main take-away message of our paper is that these algorithms not only obtain the best known time for solving Maximum Matching but that they are also (obliviously) adaptive to beneficial structure. That is, they run in linear time on several graph classes and they run in time for graphs that are vertex deletions away from any of several classes; before, most bounds were . Arguably, such adaptive algorithms are the best possible result for dealing with unknown beneficial structure because they are never worse than the general bound, in this case taking when , and smoothly interpolate to linear time on well-structured instances. Moreover, in the present case, they unify several special cases and remove the need to find exact or approximate beneficial structure.
We complemented our findings by proving that the phase framework alone still allows taking phases, and, hence, total time , even on restrictive classes like paths, trivially perfect graphs, and bipartite chain graphs (and their superclasses), despite the existence of (dedicated) linear-time algorithms. Of course, all of these cases are easy to handle but it raises the question whether there are simple further properties to demand of a phase-based algorithm so that it is provably adaptive to larger classes such as cocomparability or bounded treewidth graphs? In the same vein, it would be interesting whether time is possible relative to feedback vertex number , i.e., relative to deletion distance to a forest.
More generally, with the large interest in “FPT in P” (or efficient parameterized algorithms), it seems interesting what other fundamental problems admit adaptive algorithms that interpolate between, say, linear time and the best general bound. Are there other cases where a proven algorithmic paradigm, like the path packing phases of Hopcroft and Karp [35], also obliviously yields the best known running times relative to beneficial input structure?
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Amir Abboud, Virginia Vassilevska Williams, and Joshua Wang. Approximation and fixed parameter subquadratic algorithms for radius and diameter in sparse graphs. In Proceedings of the twenty-seventh annual ACM-SIAM symposium on Discrete Algorithms , pages 377–391. SIAM, 2016.
- 2[2] Amir Abboud, Virginia Vassilevska Williams, and Huacheng Yu. Matching triangles and basing hardness on an extremely popular conjecture. In Rocco A. Servedio and Ronitt Rubinfeld, editors, Proceedings of the Forty-Seventh Annual ACM on Symposium on Theory of Computing, STOC 2015, Portland, OR, USA, June 14-17, 2015 , pages 41–50. ACM, 2015. URL: https://doi.org/10.1145/2746539.2746594 , doi:10.1145/2746539.2746594 . · doi ↗
- 3[3] Jérémy Barbay, Johannes Fischer, and Gonzalo Navarro. Lrm-trees: Compressed indices, adaptive sorting, and compressed permutations. Theor. Comput. Sci. , 459:26–41, 2012. URL: https://doi.org/10.1016/j.tcs.2012.08.010 , doi:10.1016/j.tcs.2012.08.010 . · doi ↗
- 4[4] Jérémy Barbay and Gonzalo Navarro. On compressing permutations and adaptive sorting. Theor. Comput. Sci. , 513:109–123, 2013. URL: https://doi.org/10.1016/j.tcs.2013.10.019 , doi:10.1016/j.tcs.2013.10.019 . · doi ↗
- 5[5] Holger Bast, Kurt Mehlhorn, Guido Schafer, and Hisao Tamaki. Matching algorithms are fast in sparse random graphs. Theory of Computing Systems , 39(1):3–14, 2006.
- 6[6] Matthias Bentert, Till Fluschnik, André Nichterlein, and Rolf Niedermeier. Parameterized aspects of triangle enumeration. In International Symposium on Fundamentals of Computation Theory , pages 96–110. Springer, 2017.
- 7[7] Claude Berge. Two theorems in graph theory. Proceedings of the National Academy of Sciences , 43(9):842–844, 1957.
- 8[8] Norbert Blum. A new approach to maximum matching in general graphs. In International Colloquium on Automata, Languages, and Programming , pages 586–597. Springer, 1990.
