240 likes | 424 Views
Algebraic Algorithms. Definition. Combinatorial methods : Tries to construct the object explicitly piece-by-piece . Algebraic methods : Implicitly sieves for the object by evaluating a sum . The 4cycle Detection Problem. 4cycle detection.
E N D
Definition Combinatorialmethods: Tries to construct the objectexplicitlypiece-by-piece. Algebraicmethods: Implicitlysieves for the object by evaluating a sum.
4cycle detection • Init a booleannxn table T(:,:)=false. • For eachvertex v • For each pair of neighborsu,w of v • IfT(u,w) thenreturntrue and stop • T(u,w)=true • End • End • Returnfalse
Square MatrixMultiplication • What is the computationalcomplexity in terms of number of scalar operations (*,+) of computing the product of twonxn-matrices A and B? • From definition Cij=SkAikBkjwe get O(n3) time. • There is a (highlytheoretical) O(n2.373) time algorithm!
Strassen’salgorithm T(n)=cn2+7T(n/2)=cn2+7c(n/2)2+72T(n/4)= cn2+7c(n/2)2+72c(n/4)2+73T(n/8)=…= cn2(1+7/4+(7/4)2+…+(7/4)log2(n))+7log2(n)= O(nlog2(7))=O(n2.81).
VerifyingMatrixProducts • Given threenxnmatrices A,B, and C you want to verify that AB=C. • Can you do this fasterthanrecomputing the matrixproduct?
VerifyingMatrixProducts • Idea: Project the differencematrix on a randomly chosen 0/1-vector r. • If (AB-C)r=A(Br)-Cr=0, weconclude that AB=C, otherwisewedeemthem different. • No false negatives. • False positives with probability <=1/2. Note that this is an O(n2) time algorithm!
VerifyingMatrixProducts (AB-C)= r= r1 e1 e2 e3 e4 r2 r3 r4
PolynomialIdentity Testing • Given ”black box” multivariatepolynomial P, is P identicallyzero or not? • Think of polynomial P as given by arithmeticcircuit: + x x x x + + + + + + + + x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14
The Schwartz Zippel Lemma • Schwartz-Zippel Lemma: Let P(x1,x2,…,xn) be a multivariatenon-zeropolynomial of total degree d over a finite field F. For uniformly and independentlysampledvalues r1,r2,…,rn in F:
BipartiteMatching Pick as many end-pointdisjointedges as possible.
BipartiteMatching: Augmentationpaths Classic matchingalgorithm: Usedfs to findaugmentationpaths.
BipartiteMatching: Biadjacencymatrix 1 A B D C A E 1 2 B 2 3 C 3 4 D 4 5 5 E
Determinants B D C A E 1 2 In fields of characteristictwo: 3 4 5
Determinants with indeterminates B D C A E 1 2 3 4 5
Algorithm B D C A 1. Replaceindeterminates by randomvaluesxij=rij. 2. Compute the determinant. 3. If it is non-zeroreturnYesotherwise No. E 1 2 3 4 5
General Matchings 2 4 3 5 1 6 1 2 1 2 3 3 4 4 5 6 5 6