Fast Parallel Matrix GCD
Fast Parallel Matrix GCD
1. INTRODUCTION
The work of the first two authors was partially supported by NSERC Grant A7631, and
that of the third author by ONR Grant N00014-76-C-0018.
241
0019-9958/82 $2.00
Copyright © 1982 by AcademicPress, Inc.
All rights of reproductionin any form reserved.
242 BORODIN, VON ZUR GATHEN, AND HOPCROFT
2. THE MODEL
fm
fm-I
gn
gn-1 gn
-~s._~_~] -0].,::
°.
g~
l SO [
f. ! tm--k-I ]
A..-A
go.
• go "'" g k _1/
o,
246 BORODIN, VON ZUR GATHEN, AND HOPCROFT
4. RANK OF MATRICES
For algorithms computing the rank of matrices, i.e., the maximal size of
nonsingular submatrices, we can restrict attention to square matrices (by
padding with zeroes if necessary). We denote by Mn(S ) the set of n × n
matrices with entries from a set S. The rank cannot in general be considered
as an element of the ground field, and we have to make some output
convention such as the following: we require the algorithm to compute
fl ..... f~ ~ F(xl~, xlz ..... x~n) such that for any A E M.(F)
rank(A) = max{i: i = 0 or f/(A) 4= 0}.
s = max{i: i = 0 or f. 4= 0}.
It is clear from Theorem I that this algorithm uses parallel time O(log 2 n), a
polynomially bounded number of processors, and no division. Also
248 BORODIN, VON ZUR GATHEN, AND HOPCROFT
Prob(g~(B, C) = 0) ~ 0.95.
1
D = M.(F)
0
and similarly for C. Since the entries of B and C are chosen independently,
pr(B) and p~(C) are independent random variables• Hence we get
FAST PARALLEL MATRIX 249
Prob(gA(B, C) = 0) = Prob(p~(BAC) = O)
The third equality follows from the fact that the mapping
Mn(F ) × M , ( F ) -t Mn(F) X M , ( F )
(B, C ) ~ (BS-', T-1C)
is a bijection. |
For the two lemmas that establish the probabilistic estimates, we assume
the following sebup: A field F, P _~ F finite with p ~> 2 elements, and d ~ N.
q = V r o b ( f = 0) = p - m # { a ~ pro: f ( a ) = 0}.
+#
la ~Pm: g~(a)@ 0 and ~ gi(a) a m
i
<~ pm(m -- 1)diP + d p m- ' = pmmd/p.
Hence q <~md/p. |
250 BORODIN, VON ZUR GATHEN, AND HOPCROFT
u(t, n)
3/4
1/2
1/4
t
1/4 1/2 3/4 1
FIG. 1. The upper bound u(t, n) on the probability that an n X n matrix is singular. The
entries of the matrix are nonconstant polynomials of degree ~<d over an arbitrary field F
whose arguments are randomly chosen from a subset of F with p elements, and t = dip. The
values n = 1, 2, 3, 4 are shown, and n = oe shows an upper bound for any n E N.
where g(A) is the matrix with (i,j) entry gu(Au). For 1 ~< r~< n, let Tr be the
set of all r × n matrices with entries from P, and S t = {A E Tr:
rank(g(A)) = r}. Now let A C S~_ 1 and 1~_ {1 ..... n} such that # I = r - 1
FAST PARALLEL MATRIX 251
and the square minor of g(A) with rows 1..... r - - 1 and columns i ~ I is
nonsingular. A vector y C F" which is linearly dependent on the row vectors
of g(A) is determined by its entries Yi for i E I.
For a vector z C T~ such that y = (gn(z0,..., g~,(z,)) is linearly dependent
on the rows of g(A), we can in general choose the entries z i for i E I
arbitrarily; for the other entries we then have at most d choices each, deter-
mined by the fixed value for gri(zi). In particular, there are at most
pr-~d ~-~+1 such vectors z E T 1. Thus
#Sr>/ ( p n - pr-ld"-r+~)#Sr_ l= p n ( 1 - t " r+,)#Sr_~,
Thus
follows. This implies q =- u(t, n). This fact has been discovered several times,
see, e.g., Jordan (1911), F i n e - N i v e n (1944), and R o t m a n (1973,
Theorem 8.8). |
Statement (iii) shows that the estimate in (i) is sharp in a certain sense.
We remark that the estimate of (i) also holds when the determinant is
replaced by the permanent; the proof is slightly different.
It is now clear what the estimates in the proof of Theorem 3 really should
252 BORODIN, VON ZUR GATHEN, AND HOPCROFT
THEOREM 4. For any field F, there exists a Las Vegas algorithm f o r the
rank of n × n matrices that uses parallel time O(log z n), no divisions and a
polynomial number o f processors and that either returns the rank o f the input
matrix (and a maximal nonsingular minor) or reports "failure." The
probability o f the second ease is ~ 2 - " .
Proof Let A ~ Mn(F ). For 1 ~< i ~< n let A i C Mn(F) consist of the first i
rows of A and zero rows otherwise, and r i = rank(Ai). Apply the algorithm
of Theorem 3 independently 28n times in parallel to each A i, and let s i be the
maximum of the numbers computed forAi. Thus s; ~< r t, and for each i
[ 19 "~28n
Prob(si < ri) <. ~ j .
Let I = { i : - l ~ < i < ~ n and si_ l < s i } (with s 0 = 0 ) , and A ' C M , ( F ) be the
matrix whose ith row is the ith row of A if i ~ 1 and zero otherwise. Perform
the computation that was done above for the rows of A now for the columns
of A' to obtain a set J~_ {1,..., n}. The parallel time for all this is O(log 2 n),
and
Prob(the I × J minor of A is not a maximal (square)
nonsingular minor) <. zntT¢)
~ " 19 x28n < 2 - "
If #I4= g~4r, then report failure. Else apply the determinant algorithm of
Theorem 1 to compute AIj and each AKL with I t _ K , J c L , # K = # L =
# I + 1 in parallel time O(log 2 n). Here AKL denotes the determinant of the
minor of A with rows from K and columns from L. If either A u = 0 or some
such A/~L is nonzero, then report failure. Otherwise, return s n = rank(A) and
the I × J minor as a maximal nonsingular minor. II
Using the rank algorithm over ~ by Ibarra-Moran-Rosier and the above
construction, we get a deterministic algorithm that uses parallel time
O(log 2 n) and computes a maximal nonsingular minor. Can we have similar
improvement for arbitrary fields? Of course our Monte Carlo algorithm
yields nonuniform algorithms using parallel time O(log 2 n). It would be
particularly interesting to have an answer to the following:
Open Question 2. Can R A N K be computed in parallel time O(log 2 n)
over finite fields, using a uniform family of deterministic algorithms?
FAST PARALLEL MATRIX 253
5. REDUCTIONS
[iJ
1 ' r<i<~n,
The latter question is also open in the sequential setting (see Baur-Strassen,
1983).
6. CONCLUSIONS
ACKNOWLEDGMENTS
We are very grateful to Steve Cook for an observation which led to Theorem 2, to both
Steve Cook and Les Valiant for pointing out relations with combinatorial problems, and to
Volker Strassen for an improvement in the algorithm for Theorem 3. Thanks also go to
Yaacov Yesha for pointing out one of the references.
REFERENCES
643/52/3-2
256 BORODIN, VON ZUR GATHEN, AND HOPCROFT