24
Transversal Hypergraphs to Perfect Matchings in Bipartite Graphs: Characterization and Generation Algorithms Endre Boros, 1 Khaled Elbassioni, 2 and Vladimir Gurvich 1 1 RUTCOR, RUTGERS UNIVERSITY 640 BARTHOLOMEW ROAD PISCATAWAY, NJ 08854-8003 E-mail: {boros,gurvich}@rutcor.rutgers.edu 2 MAX-PLANCK-INSTITUT F ¨ UR INFORMATIK SAARBR ¨ UCKEN, GERMANY E-mail: [email protected] Received April 18, 2004; Revised February 27, 2006 Published online 4 May 2006 in Wiley InterScience(www.interscience.wiley.com). DOI 10.1002/jgt.20180 Abstract: A minimal blocker in a bipartite graph G is a minimal set of edges the removal of which leaves no perfect matching in G. We give an explicit characterization of the minimal blockers of a bipartite graph G. This result allows us to obtain a polynomial delay algorithm for finding all minimal blockers of a given bipartite graph. Equivalently, we obtain a polynomial delay algorithm for listing the anti-vertices of the perfect matching polytope of G. We also provide generation algorithms for other related problems, Contract grant sponsor: National Science Foundation Grant (in part); Contract grant number: IIS-0118635. Contract grant sponsor: DIMACS, the National Science Foun- dation’s Center for Discrete Mathematics and Theoretical Computer Science (par- tially to V. G.). Journal of Graph Theory © 2006 Wiley Periodicals, Inc. 209

Transversal hypergraphs to perfect matchings in bipartite graphs: Characterization and generation algorithms

Embed Size (px)

Citation preview

Transversal Hypergraphsto Perfect Matchings inBipartite Graphs:Characterization andGeneration Algorithms

Endre Boros,1 Khaled Elbassioni,2 and Vladimir Gurvich1

1RUTCOR, RUTGERS UNIVERSITY640 BARTHOLOMEW ROAD

PISCATAWAY, NJ 08854-8003E-mail: {boros,gurvich}@rutcor.rutgers.edu

2MAX-PLANCK-INSTITUT FUR INFORMATIKSAARBRUCKEN, GERMANY

E-mail: [email protected]

Received April 18, 2004; Revised February 27, 2006

Published online 4 May 2006 in Wiley InterScience(www.interscience.wiley.com).DOI 10.1002/jgt.20180

Abstract: A minimal blocker in a bipartite graph G is a minimal set ofedges the removal of which leaves no perfect matching in G. We give anexplicit characterization of the minimal blockers of a bipartite graph G. Thisresult allows us to obtain a polynomial delay algorithm for finding all minimalblockers of a given bipartite graph. Equivalently, we obtain a polynomialdelay algorithm for listing the anti-vertices of the perfect matching polytopeof G. We also provide generation algorithms for other related problems,

Contract grant sponsor: National Science Foundation Grant (in part); Contract grantnumber: IIS-0118635. Contract grant sponsor: DIMACS, the National Science Foun-dation’s Center for Discrete Mathematics and Theoretical Computer Science (par-tially to V. G.).

Journal of Graph Theory© 2006 Wiley Periodicals, Inc.

209

210 JOURNAL OF GRAPH THEORY

including d-factors in bipartite graphs, and perfect 2-matchings in generalgraphs. © 2006 Wiley Periodicals, Inc. J Graph Theory 53: 209–232, 2006

Keywords: bipartite graphs; perfect matchings; blockers; generation algorithms; matchable graphs

1. INTRODUCTION

Let G = (A, B, E) be a bipartite graph with bipartition A ∪ B and edge set E. Forsubsets A′ ⊆ A and B′ ⊆ B, denote by G[A′, B′] the subgraph of G induced byA′ ∪ B′. A perfect matching in G is a subgraph in which every vertex of G hasdegree exactly one, or equivalently a subset of |A| = |B| pairwise disjoint edgesof G. Throughout the article, we shall assume that a graph with no vertices has aperfect matching. A blocker in G is a subset of edges X ⊆ E such that the graphG = (A, B, E \X) does not have a perfect matching. A blocker X is minimal if,for every edge e ∈ X, the set X \ {e} is not a blocker. Denote respectively byM(G)and B(G) the families of all perfect matchings and all minimal blockers in G. Notethat in any bipartite graph G, the set B(G) is the family of minimal transversals tothe familyM(G), that is, B(G) is the family of minimal edge sets containing anedge from every perfect matching in G. Clearly, B(G) = {∅} if |A| �= |B|.

The main problem we consider in this article is the following.

GEN(B(G)): Given a bipartite graph G, generate all minimal blockers of G.

The analogous problem GEN(M(G)) of enumerating perfect matchings for bi-partite graphs was considered in [9,10,29,30]. These problems are special cases ofthe more general open problems of generating vertices and anti-vertices of a poly-tope given by its linear description. Indeed, let H be the vertex-edge incidence ma-trix of G = (A, B, E), and consider the polytope P(G) = {x ∈ R

E |Hx = e, x ≥0}, where e ∈ R

|A|+|B| is the vector of all ones. Then the perfect matchings of G arein one-to-one correspondence with the vertices of P(G), which in turn, are in one-to-one correspondence with the minimal collections of columns of H containingthe vector e in their conic hull. On the other hand, the minimal blockers of G are inone-to-one correspondence with the anti-vertices of P(G), that is, the maximal col-lections of columns of H , not containing e in their conic hull. Both correspondinggenerating problems are open for general polytopes, see [2] for details.

In the special case, when H is the incidence matrix of a bipartite graph G, theproblem of generating the vertices of P(G) can be solved with polynomial delay[9,10,29,30], that is, given a graph G = (A, B, E) and a collection X of vertices ofP(G), a new vertex can be found in time polynomial in |A|, |B|, and |E| (but inde-pendent of |X|). In this note, we obtain an analogous result for anti-vertices of P(G).

Theorem 1. Problem GEN(B(G)) can be solved with polynomial delay.

For non-bipartite graphs G, it is well-known that the vertices of P(G) are half-integral [23] (i.e., the components of each vertex are in {0, 1, 1/2}), and that they

Journal of Graph Theory DOI 10.1002/jgt

TRANSVERSAL HYPERGRAPHS IN BIPARTITE GRAPHS 211

correspond to the basic 2-matchings of G, that is, subsets of edges that cover thevertices with vertex-disjoint edges and vertex-disjoint odd cycles. Polynomial delayalgorithms exist for listing the vertices of 0/1-polytopes [4], simple and simplicialpolytopes (e.g., [1]), but the status of the problem for general polytopes is still open.We show here that for the special case of the polytope P(G), the problem can besolved in incremental polynomial time, that is, given a collection X of vertices ofP(G), a new vertex can be found in time polynomial in |A|, |B|, |E|, and |X|.Theorem 2. All basic perfect 2-matchings of a graph G can be generated inincremental polynomial time.

The proof of Theorem 1 is based on a nice characterization of minimal blockers,which may be of independent interest. This characterization will be given in Section2. The method used for enumeration is the so-called supergraph approach whichwill be outlined in Section 3A. A special case of this method, when applicable,can provide enumeration algorithms with stronger properties, such as enumerationin lexicographical ordering, or enumeration with polynomial space. This specialcase will be described in Section 3B and will be used in Section 5 to solve twoother related problems of enumerating generalized d-factors in bipartite graphs,and enumerating perfect 2-matchings in general graphs. The latter result will beused to prove Theorem 2.

It should be mentioned that there exists a polynomial-time algorithm for near-uniformly sampling from within the perfect matchings of a bipartite graph [16].The analogous problem for minimal blockers of bipartite graphs remains open.

2. PROPERTIES OF MINIMAL BLOCKERS

A. The Neighborhood Function

Let G = (A, B, E) be a bipartite graph. For a subset X ⊆ A ∪ B, denote by

�(X) = �G(X) = {v ∈ (A ∪ B) \X | {v, x} ∈ E for some x ∈ X}

the set of neighbors of X. It is known (see, e.g., [21]), and also easy to verify, thatthe set-function |�(·)| is submodular, that is

|�(X ∪ Y )| + |�(X ∩ Y )| ≤ |�(X)| + |�(Y )|

holds for all subsets X, Y ⊆ A ∪ B. A simple but useful observation about submod-ular set-functions is the following (see, e.g., [22,23]):

Proposition 1. Let V be a finite set and f : 2V → R be a submodular set-function.Then the family of sets X minimizing f (X) forms a sub-lattice L of the Booleanlattice 2V . If f (X) is polynomial-time computable for every X ⊆ V , then the uniqueminimum and maximum of this sub-lattice can be found in polynomial time.

Journal of Graph Theory DOI 10.1002/jgt

212 JOURNAL OF GRAPH THEORY

Proof. Let α = min{f (X) : X ⊆ V } and F = {X ⊆ V : f (X) = α}. If X, Y ∈F, then

2α ≤ f (X ∪ Y )+ f (X ∩ Y ) ≤ f (X)+ f (Y ) = 2α,

from which the first statement of the proposition follows. To see the second state-ment, note that X is the unique minimum (maximum) of the sub-latticeL if and onlyif X is a minimum (maximum) cardinality subset with the property that f (X) = α.Thus to find such a minimum (maximum) set, we first find any set X ∈ F (which canbe computed in polynomial time, see [11,15,26]). Then we greedily reduce (extend)X to a minimum (maximum) cardinality set as follows. Iteratively, for v ∈ X (re-spectively, for v �∈ X), we compute a minimizer X′ ← argmin{f (Y ) : Y ⊆ X \ {v}}(respectively, X′ ← argmin{f (Y ) : Y ⊆ V, Y ⊇ X ∪ {v}}) and if f (X′) = α we setX← X′. �

B. Matchable Graphs

Matchable graphs, introduced in [14], play an important role in the characterizationof minimal blockers. In this subsection, we define them and give some of their usefulproperties.

Definition 1 ([14]). A bipartite graph G = (A, B, E) with |A| = |B| + 1 (or|B| = |A| + 1) is said to be matchable if the graph G− v has a perfect match-ing for every vertex v ∈ A (respectively, v ∈ B).

The smallest matchable graph is one in which |A| = 1 and |B| = 0 (or |A| = 0and |B| = 1). The following is a useful equivalent characterization of matchablegraphs.

Proposition 2 ([14]). For each bipartite graph G = (A, B, E) with |A| = |B|+1,the following statements are equivalent:

(M1) G is matchable;(M2) G has a matchable spanning tree, that is, a spanning tree T in which every

vertex v ∈ B has degree 2;It can be shown that for bipartite graphs G = (A, B, E) with |A| =|B| + 1, properties (M1) and (M2) are further equivalent with:

(M3) G contains a unique independent set of size |A|, namely the set A.

Note that matchable graphs are bipartite graphs with surplus 1, in the sense asdefined in [22]. Furthermore, a claim analogous to Proposition 2 was also shownby [9,20] (see also [22, page 20]).

Given a bipartite graph G, let us say that a matchable induced subgraph of G ismaximal, if it is not a proper subgraph of any other matchable induced subgraph of

Journal of Graph Theory DOI 10.1002/jgt

TRANSVERSAL HYPERGRAPHS IN BIPARTITE GRAPHS 213

G. The following extension procedure was proposed in [14, proof of (2)], and willbe used occasionally in the article:

Extend(G1, M)

Input. A matchable induced subgraph G1 = G[A1, B1] of a bipartite graphG = (A, B, E), where A1 ⊆ A and B1 ⊆ B, and a perfect matching M of G2 =G[A2, B2], where A2 = A \ A1 and B2 = B \ B1.

Output. An extension of G1 into a maximal matchable induced subgraphof G.

Main Loop. Until there exist adjacent vertices a ∈ A1 and b ∈ B2, add b to B1

and a′ to A1, where {a′, b} is the edge of M incident with b.

When G = (A, B, E) is a matchable graph, this procedure can be used to constructa matchable spanning subtree of G in polynomial time [14]. Indeed, let v be anarbitrary vertex of A, G1 = [{v},∅] and M be a matching in G− v, then it easy to seethat the above extension procedure will end up in a matchable spanning subtree of G.

We shall also need the following properties of matchable graphs.

Proposition 3. Let G = (A, B, E) be a matchable graph with |A| = |B| + 1, andlet a ∈ A and b ∈ B be given vertices. Then there exist partitions A1 ∪ A2 = A \{a} and B1 ∪ B2 = B \ {b} such that (i) G1 = G[A1, B1] is a maximal matchableinduced subgraph of G′ = G− {a, b}, (ii) G2 = G[A2, B2] has a perfect matching,and (iii) the graph G[A1, B2] has no edges. Furthermore, this decomposition of G′

is unique, and can be found in polynomial time.

Proof. First observe that

|�G′(X)| ≥ |X| − 1, for all X ⊆ A \ {a}. (1)

This follows from the matchability of G. Indeed, if �G′(X) ≤ |X| − 2 for someX ⊆ A \ {a}, then |�G(X)| ≤ |X| − 1, and consequently, the graph G− a does nothave a perfect matching.

Since G′ does not have a perfect matching, it follows by Hall’s theorem (see, e.g.,[13,23]) that there must exist a subset X of A \ {a} such that |�G′(X)| = |X| − 1. LetA1 be a subset of A \ {a}with minimum cardinality such that |�G′(A1)| = |A1| − 1.

Then the induced graph G1def= (A1, �G′(A1)) is matchable. To see this, note that

for any vertex v ∈ A1 and any subset X ⊆ A1 \ {v}, we must have |�G1 (X)| ≥ |X|by the minimality of |A1|. Thus it follows by Hall’s theorem that the graph G1 − v

has a perfect matching. Now suppose that the graph G2 = G[A2, B2], where A2def=

A \ (A1 ∪ {a}) and B2def= B \ (�G′(A1) ∪ {b}), is not empty. Since G is matchable,

the graph G− a has a perfect matching M. Note that in the original graph thereare no edges between A1 and B2, that is, the subgraph G[A1, B2] has no edges.It follows that M must match all vertices in B2 to those in A2, that is, G2 has a

Journal of Graph Theory DOI 10.1002/jgt

214 JOURNAL OF GRAPH THEORY

perfect matching. Furthermore, the fact that G[A1, B2] is empty implies also thatG1 cannot be a proper subgraph of any other matchable subgraph of G′.

Let us now show that the above decomposition of G′ is unique. It is enough toshow that the set A1 defined above is unique. But the latter claim follows from thefollowing facts: (i) the function f : 2A\{a} → Z defined by f (X) = |�G′(X)| − |X|is submodular, (ii) by (1), min{f (X) : X ⊆ A \ {a}} = −1, and (iii) by Proposi-tion 1, the set F = {X ⊆ A \ {a} : f (X) = −1} forms a lattice, and therefore theminimality of |A1| implies that A1 is the unique minimum of this lattice. Finally,Proposition 1 also implies that the set A1, and hence the above decomposition ofG′, can be constructed in polynomial time. �

Remark 1. Let us note that by our assumption in Proposition 3, there exists aperfect matching M between A \ {a} and B. Let {x, b} ∈ M be the edge of thisperfect matching incident with b, and consider all M-alternating paths starting withthis edge from vertex b. Then, as an alternative proof for Proposition 3, we canshow that the set of vertices reached by such alternating paths is exactly A1 ∪ B1.This way we can determine A1 and B1 in O(|E|) = O(|A||B|) time.

The next proposition acts, in a sense, as the opposite to Proposition 3: Givena decomposition of a matchable graph into a matchable subgraph and a subgraphwith a perfect matching, we can reconstruct in a unique way the original matchablegraph.

Proposition 4. Let G = (A, B, E) be a bipartite graph and let G1 = G[A1, B1]and G2 = G[A2, B2] be vertex-disjoint subgraphs of G such that G1 is matchableand G2 has a perfect matching. Let G′ = G[A1 ∪ A2, B1 ∪ B2]. Then there is aunique extension of G1 into a maximal matchable induced subgraph G′1 = G[A′1 ⊇A1, B

′1 ⊇ B1] of G′, such that the graph G′2

def= G[(A1 ∪ A2) \ A′1, (B1 ∪ B2) \ B′1]has a perfect matching. Such an extension yields the unique possible decompositionof G′ into a maximal matchable induced subgraph and a subgraph with a perfectmatching, and can be constructed in polynomial time.

Proof. Fix a perfect matching M in G2, and apply the extension procedureExtend(G1, M) given after Proposition 2. When this procedure terminates, we gettwo graphs G′1 = G[A′1, B

′1] and G′2 = G[(A1 ∪ A2) \ A′1, (B1 ∪ B2) \ B′1] such

that G′1 is (maximal) matchable and G′2 has a perfect matching. So it remains toverify that such an extension is unique. Suppose on the contrary that there is anotherdecomposition of G′ given by the graphs G′′1 = G[A′′1, B

′′1] and G′′2 = G[A′′2, B

′′2],

where G′′1 is a maximal matchable induced subgraph of G′, and G′′2 has a per-fect matching. By maximality, the graphs G[A′1, B

′2] and G[A′′1, B

′′2] have no

edges (otherwise, the extension procedure can be used to extend G′1 and G′′1 intostrictly bigger matchable subgraphs). This, together with A′1 ∪ A′2 = A′′1 ∪ A′′2 andB′1 ∪ B′2 = B′′1 ∪ B′′2, implies that

Journal of Graph Theory DOI 10.1002/jgt

TRANSVERSAL HYPERGRAPHS IN BIPARTITE GRAPHS 215

(i) |A′1 ∩ A′′2| ≤ |B′1 ∩ B′′2 | since G′′2 has a perfect matching and there is no wayto match the vertices of A′1 ∩ A′′2 in G′′2 except using vertices from B′1 ∩ B′′2(there are no edges between A′1 ∩ A′′2 and B′2 ∩ B′′2).

(ii) if B′1 ∩ B′′2 is not empty then |A′1 ∩ A′′2| > |B′1 ∩ B′′2 |: this follows from thefact that for any v ∈ A′1, the graph G′1 − v has a perfect matching and thereis no way to match the vertices of B′1 ∩ B′′2 in G′1 − v except using verticesfrom A′1 ∩ A′′2 (note that the graph G[A′1 ∩ A′′1, B

′′2] has no edges).

Thus |B′1 ∩ B′′2 | > 0 implies that the set A′1 ∩ A′′2 is not empty, so it contains avertex, say v′. But then again G′1 − v′ has a perfect matching which matches theset B′1 ∩ B′′2 with the set (A′1 ∩ A′′2) \ {v′}.

Clearly (i) and (ii) above imply that the sets A′1 ∩ A′′2 and B′1 ∩ B′′2 are both empty.By symmetry we can also conclude that the sets A′′1 ∩ A′2 and B′′1 ∩ B′2 are emptyand hence complete the proof the proposition. �

As a simple application of Proposition 4, we obtain the following corollary.

Corollary 1. Let G = (A, B, E) be a bipartite graph and G′ = G[A′, B′] be amatchable subgraph of G. Given two vertices a ∈ A \ A′ and b ∈ B \ B′ such thatthere is an edge {b, a′} for some a′ ∈ A′ ({a, b} is not required to be an edge of G),there exists a unique decomposition of G′′ = G[A′ ∪ {a}, B′ ∪ {b}] into a maximalmatchable induced subgraph and a subgraph with a perfect matching.

Proof. Start with the graphs G1 = ({a},∅) which is matchable, and G2 =(A′, B′ ∪ {b}) which has a perfect matching, and apply Proposition 4. �

Proposition 5. Let T = (A, B, E) and T ′ = (A′, B′, E′) be two matchable treessuch that |A| = |B| + 1, |A′| = |B′| + 1, A ⊂ A′, and B ⊂ B′. Then (i) there existsa vertex b ∈ B′ \ B such that |�T ′({b}) ∩ A| ≥ 1, (ii) for any such vertex b, there

exists a vertex a ∈ A′ \ A, such that the graph G[a, b]def= (A ∪ {a}, B ∪ {b}, E′′) is

matchable, where E′′ = (E ∪ E′) ∩ ((A ∪ {a})× (B ∪ {b})).Proof. Note that |A′ \ A| = |B′ \ B|. Thus if there no vertex b ∈ B′ \ B which

has a neighbor in A, then |�T ′(B′ \ B)| = |A′ \ A| = |B′ \ B|. But then the numberof edges in the subforest of T ′ induced by the set (A′ \ A) ∪ (B′ \ B) is 2|B′ \ B| >|A′ \ A| + |B′ \ B| − 1, which is a contradiction. This shows (i). To prove (ii), letb0 be a vertex in B′ \ B, with a neighbor x ∈ A. Let y be the other neighbor of b0

in T ′ (recall that |�T ′(b0)| = 2 since T ′ is matchable). If y ∈ A′ \ A, then the treeT ∪ {b0, x} ∪ {b0, y} is a matchable spanning tree for G[y, b0]. Otherwise (y ∈ A),the following procedure finds a vertex a ∈ A′ \ A and a matchable spanning treeT ′′ for the graph G[a, b0] (see Fig. 1).

Step 1. Let C0 = (A(C0), B(C0), E(C0)) be the cycle in T ∪ T ′ composed of theedges {b0, x}, {b0, y}, and the path in T from x to y, where A(C0) ⊆ A, B(C0) ⊆ B,and E(C0) ⊆ E ∪ E′ is the set of edges of C0. Initialize S ← A(C0) ∪ (B(C0) \{b0}), and i← 1. In what follows, we let A(S) = A ∩ S and by B(S) = B ∩ S,

Journal of Graph Theory DOI 10.1002/jgt

216 JOURNAL OF GRAPH THEORY

and note that the invariant that T [A(S), B(S)] is a matchable spanning tree of S ismaintained throughout the procedure. Initialize a0 to any vertex in A, and repeatSteps 1.1 and 1.2 while ai−1 �∈ A′ \ A.

Step 1.1. Find vertices bi ∈ B(S) and ai �∈ A(S) such that the edge {ai, bi} ∈E′ \ E; such a pair of vertices must exist since not all vertices v ∈ B(S) have bothneighbors in T ′ belonging to A(S), as this would imply by |A(S)| = |B(S)| + 1 thatthere is a cycle in T ′. If ai ∈ A′ \ A, then continue with Step 2.

Step 1.2. Otherwise, the graph T ∪ {ai, bi} contains a unique cycle Ci =(A(Ci), B(Ci), E(Ci)). Set S ← S ∪ (A(Ci) ∪ B(Ci)), and i← i+ 1.

Clearly, the above loop must terminate after i ≤ |A| iterations, and we get avertex ai ∈ A′ \ A. Let i0 = i, i1 be the smallest index j such that bi0 ∈ B(Cj), i2 bethe smallest index j such that bi1 ∈ B(Cj), and so on. This way we obtain indicesi = i0 > i1 > . . . > is = 0, for some s ≥ 0. Now we modify the tree T iterativelyas follows.

Step 2. For j = is−1, . . . , i1 we do the following: let vj be the neighbor of bj inthe unique cycle C′j in the graph T ∪ {bj, aj}. Set T ← T ∪ {bj, aj} \ {bj, vj}.

Note that, for j ∈ {i1, . . . , is−1}, the cycle C′j found in Step 2 may be differentfrom the corresponding cycle Cj found in Step 1.2 above. However, it is not difficultto see that at the end of each iteration j = ik in Step 1.2, it holds that the path betweenx and y in the current tree T passes through bik+1 . In particular at the end of Step 2, weknow that bi0 lies on the path between x and y in T . Let a′ be one of the two neighborsof bi0 on that path. Finally we set T ← T ∪ {{b0, x}, {b0, y}, {bi0, ai0}} \ {bi0, a

′}.To see that the final tree T is indeed a matchable spanning tree, observe that bydeleting the edge {bi0, a

′} we break T into two components, one of which will beconnected to ai0 after adding the edge {ai0, bi0}, and both of which will connectedto b0 after adding the edges {b0, x} and {b0, y}. Therefore, T is connected and eachvertex in B ∪ {b0} has degree 2 in T . Thus, we can now conclude that the graphG[ai0, b0] is matchable since it has a matchable spanning tree. �

Proposition 5 implies that matchable graphs are “connected and continuous”in the sense that we can reach from a given matchable graph to any matchablegraph containing it by repeatedly appending pairs of vertices, one at a time, alwaysremaining within the class of matchable graphs. See Figure 2 for an Example.

Corollary 2. Let G = (A, B, E) and G′ = (A′, B′, E′) be two matchable graphssuch that |A| = |B| + 1, |A′| = |B′| + 1, A ⊂ A′, and B ⊂ B′. Then there exist apair of vertices a ∈ A′ \ A and b ∈ B′ \ B, and a set of edges E′′ ⊆ E ∪ E′, suchthat the graph (A ∪ {a}, B ∪ {b}, E′′) is matchable.

Proof. Let T and T ′ be matchable spanning trees of G and G′, respectively,and apply Proposition 5. �Journal of Graph Theory DOI 10.1002/jgt

TRANSVERSAL HYPERGRAPHS IN BIPARTITE GRAPHS 217

b

x

y

b

b

b

b

a

a

a

a

C

C

C

C

0

1

2

3

4

4

2

2

1

0

3

3

b

x

y

b

b

b

b

a

a

a

a

C

C

C

C

0

1

2

3

4

4

2

2

1

0

3

3

FIGURE 1. Illustration of the proof of Proposition 5. White vertices belong toA ∪ A′ and black vertices belong to B ∪ B′; solid lines indicate edges of T anddotted lines indicate edges of T′ . On the left we show the original set of cyclesobtained by the procedure described in the proof (here i0 = 4, i1 = 3, i2 = 1, andi3 = 0), and on the right we show the modified tree T.

FIGURE 2. Example for Proposition 5. White vertices belong to A ∪ A′ and blackvertices belong to B ∪ B′; solid lines indicate edges of T and dotted lines indicateedges of T′. On the left we show the initial configuration, and on the right we showthe new one after the extension.

Journal of Graph Theory DOI 10.1002/jgt

218 JOURNAL OF GRAPH THEORY

Corollary 2 also implies that, given a matchable subgraph G′ of a bipartite graphG = (A, B, E), we can check in polynomial time whether G′ is a maximal match-able induced subgraph of G.

C. Characterization of Minimal Blockers

We start with the following definition.

Definition 2. Let G = (A, B, E) be a bipartite graph that has a perfect matching.A matchable split of G, denoted by [(A1, B1), (A2, B2), (A3, B3)], is a partition ofthe vertex set of G into sets A1 ∪ A2 ∪ A3 = A and B1 ∪ B2 ∪ B3 = B such that

(B1) |A1| = |B1| + 1, |A2| = |B2| − 1, |A3| = |B3|,(B2) the graph Gi = G[Ai, Bi] is matchable for i = 1, 2,(B3) the graph G3 = G[A3, B3] has a perfect matching, and(B4) the graphs G[A1, B3] and G[A3, B2] have no edges.

Denote by S(G) the family of all matchable splits of G. We are now ready tocharacterize minimal blockers of bipartite graphs.

Theorem 3. Let G = (A, B, E) be a bipartite graph in which there exists a perfectmatching. Then a subset of edges X ⊆ E is a minimal blocker if and only if there is amatchable split [(A1, B1), (A2, B2), (A3, B3)] ofG, such thatX = {{a, b} ∈ E : a ∈A1, b ∈ B2}. This correspondence between minimal blockers and matchable splitsis one-to-one. Moreover, given a minimal blocker we can construct a matchablesplit, and vice versa, from a given matchable split we can construct a minimalblocker, both in polynomial time.

Proof. The correspondence � : B(G)↔ S(G) is defined as follows:(i) Given a minimal blocker X ∈ B(G), define the corresponding matchable split

�(X) = [(A1, B1), (A2, B2), (A3, B3)] by the following (polynomial-time) proce-dure. (1) Let G′ = G−X. By the minimality of X, we must have |�G′(Z)| ≥|Z| − 1 for every Z ⊆ A. (2) Since G′ does not have a perfect matching, thereexists a subset Z ⊆ A with |�G′(Z)| = |Z| − 1. Let A1 ⊆ A be a smallest suchZ, and B1 = �G′(A1). (3) Similarly, let B2 be a minimum cardinality subsetof B such that |�G′(B2)| = |B2| − 1, and let A2 = �G′(B2). (4) Finally, defineA3 = A \ (A1 ∪ A2) and B3 = B \ (B1 ∪ B2).

Now let us verify that �(X) is indeed a matchable split. First, the sets A1

and A2 are disjoint: If A1 ∩ A2 �= ∅, then B1 ∩ B2 �= ∅ and the minimality of A1

and B2 gives |�G′(A1 \ A2)| ≥ |A1 \ A2| and |�G′(B2 \ B1)| ≥ |B2 \ B1|. Note that�G′(A1 \ A2) ⊆ B1 \ B2 and �G′(B2 \ B1) ⊆ A2 \ A1, and thus we get |A1 \ A2| ≤|B1 \ B2| and |B2 \ B1| ≤ |A2 \ A1|. But adding-up the last two inequalities givesthe contradiction |A1| + |B2| ≤ |B1| + |A2|. This shows that A1 and A2 are dis-joint sets, implying that there are no edges in G′ between the sets A1 and B2.Furthermore, since for any edge e ∈ X, the graph G′ + e has a perfect matching, e

Journal of Graph Theory DOI 10.1002/jgt

TRANSVERSAL HYPERGRAPHS IN BIPARTITE GRAPHS 219

must be incident to both A1 and B2 in G, since otherwise |�G′+e(A1)| = |A1| − 1or |�G′+e(B2)| = |B2| − 1, in violation of Hall’s condition. Thus X = {{a, b} ∈ E :a ∈ A1, b ∈ B2}, which also implies (B4). Second, the graphs G1 = G[A1, B1] andG2 = G[A2, B2] are both matchable. If not, then there is a vertex, say v ∈ A1 suchthat G1 − v does not have a perfect matching. But then Hall’s theorem implies thatthere is a subset Z ⊆ A1 \ {v} such that |�G′(Z)| ≤ |Z| − 1, in contradiction withthe minimality of A1. Third, since for every edge e = {a, b} ∈ X, where a ∈ A1

and b ∈ B2, the graph G′ + e has a perfect matching M, the vertices in A1 \ {a}must be matched by M to those in B1 and the vertices in B2 \ {b}must be matchedby M to those in A2. But then the vertices in A3 must be matched by M to those inB3, that is, G3 = (A3, B3) has a perfect matching.

Finally, the fact that the sets A1 and B2 defined above, and hence the matchablesplit they define, are unique and can be found in polynomial time, follows fromProposition 1, since the function �G′(Z)− |Z| is submodular and A1 and B2 are itssmallest minimizers over A and B, respectively.

(ii) Given a matchable split Y = [(A1, B1), (A2, B2), (A3, B3)] of G, definethe corresponding minimal blocker to be �−1(Y ) = {{a, b} ∈ E : a ∈ A1, b ∈ B2}.Clearly, �−1(Y ) is blocker since A1 has neighborhood of size |A1| − 1 in G′ def=G−�−1(Y ). Furthermore, if e = {a, b} ∈ �−1(Y ), where a ∈ A1 and b ∈ B2, thenthe graph G′ + e has a perfect matching M. Indeed, by the matchability of thesplit Y , the graphs (A1 \ {a}, B1), (A2, B2 \ {b}) and (A3, B3) have disjoint per-fect matchings M1, M2, and M3. Hence, M = M1 ∪M2 ∪M3 ∪ {e} is a perfectmatching for G′ + e. Thus we conclude that �−1(Y ) is a minimal blocker.

Finally, let us verify that the above mapping is one-to-one. For this we needto verify that �−1(�(X)) = X for all X ∈ B(G) and �(�−1(Y )) = Y for all Y ∈S(G). The former claim follows from the fact that, if X ∈ B(G) and Y = �(X) =[(A1, B1), (A2, B2), (A3, B3)], then X = {{a, b} ∈ E : a ∈ A1, b ∈ B2} = �−1(Y ).The latter claim follows from the uniqueness of the sets A1 and B2 defining thematchable split �(X) for any X ∈ B(G). �Remark 2. Let us note that part (i) in the above proof could alternatively be de-rived by using alternating paths.1 Namely, we consider a maximum matching M inG′ = (A, B, E \X). Since X is a minimal blocker, we must have |M| = |A| − 1 =|B| − 1. We denote by a ∈ A and b ∈ B the unique points not covered by M. Letus now consider all M-alternating paths starting at vertex a, and denote by A1 ⊆ A

and B1 ⊆ B the set of vertices reached by such alternating paths. Similarly, letus denote by A2 ⊆ A and B2 ⊆ B the set of vertices reached by M-alternatingpaths starting at vertex b. Clearly, these sets are pairwise disjoint, a ∈ A1, |A1| =|B1| + 1, b ∈ B2, and |B2| = |A2| + 1. Let us finally define A3 = A \ (A1 ∪ A2)and B3 = B \ (B1 ∪ B2). It can be shown that the graphs G[A1, B1] and G[A2, B2]are matchable, and that G[A3, B3] is perfectly matched by the edges of M be-longing to this induced subgraph. Furthermore, the subgraphs G[A1, B2 ∪ B3] and

1 This was pointed out to us by an anonymous reviewer.

Journal of Graph Theory DOI 10.1002/jgt

220 JOURNAL OF GRAPH THEORY

G[A1 ∪ A3, B2] cannot have any edges. Finally, the sets A1, A2, B1, and B2 can beshown to be unique, independent of the choice of M (cf. [7]).

3. GENERATION ALGORITHMS

Given a (bipartite) graph G = (V, E), let π : 2E → {0, 1} be a monotone propertydefined on subsets of E: if p(X) = 1, that is, the graph (V, X ⊆ E) satisfies π,then any supergraph (V, Y ⊇ X) also satisfies π. Consider the problem of listingall subgraphs of G, or correspondingly, the family Fπ ⊆ 2E of all minimal subsetsof E, satisfying a monotone property π. For instance, if π(X) is the property thatthe subgraph with edge set X ⊆ E is connected, then Fπ is the family of spanningtrees of G; if π(X) is the property that the subgraph G(A, B, X ⊆ E), of a bipartitegraph G = (A, B, E), has a perfect matching, then Fπ is the family of all perfectmatchings of G. Note that, with each family of subgraphsFπ satisfying a monotoneproperty π, we can associate the dual family

Fdπ = {X ⊆ E | X is a minimal transversal of Fπ},

where X ⊆ E is a transversal ofFπ if and only if X ∩ Y �= ∅ for all Y ∈ Fπ. Thus ifπ(X) is the property that G(V, X) is connected, thenFd

π is the family of all minimalcuts of G = (V, E), and if π(X) is the property that the subgraph G(A, B, X ⊆ E),of a bipartite graph G = (A, B, E), has a perfect matching then Fd

π is the family ofall minimal blockers of G.

Enumeration algorithms for listing subgraphs satisfying a number of monotoneproperties are well known. For instance, it is known [26] that the problems of listingall minimal cuts or all spanning trees of an undirected graph G = (V, E) can besolved with delay O(|E|) per generated cut or spanning tree. It is also known (seee.g., [6,12,24]) that all minimal (s, t)-cuts or (s, t)-paths, can be listed with delayO(|E|) per cut or path. Furthermore, polynomial delay algorithms also exist forlisting perfect matchings, maximal matchings, maximum matchings in bipartitegraphs, and maximal matchings in general graphs [9,10,28,29].

In the next subsections we give an overview of two commonly used techniquesfor solving such enumeration problems; see e.g. [17,20,25] for more details.

A. The Supergraph Approach

This technique works by building and traversing a directed graph G = (Fπ, E), de-fined somehow on the family to be generated Fπ ⊆ 2E. The arcs of G are definedby a polynomial-time computable neighborhood function N : Fπ → 2Fπ that de-fines, for any X ∈ Fπ the set of its outgoing neighborsN(X) in G. A special vertexX0 ∈ Fπ is identified from which all other vertices of G are reachable. The methodworks by traversing, say in breadth-first search order, the vertices of G, startingfrom X0. If G is strongly connected then X0 can be any vertex inFπ. The followingis a basic fact that we will need about this approach (see e.g., [17,27]):

Journal of Graph Theory DOI 10.1002/jgt

TRANSVERSAL HYPERGRAPHS IN BIPARTITE GRAPHS 221

(S) If |N(X)| ≤ p(|V |, |E|) for every X ∈ Fπ, where p(|V |, |E|) is polynomial thatdepends only on the size of G, then the supergraph method yields a polynomialdelay algorithm for enumerating Fπ.

We give two examples below.Generation of matchable spanning trees. Let G = (A, B, E) be a matchable bi-partite graph with |A| = |B| + 1. For X ⊆ E, let π(X) be the property that graph(A, B, X) is matchable. Then, by (M2), Fπ is the family of all matchable span-ning trees of G. For any X ∈ Fπ, the outgoing neighbors of X are defined asfollows. For every edge e = {a, b} ∈ E \X, where a ∈ A and b ∈ B, let e′(X, e)be the edge incident to b on the unique path in T = (A, B, X) between a andb. Note that (A, B, X ∪ {e} \ {e′(X, e)}) is a matchable spanning tree of G. De-fineN(X) = {X ∪ {e} \ {e′(X, e)} | e ∈ E \X}. Clearly, for any X ∈ Fπ, |N(X)| =|E| − 2|A| + 2 and each element ofN(X) can be computed in O(|A|) time. Giventwo vertices X, Y ∈ Fπ of G, we claim that there exists a path from X to Y of lengthat most |X \ Y ||Y \X|. Namely, we can show that if X �= Y , then in at most |Y \X|neighbor steps we can reduce the cardinality |X \ Y | by one. This will prove thestrong connectivity of G (and in fact show that G has diameter at most O(|A|2)). Toprove the claim, let us consider a vertex b ∈ B, and denote by d(b) the degree of

b in the graph G′ def= (A, B, X ∪ Y ). If d(b) = 2 for all b ∈ B, then we must haveX = Y , and we are done. Otherwise, assume that d(b) > 2, and consider two cases:

Case I. d(b) = 4: choose an arbitrary edge e = {a, b} ∈ Y \X. Then the edgee′ = e′(X, e) on the unique cycle in the graph (A, B, X ∪ {e}) is in X \ Y . LetX′ = X ∪ {e} \ {e′} be the corresponding neighbor of X in G. Then |X′ \ Y | =|X \ Y | − 1.

Case II. d(b) = 3: denote by {a, b} ∈ X ∩ Y , {a′, b} ∈ X \ Y and {a′′, b} ∈ Y \X

the edges incident to b in G′. Let G′′ = G′ − b and denote by Z the edge set of G′′.Let us assign length 0 to all edges in X ∩ Z and length 1 to all edges in (Y \X) ∩ Z,and denote by distZ(a′, a′′) the length of a shortest (a′, a′′)-path in G′′. With thisassignment, it is not difficult to see that distZ(a′, a′′) is finite. If distZ(a′, a′′) > 0,then choose an arbitrary edge e = {x, y} ∈ Y \X on the shortest (a′, a′′)-path inG′′, and consider the neighbor X′ of X obtained by adding e to X, giving it length0, and then dropping e′ = e′(X, e). Since the endpoints of e′ are connected withinthe set X ∪ {e}, we have distZ′(a′, a′′) < distZ(a′, a′′), where Z′ = Z ∪ {e} \ {e′}.Thus, repeating this operation for at most |Y \X| steps we can arrive to a vertexX′ in G, where distZ(a′, a′′) = 0 (Z = X′ ∪ Y minus the edges incident to b), thatis, in which a′ and a′′ are connected by a path P within X′ ∩ Z. Now we addthe edge e = {a′′, b} to X′. The unique cycle in (A, B, X ∪ {e}) is formed then byP ∪ {{a′′, b}, {a′, b}}, and hence we need to remove e′(X′, e) = {a′, b} to get to aneighbor X′′ of X. Hence, for this neighbor we have |X′′ \ Y | < |X \ Y |.

It follows then from (S) that we get a polynomial delay algorithm for generatingthe family Fπ.

Journal of Graph Theory DOI 10.1002/jgt

222 JOURNAL OF GRAPH THEORY

Generation of minima of submodular functions. Let f : 2V → R be a submodularfunction, α = min{f (X) : X ⊆ V }, and π(X) be the property that X ⊆ V is a min-imizer of f . Although π is not monotone, we can still use the supergraph approach

to generate the elements of the family Fdef= {X ⊆ V : π(X) = 1}. By Proposition

1, the set F forms a sublattice L of 2V , and the smallest element X0 of this latticecan be computed in polynomial time. For X ∈ F, defineN(X) to be the set of sub-sets Y ∈ L that immediately succeed X in the lattice order. The elements of N(X)can be computed by finding, for each v ∈ V \X, the smallest cardinality mini-mizer X′ = argmin{f (Y ) : Y ⊇ X ∪ {v}} (again using Proposition 1) and checkingif f (X′) = α. Then |N(X)| ≤ |V |, for all X ∈ F. Note also that the definition ofN(·) implies that there is a path in the supergraph G from X0 to any other vertexX ∈ F. Thus it follows from (S) that all the elements of F can be enumerated withpolynomial delay.

B. The Flashlight (Backtracking) Approach

This can be regarded as an important special case of the supergraph method. Assumethat we have fixed some order on the elements of E. Let X0 be the lexicographicallysmallest element in Fπ. For any X ∈ Fπ, let N(X) consist of a single element,namely, the element next to X in lexicographical ordering. Thus the supergraph Gin this case is a Hamiltonian path on the elements ofFπ. The following is a sufficientcondition for the operator N(·) (and also for the element X0) to be computable inpolynomial time:

(F1) For any two disjoint subsets S1, S2 of E, we can check in polynomialtime p(|V |, |E|) if there is an element X ∈ Fπ, such that X ⊇ S1 andX ∩ S2 = ∅.

(See [25] for general background on backtracking algorithms). The traversal of G,in this case, can be organized in a backtracking tree of depth at most |E|, whoseleaves correspond to the elements of the family Fπ, as follows. Each node of thetree is identified with an ordered pair (S1, S2) of two disjoint subsets S1, S2 ⊆ E,and has at most two children. At the root of the tree, we have S1 = S2 = ∅. Thetwo children of an internal node (S1, S2) of the tree are defined as follows. Wechoose the smallest element e ∈ E \ (S1 ∪ S2) such that there is a subset X ∈ Fπ,satisfying X ⊇ S1 ∪ {e} and X ∩ S2 = ∅. If no such element can be found, then thecurrent node is a leaf. Otherwise, the left child of the node (S1, S2) is identified with(S1 ∪ {e}, S2). Analogously, the right child of the node (S1, S2) is (S1, S2 ∪ {e}),provided that there is a subset X ∈ Fπ, such that X ⊇ S1 and X ∩ (S2 ∪ {e}) = ∅.

Clearly, for this method to work in polynomial time, we need (F1) to hold.In general, such a check is NP-hard, but in some cases it can be performed inpolynomial time, provided that we do the extension from the set S1 to S1 ∪ {e} in amore careful way. More precisely, let F′π ⊆ 2E be a family of sets, such that

Journal of Graph Theory DOI 10.1002/jgt

TRANSVERSAL HYPERGRAPHS IN BIPARTITE GRAPHS 223

(F2) F′π ⊇ Fπ,(F3) for every non-empty X ∈ F′π, there exists an element e ∈ X such that X \{e} ∈ F′π (in particular, ∅ ∈ F′π), and

(F4) we can test in polynomial time if a given set X ∈ F′π.

In the backtracking procedure, we always maintain the invariant S1 ∈ F′π. The fol-lowing is a weaker requirement than that of (F1), and provides a sufficient conditionfor this backtracking method to work in polynomial time:

(F5) For any two disjoint subsets S1 ∈ F′π and S2 ⊆ E, and for any e ∈ E \ (S1 ∪S2) such that S1 ∪ {e} ∈ F′π, we can check in polynomial time if there is anelement X ∈ Fπ, such that X ⊇ S1 ∪ {e} and X ∩ S2 = ∅.

This way, under assumption (F5), we obtain a polynomial delay, polynomialspace algorithm for enumerating the elements of Fπ in lexicographical order.

We give an example.Generation of perfect matchings in general graphs. Let G = (V, E) be a graphon vertex set V , and let π(X) be the property that the graph (V, X) has a perfectmatching, for X ⊆ E. Given disjoint subsets S1, S2 ⊆ E, we can perform the checkin (F1) by checking if there is a perfect matching in the graph G′ = G− V ′ − S2,where V ′ = {v ∈ V : v ∈ e for some e ∈ S1}, that is the graph obtained from G bydeleting the edges in S2 and vertices incident to the edges in S1. Thus all perfectmatchings of G can be generated with polynomial delay. A more efficient procedure,in the bipartite case, can be found in [9].

4. POLYNOMIAL DELAY GENERATION OF MINIMAL BLOCKERS

In this section, we use the supergraph approach to show that minimal blockerscan be enumerated with polynomial delay. Using Theorem 3, we may equivalentlyconsider the generation of matchable splits. We start by defining the neighborhoodfunction used for constructing the supergraph GS of matchable splits.

A. The Supergraph

Let G = (A, B, E) be a bipartite graph that has a perfect matching. Given a match-able split X = [(A1, B1), (A2, B2), (A3, B3)] ∈ S(G), the set of outgoing neighborsof X in GS are defined as follows. Denote by G1 = G[A1, B1], G2 = G[A2, B2],and G3 = G[A3, B3], the subgraphs of G induced by X. For each edge {a, b} ∈ E

connecting a vertex a ∈ A2 to a vertex b ∈ B2, such that b is also connected to somevertex a′ ∈ A1, there is a unique neighbor X′ = N(X, a, b) of X, obtained by thefollowing procedure:

1. Let A′′1 = A1 ∪ {a}, B′′1 = B1 ∪ {b}, and G′′1 = G[A′′1, B′′1]. Because of the

edges {a, b}, {a′, b} ∈ E, the graph G′′1 is matchable; see Corollary 1.

Journal of Graph Theory DOI 10.1002/jgt

224 JOURNAL OF GRAPH THEORY

2. Delete the vertices a, b from G2. This splits the graph G2 − {a, b} in a uniqueway into a matchable graph G′2 = G[A′2, B

′2], with |B′2| = |A′2| + 1, and a

graph with a perfect matching G′′2 = G[A′′2, B′′2], such that there are no edges

in E between A′′2 and B′2; see Proposition 3.3. Let A′′3 = A3 ∪ A′′2 and B′′3 = B3 ∪ B′′2. Then the graph G′′3 = G[A′′3, B

′′3]

has a perfect matching. Using Proposition 4, extend G′′1 in the unionG[A′′1 ∪ A′′3, B

′′1 ∪ B′′3] to a maximal matchable graph G′1 = G[A′1, B

′1] such

that the graph G′3 = G[A′3, B′3] = G[A′′3 ∪ A′′1 \ A′1, B

′′3 ∪ B′′1 \ B′1] has a per-

fect matching.4. Let X′ = [(A′1, B

′1), (A′2, B

′2), (A′3, B

′3)], and note that X′ ∈ S(G).

Similarly, for each edge {a, b} ∈ E connecting a vertex a ∈ A1 to a vertex b ∈ B1,such that a is also connected to some vertex b′ ∈ B2, there is a unique neighbor X′

of X, obtained by a procedure similar to the above.

B. Strong Connectivity

For the purpose of generating minimal blockers in a bipartite graph G = (A, B, E),we may assume without loss of generality that

(A1) The graph G is connected.(A2) Every edge in G appears in a perfect matching.

Indeed, if G has at least two connected components, then the set of minimal blockersof G is the disjoint union of the sets of minimal blockers in the different components,computed individually for each component. Furthermore, all the edges in G thatdo not appear in any perfect matching can be removed, since they do not appear inany minimal blocker. In this section, we prove the following.

Lemma 1. Under the assumptions (A1) and (A2), the supergraph GS is stronglyconnected.

In view of (S), Lemma 1 implies Theorem 1. Call a v-star, and denote by v∗, theset of edges incident to a given vertex v ∈ A ∪ B. We need the following lemma.

Lemma 2. Let G = (A, B, E) be a bipartite graph satisfying (A1) and (A2).Then (i) Every star in G is a minimal blocker. (ii) The matchable split correspond-ing to an a-star, a ∈ A, is [({a},∅), (A \ {a}, B), (∅,∅)]. (iii) The matchable splitcorresponding to a b-star, b ∈ B, is [(A, B \ {b}), (∅, {b}), (∅,∅)].

Proof. (i) Clearly, v∗ is a blocker for any v ∈ A ∪ B. Furthermore, since by(A2) any edge connected to v appears in some perfect matching (which of coursedoes not contain any other edge incident to v), it follows that v∗ is indeed a minimalblocker.

(ii) Consider any vertex a ∈ A. Let [(A1, B1), (A2, B2), (A3, B3)] be the match-able split corresponding to a∗. Then a ∈ A1, �G({a}) ⊆ B2, and a∗ is the set of edges

Journal of Graph Theory DOI 10.1002/jgt

TRANSVERSAL HYPERGRAPHS IN BIPARTITE GRAPHS 225

in the graph G[A1, B2]. Note that B1 is empty. If not, then |A1| ≥ 2 and therefore,there exists a vertex a′ ∈ A1, a′ �= a. But then the graph G[A1 \ {a′}, B1] does nothave a perfect matching since a ∈ A1 \ {a′} cannot be matched with any vertexfrom B1, in contradiction to the matchability of G[A1, B1]. Thus we conclude thatA1 = {a} and B1 = ∅. Next, suppose that B3 is non-empty. Then the connectivityof G and the fact that there are no edges in G between A3 and B2 imply that theremust exist an edge e = {a′, b} where a′ ∈ A2 and b ∈ B3. By (A2) there is a per-fect matching M, containing e in G. Clearly, M must match a′ to b and a to somevertex b′ ∈ B2. But then M must also match the set A2 \ {a′} with B2 \ {b′}, whichis impossible since |A2 \ {a′}| = |B2 \ {b′}| − 1. This contradiction shows (ii); (iii)can be shown by a similar argument. �

Given two matchable splits X = [(A1, B1), (A2, B2), (A3, B3)] and X′ =[(A′1, B

′1), (A′2, B

′2), (A′3, B

′3)] of a graph G, let us say that X and X′ are perfectly

nested (see Figure 3) if

(N1) A1 ⊆ A′1 and B1 ⊆ B′1,(N2) A2 ⊇ A′2 and B2 ⊇ B′2, and(N3) each of the graphs G[A2 ∩ A′1, B2 ∩ B′1], G[A3 ∩ A′1, B3 ∩ B′1], G[A2 ∩

A′3, B2 ∩ B′3], and G[A3 ∩ A′3, B3 ∩ B′3], has a perfect matching.

a’

a

b

B

BA

AB 3

2 2A

3

1 1

FIGURE 3. Two matchable splits X and X′: solid lines surround the sets of X anddotted lines surround the sets of X′. The right figure shows the configuration aftera neighbor N(X,a,b) of X in GS is found.

Journal of Graph Theory DOI 10.1002/jgt

226 JOURNAL OF GRAPH THEORY

The strong connectivity of the supergraph GS is a consequence of the followingfact.

Lemma 3. There is a directed path in GS between any pair of perfectly nestedmatchable splits.

Proof. Let X = [(A1, B1), (A2, B2), (A3, B3)] and X′ = [(A′1, B′1), (A′2, B

′2),

(A′3, B′3)] be two matchable splits, satisfying (N1), (N2), and (N3) above. We

show that there is a directed path in GS from X to X′. A path in the op-posite direction can be found symmetrically. Fix a matching M in the graphG[A′1 ∩ A2, B

′1 ∩ B2]. By Proposition 5 (applied to any matchable spanning trees

of the graphs G[A1, B1] and G[A′1, B′1]), there is a vertex b ∈ B′1 \ B1, such

that b is connected by an edge {a, b} to some vertex a ∈ A1 (see Figure 3).Note that b �∈ B3 ∩ B′1 since the graph G[A1, B3] is empty. Thus b ∈ B2 ∩ B′1.Let a′ ∈ A′1 ∩ A2 be the vertex matched by M to b. Now consider the neigh-bor X′′ = N(X, a′, b) = [(A′′1, B

′′1), (A′′2, B

′′2), (A′′3, B

′′3)] of X in GS. We claim that

X′′ is perfectly nested with respect to X′. To see this observe, by Proposition3, that the graph G[A2, B2]− {a′, b} is decomposed, in a unique way, into amatchable graph G′′2 = G[A′′2, B

′′2] and a graph with a perfect matching G′′′2 =

G[A′′′2 , B′′′2 ]. On the other hand, the graph G[A′2, B′2] is matchable, while the

graph G[A2 ∩ (A′1 ∪ A′3) \ {a′}, B2 ∩ (B′1 ∪ B′3) \ {b}] has a perfect matching, andtherefore by Proposition 4, the induced subgraph of G defined by the union ofthese two graphs (which is G[A2, B2]− {a′, b}) decomposes in a unique way intoa maximal matchable induced subgraph F1 containing G[A′2, B

′2] and a graph

with a perfect matching F2. The uniqueness of the decomposition implies thatF1 = G′′2 and F2 = G′′′2 , and hence A′′2 ⊇ A′2 and B′′2 ⊇ B′2. Note that the graphG[A′′2 ∩ A′1, B

′′2 ∩ B′1] still has a perfect matching since F1 = G′′2 can be obtained

from G[A′2, B′2] by calling the procedure EXTEND(G[A′2, B

′2], M ′), where M ′ is a

matching containing M \ {a′, b}. Note also that the graph G[A′′1, B′′1] is obtained by

extending the matchable graph G[A1 ∪ {a′}, B1 ∪ {b}] with pairs of vertices fromthe graph G[A′′′2 ∪ (A′1 ∩ A3), B′′′2 ∪ (B′1 ∩ B3)], which has a perfect matching. Suchan extension must stay within the graph G[A′1, B

′1], that is, A′′1 ⊆ A′1 and B′′1 ⊆ B′1,

since there are no edges between A′1 and B′′′2 ∩ B′3. Finally, since the extension leavesa perfect matching in the graph G[A′′′2 ∪ (A′1 ∩ A3) \ A′′1, B

′′′2 ∪ (B′1 ∩ B3) \ B′′1], we

conclude that X′′ and X′ are perfectly nested. This way, we obtained a neighbor X′′

of X that is closer to X′ in the sense that |A′′1| > |A1|. This implies that there is apath in GS from X to X′ of length at most |A′1 \ A1|. �

Proof of Lemma 1. Let X = [(A1, B1), (A2, B2), (A3, B3)] be a matchablesplit. Let a be any vertex in A1, then the matchability of A1 implies that thegraph G[A1 \ {a}, B1] has a perfect matching. Thus, with respect to a∗ and X, theconditions (N1)–(N3) hold, implying that they are perfectly nested. Lemma 3 henceimplies that there are directed paths in GS from a∗ to X and from X to a∗. Similarlywe can argue that there are directed paths in GS between X and b∗ for any b ∈ B2.In particular, there are directed paths in GS between a∗ and b∗ for any a ∈ A and

Journal of Graph Theory DOI 10.1002/jgt

TRANSVERSAL HYPERGRAPHS IN BIPARTITE GRAPHS 227

b ∈ B, and any other matchable split X′ is connected to X through the stars. Thelemma follows. �

5. SOME GENERALIZATIONS AND RELATED PROBLEMS

A. d-Factors

Let G = (A, B, E) be a bipartite graph, and d : A ∪ B → {0, 1, . . . , |A| + |B|} bea non-negative function assigning integral weights to the vertices of G. We shallassume in what follows that, for each vertex v ∈ A ∪ B, the degree of v in G isat least d(v). A d-factor in G is a subgraph (A, B, X) covering all the vertices ofG, such that each vertex v ∈ A ∪ B has degree d(v) (see Section 10 in [22]). Thusperfect matchings correspond to the case d ≡ 1. Note that d-factors of G are in one-to-one correspondence with the vertices of the polytope P∗(G) = {x ∈ R

E | Hx =d, 0 ≤ x ≤ e}, where H is the incidence matrix of G, and d = (d(v) : v ∈ A ∪ B).In particular, checking if a bipartite graph has a d-factor can be done in polynomialtime by solving a capacitated transportation problem with edge capacities equalto 1, [5].

Since the d-factors are the vertices of a 0/1-polytope, they can be computed withpolynomial delay [4]. We present below a more efficient procedure.

Theorem 4. For any given bipartite graph G = (A, B, E), and any non-negativeinteger function d : A ∪ B → {0, 1, . . . , |A| + |B|}, after computing the first d-factor, all other d-factors of G can be enumerated with delay O(|E|).

Proof. We use the flashlight method. LetMd(G) be the set of d-factors of G.It is enough to check that the condition (F1) is satisfied. Given S1, S2 ⊆ E, we cancheck in polynomial time whether there is an X ∈Md(G) such that X ⊇ S1 andX ∩ S2 = ∅ by checking the existence of a d ′-factor in the graph (A, B, E \ S2),where for v ∈ A ∪ B, d ′(v) = d(v)− degS1

(v) and degS1(v) denotes the number of

edges incident to v in the graph (A, B, S1).A more efficient procedure can be obtained as a straightforward generaliza-

tion of the one in [9]. It is a slight modification of the flashlight method thatavoids checking the existence of a d-factor at each node in the backtracking tree.Given a d-factor X in G, it is possible to find another one, if it exists, by thefollowing procedure. Orient all the edges in X from A to B and all the otheredges in E \X from B to A. Then it is not difficult to see that the resulting di-rected graph G′ has a directed cycle if and only if G contains another d-factorX′ ∈Md(G). Such an X′ can be found by finding a directed cycle C in G′, and tak-ing the symmetric difference between the the edges corresponding to the arcs of C

and X.Now, the backtracking algorithm proceeds as follows. Each node w of the

backtracking tree is identified with a weight function dw, a dw-factor Xw, and abipartite graph Gw = (A, B, Ew). At the root r of the tree, we compute a d-factorX in G, and let dw ≡ d and Gw = G. At any node w of the tree, we check if there

Journal of Graph Theory DOI 10.1002/jgt

228 JOURNAL OF GRAPH THEORY

is another dw-factor X′w using the above procedure, and if there is none, we definew as a leaf. Otherwise, we let ew be an arbitrary edge in Xw \X′w. This defines thetwo children u and z of w by: du(v) = dw(v)− 1 for v ∈ ew and du(v) = dw(v) forall other vertices v ∈ A ∪ B, Xu = Xw, Gu = Gw, dz ≡ dw, Xz = X′w, and finally,Gz = Gw − ew. The d-factors computed at the nodes of the backtracking tree aredistinct and they form the complete set of d-factors of G. �

Let us mention that the supergraph approach can also be used directly to generatethe d-perfect matchings of G = (A, B, E) in incremental polynomial time. Givena d-perfect matching X ∈Md(G), we define the neighborhood function N(X) asfollows. Direct all the edges in X from A to B and all the other edges in E \X fromB to A. For every directed cycle C, with (corresponding) edge set Y , in the resultingdirected graph G(X) = (A, B, E(X)), letN(X, C) ∈ N(X) be the d-factor obtainedfrom X by deleting all the edges in X ∩ Y and adding all the edges in Y \X. Nowthe set of neighbors of X is given by

N(X) = {N(X, C) : C is a directed cycle in G(X)}.

Note that two different cycles C and C′ in G(X) give two different neighborsN(X, C) and N(X, C′), since N(X, C) = X�Y is the symmetric difference of X

and the edges of C. Furthermore, the computation of all directed cycles in G(X) canbe carried out with polynomial delay, see [26]. Finally, the supergraph G definedby the above neighborhood function is strongly connected. Indeed, consider anytwo d-factors X, X′ ∈Md(G). Consider the graph G′ = (A, B, X ∪X′). Delete allthe edges in X ∩X′ from G′ and orient the edges in X \X′ from A to B and theedges in X′ \X from B to A. Then every vertex in the resulting graph G′′ has equalin- and out-degrees. Thus it follows that G′ has an Eulerian decomposition intothe union of arc-disjoint directed cycles. Taking any such cycle C and constructingthe neighbor X′′ = N(X, C), we obtain an element X′′ in the neighborhood of X

with a smaller difference |X′ \X′′|. This shows that G is strongly connected andhas diameter linear in |E|.

B. 2-Matchings in General Graphs

Let G = (V, E) be an undirected graph with vertex set V and edge set E. Let H

be the incidence matrix of G. As stated in the introduction, if G is a bipartitegraph then the perfect matchings of G correspond to the vertices of the polytopeP(G) = {x ∈ R

E | Hx = e, x ≥ 0}. In general, the vertices of P(G) are in one-to-one correspondence with the basic perfect 2-matchings of G, that is, subsets ofedges which form a cover of the vertices with vertex-disjoint edges and odd cycles(see [23]). A (not necessarily basic) perfect 2-matching of G is a subset of edgesthat covers the vertices of G with vertex-disjoint edges and (even or odd) cycles.Denote respectively byM2(G) andM′2(G) the families of perfect 2-matchings andbasic perfect 2-matchings of a graph G. We show below that, the familyM2(G) can

Journal of Graph Theory DOI 10.1002/jgt

TRANSVERSAL HYPERGRAPHS IN BIPARTITE GRAPHS 229

be enumerated with polynomial delay, and the familyM′2(G) can be enumeratedin incremental polynomial time.

Theorem 2 will follow from the following two lemmas.

Lemma 4. All perfect 2-matchings of a graph G can be generated with polynomialdelay.

Proof. We use the flashlight method with a slight modification. For X ⊆ E,let π(X) be the property that the graph (V, X) has a perfect 2-matching. ThenFπ =M2(G). Define F′π = {X ⊆ E : the graph (V, X) is a vertex-disjoint unionof some cycles, some edges, and a path possibly of length zero}. It is easy to checkthat conditions (F2), (F3), and (F4) are satisfied. Given S1 ⊆ F′π, S2 ⊆ E, we modifythe basic approach described in Section 3B in two ways. First, when we considera new edge e ∈ E \ (S1 ∪ S2) to be added to S1, we first try an edge incident to anendpoint of the path in S1, if this path has positive length. If the path has length zero,then any edge e ∈ E \ (S1 ∪ S2) can be chosen and defined to be a path of lengthone in S1 ∪ {e}. Second, when we backtrack on an edge e defining a path of lengthone in S1, we redefine S1 by considering e as a single edge rather than a path oflength one. Now it remains to check that (F5) is satisfied. Given S1 ⊆ F′π, S2 ⊆ E,and an edge e ∈ E \ (S1 ∪ S2), chosen as above, such that S1 ∪ {e} ∈ F′π, we cancheck in polynomial time whether there is an X ∈M2(G) such that X ⊇ S1 ∪ {e}and X ∩ S2 = ∅ in the following way. First, we delete from G all edges in S2, andall vertices incident to edges in S1, except the end-points x and y of the single pathP in S1. Let us call the resulting graph G′. Then, we construct an auxiliary bipartitegraph Gb from G′ as follows (see [23]). For every vertex v �= x, y of G′ we definetwo vertices v′ and v′′ in Gb. In addition, Gb also contains two other vertices x′

and y′′. For every edge {u, v} in G′, with {u, v} ∩ {x, y} = 0, we define two edges{u′, v′′} and {u′′, v′} in Gb. For each edge {x, u} in G′, we introduce an edge {u′, x′′}in Gb, and for each edge {u, y} in G′, we introduce an edge {u′, y′′} in Gb. It is easyto see that there is an X ∈M2(G) such that X ⊇ S1 ∪ {e} and X ∩ S2 = ∅ if andonly if there is a perfect matching in Gb. �

Lemma 5. For a graph G = (V, E), we have

|M2(G)| ≤(|M′2(G)| + 1

2

). (2)

Proof. Note that each non-basic perfect 2-matching M in G can be decom-posed into two distinct basic perfect 2-matchings M ′ and M ′′. This can be done bydecomposing each even cycle C in M into two edge-disjoint perfect matchings C′

and C′′. The two basic perfect 2-matchings M ′ and M ′′ are defined to contain thedisjoint edges in M and the edges of the odd cycles in M. In addition, M ′ containsthe edges of the perfect matching C′ for each even cycle C in M and M ′′ contains the

Journal of Graph Theory DOI 10.1002/jgt

230 JOURNAL OF GRAPH THEORY

edges of the perfect matching C′′ for each even cycle C in M. This decompositionimplies (2). �

Proof of Theorem 2. By generating all perfect 2-matchings of G and discardingthe non-basic ones, we can get generate all basic perfect 2-matchings. By Lemma5, the total time for this generation is polynomial in |V |, |E|, and |M′2(G)|. Sincethe problem is self-reducible, we can convert this output polynomial generationalgorithm to an incremental one, see [3,8,18] for more details. �

ACKNOWLEDGMENTS

We thank Leonid Khachiyan for helpful discussions, and two anonymous refereesfor some useful remarks.

REFERENCES

[1] D. Avis and K. Fukuda, A pivoting algorithm for convex hulls and vertexenumeration of arrangements and polyhedra, Sym Comput Geometry 1991,North Conway, NH, pp. 98–104.

[2] E. Boros, K. Elbassioni, V. Gurvich, and L. Khachiyan, On enumerating min-imal dicuts and strongly connected subgraphs, in Proceedings of 10th Interna-tional Conference on Integer Programming and Combinatorial Optimization(IPCO X), New York, NY, USA, June 2004, Lecture Notes in Computer Sci-ence 3064, pp. 152–162.

[3] E. Boros, K. Elbassioni, V. Gurvich, and L. Khachiyan, Generating maximalindependent sets for hypergraphs with bounded edge-intersections, to appearin Proceedings of 6th Latin American Theoretical Informatics Conference(LATIN 2004), Buenos Aires, Argentina, April 2004, Lecture Notes in Com-puter Science 2976, pp. 488–498.

[4] M. Bussieck and M. Lubbecke, The vertex set of a 0/1-polytope is stronglyP-enumerable, Comput Geometry: Theory Appl 11(2) (1998), 103–109.

[5] W. Cook, W. Cunningham, W. Pulleyblank, and A. Schrijver, CombinatorialOptimization, John Wiley and Sons, New York, 1998 Chapter 4, 91–126.

[6] N. Curet, J. DeVinney, and M. Gaston, An efficient network flow code forfinding all minimum cost s-t cutsets, Computer Operations Res 29 (2002),205–219.

[7] A. L. Dulmage and N. S. Mendelsohn, A structure theory of bipartite graphsof finite exterior dimension, Trans Roy Soc Canada Ser III 53 (1959), 1–13.

[8] T. Eiter, G. Gottlob, and K. Makino, New results on monotone dualization andgenerating hypergraph transversals, SIAM J Comput 32 (2003), 514–537.

[9] K. Fukuda and T. Matsui, Finding all minimum-cost perfect matchings inbipartite graphs, Networks 22(5) (1992), 461–468.

Journal of Graph Theory DOI 10.1002/jgt

TRANSVERSAL HYPERGRAPHS IN BIPARTITE GRAPHS 231

[10] K. Fukuda and T. Matsui, Finding all the perfect matchings in bipartite graphs,Appl Math Lett 7(1) (1994), 15–18.

[11] M. Grotschel, L. Lovasz, and A. Schrijver, Geometric Algorithms and Com-binatorial Optimization, Springer-Verlag, Berlin, 1993.

[12] D. Gusfield and D. Naor, Extracting maximum information about sets of min-imum cuts, Algorithmica 10 (1993), 64–89.

[13] M. Hall, Combinatorial Theory, Blaisdell Publ. Co., Waltham, 1967.[14] P. L. Hammer and I. E. Zverovich, Constructing of a maximum stable set with

k-extensions, Combin, Probab Comput 14(3) (2005), 311–318.[15] S. Iwata, L. Fleischer, and S. Fujishige, A combinatorial, strongly polynomial-

time algorithm for minimizing submodular functions, Proceedings of 32ndannual ACM symposium on Theory of computing (STOC 2000), Portland,Oregon, US, pp. 97-106.

[16] M. Jerrum and A. Sinclair, Approximating the Permanent, SIAM J Comput18 (1989), 1149–1178.

[17] D. S. Johnson, M. Yannakakis, and C. H. Papadimitriou, On generating allmaximal independent sets, Inf Process Lett 27 (1988), 119–123.

[18] L. Khachiyan, E. Boros, K. Elbassioni, V. Gurvich, and K. Makino, On thecomplexity of some enumeration problems for matroids, SIAM J DiscreteMath 19(4) (2006), 966–984.

[19] M. Las Vergnas, Transversales disjointes d’une famille d’ensembles, preprint,1970.

[20] L. Lovasz, A generalization of Konig’s theorem, Acta Math Acad Sci Hung21 (1970), 443–446.

[21] L. Lovasz, Submodular functions and convexity, In: Mathematical Pro-gramming: The State of the Art, Springer Verlag, 1983. Bonn, 1982,pp. 235–257.

[22] L. Lovasz and M. D. Plummer, Matching Theory, North-Holland, Amsterdam,1986.

[23] K. Murota, Matrices and Matroids for Systems Analysis, (Algorithms andCombinatorics, Vol. 20), Springer-Verlag, Berlin 2000.

[24] J. S. Provan and D. R. Shier, A paradigm for listing (s, t) cuts in graphs,Algorithmica 15 (1996), 351–372.

[25] R. C. Read and R. E. Tarjan, Bounds on backtrack algorithms for listing cycles,paths, and spanning trees, Networks 5 (1975), 237–252.

[26] A. Schrijver, A combinatorial algorithm minimizing submodular functions instrongly polynomial time, J Combin Theory Ser B 80(2) (2000), 346–355.

[27] B. Schwikowski and E. Speckenmeyer, On enumerating all minimal solutionsof feedback problems, Discrete Appl Math 117(1–3) (2002), 253–265.

[28] T. Uno, Algorithms for enumerating all perfect, maximum and maximalmatchings in bipartite graphs, in Proceedings of 8th International Symposium

Journal of Graph Theory DOI 10.1002/jgt

232 JOURNAL OF GRAPH THEORY

on Algorithms and Computation (ISAAC 1997), Singapore, December 1997,Lecture Notes in Computer Science 1350, pp. 92–101.

[29] T. Uno, A fast algorithm for enumerating bipartite perfect matchings, in Pro-ceedings of 12th International Symposium on Algorithms and Computation(ISAAC 2001), Christchurch, New Zealand, December 2001, Lecture Notesin Computer Science 2223 (Springer, Berlin, 2001), pp. 367–379.

Journal of Graph Theory DOI 10.1002/jgt