lll 演算法 張圻毓. outline algorithm example algorithm input : linearly independent column...

21
LLL 演演演 演演演

Post on 20-Dec-2015

239 views

Category:

Documents


6 download

TRANSCRIPT

LLL 演算法

張圻毓

Outline

Algorithm Example

621

501

311

Algorithm Input : Linearly independent column vector f1……fn

Zn

Output : A reduced basis (b1……bn) of the lattice L=

Σ1 i n≦ ≦ Zfi Zn

Algorithm 1. for i =1,…,n do bi fi

compute the GSO G*,M Qn*n , i 2 2.while i n ≦ do 3. for j= i-1,i-2,…,1 do 4. bi bi - 「 μij 」 bj update the GSO {replacement step}

Algorithm 5. if i>1 and then exchange bi-1 and bi and update the GSO , i i-1 else i i+1 6. return b1,…,bn

2*2*1 2 ii bb

Example

Example

Example b2

*=b2-uijb1 (b2減去 b2投影至 b1) (b1*=b1)

Example b3

*=b3-(u32b2+u31b1) (b3減去 b3投影至 b1與 b2所成平面 )

Example i=2 n(*n=3 ≦ 因為三階矩陣 ) j=1 b2 b2 – 「 u21 」 b1

(u21=b2·b1

*/b1*·b1

*) 投影比值 ( u∵ 21=1/3 u∴ 21取 0 )

所以 b2=b2 update GSO 也不變 檢查 b2與 b1 ,所以不用 exchange i=i+1

2*2*1 2 ii bb

621

501

311

Example i=3 , j=2 b3 b3 – 「 u32 」 b2

(u32=b3·b2*/b2

*·b2*) 投影比值

( u∵ 32=13/14 u∴ 32取 1 )

所以 b3=b3-b2=(4,5,4) update GSO

421

501

411

Example

Example i=3 , j=1 b3 b3 – 「 u31 」 b1

( u∵ 31=14/3 u∴ 31取 4 )

所以 b3=b3-4b1=(0,1,0) update GSO

因為符合條件所以 b3與 b2 exchange 且 update GSO

i=i-1=2

021

101

011

2*2*1 2 ii bb

201

011

101

Example

Example

Example i=2 , j=1 b2 b2 – 「 u21 」 b1

( u∵ 21=1/3 u∴ 21取 0 )

所以 b2=b2 update GSO 也不變 因為符合條件所以 b2與 b1 e

xchange 且 update GSO i=i-1=1

2*2*1 2 ii bb

210

011

110

Example i=1, j=0 不跑 For 迴圈 且檢查 ,所以不用 exchange i=i+1 =2

2*2*1 2 ii bb

Example i=2 , j=1 b2 b2 – 「 u21 」 b1

( u∵ 21=1 )

所以 b2=b2-b1 =(1,0,1) update GSO

檢查 b2與 b1 ,所以不用 exchange

i=i+1 =3

2*2*1 2 ii bb

210

001

110

Example

Example i=3 j=2 b3 b3 – 「 u32 」 b2

( u∵ 32=1/2 u∴ 32取 0 ) 所以 b3=b3 update GSO 不變 i=3 j=1 b3 b3 – 「 u31 」 b1

( u∵ 32=0 ) 所以 b3=b3 update GSO 不變 檢查 b2與 b1 ,所以不用 exch

ange i=i+1 =4 i >n 所以 return(b1,b2,b3)

210

001

110

2*2*1 2 ii bb

Example