Matching Is As Easy As Matrix Inversion: Ketan Mulmuley '
Matching Is As Easy As Matrix Inversion: Ketan Mulmuley '
Ketan Mulmuley ’
Computer Science Department
University of California, Berkeley
Umesh V. Vazirani 2
Aiken Computation Laboratory
Harvard University
Vijay V. Vazirani 3
Computer Science Department
Cornell University
Permission to copy without fee all or part of this material is granted provided that the copies are not made or distributed for direct commercial
advantage, the ACM copyright notice and the title of the publication and its date appear, and notice is given that copying is by permission of the
Association for Computing Machinery. To copy otherwise, or to republish, requires a fee and/or specific permission.
346
Our algorithm is conceptually different Since S contains n elements,
in that it directly finds a perfect matching in
the graph. It is somewhat faster (RI@) and Pr [There exists a singular
requires 0 (n3*‘m) processors. element] 5 ( ‘1 xn= l/2.
2n
347
Let U= {ul, - - - u,}, ‘V= {vl, - - - v,}, i.e. aM, in the above sum will have value 2”.
and let D be the nx n adjacency matrix of G, The remaining permutations have value zero,
i.e. dij= 1 if (ui,vi)EE, an.d 0 otherwise. or a higher power of 2. Hence IBij 12”“/2’+
Obtain an integer’ matrix B from D by will be odd. On the other hand, if (Us, Vi) 4
replacing the l’s in D by 2”+, where wii is M, all permutations in the sum have value
the weight assigned to the edge (Ui,Vj). zero, or a power of 2 higher than 2”. Hence
IB~j12”“/2” will be even. The lemma fol-
Lemma 2: Suppose the minimum weight lows.
perfect matching in G(U, V,E) is unique.
Let this matching be M and its weight be w. The algorithm to find M is now
Then IB I# 0; moreover, the highest power straightforward:
of 2 which divides IB I is 2”.
Proof: First notice that each perfect match- Procedure: Perfect Matching (G, B);
ing in G corresponds to a permutation in S,.
For each permutation cr on (1, 2, . . . . n),
define Step 1: Compute IB I, and obtain W.
Thus by evaluating IB I, we can deter- Definition: Given a graph G (V, E), the
mine the weight of the minimum weight adjacency matrix of G is an nx n symmetric
matching. The next lemma will enable us to matrix D SU& that dij = 1 if (Vi, vj)EE, and
obtain the matching itself. 0 otherwise. The Tutte matrix of G is an
nx n skew-symmetric matrix A, obtained as
Lemma 3: Let M be the unique minimum follows from D: if dij = dji = 1, replace
weight matching in G, and let w be its them by indeterminates Xii and -Xi;, so that
weight. The edge (Ui, Vi) belongs to M iff the entries above the diagonal are positive,
IBij 12”” and leave the 0 entries of D unchanged.
is odd.
2” Theorem (Tutte [Tu]): Let G(V, E) be a
graph and let A be its Tutte matrix. Then
Proof: First notice that
IA I# 0 iff there is a perfect matching in G.
IB~~12”V
‘J
= x sign(cr)v Obtain an integer matrix B from the
0:0(i)= j
Tutte matrix by substituting for the indeter-
Let cry be the permutation correspond- minates Xii the integers 2w’j, where Wij is the
ing to M. If (Uj, vi) E M, one permutation, weight assigned to the edge (Vi, Vj). The
348
algorithm given above, operated with B, graph G (V, E), given edge-weights w(e) for
gives a perfect matching in G. The proof of each edge OS??in unary. First notice that if
Lemmas 2 and 3 is more involved for gen- the weight of each edge is scaled up by a fac-
eral graphs, and it appears in the final paper tor of mn,’ the minimum weight perfect
(to appear in Combinatorics). matchings will be lighter than the rest by at
Notice that the only non-trivial compu- least mn. We can now use the isolating
tational effort required in the matching algo- lemma to isolate one of I these minimum
rithm is the evaluation of the determinant weight matchings: to edge e& assign the
and adjoint of B. We will use Pan’s IPa] weight mnw(e) + re, where T, is chosen uni-
randomized matrix-inversion algorithm, formly and independently from [l, 2m]. The
which computes IBI and a&(B) in order to proof of Lemma 1 works in this setting as
compute B- i. It requires 0 (log2n) time and well. As such this algorithm will require
O(n3.‘m) processors for inverting an nx n O(n3.‘mW) processors, where W is the
matrix whose entries are m-bit integers, In weight of the heaviest edge. Hence if the
comparison, there is a processor-efficient edge-weights are in unary, this problem is in
RNC3 implementation of the algorithm of RNC2. The parallel complexity of this prob-
[KUW 11 which requires 0 (n3.5) processors lem when the edge-weights are given in
binary is as yet unresolved.
WI.
Theorem 1: There is an RNC2 algorithm for b). The problem of finding a maximum
finding a perfect matching in general graphs. matching in a graph can now be reduced to
The algorithm requires 0 (n3.‘m) parallel minimum weight perfect matching as follows:
processors. extend G into a complete graph by throwing
in new edges. Assign weight 0 to each edge
of G, and 1 to each of the new edges, and
Although the sequential version of our find a minimum weight perfect matching (for
algorithm is less efficient than conventional an alternative method see [RV]).
matching algorithms (the most efficient of
these takes O(mJ T) steps [MV]), it has the
advantage of being easy to program, espe- c). The vertex-weighted matching problem is
cially if a subroutine for matrix inversion is the following:
available, In BV] a simple matching algo-
rithm is presented, addressing the issue of input : Graph G (V, E), and a positive weight
ease of programming. It would be informa- for each vertex VEV.
tive to compare these two algorithms.
Problem: Find a matching in G whose
vertex-weight is maximum. The vertex-
weight of a matching is defined to be the
sum of the weights of the vertices covered by
5. Parallel Algorithms for Related the matching.
Problems
First notice that the desired matching
will be a maximum matching. This is so
A parallel algorithm for the perfect because any non-maximum matching can be
matching problem easily yields parallel algo- augmented into a maximum matching
rithms for the following related problems. without unmatching any vertex in the pro-
RNC3 algorithms for these problems are cess. Define V’GV to be a matching set if V’
given in [KUWl]. Here we give RNC2 algo- is the set of vertices covered by a maximum
rithms. matching in G. The solution now consists of
finding the heaviest matching set, and a per-
a). We first address the problem of finding a fect matching in the subgraph induced by
minimum weight perfect matching in a
349
these vertices. Sort the v’ertices of G by parallelized? Notice that the self-reduction
decreasing weight. Two matching sets can process yields the lexicographically first solu-
be compared lexicographically in this sorted tion. For several problems, such as maximal
order. independent set and depth first search, find-
ing such a solution is P-complete (see [Co]),
Lemma 4: The lexicographically largest even though efficient parallel algorithms
matching set is the heaviest matching set. exist for the unrestricted search problem (the
parallel complexity of finding the lexico-
Proof: Let L and H be maximum matchings graphically first perfect matching or the lexi-
which give the lexicographically largest and cographically first maximal matching is as
the heaviest matching sets respectively. Sup- yet unresolveld). This issue was first studied
pose these matching sets are: different. Let u by Karp, Upfal and Wigderson [KUW2].
be the first vertex in the sorted order where Motivated from matroid theory, they give an
the two sets differ. The vertex u will be RNC2 procedure for the search problem,
matched in L but not in 1Fi. Consider the using an oracle for the ‘rank’ function. Via
symmetric difference of L and H. This will the isolating lemma, we reduce a general
have an alternating even length path from 1( search problem to the weighted decision
to a vertex v, say. The symmetric difference problem, where the weights are polynomially
of this path and H will yield a matching bounded.
heavier than H, since v is lighter than u. The
contradiction proves the lemlma. Theorem 3: Let (S, F) be an arbitrary set
We now use the A?NC2 algorithm system, and let 0 be an oracle for the
presented in [VV] for obtaining the lexico- weighted decision problem, ‘Given polynomi-
graphically largest matching set. This algo- ally bounded positive integral weights for the
rithm is based on a generalization of Tutte’s elements of ,S and a positive integer k, is
Theorem. there a set j7 whose weight is k or less?’
There is an RNC’ procedure which uses 0 to
solve the search problem ‘Find a set in F’.
Theorem 2: The following problems are in
RNC2: The procedure is similar to the perfect
a). Finding a maximum matching in a graph. matching algorithm of Section 3. The weight
b). Finding a minimum weight perfect of the minimum weight set is determined by
matching when the edge weights are given in binary search on k, using O(logn) calls to
unary. the weighted decision procedure. Its ele-
c). Finding a maximum vertex-weighted ments are identified in parallel by the follow-
matching (even if the vertex weights are ing observati.on: an element Xi is in the
given in binary). minimum weight set iff upon increasing its
weight by 1, the weight of the minimum
weight set increases. Hence we can deter-
mine the elements of the minimum weight
set in parallel.
6. Other Applications of the Isolating Using this procedure we obtain an
Lemma RNC2 algorithm for the following problem
posed by Papadimitriou and Yannakakis
[PY]. Interestingly enough, it is not known
a) Parallel Complexity of Search vs. Deci- if this problem can be solved in (determinis-
sion Problems tic) polynomial time.
For the case of sequential computation,
search problems are reducible to the Exact Matching:
corresponding decision problems via self- Input: A graph G (V, E), a subset E‘cE of
reducibility. Can such al reduction be red edges, and a positive integer k.
350
Output: Find a perfect matching involving w(v) to each vertex VEV, chosen from [l,
exactly k red edges. 2n1, where n = IVI. By the isolating
lemma, with probability at least l/2, the
In this case the set system will consist of all maximum weight clique will be unique in
perfect matchings which have exactly k red this graph. The transformed graph G’ is now
edges. Assume that polynomially bounded obtained as follows: corresponding to vertex
weights w, are given to the edges ee.E of G, WV, G’ will have 2nk + w(v) vertices, with
and there is a unique minimum weight per- a clique on them. Corresponding to each
fect matching with k red edges. The follow- edge (u, v) in G, each copy of u is joined to
ing NC2 procedure, suggested by Lovasz, each copy of v in G’. Next choose a random
will find the weight of this perfect matching: integer r in [l, 2nk], and let k’ = 2nk2 + r.
in the Tutte matrix of G, substitute 2w’ for a The transformed problem is (G’, k’).
variable x, if eczE- E’ and 2w’y if eEE’, The following hold by Lemma 1:
where y is an indeterminate. Let B be the
resulting (skew-symmetric) matrix. Now, (1) (G, k) $ CLIQUE => (G’, k’) d
UNIQUE CLIQUE.
IBI = @f(B))2
(2) (G, k) E CLIQUE = > Pr [(G’, k’)
where pf(B) is the Pfaffian of B. Compute E UNXQUE CLIQUE] 2 114n.
IB I using the parallel determinant algorithm
of [BCP], and then compute its square-root
by interpolation. The power of 2 in the coef-
ficient of yk will be the weight of the
minimum weight perfect matching involving 7, Discussion and Future Directions
exactly k red edges.
One difficulty in solving combinatorial
Theorem 4: The exact matching problem is problems in parallel is the following: on the
in RNC2. one hand it is crucial to coordinate the pro-
cessors so they seek the same solution in
parallel; on the other hand, the problem of
b) Randomized Reductions finding a solution with any special proper-
We now turn to another application of ties, such as the lexicographically first one, is
the isolating lemma. Valiant and Vazirani typically P-complete. The isolating lemma
[ValVaz] studied the complexity of finding gets around this; it induces a probability dis-
solutions to instances of SAT having unique tribution on the set of matchings in the
solutions. They show that this problem is graph, and it picks one matching from this
M-hard under randomized reductions. Their distribution. The distribution assigns a non-
proof is based on the hash-function property zero probability to each matching in the
of GF [2] inner products. The isolating graph. Can the methods presented here be
lemma yields a simpler proof. extended to achieve a uniform probability
For simplicity, we consider the distribution, thereby obtaining random
CLIQUE problem, which is parsimoniously matching in the given graph? This will help
inter-reducible with SAT. The core of the solve a long-standing open problem, that of
proof is illustrated by showing a randomized estimating the permanent of a O/l matrix.
reduction from CLIQUE to UNIQUE Computing the permanent exactly is #P-
CLIQUE. The CLIQUE problem is ‘Given a complete [Va]; however, the problem of
graph G(V, E) and an integer k, is there a estimating the permanent is equivalent to the
clique of size k in the graph?’ On the other problem of generating a random perfect
hand, UNIQUE CLIQUE asks if there is matching in a bipartite graph [Br], [JVV].
exactly one clique of size k. The main step in the matching algo-
The reduction is as follows. First rithm, matrix inversion, can be accomplished
assign a random and independent weight in several ways: by Guassian elimination, a
351
greedy algorithm, or by Strassen’s method set in F is u:niclue with probability at Ileast
(see [AHU]), which is based on divide and half.
conquer. Thus by suitably implementing An important open problem remaining
matrix inversion, the matlching algorithm is whether the maximum matching probIem
acquires a greedy/divide-and-conquer fla- is in (determmistic) NC. Currently, incom-
vour. This opens the possibility of a com- parability graphs is the largest class of
binatorial algorithm for matching which has graphs for which this problem is known to be
this flavour. Notice that the algorithm in NC [KVV]. It may be easier to solve the
presented relies critically on the choice of a decision problem, ‘Does the given graph
suitable generalization of matching: the have a perfect matching?‘, before tackling
weighted problem with the additional condi- the general search problem. The following
tion that there is a unique minimum weight modified decision problem is known to be in
perfect matching. Whereas it is unlikely that hTC, ‘Does the given bipartite graph have a
there is a greedy/divide-and-conquer algo- unique perfect matching?’ [KVV].
rithm for matching itself, the results
presented in this paper indicate that it is not
unreasonable to expect a combinatorial algo-
rithm for the generalized problem, or a suit-
able modification. Acknowledgements: We are thankful to
In applying the isolating lemma to the David Aldous, Jack Edmonds, Laszlo
case of perfect matchings, it seems that sub- Lovasz, Eva Tardos and Les Valiant for
stituting random integers from [l, 2n3 valuable discussions.
should suffice where IVI = n. This will
improve the processor-efficiency of the paral-
lel algorithm and the running time of the
sequential Las Vegas algorithm.
Notice that the proof of the isolating References
lemma relies on the independence of the
weights of the elements. It would be interest-
ing to study how crucial the role of indepen- [AHUI A.V. Aho, J.E. Hopcroft, and J.D.
dence is. The semi-random source, intro- Ullman, The Design and Analysis of
duced in [SV] and [Vaz], mathematically Computer Algorithm, Addison-
models dependence using the notion of an Wesl.ey, Reading, Mass,, 1974.
adversary. Thus one could study the proba- WPI A. Borodin, S.A. Cook, and N.
bility that the minimum weight set is unique, Pippinger, ‘Parallel Computation
if the weights of the elements are assigned for Well-endowed Rings and Space
by a semi-random source. One possible for- Bounded Probabilistic Machines,’
mulation is the following: Information and Control 58, l-3
(1983). pp. 113-136.
Let (S,F) be a set system with
s= {Xl, * - * x,}. Each element of S is [BGHI A. Borodin, J. von zur Gathen, and
assigned a label by the roll of an m+ k sided J.E. Hopcroft, ‘Fast Parallel Matrix
dice whose k faces are labelled with *, and and GCD Computations’, Twenty
the remaining faces are numbered from 1 to Third Annual IEEE Symp. on the
m. Each face is equally likeby to appear. The Foundations of Computer Science
adversary now looks at all the outcomes and (1982?),pp. 65-71.
assigns weights from [1, * * u m] to the *‘ed IBrl A.Z. Broder, ‘How Hard is it to
elements, trying to ensure that the minimum Marry at Random? (On the
weight set in F is not unique. The problem Approximation of the Permanent)‘,
is to place good bounds on .m and k so that Eighteenth Annual Symp. on the
despite the adversary, the minimum weight Theory of Computing, (1986), pp.
352
50-58. and Theoretical Computer Science
[Co1 S.A. Cook, ‘A Taxonomy of Prob- Conference, (1985), to appear in
lems with Fast Parallel Algorithms,’ Theoretical Computer Science.
information and Control, 64, 2-22 ml1 L. Lovasz, ‘On Determinants,
(1985). Matchings and Random Algo-
ux L. Csanky, ‘Fast Parallel Matrix rithms,’ Fundamentals of Computing
Inversion Algorithms,’ SIAM J. Theory, edited by L.Budach,
Computing 5, (1976), pp. 618-623. Akademia-Verlag, Berlin, (1979).
IEd11 J. Edmonds, ‘Paths, Trees and [Lo21 L. Lovasz, ‘Combinatorial Problems
Flowers, ’ Canad. J. Math., 17, and Exercises, ’ Akademiai Kaido,
(1965), pp. 449-467. Budapest, and, North-Holland,
Amsterdam, (1979).
[Ed21 J. Edmonds, ‘Systems of Distinct
Representatives and Linear Atge- u-a L. Lovasz and M. Plummer,
bra,’ J. Res. Nat. Bureau of Stan- Matching Theory, Academic Press,
dards, 71B, 4, (1967), pp 241-245. Budapest, Hungary, (in press).
@PI Z. Galil and V. Pan, ‘Improved WV1 S. Micali and V.V. Vazirani, ‘An
Processor Bounds for Algebraic and 0 (4 IVI IE I) Algorithm for Find-
Combinatorial Problems in RNC,’ ing Maximum Matching in General
Twenty Sixth Annual IEEE Symp. on Graphs,’ Twenty First Annual IEEE
the Foundations of Computer Sci- Symp. on the Foundations of Com-
ence, (1985). pp. 490-495. puter Science, (1980), pp 17-27.
[JVVI M.R. Jerrum, L.G. Valiant and Pal V. Pan, ‘Fast and Efficient Algo-
V. V. Vazirani, ‘Random Genera- rithms for the Exact Inversion of
tion of Combinatorial Structures Integer Matrices, Fifth Annual
from a Uniform Distribution’, Foundations of Software Technology
Theoretical Computer Science 43 and Theoretical Computer Science
(1986) pp. 169-188. , Conference, (1985).
353
Wal L.G. Valiant, ‘The Compl.exity of
Computing the Perimanent’,
Theoretical Computer Science 8
(1979) pp. 189-201.
[ValVaz]L.G. Valiant and V.V. Vazirani,
‘NP is as Easy as Detecting Unique
Solutions,’ Theoretical Computer
Science, 47 (1986), pp. 85-93.
[Vaz] U.V. Vazirani, ‘Randomness,
Adversaries and Computation’,
Ph.D. Dissertation, University of
California, Berkeley (1986)..
WV1 U.V. Vazirani and V.V. Vazirani,
‘The Two-Processor Scheduling
Problem is in Random NC,’ Seven-
teenth Annual Symp. on Theory of
Computing, (1985), pp. 11-21.
354