Bartha  conjectured that a unique perfect matching of a given graph of size , if it exists, can always be found in time. Gabow, Kaplan, and Tarjan  describe a algorithm for this problem. Furthermore, they show that, if apart from , some perfect matching is also part of the input, then one can decide the uniqueness of in time. Since maximum matchings can be found in linear time for chordal bipartite graphs , cocomparability graphs , convex bipartite , and cographs [3, 16], also deciding whether these graphs have a unique perfect matching, as well as finding the unique perfect matching, if it exists, is possible in linear time. Also for strongly chordal graphs given a strong elimination order , a maximum matching can be found in linear time, and the same conclusion applies. Levit and Mandrescu  showed that unique perfect matchings can be found in linear time for König-Egerváry graphs and unicyclic graphs.
We contribute some structural and algorithmic results concerning graphs with a unique perfect matching. First, we extend a result from  to cographs and split graphs, which leads to a very simple linear time algorithm deciding the existence of a unique perfect matching, and finding one, if it exists. For interval graphs, we describe a linear time algorithm that determines a perfect matching, if the input graph has a unique perfect matching. Similarly, for connected claw-free graphs of even order, we describe a linear time algorithm that determines a perfect matching. Together with the result from  this implies that for such graphs the existence of a unique perfect matching can be decided in linear time. Finally, we give a constructive characterization of claw-free graphs with a unique perfect matching.
For a graph , we say that a set forces a unique perfect matching in if , and for every , where , and denotes the closed neighborhood of in . Clearly, if forces a unique perfect matching in , then has a unique perfect matching , where is the only neighbor of in for . As shown by Golumbic, Hirst, and Lewenstein (Theorem 3.1 in ), a bipartite graph has a unique perfect matching if and only if some set forces a unique perfect matching in ; their result actually implies that both partite sets of force a unique perfect matching. This equivalence easily extends to cographs and split graphs.
If is a cograph or a split graph, then has a unique perfect matching if and only if some set forces a unique perfect matching in .
Since the sufficiency is obvious, we proceed to the proof of the necessity. Therefore, let be a cograph or a split graph with a unique perfect matching . In view of an inductive argument, and since the classes of cographs and of split graphs are both hereditary, it suffices to consider the case that is a connected graph of order at least , and to show that has a vertex of degree .
First, suppose that is a cograph. Since is connected, it is the join of two graphs and . If and both have order at least , then contains either two edges between and , or one edge of as well as one edge of . In both cases, these two edges are part of an -alternating cycle of length , which is a contradiction. Hence, we may assume that contains exactly one vertex , which is a universal vertex in . Let be such that . If is a neighbor of in , and , then is an -alternating cycle of length , which is a contradiction. Hence, the vertex has degree in .
Next, suppose that is a split graph. Let , where is an independent set, and is a clique that is disjoint from . Since has a unique perfect matching, it follows easily that is either or . Since has order at least , the set is not empty. If no vertex in has degree , then it follows, similarly as for bipartite graphs, that contains an -alternating cycle, which completes the proof. ∎
If is given by neighborhood lists, then it is straightforward to decide the existence of a set that forces a unique perfect matching in in linear time, by iteratively identifying a vertex of degree , and removing this vertex together with its neighbor from . Altogether, for a given cograph or split graph, one can decide in linear time whether it has a unique perfect matching, and also find that matching, if it exists.
Our next results concern interval graphs.
Let be an interval graph with a unique perfect matching , and let be an interval representation of such that all endpoints of the intervals for are distinct.
If is such that , and is such that , then .
Suppose, for a contradiction, that for some neighbor of that is distinct from . Let be such that . By the choice of and , and since the intervals and intersect, also the intervals and intersect, that is, . Now, is an -alternating cycle of length , which is a contradiction. ∎
Since, for a given interval graph, an interval representation as in Lemma 2.2 can be found in linear time , Lemma 2.2 yields a simple linear time algorithm to determine a perfect matching in a given interval graph , provided that has a unique perfect matching.
We proceed to claw-free graphs.
Let be a graph. Let be a path in , where we consider to be the last vertex of . We consider two operations replacing with a longer path in .
arises by applying an end-extension to , if is the path , where is some neighbor of that does not lie on .
arises by a swap-extension to , if , and is the path
where is some neighbor of that does not lie on . Note that and need to be adjacent for this operation.
The following lemma is a simple variation of a folklore proof of Sumner’s result  that connected claw-free graphs of even order have a perfect matching.
If is a connected claw-free graph of even order, and is a path in that does not allow an end-extension or a swap-extension, then the edge belongs to some perfect matching of .
In view of an inductive argument, it suffices to show that is connected. Suppose, for a contradiction, that is not connected. Clearly, . If , then has neighbors in two components of while is only adjacent to , which yields a claw centered at . Now, let . The path lies in one component of . Let be a component of that is distinct from . Since allows no end-extension, has no neighbor in . Hence, has a neighbor in . Since and are not adjacent, and is claw-free, is adjacent to , and allows a swap-extension, which is a contradiction. ∎
The algorithm PMinCF works correctly and can be implemented to run in time for a given connected claw-free graph of even order.
Line 1 initializes the matching as empty and the order of the path as . The while-loop in lines 1 to 1 extends the matching iteratively as long as possible using the last edge of the path . If , which happens in the first execution of the while-loop, and possibly also in later executions, then, in line 1, the path is reinitialized with using any edge of . The repeat-loop in lines 1 to 1 ensures that allows no end-extension and no swap-extension, which, by Lemma 2.3, implies the correctness of PMinCF. The proof of Lemma 2.3 actually implies that stays connected throughout the execution of PMinCF. In line 1 we check for the possibility of an end-extension, which, if possible, is performed in line 1. If no end-extension is possible, we check for the possibility of a swap-extension. The first time that some specific vertex is the last vertex of , and we check for the possibility of a swap-extension, we set to the largest integer such that is adjacent to . Initializing as for every vertex of in line 1 indicates that its correct value has not yet been determined. This happens for the first time in lines 1 and 1. Once has been determined, it is only updated in line 1 for , and, if necessary, in line 1 for . Clearly, is adjacent to if and only if . Therefore, line 1 correctly checks for the possibility of a swap-extension, which, if possible, is performed in lines 1, 1, and 1. Altogether, the correctness follows, and it remains to consider the running time.
We assume that is given by neighborhood lists, that is, for every vertex of , the elements of the neighborhood of in are given as an (arbitrarily) ordered list. Checking for the existence of a suitable vertex within the if-statements in lines 1 and 1 can be implemented in such a way that we traverse the neighborhood list of every vertex at most once throughout the entire execution of PMinCF. Every time we check for the existence of such a neighbor of , we only need to consider the neighbors of that have not been considered before, that is, we start with the first not yet considered neighbor of within its neighborhood list, and continue until we either find a suitable neighbor or reach the end of the list. Since vertices that leave are also removed from in line 1, this is correct, and the overall effort spent on checking for such neighbors is proportional to the sum of all vertex degrees, that is, . The first computation of in line 1 can easily be done in time. After that, every update of only requires constant effort. Since is extended exactly times, the overall effort spent on maintaining is again proportional to the sum of all vertex degrees. Altogether, it follows that the running time is , which completes the proof. ∎
Again, it follows using  that one can decide in linear time whether a given claw-free graph has a unique perfect matching.
Our final goal is a constructive characterization of the claw-free graphs that have a unique perfect matching Let be the class of graphs obtained by starting with equal to , and iteratively applying the following two operations:
Add to two new vertices and , and the three new edges , , and , where is a simplicial vertex of .
Add to two new vertices and , the new edge , and new edges between and all vertices in a set , where is a non-empty clique in such that is a clique for every vertex in .
A connected claw-free graph has a unique perfect matching if and only if .
It is easy to prove inductively that all graphs in are connected, claw-free, and have a unique perfect matching. Note that requiring to be simplicial in Operation 1 ensures that no induced claw is created by this operation. Similarly, the conditions imposed on in Operation 2 ensure that no induced claw is created.
Now, let be a connected claw-free graph with a unique perfect matching . If has order , then, trivially, is , which lies in . Now, let have order at least . By Kotzig’s theorem [8, 12], has a bridge that belongs to . In particular, is not -connected. Let be an endblock of . If , then is or , and the claw-freeness of easily implies that arises from a proper induced subgraph of by applying Operation 1 or 2. Hence, we may assume that . If is even, then, by Kotzig’s theorem, , and hence also , has two distinct perfect matchings, which is a contradiction. Hence,
is odd, that is. If is the cutvertex of in , then, since is claw-free, is a clique of order at least . This implies that is -connected. Again, by Kotzig’s theorem, , and hence also , has two distinct perfect matchings, which is a contradiction, and completes the proof. ∎
Acknowledgment We thank Vadim Levit for drawing our attention to the problem studied in this paper.
-  M. Bartha, Efficient unique perfect matching algorithms, 8th Joint Conference on Mathematics and Computer Science, July 14-17, 2010, Komárno, Slovakia.
-  M. Chang, Algorithms for maximum matching and minimum fill-in on chordal bipartite graphs, Lecture Notes in Computer Science 1178 (1996) 146-155.
-  D.G. Corneil, Y. Perl, L.K. Stewart, A linear recognition algorithm for cographs, SIAM Journal on Computing 14 (1985) 926-934.
-  E. Dahlhaus, M. Karpinski, Matching and multidimensional matching in chordal and strongly chordal graphs, Discrete Applied Mathematics 84 (1998) 79-91.
-  M.C. Golumbic, T. Hirst, M. Lewenstein, Uniquely Restricted Matchings, Algorithmica 31 (2001) 139-154.
-  H.N. Gabow, H. Kaplan, R.E. Tarjan, Unique Maximum Matching Algorithms, Journal of Algorithms 40 (2001) 159-183.
-  M. Habib, R. McConnell, C. Paul, L. Viennot, Lex-bfs and partition refinement, with applications to transitive orientation, interval graph recognition and consecutive ones testing, Theoretical Computer Science 234 (2000) 59-84.
-  A. Kotzig. On the theory of finite graphs with a linear factor II, Matematicko-Fyzikálny Časopis, Slovenskej Akadémie Vied 9 (1959) 136-159.
V.E. Levit, E. Mandrescu, Computing unique maximum matchings in
time for König-Egerváry graphs and unicyclic graphs, Journal of Combinatorial Optimization 32 (2016) 267-277.
-  L. Lovász, M.D. Plummer, Matching theory, Annals of Discrete Mathematics, 29, 1986, North-Holland Publishing Co., Amsterdam.
-  G.B. Mertzios, A. Nichterlein, R. Niedermeier, Linear-Time Algorithm for Maximum-Cardinality Matching on Cocomparability Graphs, arXiv:1703.05598.
-  G. Nenashev, A short proof of Kotzig’s theorem, arXiv:1402.0949
-  G. Steiner and J.S. Yeomans, A linear time algorithm for maximum matchings in convex, bipartite graphs, Computers & Mathematics with Applications 31 (1996) 91-96.
-  D.P. Sumner, Graphs with -factors, Proceedings of the American Mathematical Society 42 (1974) 8-12.
-  X. Wang, W. Shang, J. Yuan, On Graphs with a Unique Perfect Matching, Graphs and Combinatorics 31 (2015) 1765-1777.
-  M. Yu, C. Yang, An time algorithm for maximum matching on cographs, Information Processing Letters 47 (1993) 89-93.