,
0~
Optimization Methods and Software Vol. 21, No.5, October 2006,819-831
Taylor&Francis Taylm&F"ndsGroup
Solving rank one perturbed linear Diophantine systems by the ABS method KEYVAN AMINIt and NEZAM MAHDAVI-AMIRI*:j: tDepartment of Sciences, Razi University, Kermanshah, Iran :j:Department of Mathematical Sciences, Sharif University of Technology, Tehran, Iran (Received 16 July 2003; revised 8 March 2005; infinalform
15 March 2005)
We show how to update the general solution of linear Diophantine systems obtained by the integer ABS method when the coefficient matrix is subjected to a rank one change. Keywords: ABS methods; Diophantine systems; Rank one update AMS Subject Classification:
1.
65F05; 1ID99
Introduction
The ABS methods, introduced by Abaffy et at. [1], are a general class of algorithms for solving linear and non-linear algebraic systems and have been extensively applied to several types of linear systems. The basic algorithm works on a system having the form
Ax =b
(A E Rm,n, X E Rn, bERm).
(1)
Esmaeili et at. [2] gave a class of integer ABS (lABS) methods to compute the general solutionof the Diophantine system Ax =b
(A E Zm,n,x E Zn,b E Zm).
(2)
We show how to compute the general solution of a rank one perturbed system
(A + uvT)x
=b
(A E Zm,n, X E Zn, b E Zm, m :S n)
(3)
where u E zm, V E zn are arbitrary vectors, using the general solution of equation (2) obtained by the application of an lABS algorithm.
'Corresponding
author. Emai1:
[email protected]
Optimization Methods and Software ISSN 1055-6788 print/ISSN 1029-4937 online @2006 Taylor & Francis http://www.tandf.co.uk/joumals DOl: 10.1080/10556780500247766
..J
820
K. Amini and N. Mahdavi-Amiri
Special instances of system (3) appear in the following forms (in what follows, ei is the ith unit vector with appropriate dimension, and ai and a; are the ith column and the ith row of matrix A, respectively): (1) Change the ith column or the ith row ofthe coefficient matrix to zero vector [by choosing (u = -ai, v = eJ or (u = ei, VT= -aD, respectively]. (2) u or vT the ith column or the ith row of the coefficient matrix (by choosing v = ei or u
= ei, respectively).
Li [3] used the ABS method for updating the solution of a rank one perturbed linear system in the real case. Here, we will present methods for solving the perturbed integer system (3) after an application of an lABS method to the original problem (2). In section 2, we describe briefly theABS and the lABS algorithms and explain how to solve Diophantine system of equations. In section 3, we show how to update the integer solution after a rank one change and present the resulting algorithm.
2. lABS algorithms for solving Diophantine systems The class of lABS algorithms has been introduced for solving the linear Diophantine system of equations [2] based on the basic ABS algorithms for solving the real linear system of equations. A basic ABS algorithm starts with an initial vector XI E Rn (arbitrary) and a nonsingular matrix HI E Rnxn (Spedicato's parameter). Given that Xi is a solution of the first i-I equations, the ABS algorithm computes Xi+! as the solution of the first i equations by performing the following steps [1,4]. (1) Determine Zi (Broyden's parameter) such that zT Hiai i= 0 and set,
Pi = HT , Z,.. (2) Update the solution by Xi+1
= Xi + OIi Pi
(4)
where the step size OIiis given by b . -aT Xi
,
OIi
=
, . aTPi
(5)
(3) Update the Abaffian matrix Hi by Hi+1
= H,-.
HiaiwT" H .a wT, H ,i
.
where Wi E Rn (Abaffy's parameter) is arbitrary provided that wT Hiai It can be shown that Si
=
Hiai
=0
i=
O.
if and only if ai is linearly dependent on the vectors
ai, . . . , ai-I [4]. Indeed, if Si = 0 and ti = bi -
=0
(6)
aT Xi
= 0 then the ith equation is redundant;
0 then the system of equations is incompatible and hence lacks solution. We now describe how to determine the parameters XI, HI, Zi, and Wi in the ABS algorithm so that Xi (for every i, 1 :S i :S m) is an integer vector if a solution exists [2]. Suppose that Xi is an integer vector, it is clear that if OIiand Pi are integral then Xi+J is integral. From equation (5), it is obvious that if aT Pi divides (bi - aTxJ then OIiis integral. In addition, if Hi and Zi are an integer matrix and an integer vector, respectively, then Pi is integer. Now assume Hi is an if Si
and ti
i=
821
Perturbed linear Diophantine systems
integer matrix. Considering the updating formula (6), if wTHjaj divides all the components of HjajwT Hj, then Hi+1remains an integer matrix. The following theorem gives a suitable choice of the parameters of the ABS algorithm to compute the integer solutions of the system (2). (In what follows, gcd(sj) stands for the greatest common divisor of the components of Sj.) THEOREMI Let A havefull rank and the Diophantine system (2) be solvable. Let the sequence of Abaffian matrices be generated by the basic ABS algorithm with the following parameter choices: (I) HI unimodular, XI, an integer vector, (2) for every i (1 s iSm), Zi and Wj each a solution of the Diophantine equation
sTX = OJ (x E Zn, Sj = Hjaj, OJ= gcd(sj)). Then, (a) The sequence of Abaffian matrices Hj is well defined and remains integral. (b) x = Xj+l + H7+1q (q E zn) is the general integer solution of the first i equations of(2).
.
Proof For the proof of Theorem 1, refer ref. [2].
It can be shown that the system (2) has a solution if and only if OJdivides (bj - aTXj) for i = I, . . . , m [2].
Using the earlier results, the following algorithm solves linear Diophantine system of equations (2) [2]. (Subsequently,rj gives the rank of the first i-I equations.) lABS
ALGORITHM
(1) Choose XI E zn, arbitrary, and HI E znxn arbitrary and unimodular. Let i = 1, rl = O. (2) Compute tj = bj - aTXj and Sj = Hjaj. (3) If (Sj = 0 and tj = 0) then let Xj+1 = Xj, Hi+1= Hj, rj+1= rj and go to (7) (the ith equation is redundant). If (Sj = 0 and tj =1= 0) then stop (the ith equation and hence the system is incompatible). (4) {Sj =1= O}Compute OJ= gcd(sj). If ''''''(OJ Itj) then stop (the ith equation and hence the system are integrally inconsistent) else compute Zj E zn a solution of sTx = OJand let pj
= H7zj
t. aj =...!.. O. I and Xj+1 =Xj +ajpj. (5) Update the Abaffian
matrix Hj to Hi+1 by computing
Wj E zn a solution
letting Hj+1
(6) Let rj+1 = rj
= Hj
+ 1.
(7) If i = m then stop (Xm+lis a solution) else let i = i + 1 and go to (2).
-
HjajwT Hj
wTHjai
.
of sT x
= OJand
I I
822
K. Amini and N. Mahdavi-Amiri
NOTES Si = Hiai and 8i = gcd(si). So one can divide Siby 8i first and then solve s! x (2) The same note applies to computing Wi.
(1)
= 1 for Zi.
We now list some properties of the lABS algorithm [2,4]. (1) Let HI E znxn be an arbitrary unimodular matrix, ai, . . . ,am be linearly independent vectors in zn (m :s n) and Hi be a sequence of matrices generated by the update formula (6) in the lABS algorithm. Then, (a) For i :S j :S m, the vectors Hia j are non-zero and linearly independent. (b) For i = 2, ..., m + 1,
Hiaj = 0 1 :S j < i. (c) For i = 1,..., m, the vectors al,..., ai-l form an integer basis for Null(n). (2) The vector Xi+l, generated by the lABS algorithm, solves the first i equations of the system (2) and every solution of the first i equations of the system (2) can be written in the following form: (7) (s E Zn). Y = Xi+1 + Hi~IS In particular, the general solution of the system (2) is given by
= Xm+1 + H~+ls
i
(s E Zn).
(3) The vector y E zn, can be written as in equation (7) if and only if y is a solution of the first i equations of (2). (4) If rank(A) = q < m and the system (2) has a solution then the lABS algorithm computes a solution in q steps (in exact arithmetic). In addition, all solutions of system (2) have the following form: i
= Xq+1
+ H;+ls
(s
E Zn)
where Hq+1 is the Abaffian obtained by an application of the lABS algorithm to the independent rows of A.
2.1 Rosser's algorithm In the lABS algorithm (steps 4 and 5), we need to solve a single Diophantine linear equation. Here, we state a fundamental theorem and describe a classical algorithm for computing the greatest common divisor of a set of integer numbers and the general solution of the single Diophantine linear equation
alxl + . . . + anXn = b.
(8)
THEOREM 2 Let a], . . . ,an and b be integer numbers. Then equation (8) has no integer solution if and only if-'(gcd(a], ..., an)lb). Moreover, if(gcd(al, ..., an)lb, n > 1) then equation (8) has an infinitenumber of integer solutions. Proof Refer ref. [5] for the proof of Theorem 2.
.
In solving equation (8), the computation of 8, the greatest common divisor of the coefficients, is necessary and fundamental. Some algorithms for solving equation (8) are'given by Blankenship [6] and Morita and Salkin [7].
~
I
823
Perturbed linear Diophantine systems
Here, we recall the classical algorithm due to Rosser [8], which has the desired property of significantly avoiding a rapid growth of the intermediate results, a property needed for numerical stability. Consider the single equation of the form (8), and without loss of generality, let
a] > 0
and al 2: a2 2: . . . 2: an 2: O.
(If aj < 0 alter Xj with -Xj; ifaj < ai, for j < i, then swap Xj with Xi and if al = 0 then wehave a trivial equation.) Let a be the column vector with components ai. We denote by laJ the greatest integer less than or equal to a, and Cij, Cj the (i, nth component and the jth columnof C, respectively. The steps of the algorithm are summarized as follows. ROSSER'S ALGORITHM
(1) Let C(O)
= (a
I)T and k
(2) While cg) -1=0 do *- C(k) (a ) C -
. .. > -
C(k) In'
(3) Let the final matrix be
0
u] where Uj E Zn, j
U2
2J
= 1, . . . , n.
After completion of Rosser's algorithm, we have £5= gcd(al,"', (8) lacks an integer solution, otherwise, X
=
an)' So if -'(£5lb) then
b -U]
£5
+ Y2U2+ . . . + YnUn
with arbitrary integers Y2, . . . , Yn, forms the general integer solution of equation (8). For correctness of the earlier algorithm, observe that the common divisor of two numbers divides the remainder of the division of the numbers, i.e.,
gcd(a, b) = gcd(b, a REM b) = gcd(a, a REM b). Observations (1) As ci~) and cg) are the largest elements of the first row, then the integer number Lci~)/ci~) J is usually small. Hence, it is observed that Rosser's algorithm usually stops with the components of Uihaving the same scale as the component of C(O). (2) Rosser's algorithm terminates in polynomial time (for a proof see Schrijver [9]). Some ideas for pivoting (1) Choose pivot so that remainder is as small as possible. Does this help not to grow intermediate results? (2) In each iteration k, do reduction in a sequence of adjacent nonzero columns i.e.,
CoLI and 2, Col.3 and 4, . . . Remark A vector z such that aTz Aardal et at. [10].
= £5can also
be obtained using the methods proposed by
j
~
'
1
824
K. Amini and N. Mahdavi-Amiri
3. Solving rank one pertnrbed Diophantine systems System (1) can be transformed into the following form: [Im
(x E Zn)
U][~]X=b
(9)
where 1mE zm xmis the identity matrix. Assume that the Diophantine system is a determined or an underdetermined system (m :Sn). System (9) is equivalent to the following system of m + n + 1 equations: [1m u] y
= bYE
Zm+l
(10a) (lOb)
[~] X = Y
X E Zn
The general solution of (lOa) is characterized by the following theorem. THEOREM3 The general solution of(10a) has the form
Y Proof
(11)
= [~] + [ ~u] t
(t E Z).
Observe that (11) is integral and satisfies [1m u]y
= [1m u] [
b - ut
t
] =b-ut+ut=b.
Conversely, let y be an integer solution of the system (10a), then
t E Z, Y E Zm
y=[n and
y = b - ut y
=
b - ut [ t ]
= b
-u 0 + [ ] [ 1 ] t.
. Now, by substituting form (11) into equation (10b) we obtain (t E Z)
[ ~ ] x = [b ~ ut] or Ax
=b-
VTX = t
ut
(12a) (12b)
-. 825
Perturbed linear Diophantine systems
Using the search directions of the original Diophantine system (2) (obtained by the application of an lABS algorithm), the solution of the system (12a) can be written as: m
(13)
= XI (t) + L>~i(t) Pi,
Xm+1(t)
i=1
wherethe step size ai is a linear function of t, i.e., ri(t) - J;(t)-aTxi(t) ai(t) = aTPi aTPi
i = 1,...,m
=al+alt,
(14)
and i-I
J;(t) = bi - Uit,
Xi(t) = XI(t) + Laj(t)pj. j=1
Let
Xl(t) =x~+xlt. Remark ai(t) and Xi(t) are linear functions of t. We let ai(t) =a;+alt
(15)
Xi(t) = xl +xlt. The following lemma shows that a; is integer. LEMMAI
The step size ai (t) defined by (14) has the form ai (t)
Proof Assuming that the system Ax
= a;+ alt wherea; E Z.
= b has an integer solution, then starting with any
arbitrarypoint,e.g. YI= Xf, thelABSalgorithmwill findan integersolutionof the system. Therefore,thealgorithmis welldefinedandat the ith iterationwehave aT Pi I(bi - aT Yi) and Yi+1
= Yi +
fJiPi
where bI. -a. ,Ty I. fJi =
Now, it is sufficient to establish that a; ai(t)
= fJi. Notice
that
=
b. - aTx.(t) - u.t
=
b. -aT X?
I
i
I
I
a;Pi I
i
a;Pi = a2I + alI t
"-
.
a;Pi
I
-
aTxl +u. i
I
a;Pi
It
...~
826
K. Amini and N. Mahdavi-Amiri
where a}l --
-ui - aTxl l l aJpi
a2l --
bi - aTl X2l aJpi
= Yi+1 and
Now, we prove by mathematical induction that xl+l
For i = 1 we have
CI} =
fJi,for i = 1, ..., m.
X2(t) = XI(t) + alPI 2
=XI
2
I +Xlt+
(al +alt
I
) PI
= (xf + af PI) + (xt + at PI)t. This means 2 2 2 X2 =XI +aIPI
2 +alPI
=YI
where T 2
2 - bl - T al XI
al -
= fJI,
a[ PI
and,
xi = YI + fJIPI = Y2. Now assume that xl = Yi, for i = 1, ..., k :::::m. We establish that 2 Xk+1
a~ = fJk.
= Yk+l,
We know that Xk+1 (t)
= Xk(t) + akPk 2
I
=Xk +Xkt+
2
I
(ak +akt ) Pk
= (xl + alpk) + (xl + alpk)t. So we have, 2 Xk+1
2
2
= Xk + akPk = Yk +
fJkPk
= Yk+1
and 2 ak
=
b k-akxkT 2 T
ak Pk
=
b k-akYkT 2 T
ak Pk
Therefore, it follows that for any i (1::::: i :::::m),wehavea}
= fJk' = fJi.AsfJi E Zthenal
E Z.
.
-.
Perturbed linear Diophamine
827
systems
Accordingly, we have m
= Xl(t) + :~:~>j(i(t)Pi
Xm+I(t)
i=1
m
2
2 I ,, = Xl +Xlt + ~
1
(ai +ait ) Pi
i=l
=
+
(xf + talpi ) (xl + talpi ) 1=1
t.
1=1
Thus,
Xm+I(t) = r2 + rlt where m
1
m
"I rl =XI + ~aiPi i=1
T I
I" Ui + ai Xi =XI - ~ T Pi i=1 ai Pi (16)
m
2
"2 r2 =XI + ~aiPi. i=1
As aTPi = Oi= gcd(Hiai) then m
rl
= xl -
Li=1
Ui
+ aTxl Oi
Pi.
So rl E Qn and by Lemma 1, we have r2 E zn. Therefore, the general solution of equation (12a) has the following form:
x = Xm+I(t) + H~+Iz A
=> X = r2 + rJt
Z E Zn, t E Z
T n + Hm+IZ Z E Z , t E Z.
For the general solution to be integer, we must choose t so that Xm+l(t) is integral. Therefore, we must have rl t E zn. Set t
= qt'
(t' E Z arbitrary)
and let q be the smallest
positive
integer
number
so that
rJq E zn. Then x=r2+rlqt'+H~+IZ A
X
I
ZEZn, T
= r2 + rlt + Hm+IZ A
tfEZ
h r2, rl E Z were A
n
is the general integer solution of equation (12a). By substituting variable t (12b) changes to the following equation: VTX
Therefore, we have the following result.
= qt'.
= qt'
in equation
(17)
II
" Ii
828
K. Amini and N. Mahdavi-Amiri
THEOREM4
The general integer solution of the Diophantine system Ax
Ii Ii
L
=b-
uqt'
is given by A
X=r2+rlt
A'
Tn'
+ Hm+IZ (ZEZ
,t
(18)
EZ)
where PI = qrl, with q being the smallest positive integer so that rlq E zn, and rl, r2 are given by equation (16). Now, by substituting equation (18) into equation (17) we obtain the general solution of the perturbed system (3). After the substitution, we obtain V
TH T
TA r,t+v
m+lZ+v
T
(19)
r2 =qt.
We consider the following two cases. Case 1 Hm+1v = 0 implying that vT is a linear combination of the rows of the matrix A. In this case, equation (19) is written as (q - VTpI)t
= vTr2'
(20)
There are four possibilities for (20) as we outline as follows. (a) (q - VTPI -10 and (q - vTPdlvT r2). In this situation, the parameter t is integer and the general solution of system (3) is given by
(
A
x=r2+
q
VTr2 TA
-
v rl
)
T
A
(21)
rl+Hm+lz,
(b) (q - VTPI -10 and -'((q - VTPI)lvTr2)). Then the system (3) has no integer solution. (c) (q - VTPI = 0 and VTr2 = 0). Then equation (19) becomes: vTr2
= (q -
vTpI)t
= O.
As VTr2 = 0, then (19) is satisfied for any arbitrary t. Therefore, in this case the general solution is given by, A
A
x=r2+rlt+
T Hm+IZ ZEZ,
n
tEZ
or
x = (H~+I
h)
(;) + r2 = H'~+2g+ r2,
g
E zn+1
(d) (vTPI - q = 0 and vTr2 -10). Then the system (3) has no integer solution.
(22)
-.829
Perturbed linear Diophantine systems
Case 2
Hm+1v =1= 0 (rank(AT) We know, by (19), that
=1= rank ([AT v])).
(VTH~+I)z + (VT1'I)t + VTrz
= qt.
Therefore, t E Z and z E zn must be chosen to satisfy the latter equation. Indeed, we must find the general solution of the single Diophantine equation
= -VT rz
(Hm+1V)TZ + (VT1'1- q)t
(t E Z, Z E Zn).
(23)
The necessary and sufficient condition for the existence of the solution is that 8 divides -v Trz, where
8 = gcd((vT1'1 - q), gcd(Hm+1 V)T)
= gcd((vT1'1 -
q), (Hm+1V)T).
(24)
Then, by Rosser's algorithm the general solution of equation (23) can be expressed as:
[:J ~_V>o+[o, where
uo, UI, . . . , Un are the corresponding
computing
8. So the general
solution
...
[;:].
uoJ
vectors generated by Rosser's algorithm in
of system (3) can be written as:
x = rz + 1'lt + H~+lz
z E Zn,
t E Z
or
x = (1'1
G) + rz
H~+I)
T
T -v rz Hm+l) -y-uo
~
= rz + (rl
(
VTrz
+ [UI 00]
[;:D
~
= rz - - 8 (rl
H/~+I) Uo + (1'1
H~+I)[ul
Un]y.
Thus, ~
H~Tm+'Y
~
X=Xm+l+
n
(25)
YEZ
where ~T
Hm+I
= [UI
T Un]
rl Hm+1
( )
Xm+I = rz -
and
VTrz - 8 (rl HTm+I) Uo. ~
Now, considering the earlier results, we propose the following algorithm for solving the perturbed system (3). ALGORITHM ROPDSS (Rank one perturbed Diophantine system solver) (1) Let Hm+IbetheAbaffianmatrixandpl,..., the lABS algorithm to system Ax
t (t E Z). .
Pmbe the searchvectorsobtainedby applying let XI = xl t + xl be a linearfunctionof
= b. Also
1!
Ii
K. Amini and N. Mahdavi-Amiri
830
(2) For i := 1 until m do Xl,+1
'.-
+ Ui
Xi 1 -
z . X i+l .= x.I
Z
aTi XlI a;Pi
+
Pi
h ,. - a T. x.Z ' , Pi aTi p ''
(3) Find q (the smallest positive integer such that qX':'+lE zn) and set
z rz := Xm+1 1 rl := qXm+l'
(4) Compute s = Hm+lv. (5) If (s =F0) then I
I
L
Use Rosser's algorithm and compute 8 = gcd((vTri - q), (Hm+lV)T) and the corresponding vectors uo, Ul, ..., Un. If -.(8 I -vT rz) then the system has no solution and stop, else compute vTrz
A
Xm+l
= rz - - 8 (rl
H'~+l) Uo
and Hm+l
= (rl
H~+l) [Ul
Un]
and go to (7). (6) {s = O} If (VTrl =Fq and (q - VTrl) I VTrz) then compute A
=
Xm+l
VTrz
(
q - vT rl
)
+ rz,
rl
Hm+l= Hm+l, and go to (7). If (vT rl =Fq and -.((q - VTrl) I VTrz)) then system (3) has no integer solution and stop. If (v Trz =F0 and vTrl = q) then system (3) has no integer solution and stop. If (VT rz
=0
and vT rl
= q)
then set Xm+l
= rz, Hm+l
Hm+l
=
stop (the general solution of system (3) is: (7) Stop (the general
solution
of system (3) is:
(
rT
)'
x = Xm+1 + H~+lg, g
x=
Xm+1
+ H~+1
E zn+l).
Z, Z E
zn).
Acknowledgements The authors thank Sharif University of Technology for supporting this work.
-
Perturbed linear Diophantine systems
831
References [1] Abaffy, J., Broyden, C.G. and Spedicato, E., 1984, A class of direct methods for linear equations. Numerische Mathematik, 45,361-376. [2] Esmaeili, H., Mahdavi-Amiri, N. and Spedicato, E., 2001, A class of ABS algorithms for Diophantine linear systems. Numerische Mathematik, 90, 101-1 IS. [3] Li, S., 1995, The ABS methods for rank one perturbed linear system of equations. In: E. Spedicato, Z. Li and L. Luksan (Eds), Proceedings of the Second International Conference on ABS Algorithms, pp. 4S-S2. [4] Abaffy, J. and Spedicato, E., 1989, ABS Projection Algorithms: Mathematical Techniques for Linear and Nonlinear Equations (Chichester: Ellis Harwood). [S] Rosen, K.H., 1986, Elementary Number Theory and its Applications (Addison-Wesley). [6] Blankenship, W.A., 1963, A new version of the Euclidean algorithm. American Mathenwtical Monthly, 70, 742-74S. [7] Morita, S. and Salkin, H.M., 1980, Using the Blankenship algorithm to find the general solution of a linear Diophantine equation. Acta Informatica, 13, 379-382. [8] Rosser, J.B., 1941, A note on the linear Diophantine equations. American Mathematical Monthly, 48, 662-666. [9] Schrijver, A., 1986, Theory of Linear and Integer Programming (John Wiley and Sons). [10] Aardal, K., Hurkens, C. and Lenstra, A.K., 1997, An algorithm for solving Diophantine equations with lower and upper bounds on the variables. Report UU-CD-1997-40, Computer Science Department, University of Utrecht.
HONORARY FOUNDING EDITOR Yu. G. Evtushenko
VOLUM'E 21:
NUMBER 5 October 260.6 ISSN 110.55-6188
CO-EDITORS O. P. Burdakov A. Griewank REGIONAL EDITORS Americas: F. Potra Asia: T. Tsuchiya Europe: S. Ulbrich SOFTWARE EDITOR M. Anitescu -,-"""-"",,,,,,,,,,,,,,,,,,,,,"'"
-'111111""-_""""
"""""'--"-''''''''''''-'"""""""""""
'II1II
III,
j ~
M
III ~ ~
,,,,'
,
',"""1
I, I I
~
li::
"""" a""""-""",,
-"""""""""-"""",,
,II',
'
,.'
i
'\'"
9
!'
I:
'''':11'
.
""'"""""""""-"",,,-,,,,-,,,,,,,, """"-",-"""",,
~ ~
Taylor& Francis .,yIo