Preserving Sparity for General Solution of Linear Diophantine Systems

under the Creative Commons Attribution License, which permits unrestricted use, distribution , and reproduction in any medium, provided the original work is properly cited. Abstract Here, we present an efficient algorithm for preserveving sparsity in computing the general solution of linear Diophantin systems. In the kth iteration of the algorithm, the general solution k − 1 equations of the systems is at hand. Then, we present numerical results to justify the efficiency of the resulting algorithm.


Introduction
Consider the linear Diophantine system By solving (1), we mean finding an integer vector v ∈ Z n satisfying (1) and an integer matrix N ∈ Z n×(n−m) with linearly independent columns so that every x ∈ Z n satisfies (1) if and only if there exists some y ∈ Z n−m so that x = v + Ny. v is the particular solution and N is a basis for the null space of A. Linear Diophantine systems has many applicaions in engineering and mathematical sciences such as design of circuits, graph theory, integer rogramming anf etc.There are many algorithms for computing the solution of a linear Diophantine system [1,2,3,4].Many of these algorithms, including those of [2,4], are generalization of algorithms for solving a single linear Diophantine equation such as the extended greatet common divisor [5] and the Rosser's algorithm [7] and etc.This paper is concerned with preserving sparsity in computations of linear Diophantine systems.In section 2 we propose an efficient algorithm for computing the general solution of a linear diophantine equation which preserves sparsity.In section 3, we generaliza the proposed algorithm to obtain an algorthm for computing the general solution of a system of linear Diophantine equations which preserves sparsity.In section 4 we justify the efficiency of our proposed algotithm by presenting some numerical results.Finally, section 5 is devoted to concluding remarks.

Single linear Diophantine equation
Cosider the following single linearDiophantine equation Throughout the paper, by gcd(v T ) we mean the greatest common divisor of the elements of v. Using the same notations as in [4], let I denote the n × n identity matrix and .
Assume a 1 = 0. Let c ij be the element in the i-th row and j-th column of C, C j be the j-th column of C and B j be the j-th component of B.Moreover, let a and b be two integer numbers.We say a divides b, and write a | b if and only if b = aq for some q ∈ Z. Below, x is the greatest integer number less than or equal to x.Our proposed algorithm for solving a single linear Diophantine equation is as follows.Despite other algorithms, this algorithm selects the next two sparsest columns to perform the Euclidean algorithm.

Algorithm 2.1 Sparse linear Diophantine Solver (SDS)
Step 1 : nonincreasing order with respect to number of nonzero columns of U so that c 11 > c 12 .
Step 2 nonincreasing order with respect to to number of nonzero columns of U so that c 11 > c 12 .) At this point the matrix C and the vector B have the forms: where v, p and u i ∈ Z n , 1 ≤ i ≤ n − 1, and δ = gcd(a T 1 ).If θ = 0 then (2) has no integer solution else the general integer solution of ( 2) is:

Sparsity in linear Diophantine systems
In this section we develope an efficient algorithm for computing the genral solution of a system of linear Diophantine system (1).Note that we assume that rank(A) = m.Let where U (1) is a basis for the integer null space of a T 1 and v (1) is an integer solution of a T 1 x = b 1 , both obtained by an application of SDS to a T 1 x = b 1 , U (i+1) is the basis for the integer null space of a T i+1 N (i) , and v (i+1) is the particular integer solution of the single Diophantine equation, both obtained by an application of SDS.Suppose that A has full row rank and the Diophantine system (1) has an integer solution.It can be verified that s (i) is a particular solution and N (i) is a basis for the integer null space of the first i equations, see [6] for the proof.Here, to consider the sparsity issues, in every iteration, among all rows not considered so far, we choose the row with smallest numer of nonzeros for computing s i .The resulting algorithm is as follows.

Algorithm 3.1 Sparse linear Diophantine System Solver (SDSS)
Step 1: Step 2: Among all rows of A not considered so far, let a t i be the row with minimum number of nonzero components.Compute

(c) If
Apply SDS to the matrix C and the vector B above.The resulting matrix C fin and the resulting integer vector B fin have the forms, If θ = 0 then stop {the linear Diophantine system Ax = b has no integer solution} else set v = s, U = N and r = r + 1.
Step 3: Step 4: If i = m then stop (v is an integer solution for (1) and U is a basis for the integer null space of A and r is the rank of A) else set i = i + 1 and go to Step 2.

Numerical results
In this section we provide with a numerical example, showing that our proposed algorithm is efficient.We implemented the algoritm in the Matlab environment, using an Intel Core 2 Duo cpu, 1.8 GHz processor of 1GB RAM.We applied the resulting algorithm to a sparse test problem which is made as follows.We first considered a sparse integer matrix which is given by Mark Giesbrecht and can be obtained from sparse matrix collection of the university of Florida.The matrix has 18 rows and 30 columns.Moreover, the density of the given spare matrix is 0.12.We then let x be an arbitrary sparse integer vector and compute b = Ax.This way we are sure that the linear Diophantine system Ax = b has sparse integer solutions.We then applied our implemented algorithm to the resulting linear Diophantine system to obtain a null space basis and a particular solution.We obtained an sparse null space basis with 12 rows and 30 columns and a sparse integer solution.The density of the resulting null space basis was 0.14 which is close to the density of the original coefficient matrix.To compare our proposed algorithm with an efficient algorithm of the literature we also applied the LLL-based Hermite normal form algorithm [5] to the same linear Diophantine system and obtaned a null space basis with sparsity of 0.21.In a similar way the sparsity of the particular solution obtained by using our approach is more than that of the LLL-based Hermite normal form algorithm.This justifies the efficiency of our proposed lagorithm.

Conclusions
In this paper we proposed an efficient algorithm for computing the general solution of a sparse linear Diophantine system and presented numerical results to justify its efficiency.We also compared our proposed algorithm with an algorithm which is based on LLL-reduction algorthms.

( a )
If s i = 0 and τ i = 0 then stop {the system has no integer solution} (b) If s i = 0 and τ i = 0 {the ith equation is redundant} then go toStep 4.