How fast can one compute the permanent of circulant matrices

22

Transcript of How fast can one compute the permanent of circulant matrices

How fast can one compute the permanent of circulant matrices?A. Bernasconi� B. Codenottiy V. Crespiz G. RestayAbstractIn this paper we address the problem of computing the permanent of (0; 1) -circulantmatrices. We investigate structural properties of circulant matrices, showing that (i) ifthey are dense enough, then they contain large arbitrary submatrices, and, (ii) if they arevery sparse, then they are not too \far" from convertible matrices. Building upon (ii),we then develop an e�cient algorithm, which allows us to compute permanents of verysparse circulants of size up to 200.1 IntroductionThe computation of the permanent of a matrix seems to be a very hard task, even for (0; 1)matrices. Valiant proved that computing the permanent of a (0; 1) matrix is #P -complete(see [V179] and [V279]). The class #P contains those functions that can be computed inpolynomial time by a counting (nondeterministic) Turing machine, and the #P -completeproblems represent the hardest problems within the class. More recently, several authorshave found even stronger negative results [DLMV88, FL92].Thus it is extremely unlikely that there is a polynomial time algorithm for computing thepermanent. Actually, the best known algorithm for computing the permanent is due to Ryser[R63] and takes O(n 2n) operations, where n is the matrix size.In this paper, we continue the work started in [CCR96] and investigate structural andcomputational properties of permanents of circulant matrices.We �rst deal with a structural issue. Namely we address the problem of computingthe permanent of circulants vs the general case. The results obtained give indications thatpermanents of dense enough circulants cannot be computed signi�cantly faster than those ofarbitrary matrices. On the other hand, we also show that very sparse circulants are not too�Institut f�ur Informatik, Technische Universtit�at M�unchen, 80290 M�unchen (Germany). e-mail:[email protected] di Matematica Computazionale del CNR, Via S. Maria 46, 56126-Pisa (Italy). e-mail:fcodenotti,[email protected] di Informatica, Universit�a degli Studi di Milano, Milano (Italy). e-mail: [email protected] of this work has been done while visiting IMC-CNR in Pisa.1

\far" from convertible matrices and we take advantage of this property to develop an e�cientalgorithm for the computation of the permanent of (0; 1)-circulants with three nonzero entriesper row. Using this algorithm we are able to compute permanents of matrices of size up to200. The e�ciency of the algorithm depends on two facts, i.e., (a) that these matrices containlarge convertible submatrices, and (b) that for any matrix of prime size n and of the formI + P h + P k, we can �nd a matrix (with the same permanent) of the form I + P i + P j suchthat the sum of the two least values among fi; j; n � i; n� jg does not exceed p8n.The rest of this paper is organized as follows. In Section 2 we introduce the main notationused throughout the paper. In Section 3 we investigate the relationship between generalmatrices on the one side, and circulant matrices and convertible matrices on the other one.Building upon our previous work on the same topic and on some new equivalences betweenpermanents, in Section 4 we present an e�cient algorithm for the computation of permanentsof very sparse circulants, and we show the outcomes of the experiments. Concluding remarksare in Section 5.2 PreliminariesLet � be the set of all permutations of the �rst n integers. The permanent of an n � nmatrix A = (ai;j) is de�ned as P�2�Qni=1 ai;�i , where � = (�1 ; : : : ; �n). We will denote thepermanent and the determinant of a square matrix A as per(A) and det(A), respectively. A(0; 1)-matrix A is said to be convertible if there exists a (�1; 1)-matrix X such that per(A) =det(A ? X), where ? denotes the elementwise product, i.e., the (i; j)-th entry of the matrixA ? X is ai;jxi;j .The permanent of a (0; 1) matrix has an interpretation in terms of both the digraph andthe bipartite graph that can be associated with the matrix. More precisely, if A is an n� n(0; 1) matrix, we denote by D(A) the digraph whose adjacency matrix is A and by G[A] the2n-node bipartite graph associated with A in the natural way. Then the permanent of A isequal to the number of cycle covers of D(A) as well as to the number of perfect matchings ofG[A]. Recall that a cycle cover of D(A) is a node disjoint covering of all the nodes of D(A) interms of its cycles, whereas a matching of G[A] is a set of pairwise node disjoint edges, and aperfect matching (or 1-factor) of G[A] is a matching such that each node of G[A] is incidentto exactly one of the edges forming the matching.We will use the Big-Oh notation for orders of magnitudes, i.e., O(m) will stand for \asymp-totically not greater than cm", and �(m) for \asymptotically of the same order as cm", wherec is a constant with respect to m.Let Pn denote the (0; 1) n�n matrix with 1's only in positions (i; i+1), i = 1; 2; : : : ; n�1,and (n; 1). Any (0; 1) circulant matrix can be written in the form P t1+P t2+ : : :+P tk , where0 � t1 < t2 < : : : < tk < n. 2

3 Circulant, arbitrary, and convertible matricesAlthough circulant matrices have a very nice special structure, the evaluation of their perma-nents is in general far from trivial. The results of Section 3.1 will provide an explanation forthis fact. Indeed we will show that a graph whose adjacency matrix is circulant (which wewill call circulant graph) contains a large arbitrary subgraph, provided it has enough edges.This property however leaves an open door to the existence of faster algorithms in the sparsecase. In later sections we will actually show some progress to this respect.3.1 Arbitrary subgraphs of circulant graphsWe need some preliminary results on properties of certain sequences of integers.Theorem 1 ([BC62, HR66]) If m is a power of a prime, there exist m integers a1; : : : ; amsuch that 1 � a1 < a2 < : : : < am � m2 � 1 ;and all the sums ai + aj are distinct, 1 � i � j � m.Corollary 2 For any n, there exist at least M(n) = bpn=2c integers 1 � a1 < : : : < am � n,such that all the di�erences aj � ai are distinct, 1 � i � j � m.Proof. First note that if all the sums ai + aj , 1 � i � j � m, are distinct, then also allthe di�erences aj � ai, 1 � i � j � m, are distinct. In fact, aj � ai = ah � ak would implyaj + ak = ah + ai.If bpnc is a power of a prime, then there exist m = bpnc � M(n) numbers 1 � a1 <: : : < am � m2�1 � n whose di�erences are distinct and we are done. If bpnc is not a powerof a prime, let us consider the two consecutive powers of 2 such that 2h < bpnc < 2h+1.Letting m = 2h � bpn=2c =M(n) we obtain the thesis. 2We can now prove a structural property of circulant matrices, which sheds some light intothe complexity of computing permanents of circulant matrices with enough nonzero entries.Theorem 3 Let A be an n � n circulant matrix with �rst row [�1; �2; : : : ; �n]. A has aprincipal submatrix M of size m = �(pn ) whose o�-diagonal entries are distinct elements ofthe �rst row of A. More precisely, we havebpn=(2p2)c � m � dpn + 1e:Proof. The ij-th entry of the circulant matrix A can be de�ned as aij = �1+(n+j�i) mod n.The upper bound onm is trivial, since there arem2�m o�-diagonal entries inM and n�1in A. Hence we must havem2�m � n�1, from which we obtainm � 12+qn� 34 < dpn+1e.3

For the lower bound we want to determine a set of indexes S = fs1 < s2 < : : : < smgsuch that the principal submatrix M = A(S) does not contain repeated elements, except forthe diagonal which is constant and equal to the diagonal of A by construction.Let us assume, for simplicity, that sm < n=2. This implies that the entries of the strictlyupper triangular submatrix U ofM must be chosen from �2; �3; : : : ; �sm , while those below thediagonal from �n+2�sm ; �n+3�sm ; : : : ; �n. This guarantees that there is not any overlappingbetween entries above and below the main diagonal.Two entries of U , say uij and uhk, with (i; j) 6= (h; k), take the same values if and only if�sj�si+1 = �sk�sh+1. This implies that uij 6= uhk if and only ifsj � si 6= sk � sh : (1)The same condition holds for the entries below the diagonal of M .By Corollary 2 there exists a sequence of M(n=2) = bpn=2=2c indexes that satis�escondition 1 such that sm < n=2, and we obtain the thesis. 2The above result shows that a circulant graph contains an arbitrary subgraph of size�(pn). Thus it would be rather surprising to come up with algorithms for computing per-manents of arbitrary circulants with running time less than T (pn), where T (n) is the worstcase running time of the best available algorithm for the general case.3.2 Circulant vs convertible matricesIn this section we explore the relationship between circulant matrices of the form I + P +P j and the class of convertible matrices. More precisely, we take advantage of a recentcharacterization of convertibility [MRST97] in order to analyze \how far" matrices of theform I + P + P j are from convertible matrices.3.2.1 Characterization of convertible matricesLet A be a (0�1) square matrix, and let G be its associated bipartite graph. The complexityof the problem of saying whether or not A is convertible has been shown to be polynomial.Indeed, in [MRST97], the authors give a structural characterization of convertible matrices,and use it to design a polynomial-time algorithm which, given an input matrix A, outputsthe (�1; 1)-matrix X such that per(A)=det(A ? X), or a certain forbidden submatrix whichimplies that A is not convertible.We �rst recall some results and de�nitions from [MRST97]. We start with the de�nitionsof the 0-sum and 4-sum graph operations, which are the basic ingredients involved in thecharacterization of convertible matrices, while we refer to [MRST97] for the de�nition of the2-sum operation, which is more complicated and not used in our analysis.4

De�nition 1 Let G = (V;E) be a bipartite graph with a perfect matching, (A;B) be a bipar-tition of G, and X be a nonempty proper subset of A such that jN(X)j = jXj, where N(X)is the set of vertices adjacent to a vertex in X. Let G1 = (V1; E1) and G2 = (V2; E2) be thefollowing graphs:{ V1 = X [N(X), E1 = f(a; b) 2 E j a 2 X ^ b 2 N(X)g;{ V2 = V n V1, E2 = f(a; b) 2 E j a 2 A nX ^ b 2 B nN(X)g.Then, we say that G is a 0-sum of G1 and G2.De�nition 2 Let G0 be a graph, let C be a circuit of G0 of length four, and let G1; G2be two subgraphs of G0 such that G1 [ G2 = G0, G1 \ G2 = C, V (G1) � V (G2) 6= ; andV (G2)� V (G1) 6= ;. (The intersection and union of two subgraphs are de�ned in the naturalway.) Let G be obtained from G0 by deleting some (possibly none) of the edges of C. We saythat G is a 4-sum of G1 and G2 along C.The characterization of convertible matrices also involves the Heawood graph, which isthe bipartite graph associated with the incidence matrix of the Fano plane. Note that theHeawood graph is a circulant graph on 14 vertices, whose associated matrix is I7 + P + P 3.We are now ready to state the main result from [MRST97].Theorem 4 The matrix A is convertible if and only if its associated bipartite graph eitherhas no perfect matching, or it can be obtained by repeatedly applying the 0-sum, 2-sum, 4-sum operations starting from connected planar bipartite graphs with perfect matchings and theHeawood graph.Roughly speaking, convertible matrices can all be obtained by piecing together planar bipar-tite graphs and one sporadic non-planar bipartite graph.3.2.2 Constructions for some special casesWe now use the above characterization in order to analyze the distance from convertibilityfor some special matrices of the form I + P + P j . We will show that these special matricesare very \close" to convertible matrices, i.e., they become convertible after deleting just aconstant number of their entries.Notice that any circulant matrix of the class under investigation can be obviously trans-formed into a convertible one, by deleting three entries on the same row (or column). Indeed,in this way we obtain a matrix whose associated graph has no perfect matching. However,in the following analysis we will not consider this trivial transformation, since we are inter-ested in reductions from circulant to convertible matrices that preserve, as far as possible,the structural properties of the associated graphs.5

Given an n � n matrix An = In + Pn + P jn, the associated bipartite graph is a cycle oflength 2n, with n additional chords of length 2j � 1. We will use the following labelling forthe vertices: we choose one vertex and label it with 10, then we proceed clockwise and labelthe second vertex with 1, the third with 20, etc. The i-th vertex will thus be labelled withdi=2e0, if i is odd, and with i=2, if i is even. Given this labelling, any vertex i, i = 1; : : : ; n,will be adjacent to i0 and (i + 1)0 along the cycle, and to the vertex (i + j)0 through one ofthe chords (where the sum is taken mod n).Matrices of the form In+Pn+P 2n . For n even, we can use the characterization of [MRST97]to verify the convertibility of the matrix An = In+Pn+P 2n . Indeed the bipartite graph G[An]can be obtained as the 4-sum of the graphs G[A4] and G[An�2], where A4 = I4+P4+P 24 andAn�2 = In�2 + Pn�2 + P 2n�2. The convertibility of An then follows by induction, since A4 isconnected and planar. In order to obtain this decomposition for G[An], the 4-sum operationmust be performed along, e.g., the circuit C � f(1; 20); (20; 4); (4; 50); (50; 1)g of G[A4] andG[An�2], from which G[An] can be derived by deleting the edges (50; 1) and (20; 4) of C (seeFigure 1).On the contrary, when n is odd, An is known to be non-convertible (see [CCR96]).However, it is possible to turn it onto a convertible matrix, just by deleting one of its en-tries. In fact, G[An] can be obtained by a 4-sum of the graphs G[An�1] and K3;3, whereAn�1 = In�1 + Pn�1 + P 2n�1. Since n � 1 is even, we know that An�1 is convertibleand G[An�1] can be obtained as in Theorem 4. Finally, since K3;3 can be turned into aplanar graph by deleting just one of its edges, then An becomes convertible by deletingone of its entries. In this case, the 4-sum operation is performed along, e.g., the circuitC � f(1; 20); (20; 3); (3; 40); (40; 1)g, and then G[An] is derived by deleting the edges (40; 1) and(20; 3) of C (see Figure 1).Matrices of the form In + Pn + P n+12n . Let An = In + Pn + P n+12n , n odd. In thiscase it is possible to verify that G[An] can be obtained by piecing together, using the 4-sumoperation, the connected planar bipartite graphs G[B4] on 8 vertices, corresponding to thematrix B4 = I4 + P4 + P 24 , and the graph G[An�2], where An�2 = In�2 + Pn�2 + P n�12n�2 (seeFigure 2). By repeated applications of the same procedure, we �nally obtain a decompositionof G[An] into n�32 graphs (all isomorphic to G[B4]) and the graph K3;3. This shows how Ancan be made convertible by deleting only one of its entries.Matrices of the form In + Pn + P n2n . Let An = In + Pn + P n2n , n even. We prove that Ancan be made convertible by deleting two of its entries. We use the following strategy: we �rstdelete two edges from G[An], and then verify that the resulting graph ~G[An] can be obtainedas a 0-sum of a cycle of length four and a graph G1, which is a bipartite graph on 2(n � 2)vertices, with the same structure as ~G[An]. The result then follows by induction. The basis6

1’

2’

3’

4’

5’

6’

7’

8’

9’

10’1

2

3

4

56

7

8

9

10 = 1 2’ 4

5’

5

6’

6

7’

78’8

9’

9

10’

10

1’ � �4-sum 1

2’

2

3’

3

4’

4

5’

G[A10] G[A8] G[A4]1’

2’

3’

4’

5’6’

7’

8’

9’1

2

3

4

5

6

7

8

9 = 12’

3

4’

4

5’

5

6’

67’

7

8’

8

9’

9

1’ � �4-sum 1

2’

2

3’

3

4’G[A9] G[A8] K3;3Figure 1: Construction ofG[An], An = In+Pn+P 2n , for n = 10 and n = 9, respectively. G[A10]is obtained as the 4-sum of G[A8] and G[A4] along the cycle f(1; 20); (20; 4); (4; 50); (50; 1)g(bold-faced in G[A8] and G[A4]), by deleting the edges (50; 1) and (20; 4) (dotted in G[A10]).G[A9] is obtained as the 4-sum of G[A8] and K3;3 along the cycle f(1; 20); (20; 3); (3; 40); (40; 1)g(bold-faced in G[A8] and K3;3), by deleting the edges (40; 1) and (20; 3) (dotted in G[A9]).of the induction is provided by the graph G[A8] , whose associated matrix I +P +P 4 can bemade convertible by deleting at most two entries.We thus delete from G[An] the two edges (1; 20) and (n2 + 1; (n2 + 2)0), and obtain thegraph ~G[An]. Note that these two edges are located in opposite sides, with respect to thecenter of the cycle representing G[An]. The set of vertices X = f1; 2; : : : ; ng n f2; n2 + 2g issuch that jXj = jN(X)j, where N(X) is the set of vertices adjacent to a vertex in X. Thisimplies that ~G[An] can be obtained as a 0-sum of the two graphs G2 = ~G[An] n (X [N(X))and G1 = ~G[An] n V (G2), where G2 is simply given by the cycle f(2,(n2 + 2)0), ((n2 + 2)0,n2 + 2),(n2 + 2; 20); (20; 2)g.Let us now examine the structure of G1. G1 is a bipartite graph, whose 2(n� 2) verticescan be arranged over a cycle lacking two opposite edges. Moreover, the length `1 of thechords of G1 is less (by a factor of two) than the length ` of the chords of ~G[An], because ofthe \subtraction" of the graph G2 (see Figure 3). Since the length of the chords of ~G[An] is` = 2(n2 )� 1, we get l1 = 2(n�22 )� 1. 7

1’

2’

3’

4’5’

6’

7’

1

2

3

4

5

6

7 = 1’

2

3’

3

4’

4

6’

6

7’

7 � �4-sum 1

1’

4

5’

5

6’

2

2’

G[A7] G[A5] G[B4]= 7

1’

3

4’

4

7’

� �4-sum 3

3’

2

1’

4

6’

6

7’� �4-sum 1

1’

4

5’

5

6’

2

2’

K3;3 G[B4] G[B4]Figure 2: Construction of G[An], An = In + Pn + P n+12n , for n = 7. G[A7] is �rst ob-tained as the 4-sum of G[A5] and G[B4] (where B4 = I4 + P4 + P 24 ) along the cyclef(10; 2); (2; 60); (60; 4); (4; 10)g (bold-faced in G[A5] and G[B4]), by deleting the edges (10; 2)and (60; 4) (dotted in G[A7]). By applying the same procedure to G[A5], we then obtain adecomposition of G[A7] into two graphs isomorphic to G[B4] and K3;3.>From these observations, it follows that G1 has exactly the same structure as ~G[An]. Infact, G1 is the graph obtained from G[An�2], where An�2 = In�2+Pn�2+P n�22n�2 , by deletingtwo edges located in opposite sides, with respect to the center of the cycle.Matrices of the form In + Pn + P nkn . More in general, it is possible to prove, by takingadvantage of the 0-sum operation, that any matrix of the form In + Pn + P nkn can be madeconvertible by deleting at most k of its entries.We basically proceed as in the previous case: we �rst delete k edges from G[An], and thenverify that the resulting graph ~G[An] can be obtained as a 0-sum of a cycle of length 2k anda graph G1 on 2(n� k) vertices, with the same structure of ~G[An].Let us delete from G[An] the set of k edges f( ink + 1; ( ink + 2)0) j i = 0; 1; : : : ; k � 1g,and obtain the graph ~G[An]. Note that these edges are uniformly distributed along the cyclerepresenting G[An]. The set of vertices X = f1; 2; : : : ; ng n f ink + 2 j i = 0; 1; : : : ; k � 1gis such that jXj = jN(X)j. This implies that ~G[An] can be obtained as a 0-sum of G2 =~G[An] n (X [N(X)) and G1 = ~G[An] n V (G2).8

1’

2’

3’

4’

5’

6’

7’

8’

9’

10’1

2

3

4

56

7

8

9

10 = 1

3’

3

4’

4

5’

66’

6

8’

8

9’

9

10’

101’ � �0-sum

2’

2

7’

7

eG[A10] G1 G2Figure 3: Construction of ~G[An], An = In + Pn + P n2n , for n = 10. ~G[A10], which is derivedfrom G[A10] by deleting the edges (1; 20) and (6; 70), is obtained as the 0-sum of G1 and ofthe cycle G2 (bold-faced in ~G[A10]). Note that G1 has exactly the same structure as ~G[A10].G2 is simply given by the cycle of length 2k consisting of the edges f(( ink +2)0; ink +2); ( ink +2; ( (i+1)nk + 2)0) j i = 0; 1; : : : ; k � 1g, where the sums are taken mod n.G1 turns out to be a bipartite graph, whose 2(n�k) vertices can be arranged over a cyclelacking k edges, uniformly distributed along it. Moreover, the length `1 of the chords of G1 isless (by a factor of two) than the length ` of the chords of ~G[An], because of the \subtraction"of the graph G2 (see Figure 4). Since the length of the chords of ~G[An] is ` = 2(nk ) � 1, weget l1 = 2(n�kk )� 1.>From these observations, it follows that G1 is the graph obtained from G[An�k], whereAn�k = In�k+Pn�k+P n�kkn�k , by deleting k edges uniformly distributed along the cycle. Thus,G1 has exactly the same structure as ~G[An].Finally, the fact that the matrix In + Pn + P nkn can be made convertible by deleting atmost k entries, follows by induction, and the basis of the induction is provided by graphs witha constant number of vertices, which can be analyzed by direct inspection.4 An e�cient algorithmWe present an algorithm for computing the permanent of (0; 1)-circulants with three nonzeroentries per row which takes advantage of the convertibility of some of their submatrices. Thisalgorithm was already outlined in [CCR96]. Here we are able to add a proof of its worst caserunning time, we present its implementation, and the experimental results obtained.Before stating the result we need some simple Lemmas and De�nitions from [CCR96]which are reported in Section 4.1, and some equivalences between permanents of di�erentcirculant matrices, which are proved in Section 4.2.9

1’ 2’

3’

4’

5’

6’

7’

8’

9’

10’11’12’

13’

14’

15’

16’

17’

18’

19’

20’ 12

3

4

5

6

7

8

91011

12

13

14

15

16

17

18

1920 = 3’

34’

4

5’

5

6’

6

8’

8

9’9

10’1011’1113’13

14’

14

15’

15

16’

16

18’

18

19’19

20’201’ 1 � �0-sum 2’

2

7’

7

12’

12

17’

17

eG[A20] G1 G2Figure 4: Construction of ~G[An], An = In + Pn + P nkn , for n = 20 and k = 4. ~G[A20], whichis derived from G[A20] by deleting the four edges (1; 20); (6; 70); (11; 120); (16; 170), is obtainedas the 0-sum of G1 and of the cycle G2 of length eight (bold-faced in ~G[A20]). Note that G1has exactly the same structure as ~G[A20].4.1 BackgroundLemma 5 Let A be a square (0; 1) matrix such that G[A] is planar. Then the bipartite graphassociated with any square submatrix of A is planar.Lemma 6 Let A be a square (0; 1) matrix such that aij = 1. Thenper(A) = per(A�Eij) + per(A(ijj)) ;where Eij denotes the matrix whose only nonzero entry is in position (i; j), and A(ijj) denotesthe matrix obtained by deleting the i-th row and j-th column of A.De�nition 1 Let us denote with Pk;n the collection of all k-subsets of the n-set f1; 2; : : : ; ng.Let A be a (0; 1) n � n matrix. Then, for �; � 2 Pk;n, we denote with A[�; �] the k � ksubmatrix of A determined by rows i 2 � and columns j 2 �. Then per(A[�; �]) is called apermanental k-minor of A and we de�ne pk(A) as the sum of all the permanental k-minorsof A, i.e., pk(A) = X�2Pk;n X�2Pk;n per(A[�; �]) : (2)pk(A) counts the number of di�erent selections of k ones in A, such that each row and columnhas at most a nonzero entry.Lemma 7 Let A be a (0; 1) n � n matrix, and let aij = 1. Then pk(A) = pk(A � Eij) +pk�1(A(ijj)), for k � 2, and p1(A) = p1(A�Eij) + 1.10

Lemma 8 Let A = (aij) be an n�n (0; 1) matrix, and let z(A) denote the number of di�erent(0; 1) matrices M = (mij) with at most one nonzero entry in each row and column, satisfyingM � A, i.e., mij � aij, for all pairs (i; j). Then, for each nonzero entry aij, we havez(A) = nXk=1 pk(A) (3)z(A) = z(A�Eij) + z(A(ijj)) ; (4)and, in general, if the matrix A has k nonzero entries, then k + 1 � z(A) � 2k.Lemma 9 ([VV89]) The permanent of an n � n convertible matrix A for which G[A] isplanar can be computed in O(n ) time, < 3.Theorem 10 Let A, B, and C be n� n (0; 1) matrices such that A = B + C, and let G[B]be planar. Then per(A) can be computed in O(z(C)n ) time, < 3.Lemma 11 The bipartite graphs G[I +Qi +Qj ] and G[I +Qi + (QT )j ] are planar.We are now ready to state a theorem proved in [CCR96] that will be the basis to developan e�cient algorithm (see Section 4.3).Theorem 12 Let A = In+Pni+Pnj. Then per(A) can be computed in time O(2i0+j0nO(1)),where i0 and j0 are the two smallest numbers among fi; j; n � i; n� jg.4.2 EquivalencesIn this section we analyze the relationship between the permanents of di�erent circulantsA = A(i; j) = I + P i + P j of size n. In particular, given n, we are interested in the numberof di�erent values that per(A) can take, and we want to determine all the matrices B in thesame equivalence class, i.e., which have the same permanent as A, and such that per(B) =per(I + P h + P k), for given h and k. Our implementation of the algorithm derived from theresults of Section 4.1 strongly relies on these equivalences, expecially when n is prime.In [ET70] are presented two criteria under which two graphs with circulant adjacencymatrices are isomorphic. However the analysis we need di�ers since: (i) we are interestedonly in matrices of type A = I + P i + P j, and (ii) B = P�iA has the same permanent of Abut the associated graphs are not necessarily isomorphic.Given an n� n matrix A = I + P i + P j, where n is a prime number greater than 2, thebipartite graph G[A] is a cycle of length 2n with n additional chords of length d [CCR96]. It isclear that if two di�erent circulant matrices A and B of size n lead to the same chord lengths,then their associated graphs G[A] and G[B] are isomorphic and thus per(A) = per(B).Depending on n, i and j, the chord lengths will take one of the (n � 1)=2 odd valuesbetween 3 and n then there can be at most (n� 1)=2 di�erent permanents.11

In general, this \cycle+chords" representation is not unique. For example, in Figure 5,two di�erent graphs, both corresponding to A = I + P 4 + P 6 are shown. In the �rst graphthe edges of the cycle arise from I and P 4, while the chords correspond to P 6. The secondgraph is obtained using P 4 and P 6 for the cycle and I for the chords.1

2

3

4

5

6

7

8

9

10

11

A B C D E F G H I J K E 1A

8

H

4

D

11

K

7G

3C10

J

6

F

2

B

9

I5

1 E10

C

8

A

6

J

4

H2

F11D

9

B

7

K

5

I

3G

Figure 5: The matrix A = I + P 4 + P 6, for n = 11, and two equivalent descriptions of G[A],with d = 9 and d = 5.The above example can be easily generalized. Given an n � n matrix A = I + P i + P j ,with n prime, we can obtain three \cycle+chords" representations of G[A]. When the chordscorrespond to I, their length can be computed asD(n; i; j) = n� ����n� 2 hi (j � i)�1iZn � 1���� ; (5)where the absolute value takes care of the fact that the chords with lengths d and 2n � dcoincide. The notation [E]Zn indicates that the expression E is computed within the �eld Zn.The length of the chords of the other two representations of G[A], can be obtained consideringthe two matrices P n�iA = I+P n�i+P j�i and P n�jA = I+P n�j+P n+i�j. In other words,we look at the bipartite graphs G[P n�iA] and G[P n�jA]. Assuming j > i, their chord lengthsD0(n; i; j) and D00(n; i; j) satisfyD0(n; i; j) = D(n; n� i; j � i) = n� ����n� 2 h(j � i) (n� j)�1iZn � 1���� (6)D00(n; i; j) = D(n; n� j; n+ i� j) = n� ����n� 2 h(n� j) i�1iZn � 1���� : (7)For a given prime n, let us consider the triples Ti;j = (ai;j; bi;j ; ci;j) 2 Z3n, for 1 � i < j �n�1, where ai;j = (j� i)�1i, bi;j = i�1(n� j) and ci;j = (n� j)�1(j� i). The values ai;j, bi;j,and ci;j correspond to the `inner' parts of D(n; i; j), D0(n; i; j) and D00(n; i; j), respectively.Thus, if two triples Ti;j, and Th;k, share a value, then per(I + P i + P j) = per(I + P h + P k).Theorem 14 below characterizes the set of triples associated with a prime number n. Before12

stating the theorem, we need the following technical lemma.Lemma 13 If p is a prime, then the congruence xn � 1 (mod p) has gcd(n; p�1) solutions.Proof. See Theorem 2.27 in [NZ80]. 2Theorem 14 For a given prime n, the following facts hold1. 1 � ai;j; bi;j; ci;j � n � 2, and, for each 1 � t � n � 2, there exist i; j; i0; j0; i00; j00 suchthat ai;j = bi0;j0 = ci00;j00 = t.2. If two triples have one element in common, then all their elements coincide.3. The triples contain either three distinct values or an element repeated three times. Thelatter case happens only when n � 1 (mod 3), and the repeated values u and v satisfyu 6= v, u; v 6= 1 and u3 � v3 � 1 (mod n).Proof.1. Since ai;i+1 = i, then ai;i+1 takes all the values between 1 and n�2, as i varies. It neveroccurs that ai;j = n� 1 � �1, because ai;j = (j � i)�1i = n� 1 would imply j � i � �i(mod n), and thus j = 0, which is excluded by hypothesis. The proofs for bi;j and ci;jare similar.2. Let us suppose that ai;j = ah;k (the other cases are similar). >From (j � i)�1i =(k � h)�1h we obtain i(k � h) = h(j � i), ik = hj and i�1 = kh�1j�1. Thus we havebi;j = i�1(n� j) = kh�1j�1(�j) = �kh�1 = (n� k)h�1 = bh;k :Since ik = hj implies j�1 = hi�1k�1 and j = ikh�1, we haveci;j = (n� j)�1(j � i) = �hi�1k�1(ikh�1 � i) = �1 + hk�1 = (n� k)�1(k � h) = ch;k :3. Let us assume that ai;j = bi;j . We obtain (j � i)�1i = i�1(n� j), andi2 + j2 � ij (mod n) : (8)>From ai;j = ci;j and ci;j = bi;j we obtain exactly the same condition, thus if (8) holds,then ai;j, bi;j and ci;j coincide, while if (8) does not hold, then they are all distinct.Since in general we have ai;jbi;jci;j � 1 (mod n), if ai;j = bi;j = ci;j , they must beequal to one of the cubic roots of 1 in Zn, with the exception of the value 1 (in order tohave aij = 1, we should have i� j � i, that is j = 0, which is impossible). By Lemma13, the only cubic root of 1, in Zn, when n � 2 (mod 3), is 1. Hence in this case no13

triple has coincident values, while if n � 1 (mod 3) there are two other cubic roots,say u and v, i.e., the two triples (u; u; u) and (v; v; v). 2We can now resume our investigation on the sets of chord lengths that guarantee thatdi�erent matrices have the same permanent, i.e.,T (n) = �fD(n; i; j);D0(n; i; j);D00(n; i; j)g : 1 � i < j < n :It is clear from relations (5{7) that if ai;j = ah;k or ai;j = n � 1 � ah;k then D(n; i; j) =D(n; h; k), and the same holds for bi;j and ci;j, too. Taking into account the results ofTheorem 14 we obtain the following characterization of T (n).Theorem 15 The set T (n) has the following structure:� If n � 2 (mod 3), then T (n) consists of (n� 5)=6 triples and a couple equal to f3; ng.� If n � 1 (mod 3), then T (n) consists of (n � 7)=6 triples, a couple equal to f3; ngand a singleton fwg, where w = 2minfu; vg+ 1, and u; v are de�ned as in the proof ofstatement 3 of Theorem 14.In both cases, the sets in T (n) are a partition of the set f3; 5; 7; : : : ; n� 2; ng.Proof. The proof easily follows from Theorem 14. In fact, given two triples Ti;j and Th;ksuch that ai;j = (n � 1) � ah;k (and thus ai;j and ah;k are mapped in the same D(n; i; j) byx 7! n� jn� 2x� 1j), it is easy to check that bi;j = (n� 1) � ch;k and ci;j = (n� 1) � bh;k.Hence Ti;j and Th;k lead to the same element of T (n). The same is true for ai;j = (n�1)�ch;kor ai;j = (n� 1)� bh;k.There are two special cases. The �rst is given by the triples (1; (n � 1)=2; n � 2), ((n �1)=2; n � 2; 1) and (n� 2; 1; (n � 1)=2) which lead to the couple f3; ng in T (n). The secondis given by the triples fu; u; ug and fv; v; vg, when n � 1 (mod 3).Since u 6= 1 and v 6= 1 are two cubic roots of unity, we have that u+v = n�1, and thus thetwo triples (u; u; u) and (v; v; v) lead to the same singleton fwg, where w = 2minfu; vg + 1,in T (n).Except for these two special cases, it is easy to prove that, when ai;j, bi;j and ci;j aredistinct, then D(n; i; j), D0(n; i; j), and D00(n; i; j) are distinct, too. Thus T (n) is indeed apartition, since all values f3; 5; 7; : : : ; n � 2; ng are spanned by n � jn � 2x � 1j as x variesbetween 1 and n� 2. 2Since all matrices In + P i + P j whose D(n; i; j), D0(n; i; j) or D00(n; i; j) belong to thesame element of T (n) have the same permanent, we have the following corollary.14

Corollary 16 For any prime n, per(In + P i + P j), for 1 � i < j � n� 1, can take at mostdn=6e di�erent values.We now prove some Lemmas that will be used in Theorem 19 to evaluate the computationalcost of our algorithm.Lemma 17 For every prime n and every d = 1; : : : ; n� 2, the congruence x(d+ 1) + y � 0(mod n) is satis�ed by a couple of values x and y such that 0 < x � 12p2dpne and 0 < jyj �p2dpne.Proof. Let us compute the expression x(d+1)+y (mod n) for all the values jxj � 14p2dpneand jyj � 12p2dpne. Since(1 + 214p2dpne)(1 + 212p2dpne) > n ;by pidgeon-hole principle there will be two distinct couples x1; y1 and x2; y2 such thatx1(d+ 1) + y1 � x2(d+ 1) + y2 (mod n) :Let us assume, without loss of generality, that x1 � x2, and de�ne x = x1�x2 and y = y1�y2.It is clear that x(d+ 1) + y � 0 (mod n), as requested. Let us prove that x; y 6= 0. If y = 0then the congruence reduces to x(d+1) � 0 (mod n). Since n is prime this is possible onlyif x = 0, but this will imply that x1 = x2 and y1 = y2, which is a contradiction. The case forx = 0 is similar. 2Lemma 18 For every prime n and every d = 1 : : : n� 2, there are two values, i and j with0 < i + j � 2p2dpne such that at least one of the two congruences bi;j = i�1(n � j) � d(mod n) and bi;j = i�1(n� j) � n� 1� d (mod n) is satis�ed.Proof. Since n is prime we can rewrite the congruences as id � �j (mod n) and (d+1)i � j(mod n). Let x > 0 and y 6= 0 the two values provided by Lemma 17 so that x(d+1)+ y � 0(mod n). We have two cases:� y < 0. We have x(d + 1) � �y (mod n) and taking i = x and j = �y we see thatj � (d+ 1)i (mod n) is satis�ed.� y > 0. We have xd+x+ y � 0 (mod n), and hence xd � �(x+ y) (mod n). Lettingi = x and j = x+ y we obtain that id � �j (mod n) is veri�ed. 2We can now evaluate the computational cost of our algorithm.15

Theorem 19 Let A = In + Pni + Pnj, with n prime. Then per(A) can be computed in timeO(2cpnnO(1)), where c � 2p2.Proof. Given A, we want to prove the existence of a circulant B = In + Pni0 + Pnj0with per(B) = per(A) such that i0 + j0 � 2p2dpne. The thesis will then easily follow fromTheorem 12.Let us consider the value d = bi;j associated to A. Any other pair of values i0 and j0 suchthat bi0;j0 = d or bi0;j0 = n� 1 � d will lead to the same permanent, as seen above. Since inLemma 18 we indeed proved the existence of such a pair, with sum bounded by 2p2dpne,the thesis easily follows. 24.3 Implementation of the algorithmGiven as input an n�n circulant matrix B = I+P i+P j, our implementation of the algorithmderiving from the results of Sections 4.1 and 4.2 works as follows.1. Among the n�n circulant matrices A = I+P h+P k, with per(B) = per(A), �nd one thatminimizes h0+k0 where h0 and k0 are the two smallest numbers among fh; k; n�h; n�kg.2. Fill with 2's the two chosen diagonals (of length h0 and k0) of the matrix A.3. Set S = 0.4. Push A in the stack.5. While the stack is not empty:(a) Pop a matrix M from the stack.(b) If M does not contain entries equal to 2, then �nd a conversion M 0 of M andcompute S S + det(M 0).(c) Else, if Mij = 2, then push in the stack the matrix obtained from M by settingMij = 0 and the matrix obtained fromM by deleting the i-th row and j-th column.6. End of While.7. S is equal to per(B) = per(A).Let us analyze in more details the crucial steps of the above algorithm. In Step 1, we �nda circulant matrix A, with per(B) = per(A), that minimizes the number h0 + k0 of entriesto be `eliminated'. This step, which is accomplished exploiting the relations between thepermanents of the circulants (see Section 4.2), needs only O(n2) operations, but it actuallydetermines the computational cost of the rest of the algorithm, which is proportional to 2h0+k0 .16

When n is prime, by Theorem 19, we have h0+k0 � 2p2pn. Experimentally we found thatfor feasible values of n the multiplicative constant is smaller than 2p2 and approximativelyequal to 1:15. When n is not prime, experimental results show that h0 + k0 � n=2, and weare still investigating the behaviour of the algorithm.Step 5b consists of two parts. We �rst �nd a conversion of M , that is a matrix M 0 suchthat det(M 0) = per(M). Then we compute det(M 0). The computation of M 0 is performedby a simpli�ed version of the Brualdi & Shader convertibility-test algorithm [BS95]. Thesimpli�cation is due to the fact that we know in advance that the input matrix is convertible.This warrants that the algorithm has a polynomial cost. The conversion routine can besketched as follows (for simplicity we identify M with the digraph whose adjacency matrix isM):1. Permute M in such a way that M � I (element-wise). If this is not possible, thendet(M) = per(M) = 0 and we are done.2. Set all the diagonal entries of M to �1.3. Find the strong connected components of M .4. For each strong connected component C of M :(a) Select a node x of C. Let C = C �fxg. Let G be equal to a graph consisting onlyof x.(b) While C is not empty:i. Find a path or a cycle w whose endpoints are in G and whose edges andmid-points are in C.ii. If w is a cycle, set the sign of one edge to �1, and all the others to 1.iii. If w is not a cycle, but a path joining x and y, �nd any path from y to x in G.If this path is negative, set all the signs of the edges of w to 1; if it is positive,set the sign of one edge to �1, and all the others to 1.iv. Let C = C �w and G = G [ w.(c) End While(d) Substitute C with G, in M .5. End ForThe computation of the determinant of an integer matrix M of size n is performed byresorting to the Chinese Remainder Theorem. We choose k distinct primes p1; : : : ; pk ofmagnitude around 215 = 32768, such thatkYi=1 pi > 2maxh;k per(In + P hn + P kn ) :17

For example, for n = 103, we need k = 6 primes. Then we compute the determinant of Min Zpi , for i = 1; : : : ; k, and using the Chinese Remainder Theorem we obtain det(M). Thedeterminants are computed via modular Gaussian elimination. To speed-up the inversion ofpivotal elements, the tables of inverses in Zpi, for i = 1; : : : ; k, are precomputed and stored.The choice of pi � 215 allows us to maintain tables of inverses of reasonable size, and toperform integer multiplication in common 32-bits arithmetic without over ow. An alternativeto modular arithmetic would consist of using a package for multiple precision arithmetic. Thislatter approach would not speed-up the algorithm, since in this case Gaussian eliminationwould operate either on rationals or on oating point numbers of suitable precision.4.4 Experimental resultsThe algorithm described in Section 4.3 has been implemented in the C language, the codecompiled with the GNU GCC compiler, and the experiments carried out on a SUN Superspark20 workstation. Table 1 reports the time elapsed by our algorithm for matrices of prime sizeless than 103. Table 2 contains the values of the permanent of In + Pn + P kn for n � 101, nprime.It is known that permanents of matrices with three ones in each row and column areexponential in the size of the matrix. A great deal of work has been made in estimating thevalue of the basis of the exponentials. In particular, Minc [Mi87] �nds formulas to estimatethe dominating term � in the expressions �n+P�ni for circulant permanents. We have usedour algorithm to get a table of estimates for �. More precisely, Table 3 contains the valuesof the n�th root of the permanent of In + Pn + P kn for n � 131. For these values of n we seethat 1:39 � nqper(I + P + P k) � 1:618.4.5 Further observationsWe developed an algorithm for the permanent of A = I+P i+P j which exploits the convert-ibility of the matrix B obtained after deleting two of the �ve diagonals of ones in A. The keyproperty which guarantees the correctness of the algorithm is the planarity of G[B]. Not onlythis implies the convertibility of B, but also the planarity of all the graphs corresponding tothe submatrices of B generated during the execution of the algorithm.Since the cost of our algorithm is proportional to 2k, where k is the number of 1's markedfor deletion, it would be desirable to determine if k can be decreased, still mantaining theoverall structure of the algorithm. In general the above question has a positive answer. Forexample, our algorithm applied to A = I7 + P + P 5 marks 3 ones, which gives rise to thecomputation of 8 determinants, although the matrix A is already convertible, and thus onedeterminant computation would be enough.As a �rst step toward understanding how and when Theorem 10 can be generalized exploit-ing convertibility instead of planarity, we have showed, in Section 3.2, that some circulants of18

n # j0 + h0 Min T. Max T. Ryser T.5 1 2 0.60 0.60 < 0.017 2 3 0.61 0.61 < 0.0111 2 3 0.61 0.61 0.0113 3 4 0.61 0.64 0.0217 3 4 0.62 0.68 0.3519 4 5 0.63 0.74 1.4523 3 5 0.64 0.82 2529 5 5 0.71 0.99 207531 6 6 0.72 1.38 867037 7 7 0.81 2.94 0.5� 10641 7 7 0.88 3.51 8.8�10643 8 7 0.92 3.95 �47 8 7 1.02 4.64 �53 9 7 1.20 6.08 �59 10 8 1.44 13.6 �61 11 9 1.54 30.6 �67 12 9 1.86 41.2 �71 12 9 2.07 43.6 �73 13 9 2.22 49.7 �79 14 10 2.65 103.6 �83 14 9 3.00 58.9 �89 15 10 3.59 145.0 �97 17 11 4.52 338.2 �101 17 11 5.02 390.4 1.0 � 1025

n # j0 + h06 3 38 3 49 3 310 3 512 8 614 6 715 7 516 8 818 11 920 10 1021 10 722 7 1124 21 1225 6 526 10 1327 9 9Table 1: Times (in seconds) spent by our algorithm for various values of the size n. Columnmarked # reports the number of di�erent values of the permanent; column labeled j0 + h0reports the maximum number of elements marked for elimination; columns Min T. and MaxT. contain the minimum and maximal time elapsed for a problem of size n, respectively. Forcomparison we also report the actual or estimated times spent by a carefully implementedversion of Ryser's algorithm.the form I+P +P k are \structurally" close to nontrivial convertible matrices. Unfortunatelya submatrix of a convertible matrix is not necessarily convertible, and thus the generalizationis not straightforward.Given a circulant matrix A = I + P i + P j we want to �nd a minimal subset Si;j of thenonzero entries of A such that all the 2jSi;j j submatrices obtained by zeroing some elements inSi;j and deleting the rows and the columns containing the others, are convertible. In Table 4we show some experimental results comparing for various n the maximum number Mn of 1'smarked for elimination by our algorithm with Sn = maxi;j jSi;j j. The values of Sn have beendetermined by an exhaustive enumeration of all the possible subsets Si;j. These preliminaryresults seem to suggest that this approach can be convenient when n, the matrix size, is acomposite number; however a more precise investigation of the properties of the pattern of19

k 172 35733 7854 581k 192 93513 16374 11058 1143k 232 640813 72254 40975 4097k 292 11498533 686754 295255 282499 29757k 312 30103513 1461374 571675 546256 5357112 57632k 372 540185233 14205814 4163275 3969396 3730378 42661311 376071k 412 3702484533 65031774 15684995 15116736 137243712 135833313 1629589k 432 9693230313 139282194 30461235 29556516 26382257 25474959 319000110 2606921

k 472 66438388813 639838294 115000575 113669536 97677317 941372710 1226126911 9526809k 532 1192188513733 6315583914 845289615 865718996 700974857 648568458 6714983711 9289416312 66484793k 592 21392954858013 62449084574 6225954975 6653820616 5050219497 4536520658 4506162799 47724758119 70768057725 471616621k 612 56007482938033 134071276614 12118616275 13151101056 9767871477 8632709058 8623701799 90898381714 86738779517 91779538922 1393937233k 672 1005013502834313 1327279964274 89474482715 101906422496 70749183357 60553532058 60309102659 602461829510 654243248513 651754948914 1068178708930 5931135339

k 712 6888465025884013 6121032875474 339571535315 399988719776 265400882637 2216947352910 2192381239316 2189928118317 2428985530121 2431198713722 2207111197523 41602991165k 732 18034235568079233 13145519078894 661702581195 792890900176 514283377977 424561695758 419424544139 4168089446411 4682004781714 4215932733915 8214857199516 4702139962917 41872768613k 792 323611226722591513 130225433503134 4901201587215 6186889661036 3748414974817 2982359669419 28919706565310 29397968425712 34103331175915 29319957031719 33594803578124 29025393981928 63367443707729 295855748291k 832 2218064345379786813 600723003864174 18638898593935 24367585114096 14109762160217 10952596799178 10831251967819 106031969796310 104652027815311 108518206642717 247743246071518 128097592454519 107292346758120 1251279477883

k 892 39801549727369180533 5952108940567334 138391286046055 190706710048816 103226815306857 77170165487938 76347268410319 734917762140913 935733579462914 733016834992917 752687233948324 900883356830125 733565310486928 764399183145529 19187093799869k 972 1869825611995650691233 126676601800796574 2008779895400235 2968100774577536 1470370022749697 1044301938686338 1040327226380899 9867863877971310 9769022997227311 9744549474714718 9719460435462319 13328815965312720 29485879417234321 10334054439773322 10124140566617326 12558143273464936 96048233476839k 1012 12815975403723409142533 584407977253115534 7659691578399235 11715047439437336 5555573950686097 3843825730150578 3845537370656279 36068036900846310 35096763668044912 35642420839133313 38024332792116514 35726620159611715 46933982269497716 35537177379925722 37175835171596733 115709472229041740 503981220951531k 5 7 11 132 13 31 201 5233 24 91 1854 159Table 2: Permanents of In + Pn + P kn for n � 101 prime.20

k 73 k 79 k 83 k 89 k 97 k 101 k 1312 1.6180 2 1.6180 2 1.6180 2 1.6180 2 1.6180 2 1.6180 2 1.6180343 1.4656 3 1.4656 3 1.4656 3 1.4656 3 1.4656 3 1.4656 3 1.46557115 1.4110 28 1.4106 17 1.4103 29 1.4101 5 1.4099 5 1.4099 5 1.4098785 1.4103 5 1.4101 5 1.4101 5 1.4100 20 1.4098 33 1.4098 43 1.4093874 1.4068 4 1.4060 4 1.4055 4 1.4049 4 1.4043 4 1.4040 4 1.4026566 1.4019 6 1.4012 6 1.4008 6 1.4003 6 1.3998 6 1.3995 6 1.39852116 1.4002 12 1.3995 18 1.3992 13 1.3988 19 1.3984 40 1.3982 19 1.39761411 1.4001 19 1.3993 20 1.3988 24 1.3982 26 1.3975 15 1.3972 32 1.3958327 1.3983 7 1.3972 7 1.3965 7 1.3957 7 1.3948 7 1.3945 8 1.39302014 1.3981 29 1.3970 8 1.3964 8 1.3956 8 1.3948 8 1.3945 7 1.3924118 1.3980 10 1.3969 11 1.3964 28 1.3956 21 1.3947 13 1.3943 17 1.39230517 1.3980 15 1.3969 19 1.3962 17 1.3953 22 1.3944 22 1.3940 15 1.3919569 1.3979 24 1.3967 9 1.3960 9 1.3950 9 1.3940 9 1.3936 9 1.3913859 1.3966 10 1.3958 14 1.3949 10 1.3939 12 1.3934 37 1.39112125 1.3949 11 1.3938 14 1.3934 20 1.39107318 1.3938 16 1.3934 31 1.39091636 1.3936 10 1.3932 21 1.39076624 1.39067710 1.39059318 1.39057216 1.39056711 1.390562Table 3: The entries of the table are the values � = nqper(In + Pn + P kn ), for di�erent valuesof n and k.the subsets Si;j is needed.n 7 8 9 10 11 12 13 14 15 16 17 18Mn 3 4 3 5 3 6 4 7 5 8 4 9Sn 1 2 3 2 3 3 4 4 4 4 4 4Table 4: The maximum numberMn of 1's marked for elimination by our algorithm comparedwith Sn = maxi;j jSi;j j.5 ConclusionsIn this paper we have provided an investigation on permanents of (0; 1)-circulant matrices.We have shown that, for dense enough circulant matrices, these permanents do not seemto be signi�cantly easier than in the general case. On the other hand we have developedand implemented a very e�cient algorithm for the permanent of very sparse circulants, thusshowing that they are more tractable. Notice that this constrasts with what happens forgeneral matrices, where the restriction to matrices with three nonzeros per row does notmake the problem easier.Acknowledgment. We acknowledge the help of P. L. Montgomery, who suggested us ascheme for the proof of Lemma 17. 21

References[BC62] R.C. Bose, and S. Chowla. Theorems in the Additive Theory of Numbers. Com-ment. Math. Elvet. 37:141-147 (1962-63).[BS95] R.A. Brualdi, and B.L. Shader. Matrices of sign-solvable linear systems. CambridgeUniversity Press (1995).[CCR96] B. Codenotti, V. Crespi, and G. Resta. On the Permanent of Certain (0,1) ToeplitzMatrices. Linear Algebra and its Applications, accepted for publication.[DLMV88] P. Dagum, M. Luby, M. Mihail, and U. Vazirani. Polytopes, Permanents, andGraphs with Large Factors. Proc. 27th IEEE Symp. on Found. of Comput. Sc.(1988).[ET70] B. Elspas and J. Turner. Graphs with Circulant Adjacency Matrices. J. Combi-natorial Theory, 9:297{307 (1970).[FL92] U. Feige, and C. Lund. On the Hardness of Computing the Permanent of RandomMatrices. Proc. 24th ACM Symp. on the Theory of Comput. 643-654 (1992).[HR66] H.Halberstam, and K.F.Roth. Sequences. Oxford University Press (1966).[MRST97] W. McCuaig, N. Robertson, P.D. Seymour and R. Thomas. Permanents, Pfa�anorientations, and even directed circuits (extended abstract). Proc. 29th ACMSymp. on the Theory of Comput. 402-405 (1997).[Mi87] H. Minc. Permanental Compounds and Permanents of (0; 1) Circulants. LinearAlgebra and its Appl. 86:11-42 (1987).[NZ80] I. Niven and H.S. Zuckerman. An Introduction to the Theory of Numbers, JonhWiley & Sons, (1980).[R63] H.J. Ryser. Combinatorial Mathematics. Carus Mathematical Monograph No. 14(1963).[V179] L.G. Valiant. The complexity of computing the permanent. Theoretical ComputerScience 8:189-201 (1979).[V279] L.G. Valiant. Completeness classes in algebra. ACM Symp. on the Theory ofComput. 249-261 (1979).[VV89] V.V. Vazirani. NC Algorithms for Computing the Number of Perfect Matchingsin K3;3-Free Graphs and Related Problems. Information and Comput. 80 152-164(1989). 22