200 likes | 329 Views
Generating a d -dimensional linear subspace efficiently. Raphael Yuster. SODA’10. Problem statement. Computing the rank of a matrix, and, more generally, generating a row-reduced equivalent matrix is a fundamental computational algebraic problem.
E N D
Generating a d-dimensional linear subspace efficiently Raphael Yuster SODA’10
Problem statement • Computing the rank of a matrix, and, more generally, generating a row-reduced equivalent matrixis a fundamental computational algebraic problem. • Standard approach: Gaussian elimination. • This takes O(nω) < O(n2.38) time [H-B 74’, I-M-H 82’] . • No faster algorithm is known for computing the rank of general n n matrices. • If matrix is sparse (only m << n2 non-zero entries), can we compute a row reduced matrix faster? • Not known (and probably impossible via G.E.)
Problem statement and main result • If we allow randomness, the rankcan be computed faster. • O(mn)Monte Carlo[Wiedemann 86’]. • O(n3-1/(ω -1))ifm=O(n)Las Vegas [Eberly et al. 07’]. • Recall: If B is a row-reduced matrix of A then: • Bspans Rows(A) . • B has rank(A) rows. • Any d rows of B span a d-dim. subspace of Rows(A) . • Our main result:generating a d-dimensional subspace of Rows(A) requires (in some cases significantly) less time than computing a row-reduced matrix.
Main result • Let A be an n n over an arbitrary field, with m nonzero entries, and let d n: • There is an algorithm that computes a dn matrix with full row rank which is a subspace of Rows(A). • If rank(A) < d the algorithm generates a rank(A) n row-reduced matrix of A. • The running time is: • O(min{ n2-2/ω m1/ωdω-2+1/ω , n2dω-2 } ) . Dense case Sparse case
Implications and comparison • Can be used to answer queries of the form “rank(A) > d ?” • A row-reduced matrix of A, and thus rank(A), computable in time which is a function of the rank (binary search). • O(min{ n2-2/ω m1/ωrank(A)ω-2+1/ω , n2 rank(A)ω-2 } ) • If the matrix is dense, the runtime is O(n2dω-2)<O(n2d0.38). For d = o(n) this is faster than doing G.E. from scratch. • Even more efficiency if matrix is sparse:
Implications and comparison • If m = n2-εthen for dsuff. small we get better than O(n2dω-2) and sometimes even better than O(n2) : • d < (n2/m)0.528 < (n2/m)1/(ω-1)2 sub-quadratic runtime. • d < (n2/m) running time O(n2dω-2 (md/n2)1/ω). o(1)
An application • Given a graph G with n vertices what’s the cardinality M(G) of the maximum matching? • [Lovász79’] proved that computing 2M(G) (randomly) reduces to computing the rank of an n nmatrix over a small finite field. • Thus, his algorithm computes M(G) in O(nω) time. • Our algorithm computes M(G) in O(n2 M(G)ω-2) time, which is faster whenever M(G) = o(n) .
Proof of main result - outline Proof consists of two parts: Reducing the computation of a d-dim. subspace of a sparse matrix to the computation of a d-dim. subspace of a dense, but smaller, rectangular matrix. Computing a d-dim. subspace of a (possibly dense, possibly rectangular) matrix by repeatedly filtering out non-essential rows and replacing other rows with a smaller equivalent set of rows spanning the same subspace.
Proof of main result – part 1 • We need a result of Ibarra, Moran and Hui 82’: • Lemma 1: Let B be an l nmatrix. Then a row-reduced matrix can be computed in O(nlω-1) time. • We prove: • Sparse Lemma: Let A be an n nmatrix with m non-zeroes. Let d n2/m. For any s with d sn there is a matrix L with at most dn/s rows so that: • If rank(A) < dthen L is row-equivalent to A. • If rank(A) d then Rows(L) is a subspace of dimension at least dof Rows(A). • L is constructed in O(msω-1) time.
Proof of main result – part 1 Proof of Lemma 2: Partition the rows of A into t = n/s rectangular matrices, A1,…,At,each with s rows. Let ci denote the number of non-zero columns of Ai. Compact Ai by discarding zero columns (but remember their locations) thereby obtaining an s ci matrix Bi. Apply Lemma 1 to each Bi to obtain reduced equivalent matrices Ci with ci columns and rank(Bi)=rank(Ai) rows.
Proof of main result – part 1 The time required to construct Ci is O(cisω-1). So, to construct all C1,…,Cttakes O(msω-1). Let Dibe the matrix obtained from Ci by taking the first d rows of Ci. Expand Di by reinserting the zero columns. If rank(Ai) < d then Diis row-equivalent to Ai Otherwise, Di spanning a d-dim. subspace of Rows(Ai).
Proof of main result – part 1 B1 A1 A2 C1 A3 D1
Proof of main result – part 1 Let L be the union of the Di. L has at most dt = dn/s rows. If rank(A) < dthen L is equivalent to A, as each Diis equivalent to Ai. If rank(A) dthen Rows(L) is a subspace of Rows(A) with dimension at least d.
Proof of main result – part 2 Dense Lemma: Let L be an l nmatrix and let d l /2. We construct L* with at most l /2 rows so that: If rank(L) <d then L* is row-equivalent to L. If rank(L) d then Rows(L*) is a subspace of Rows(L) with dimension at least d. The running time is O(lnd ω-2).
Proof of main result – part 2 • Proof of the main result – the algorithm:We are given an n n matrix A containing m nonzero entries, and a positive integer d. • If d < n2/mapply the sparse lemma with a value s that will be chosen later after optimization. • The result is a matrix L0 with n column andl0dn/s rows satisfying the conditions of the lemma. • If dn2/mwe just set L0=A and l0= n. • In any case now Rows(L0) is a subspace of Rows(A) with dimension at least d(or else L0 is equivalent to A).
Proof of main result – part 2 We check if d l0 /2. If so, we apply the dense lemma to L0 and obtain L1 with l1 l0 /2 rows. We repeatedly apply the dense lemma to Li as long asd li/2 and obtain the next matrix Li +1. We halt when d> li/2. After halting, we perform a final Gaussian elimination on Li and obtain a reduced matrix B, which is the output of our algorithm.
Proof of main result – part 2 Proof of the main result- correctness:At any stage of the algorithm, the rows of the current matrix Li form a subspace of Rows(A), and hence also at the end Rows(B) is a subspace of Rows(A). Thus, if B has (at least) d rows then the final output is (at least) a d-dimensional subspace of Rows(A). If Rank(A) < dthen each of the Li, as well as the final B, is row-equivalent to A.
Proof of main result – part 2 • Proof of the main result- running time: • Consider first the case when dn2/m. In this case l0= n and the application of the dense lemma on Li requiresO(2-in2d ω-2) time. • After O(log n) applications the final G.E. to obtain B takes O(nd ω-1) time by Lemma 1. • The overall runtime is O(n2d ω-2) as required. • Consider next the case when d < n2/m. • The application of the sparse lemma requires O(msω-1) time.
Proof of main result – part 2 As l0dn/s, the dense lemma on Li requires:O(2-is-1n2d ω-1) time. After O(log n) applications the final G.E. to obtain B takes O(nd ω-1) time by Lemma 1. Thus, the overall running time is O(msω-1 +s-1n2d ω-1) Choosing optimal value for s which is s = (d ω-1n2/m)1/ωwe obtain a runtime of O(n2-2/ω m1/ωdω-2+1/ω) as required.