Clever Geek Handbook
📜 ⬆️ ⬇️

Wiedemann Algorithm

Wiedemann Algorithm - an algorithm that allows you to obtain a solution of a system of linear equationsAx=b,b≠0 {\ displaystyle Ax = b, b \ neq 0} {\ displaystyle Ax = b, b \ neq 0} over the final fieldK=GF(q) {\ displaystyle K = GF (q)} {\ displaystyle K = GF (q)} . It was proposed by Douglas Wiedemann ( born Douglas Wiedemann ) in 1986. For some time after the publication of the article, the algorithm did not receive much support and was considered suitable only for obtaining the best estimates of complexity [1] . But later Wiedemann's algorithms were implemented on a computer and were used, for example, to search for factoring polynomials over finite fields.

History

Wiedemann's algorithms were presented to the public in the last century. In 1986, a January issue of IEEE Transactions on Information Theory published an article by Douglas Wiedemann entitled Solving sparse linear equations over finite fields . It described algorithms for solving a system of linear equations over a finite field in the case when the matrix of the system is sparse . Moreover, the article examined cases with different sparse matrices. Also, the rationale of the algorithms and the assessment of the complexity of their work were published in the article [2] .

Task

The algorithm is needed to solve a system of linear equationsAx=b,b≠0 {\ displaystyle Ax = b, b \ neq 0} {\displaystyle Ax=b,b\neq 0} . MatrixA {\ displaystyle A} A has dimensionn×n {\ displaystyle n \ times n} n\times n and is assumed to be sparse , the number of nonzero elements in it is equal tow {\ displaystyle w} w [1] .

Theory

Using matrixA {\ displaystyle A} A a non-degenerate linear map (which is also denoted byA {\ displaystyle A} A ) in spaceKn {\ displaystyle \ mathrm {K} ^ {n}} {\displaystyle \mathrm {K} ^{n}} . Space consideredS {\ displaystyle S} S generated by many vectors{(Aibk)}i=0,one,2 {\ displaystyle \ left \ {{(A ^ {i} b_ {k})} \ right \} _ {i = 0,1,2}} {\displaystyle \left\{{(A^{i}b_{k})}\right\}_{i=0,1,2}} and is determinedAS=A|S {\ displaystyle A_ {S} = A | _ {S}} {\displaystyle A_{S}=A|_{S}} - linear displayS {\ displaystyle S} S onS {\ displaystyle S} S .

We denotefz∈Kn {\ displaystyle f_ {z} \ in \ mathrm {K} ^ {n}} {\displaystyle f_{z}\in \mathrm {K} ^{n}} - minimal polynomialAS {\ displaystyle A_ {S}} {\displaystyle A_{S}} , i.e., a nonzero polynomial of the least degree, such thatf(As) {\ displaystyle f (A_ {s})} {\displaystyle f(A_{s})} is a null mappingS {\ displaystyle S} S , moreover, normalized so that its free term is equal to unity. Note that ifg(z)∈K[z] {\ displaystyle g (z) \ in \ mathrm {K} [z]} {\displaystyle g(z)\in \mathrm {K} [z]} theng(As) {\ displaystyle g (A_ {s})} {\displaystyle g(A_{s})} - zero mapping if and only ifg(A)b=0 {\ displaystyle g (A) b = 0} {\displaystyle g(A)b=0} . Besides,f(z) {\ displaystyle f (z)} f(z) divides polynomialdet(zln-A) {\ displaystyle det (zl_ {n} -A)} {\displaystyle det(zl_{n}-A)} , and thereforedegf(z)⩽n {\ displaystyle degf (z) \ leqslant n} {\displaystyle degf(z)\leqslant n} .

We denoted=degf(z),f(z)=∑i=0df[i]zi {\ displaystyle d = degf (z), f (z) = \ sum _ {i = 0} ^ {d} {f [i] z ^ {i}}} {\displaystyle d=degf(z),f(z)=\sum _{i=0}^{d}{f[i]z^{i}}} wheref[i]∈Kn {\ displaystyle f [i] \ in \ mathrm {K} ^ {n}} {\displaystyle f[i]\in \mathrm {K} ^{n}} - coefficientsf(z) {\ displaystyle f (z)} f(z) . If you can findf(z) {\ displaystyle f (z)}   then system solutionAx=b,b≠0 {\ displaystyle Ax = b, b \ neq 0}   also located: sincef(A)b=0 {\ displaystyle f (A) b = 0}   andf[0]=one {\ displaystyle f [0] = 1}   then


x=-∑i=onedf[i]Ai-oneb{\ displaystyle x = - \ sum _ {i = 1} ^ {d} {f [i] A ^ {i-1} b}}  

Let beu {\ displaystyle u}   is any fixed vector fromKn {\ displaystyle \ mathrm {K} ^ {n}}   . Denote the standard bilinear mappingKn {\ displaystyle \ mathrm {K} ^ {n}}   atK {\ displaystyle \ mathrm {K}}   as(,) {\ displaystyle (,)}   , i.e((vone,...,vn),(wone,...,wn))=∑i=onenviwi {\ displaystyle ((v_ {1}, ..., v_ {n}), (w_ {1}, ..., w_ {n})) = \ sum _ {i = 1} ^ {n} { v_ {i} w_ {i}}}   .

Becausef(A)b=0 {\ displaystyle f (A) b = 0}   then the sequence

(u,Aib),i=0,one,2,...,{\ displaystyle (u, A ^ {i} b), i = 0,1,2, ...,}  

satisfies a linear recurrence relation whose characteristic polynomial isf(z) {\ displaystyle f (z)}   . Let befu(z) {\ displaystyle f_ {u} (z)}   is the characteristic polynomial of the shortest recurrence relation. Thenf(z)|fu(z) {\ displaystyle f (z) | f_ {u} (z)}   . Indeed, if divided by the remainder

f(z)= q ( z ) f u ( z ) + r ( z ){\ displaystyle f (z) = q (z) f_ {u} (z) + r (z)}   ,degr(z)<degfu(z) {\ displaystyle degr (z) <deg ~ f_ {u} (z)}  

then from the equalities

0=(u,f(A)b)=(u,q(A)fu(A)b)+(u,r(A)b){\ displaystyle 0 = (u, f (A) b) = (u, q (A) f_ {u} (A) b) + (u, r (A) b)}   ,

(u,fu(A)Ajb)=0,j=0,one,2,...,{\ displaystyle (u, f_ {u} (A) A ^ {j} b) = 0, j = 0,1,2, ...,}  

and minimalityfu(z) {\ displaystyle f_ {u} (z)}   will follow thatr(z)=0 {\ displaystyle r (z) = 0}   . Since a free memberf(z) {\ displaystyle f (z)}   equal to one, then we can assume that the free termfu(z) {\ displaystyle f_ {u} (z)}   equal to one.

Minimal polynomialfu(z) {\ displaystyle f_ {u} (z)}   for sequence(u,Aib),i=0,one,2,..., {\ displaystyle (u, A ^ {i} b), i = 0,1,2, ...,}   can be obtained using the Berlekamp-Messi algorithm [3] by its first2n {\ displaystyle 2n}   members. There are two methods for solving the original system.

First method. Random Vector Selectedu(z) {\ displaystyle u (z)}   . Under constructionfu(z) {\ displaystyle f_ {u} (z)}   and under the assumption thatf(z)=fu(z) {\ displaystyle f (z) = f_ {u} (z)}   , locatedx {\ displaystyle x}   according to the formula

x=-∑i=onedf[i]Ai-oneb{\ displaystyle x = - \ sum _ {i = 1} ^ {d} {f [i] A ^ {i-1} b}}  

In this way, with a fairly high probability, a solution can be found [2] .

Second method. Let beb0=b,fone(z)=fuone(z) {\ displaystyle b_ {0} = b, f_ {1} (z) = f_ {u_ {1}} (z)}   for some vectoruone {\ displaystyle u_ {1}}   . If the vectorbone=fone(A)b0 {\ displaystyle b_ {1} = f_ {1} (A) b_ {0}}   equals 0 then it isx {\ displaystyle x}   according to the formula

x=-∑i=onedf[i]Ai-oneb{\ displaystyle x = - \ sum _ {i = 1} ^ {d} {f [i] A ^ {i-1} b}}   (since thenfone(z)=f(z) {\ displaystyle f_ {1} (z) = f (z)}   )


Ifbone≠0 {\ displaystyle b_ {1} \ neq 0}   , then the procedure is repeated, that is, a random vector is selectedu2 {\ displaystyle u_ {2}}   and the minimal polynomial is constructedf2(z)=fu2(z) {\ displaystyle f_ {2} (z) = f_ {u_ {2}} (z)}   for sequence(u2,Aibone) {\ displaystyle (u_ {2}, A_ {i} b_ {1})}   . If ab2=f2(A)bone=0 {\ displaystyle b_ {2} = f_ {2} (A) b_ {1} = 0}   thenf(z)=fone(z)f2(z) {\ displaystyle f (z) = f_ {1} (z) f_ {2} (z)}   and you can find a solution x by the formula

x=-∑i=onedf[i]Ai-oneb{\ displaystyle x = - \ sum _ {i = 1} ^ {d} {f [i] A ^ {i-1} b}}   ,

otherwise selectedu3 {\ displaystyle u_ {3}}   and so on.

We prove that if donek {\ displaystyle k}   iterations thenfone(z)...fk(z) {\ displaystyle f_ {1} (z) ... f_ {k} (z)}   dividesf(z) {\ displaystyle f (z)}   . It was shown above thatf-one(z)|f(z) {\ displaystyle f-1 (z) | f (z)}   . Further, assuming thatfone(z)...fk-one(z) {\ displaystyle f_ {1} (z) ... f_ {k-1} (z)}   dividesf(z) {\ displaystyle f (z)}   , sincefk(z) {\ displaystyle f_ {k} (z)}   - minimum polynomial for sequence{(uk,Aibk-one)}i={(uk,fk-one(A)...fone(Aj)b)}j {\ displaystyle \ left \ {(u_ {k}, A ^ {i} b_ {k-1}) \ right \} _ {i} = \ left \ {(u_ {k}, f_ {k-1} (A) ... f_ {1} (A ^ {j}) b) \ right \} _ {j}}   , and the polynomialf(z)fone(z)...fk-one(z) {\ displaystyle {\ frac {f (z)} {f_ {1} (z) ... f_ {k-1} (z)}}}   cancels it thenfk(z)|f(z)fone(z)...fk-one(z) {\ displaystyle {f_ {k} (z)} | {\ frac {f (z)} {f_ {1} (z) ... f_ {k-1} (z)}}}   , as required.

Now it’s obvious that ifbx=fk(A)...fone(A)b=0 {\ displaystyle b_ {x} = f_ {k} (A) ... f_ {1} (A) b = 0}   thenf(x)=fone(x)...fk(x) {\ displaystyle f (x) = f_ {1} (x) ... f_ {k} (x)}   . That is, as soon as the zero vector is foundbk=fk(A)bk-one {\ displaystyle b_ {k} = f_ {k} (A) b_ {k-1}}   , then you can find a solution to the original system by the formula

x=-∑i=onedf[i]Ai-oneb{\ displaystyle x = - \ sum _ {i = 1} ^ {d} {f [i] A ^ {i-1} b}}   [4] .

Algorithm 1

In the original article, the algorithm has such a name. Based on it, a deterministic algorithm is constructed, which is called algorithm 2 in the original article [5] .

Algorithm Description

Stage 1. Equatedb0=b,k=0,y0=0,d0=0 {\ displaystyle b_ {0} = b, k = 0, y_ {0} = 0, d_ {0} = 0}   .

2 stage. If abk=0 {\ displaystyle b_ {k} = 0}   then the solution isx=-yk {\ displaystyle x = -y_ {k}}   , and the algorithm stops working.

3 stage. Random Vector Selecteduk+one∈Kn,uk+one≠0 {\ displaystyle u_ {k + 1} \ in \ mathrm {K} ^ {n}, u_ {k + 1} \ neq 0}   .

4th stage. Calculate first2(n-dk) {\ displaystyle 2 (n-d_ {k})}   sequence members{(uk+one,Aibk)}i=0∞ {\ displaystyle \ left \ {{(u_ {k + 1}, A ^ {i} b_ {k})} \ right \} _ {i = 0} ^ {\ infty}}   .

5 stage. Calculate the minimum polynomialfk+one(z) {\ displaystyle f_ {k + 1} (z)}   sequences from the 4th stage, and to normalize it so that its free term is equal to one. This can be done using the Berlekamp-Messi algorithm .

6 stage. Assign

yk+one=yk+f^k+one(A)bk{\ displaystyle y_ {k + 1} = y_ {k} + {\ hat {f}} _ {k + 1} (A) b_ {k}}   wheref^(z)=f(z)-f(0)z {\ displaystyle {\ hat {f}} (z) = {\ frac {f (z) -f (0)} {z}}}  

bk+one=b0+Ayk+one{\ displaystyle b_ {k + 1} = b_ {0} + Ay_ {k + 1}}   ,

dk+one=dk+degfk+one(z){\ displaystyle d_ {k + 1} = d_ {k} + deg ~ f_ {k + 1} (z)}   .

7th stage. Assignk=k+one {\ displaystyle k = k + 1}   and return to the second stage [5] .

Justification of the correctness of the algorithm using the method of mathematical induction

f^(z)=f(z)-f(0)z{\ displaystyle {\ hat {f}} (z) = {\ frac {f (z) -f (0)} {z}}}   matches the right side of the formulax=-∑i=onedf[i]Ai-oneb {\ displaystyle x = - \ sum _ {i = 1} ^ {d} {f [i] A ^ {i-1} b}}   unsigned minus sign. Atk=0 {\ displaystyle k = 0}   is selecteduone {\ displaystyle u_ {1}}   being considered2n {\ displaystyle 2n}   sequence members{(uone,Aib0)}i=0,one,2 {\ displaystyle \ left \ {{(u_ {1}, A ^ {i} b_ {0})} \ right \} _ {i = 0,1,2}}   and is locatedfone(x) {\ displaystyle f_ {1} (x)}   according to the Berlekamp-Messi algorithm . Thenyone=f^one(A)b,bone=b0+Ayone=b+Afone(A)-oneAb=fone(A)b,done=degfone(z) {\ displaystyle y_ {1} = {\ hat {f}} _ {1} (A) b, b_ {1} = b_ {0} + Ay_ {1} = b + A {\ frac {f_ {1} (A) -1} {A}} b = f_ {1} (A) b, d_ {1} = degf_ {1} (z)}   .

Let afterk {\ displaystyle k}   pass algorithm performed equality

yk=fk(A)...fone(A)-oneAb{\ displaystyle y_ {k} = {\ frac {f_ {k} (A) ... f_ {1} (A) -1} {A}} b}  

bk=fk(A)...fone(A)b{\ displaystyle b_ {k} = f_ {k} (A) ... f_ {1} (A) b}  

Then afterk+one {\ displaystyle k + 1}   passage

yk+one=yk+f^k+one(A)bk=fk(A)...fone(A)-oneAb+fk+one(A)-oneAfk(A)...fone(A)b=fk+one(A)...fone(A)-oneAb{\ displaystyle y_ {k + 1} = y_ {k} + {\ hat {f}} _ {k + 1} (A) b_ {k} = {\ frac {f_ {k} (A) ... f_ {1} (A) -1} {A}} b + {\ frac {f_ {k + 1} (A) -1} {A}} f_ {k} (A) ... f_ {1} ( A) b = {\ frac {f_ {k + 1} (A) ... f_ {1} (A) -1} {A}} b}   ,

bk+one=bk+Afk+one(A)...fone(A)-oneAb=fk+one(A)...fone(A)b{\ displaystyle b_ {k + 1} = b_ {k} + A {\ frac {f_ {k + 1} (A) ... f_ {1} (A) -1} {A}} b = f_ { k + 1} (A) ... f_ {1} (A) b}  

That is, the formulas foryk {\ displaystyle y_ {k}}   andbk {\ displaystyle b_ {k}}   saved. Now the correctness of the algorithm follows from the theory section [6] .

Deterministic Algorithm

Algorithm Description

Stage 1. Find valueAib,i=0,one,...,2n-one {\ displaystyle A ^ {i} b, i = 0,1, ..., 2n-1}   .

2 stage. Equate to zerok {\ displaystyle k}   , butg0(z) {\ displaystyle g_ {0} (z)}   unit.

3 stage. Assignuk+one=(0,...,0,one,0,...,0) {\ displaystyle u_ {k + 1} = (0, ..., 0,1,0, ..., 0)}   (unit is onk+one {\ displaystyle k + 1}   location).

4th stage. Find sequence(uk+one,Aib),i=0,one,...,2n-one {\ displaystyle (u_ {k + 1}, A ^ {i} b), i = 0,1, ..., 2n-1}   using the first step.

5 stage. Find sequence(uk+one,gk(A)Aib),i=0,one,...,2n-one-deggk(z) {\ displaystyle (u_ {k + 1}, g_ {k} (A) A ^ {i} b), i = 0,1, ..., 2n-1-deg ~ g_ {k} (z)}   , you can use the discrete Fourier transform [5] .

6 stage. Find the minimal polynomialfk+one(z) {\ displaystyle f_ {k + 1} (z)}   with a free term equal to unity using the Berlekamp-Messi algorithm .

7th stage. Assigngk+one(z)=fk+one(z)gk(z) {\ displaystyle g_ {k + 1} (z) = f_ {k + 1} (z) g_ {k} (z)}   .

8 stage. Click to enlargek {\ displaystyle k}   per unit. If adeggk(z)<n {\ displaystyle deg ~ g_ {k} (z) <n}   andk<n {\ displaystyle k <n}   then return to stage 3.

9th stage. For polynomialf(z)=gk(z) {\ displaystyle f (z) = g_ {k} (z)}   using the values ​​found in the first stageAib {\ displaystyle A ^ {i} b}   find a solutionx {\ displaystyle x}   systems using the formula

x=-∑i=onedf[i]Ai-oneb{\ displaystyle x = - \ sum _ {i = 1} ^ {d} {f [i] A ^ {i-1} b}}   [5] .

Justification of algorithm correctness

Note that in fact the algorithm works the same as Algorithm 1, only vectorsuk {\ displaystyle u_ {k}}   are not chosen randomly, but there is an enumeration of unit vectors(0,...,0,one,0,...,0) {\ displaystyle (0, ..., 0,1,0, ..., 0)}   . It's obvious thatgk(z)=fk(z)...fone(z) {\ displaystyle g_ {k} (z) = f_ {k} (z) ... f_ {1} (z)}   wherefk(z) {\ displaystyle f_ {k} (z)}   - minimum polynomial for sequence

(uk,fk-one(A)...fone(A)Aib),i=0,one,...,2n-one-deg(fk-one...fone){\ displaystyle (u_ {k}, f_ {k-1} (A) ... f_ {1} (A) A ^ {i} b), i = 0,1, ..., 2n-1- deg (f_ {k-1} ... f_ {1})}   .

The algorithm terminated with a certain parameter valuek {\ displaystyle k}   . Let's pretend thatk<n,deggk(z)=n {\ displaystyle k <n, deg ~ g_ {k} (z) = n}   . Becausedegf(z)⩽n {\ displaystyle deg ~ f (z) \ leqslant n}   andgk(z)|f(z) {\ displaystyle g_ {k} (z) | f (z)}   thengk(z)=f(z) {\ displaystyle g_ {k} (z) = f (z)}   . It follows that at step 9, the solution to the original system will be exactly found.

Now consider the casek=n {\ displaystyle k = n}   . Since all unit vectors have been enumerateduone,...,un {\ displaystyle u_ {1}, ..., u_ {n}}   then vectorgn(A)b {\ displaystyle g_ {n} (A) b}   orthogonaluone,...,un {\ displaystyle u_ {1}, ..., u_ {n}}   . Consequently,gn(A)b=0 {\ displaystyle g_ {n} (A) b = 0}   . Becausegn(z)|f(z) {\ displaystyle g_ {n} (z) | f (z)}   andf(z) {\ displaystyle f (z)}   is the minimal polynomial thengk(z)=f(z) {\ displaystyle g_ {k} (z) = f (z)}   . Therefore, in this case, the correctness of the algorithm [7] was confirmed.

Algorithm Estimation

For the deterministic algorithm, Wiedemann obtained the following complexity estimate :O(n(w+nlog(n)log(log(n)))) {\ displaystyle O (n (w + n ~ log (n) log (log (n))))}   [5] . The resulting difficulty score is the best known. Thanks to the Wiedemann algorithm, it is possible to improve the complexity estimate in other algorithms using methods for solving linear systems [1] .

Similar Algorithms

Where can a solution of a system of linear equations over a finite field come in handy? The need for their solution arises when using factorization algorithms and when solving discrete logarithm problems using factor bases [8] . There are a large number of algorithms for obtaining a solution of a system of linear equations over finite fields [9] . In addition to Wiedemann's algorithms, one can use Gaussian and structural Gaussian exceptions, the Lanczos algorithm , and the conjugate gradient method [10] . Algorithms based on fast matrix multiplication are also known, for example, the Strassen and Koppersmit-Vinograd algorithms [11] . Their own algorithms were proposed by Konovaltsev [12] and Brillhart [13] [14] .

In the general case (the matrix of the system is not sparse), the Lanczos algorithm has been used more often lately (probably, together with a structured Gaussian exception to obtain a denser matrix of the subsystem) [14] . But in the case of a sparse matrix, it is most efficient to use Wiedemann algorithms, since estimates of their complexity are the best known. Wiedemann's algorithms were not immediately recognized, but later they were nevertheless implemented on a computer. Algorithms were used, for example, to factor polynomials over finite fields [1] .

Later various modifications of the original algorithm appeared, for example, the Wiedemann block algorithm [1] .

Notes

  1. ↑ 1 2 3 4 5 Vasilenko O.N., 2003 , p. 287.
  2. ↑ 1 2 Wiedemann DH, 1986 , p. 54-62.
  3. ↑ Massey JL, 1969 , p. 122-127.
  4. ↑ Vasilenko O.N., 2003 , p. 287-288.
  5. ↑ 1 2 3 4 5 Wiedemann DH, 1986 , p. 55.
  6. ↑ Vasilenko O.N., 2003 , p. 289-290.
  7. ↑ Vasilenko O.N., 2003 , p. 290-291.
  8. ↑ Vasilenko O.N., 2003 , p. 274-275.
  9. ↑ LaMacchia B., Odlyzko A., 1990 , p. 109-133.
  10. ↑ Coppersmith D., Odlyzko A., Schroeppel R., 1986 , p. 1-15.
  11. ↑ Alekseev V. B., 1988 , p. 189-236.
  12. ↑ Konovaltsev I.V., 1967 , p. 269-274.
  13. ↑ Brillhart J., 1989 , p. 211-213.
  14. ↑ 1 2 Vasilenko O.N., 2003 , p. 291.

Literature

  • Vasilenko O. N. Number-theoretic algorithms in cryptography . - M .: ICMMO, 2003 .-- 328 p. - ISBN 5-94057-103-4 .
  • Wiedemann DH Solving sparce linear equations over finite fields. - 1986. - January ( t. 32 , No. 1 ). - S. 54-62 .
  • Kaltofen E., Lobo A. Factoring high-degree polynomials by the black box Berlekamp algorithm (Eng.) // Proceedings of ISSAC'94. - 1994. - S. 90-98 .
  • Massey JL Shift-register synthesis and BCH decoding (English) // IEEE Trans. Inform. Theory. - 1969. - T. 15 . - S. 122-127 .
  • Alekseev V. B. Complexity of matrix multiplication. Review (Russian) // Cybernetich. team .. - 1988. - T. 25 . - S. 189-236 .
  • Konovaltsev I.V. On an algorithm for solving systems of linear equations in finite fields (Russian) // Problems of Cybernetics. - 1967 .-- T. 16 . - S. 269-274 .
  • Brillhart J. A note on finding depencensies over GF (2) (Eng.) // Utilitas Math. - 1989 .-- T. 36 . - S. 211-213 .
  • LaMacchia B., Odlyzko A. Solving large sparse linear systems over finite fields (English) // Advances in Cryptology — CRYPTO'90. - 1990 .-- T. 537 . - S. 109-113 .
  • Coppersmith D., Odlyzko A., Schroeppel R. Discrete logarithms in GF (p) (English) // Algorithmica. - 1986.- T. 1 . - S. 1-15 .
Source - https://ru.wikipedia.org/w/index.php?title=Videman_algorithm&oldid=95474961


More articles:

  • GPT Cryptosystem
  • Freight
  • Urbanovich, Josip Pavlovich
  • Musig
  • Medusa (Supergirl)
  • Sayushev, Vadim Arkadyevich
  • Gamayun (Masonic Lodge)
  • Smerdov, Nikolai Andrianovich
  • Andrianov, Mikhail Stepanovich
  • Morozova, Valeria Ivanovna

All articles

Clever Geek | 2019