Also available at http://amc.imfm.si ISSN 1855-3966 (printed edn.), ISSN 1855-3974 (electronic edn.) ARS MATHEMATICA CONTEMPORANEA 5 (2012) 307–323 Factors of disconnected graphs and polynomials with nonnegative integer coefficients Christiaan E. van de Woestijne ∗ Lehrstuhl für Mathematik und Statistik, Montanuniversität Leoben Franz-Josef-Straße 18, 8700 Leoben, Austria Received 23 February 2011, accepted 20 May 2011, published online 10 April 2012 Abstract We investigate the uniqueness of factorisation of possibly disconnected finite graphs with respect to the Cartesian, the strong and the direct product. It is proved that if a graph has n connected components, where n is prime, or n = 1, 4, 8, 9, and satisfies some addi- tional natural conditions, it factors uniquely under the given products. If, on the contrary, n = 6 or 10, all cases of nonunique factorisation are described precisely. Keywords: Graphs, monoids, factorisation. Math. Subj. Class.: 05C70,13A05,20M13 1 Introduction The purpose of this note is to give an algebraic/combinatoric perspective on a result in [8] about uniqueness of factorisation of certain finite or infinite graphs with respect to well- known graph products. As already noted by the authors of [8], the structure underlying the problem is the factorisation of multivariate polynomials with nonnegative integer co- efficients. We expand on this theme, and provide precise classifications of all possible non-unique factorisations for a number of small cases, which include polynomials of un- bounded degree, however. These results immediately translate back to graphs, and as our main result, we have the following (definitions are given below). Theorem 1.1. LetG be a finite graph having n connected components, where either n = 1, 4, 8, or 9, or n is a prime number. Then if G is simple, it has unique Cartesian and strong factorisation; if G has no bipartite components, it has unique direct factorisation. If, on the contrary, n = 6, 10, 12, or 16, non-unique factorisations occur for all three products. ∗The research leading to this paper was supported by the Austrian Science Foundation FWF, project S9611, which is part of the Austrian National Research Network “Analytic Combinatorics and Probabilistic Number Theory.” E-mail address: c.vandewoestijne@unileoben.ac.at (Christiaan E. van de Woestijne) Copyright c© 2012 DMFA Slovenije 308 Ars Math. Contemp. 5 (2012) 307–323 Proof. By the Structure Theorem 2.7, together with Lemma 3.6, we reduce the problem to the unique or non-unique factorisation of univariate polynomials P with nonnegative integer coefficients such that P (1) = n. This problem is trivial for n = 1, easy for n prime (see Lemma 3.2), and solvable with the aid of a computer for the cases n ∈ {4, 6, 8, 9, 10} (see Theorems 3.7 up to 3.11); for n = 12 and 16, we have the examples (3.2) and (3.10). The results for n prime, or n = 4, are given as Exercises 6.12 and 6.13 in [8]. As solutions, the authors provide purely graph-theoretical proofs, so that we obtain a second proof for unique factorisation of polynomials P with nonnegative integer coefficients and P (1) equal to 4 or to a prime number. The problem of unique factorisation of (disconnected or even connected) graphs with loops with respect to the Cartesian and the strong product is still open — cf. Lemma 2.4 below. It has already been proven [3, Theorem 2.2] that the semiring N1 of univariate polyno- mials with nonnegative integer coefficients has full elasticity, meaning that for any rational number p/q ≥ 1, there exists a polynomial f ∈ N1 such that the number of irreducible factors in its longest factorisation is to the number of factors in the shortest as p is to q. From our results, it follows that polynomials with at most 11 terms have elasticity 1; our smallest nontrivial example (3.10) has elasticity 3/2 and 16 terms. More such examples may exist with 12, 14, or 15 terms. Up to now, we have not found any minimal example with more than 2 inequivalent factorisations. 2 Factorisations of graphs We will consider the class of finite graphs (or symmetric binary relations) Γ0 and its sub- class consisting of graphs without loops (or simple graphs) Γ. (To be precise, we consider the category of isomorphism classes of such graphs, with graph homomorphisms as arrows. This will be tacitly assumed in the sequel.) A graph G is given as a pair (V,E), where V is the set of vertices and E ⊆ V × V is the set of edges. Note that (x, y) ∈ E ⇔ (y, x) ∈ E, as our graphs are undirected. Definition 2.1. Let G and H be graphs in Γ0. (i) The disjoint union G ·∪ H is the graph with vertex set V (G) ·∪ V (H) and edge set E(G) ·∪ E(H) (both again disjoint union). (ii) The Cartesian product G  H is the graph with vertex set V (G) × V (H), such that (u, v) and (u′, v′) are adjacent if and only if u = u′ and (v, v′) ∈ E(H) or (u, u′) ∈ E(G) and v = v′. (iii) The strong product G  H is the graph with vertex set V (G) × V (H), such that distinct vertices (u, v) and (u′, v′) are adjacent if and only if u = u′ or (u, u′) ∈ E(G), and v = v′ or (v, v′) ∈ E(H), and (u, v) has a loop if and only if at least one of u and v has a loop. (iv) The direct product G×H is the graph with vertex set V (G)×V (H), such that (u, v) and (u′, v′) are adjacent if and only if (u, u′) ∈ E(G) and (v, v′) ∈ E(H). All three products are commutative and associative and distribute over the disjoint union, and are the only products with these properties such that the projections onto the factors are graph homomorphisms (direct product) or weak homomorphisms (the other C. E. van de Woestijne: Factors of disconnected graphs and polynomials with. . . 309 two). Details can be found in [8]. The Cartesian and strong products in [8] are only de- fined for simple graphs, but the extension to arbitrary graphs, using the above definitions, is immediate. The graph K1 consisting of one vertex and no edges is a neutral element with respect to both the Cartesian and the strong product, whereas the graph K∗1 , having one vertex and a loop on it, is a neutral element for the direct product. Of course, the empty graph is a neutral element for the disjoint union; by general theory, all neutral elements are unique. Finally, note that the Cartesian and strong products of two graphs are simple if and only if both factors are simple. It follows that both Γ and Γ0 are commutative semirings with operations given by the disjoint union and either the Cartesian or the strong product, whereas Γ0 is a commutative semiring with the disjoint union and the direct product. An essential question regarding graph products is whether the possible factorisations obtained with respect to such a product are unique. Here, we have the following results. Definition 2.2. Let be a graph product. A graph G that is different from the neutral element for is called irreducible with respect to if in any factorisation G = H L, either H or L is the neutral element for . Theorem 2.3. [8, Theorems 6.6, 7.14, 8.17] (i) (Sabidussi, Vizing) Let G be a connected simple graph. Then any two factorisa- tions of G into irreducibles with respect to the Cartesian product are unique up to permutation and isomorphism of the factors. (ii) (Dörfler and Imrich, McKenzie) The same result holds for the strong product. (iii) (McKenzie) Let G be a connected nonbipartite graph. Then any two factorisations ofG into irreducibles with respect to the direct product are unique up to permutation and isomorphism of the factors. The next result shows that Cartesian and strong factorisation for graphs with loops is in general not unique. The proof is easy. Lemma 2.4. Let G be a graph in which every node has a loop. Then the same holds for G  H and G  H , where H is any graph. Bipartite graphs, with or without loops, generally have several nonequivalent direct fac- torisations. A classification of these phenomena is a topic of current research by Hammack and his co-authors [1, 6, 7]. In this note, we will consider factorisations of disconnected graphs. In this case, there are certain well-known examples of non-unique factorisations. However, we will show that these examples are all reducible to the same phenomenon in the semiring of polynomials in several variables with nonnegative integral coefficients. To do this, we slightly change our perspective on the class of graphs. Instead of thinking of the connected components of a graph as being separate graphs standing next to each other, and possibly repeated more than once, we will think of each connected component as occurring only once, but with some multiplicity assigned to it. Then, an easy step is to allow also negative multiplicities. Definition 2.5. We define the class of graphs with integer-weighted components Γ̃0 to be the set of formal sums ∑ G aGG, whereG runs over the connected graphs in Γ0, and where 310 Ars Math. Contemp. 5 (2012) 307–323 the aG are integers, only finitely many of which are nonzero. We define ( ∑ G aGG) + ( ∑ G bGG) = ∑ G (aG + bG)G; ( ∑ G aGG) ( ∑ G bGG) = ∑ G ( ∑ H L=G aHbL ) G. Doing exactly the same for the subclass Γ of simple graphs yields the set Γ̃. In the definition of multiplication, we obtain a double sum, because it is possible that several combinations of components H on the left and L on the right have the same prod- uct H L = G. We combine all these and add the multiplicities together to obtain the multiplicity of (the isomorphism class of) G in the product. We note that we will continue to use the term graph in the usual way; the term graph with integer-weighted components will denote a formal sum of connected graphs, with possibly negative multiplicities. Theorem 2.6. For any choice of graph product =  ,  , ×, the set Γ̃0 is a com- mutative ring with the addition and multiplication as defined above, and the semiring Γ0 embeds into it. The additive group of Γ̃0 is the free Abelian group generated by the con- nected graphs in Γ0. Analogously, Γ̃ is a ring, and the semiring Γ embeds into it. The connected simple graphs freely generate its additive group. Proof. It is clear from the definition that the set Γ̃0 is just the free Abelian group generated by the connected graphs. If in a formal sum all weights aG are nonnegative, then the formal sum is just a graph as we know it. Conversely, every graph can be written as such a sum in exactly one way, because the decomposition of graphs as a disjoint union of connected graphs is unique. Thus, we can embed the set of graphs into the set Γ̃0. Furthermore, it is easy to see that addition and multiplication of nonnegatively weighted graphs agrees exactly with the operations of ·∪ and on graphs, so that the embedding is a homomorphism of semirings. Now what remains is to consider the operations on the whole set Γ̃0. The operations of addition and multiplication are clearly commutative. Their associativity and the distribu- tivity of over addition are easily derived from the corresponding properties of nonneg- atively weighted graphs, using the difference representation of formal sums, as follows. Every graph with integer-weighted components X can be written as a difference X1−X2, where both X1 and X2 have only nonnegative multiplicities. If we also say that every con- nected graph has nonzero multiplicity in at most one of X1 and X2, this decomposition is uniquely determined, and we see that elements of Γ̃0 can be uniquely written as the differ- ence G −H of two graphs G and H that have no connected component in common (i.e., no component of G is isomorphic to any component of H and vice versa). The details are left to the reader. The construction used here is known as forming the Grothendieck group of a commu- tative semigroup with cancellation. When the semigroup is a semiring (as in our case), the proof shows that the construction easily extends to define a compatible ring structure on the Grothendieck group. C. E. van de Woestijne: Factors of disconnected graphs and polynomials with. . . 311 Now we come to the main structure theorem (see also [5, 9]). Theorem 2.7. The following three rings are each isomorphic to the ringR = Z[x1, x2, . . . , xn, . . .] of polynomials with integer coefficients in countably many commuting variables: (i) the ring Γ̃ of simple graphs with the Cartesian product; (ii) the ring Γ̃ of simple graphs with the strong product; (iii) the subring Γ̃0,odd of Γ̃0 of graphs having only nonbipartite connected components, with the direct product. Note that we cannot extend the third part of the result to the set of all nonbipartite graphs, because this set is not a free Abelian group under disjoint union: if G is connected bipartite and H , L are connected, nonbipartite, and nonisomorphic, then we have (G ·∪ H) ·∪ L = (G ·∪ L) ·∪ H where none of the factors can be written as a sum of nonempty graphs within the class of nonbipartite graphs. One might call this kind of phenomenon a “non-unique partition”. Proof. Let be either the Cartesian or the strong product. As unique factorisation is only known for connected simple graphs, we restrict ourselves to the ring Γ̃. Now letG1, G2, . . . be some (arbitrary) enumeration of the set of irreducible connected simple graphs. We now define a ring homomorphism φ : R → Γ̃ by sending the variable xi to Gi (“evaluating the polynomial at the values Gi, for i ≥ 1”), the unit element 1 to the neutral element K1, and 0 to the empty graph. By linearity, we can obviously extend the homo- morphism to all of R. As every connected simple graph has a unique factorisation into irreducible graphs, the images of the monomials xe1i1 · . . . · x er ir contained in R are all dis- tinct, and every connected simple graph is the image of one such monomial. Thus, because the generators of the additive group ofR (which are the monomials) are mapped one-to-one onto the generators of the additive group of Γ̃, and both groups are free Abelian, we find that φ is an isomorphism. Next, consider the direct product. It is an easy exercise to show that the direct product of two connected graphs in Γ0 is bipartite if and only if at least one of the factors is bipartite. This means that the subgroup Γ̃0,odd of Γ̃0 generated by the nonbipartite connected graphs is closed under taking direct products. As it is obviously a subgroup with respect to the disjoint union and contains the neutral element K∗1 , it is a subring. Now exactly the same argument as before shows that this ring is isomorphic to R. Of the many consequences of the above isomorphisms, we only give the following. Recall that a set S has the cancellation property with respect to some binary operation on S, if for all G,H,L ∈ S, the isomorphism G H ∼= G L implies the isomorphism H ∼= L. It means that whenever we find that a certain element of S has a factor G (is “divisible” by G), the “quotient” by G is uniquely determined within S. Note that the cancellation property is inherited by any subset of S that is closed under the operation , whereas unique factorisation does not necessarily descend in this way. The following result is due to Lovász [10, Theorem 9] for the case of the direct product; see also [8, Theorem 9.10]. In fact, what Lovász proved was that quotients by nonbipartite simple graphs and by reflexive nonbipartite graphs are well-defined within the class of (not necessarily symmetric) binary relations. However, his argument extends almost verbatim 312 Ars Math. Contemp. 5 (2012) 307–323 to the case of nonbipartite graphs that may have some loops, and the result follows by the inheritance property just mentioned. Of course, our proof only shows that the cancellation law follows directly from the unique factorisation of connected graphs. As said above, we restrict to graphs without bipartite components, to avoid problems with non-unique partition. For the Cartesian and strong cases, the argument appears as [8, Theorems 6.21 and 9.5]. Corollary 2.8. The set of nonempty simple graphs has the cancellation property with re- spect to the Cartesian and the strong product. The set of graphs without bipartite compo- nents has the cancellation property with respect to the direct product. Proof. The given sets are embedded (with the operation being respected) in the ring R, which is a unique factorisation domain and hence certainly has the cancellation property with respect to multiplication of polynomials. As any two distinct factorisations G H ∼= G L would lead to distinct factorisations of the same polynomial, we conclude that cancellation holds. 3 Polynomials with nonnegative integer coefficients We now proceed to the actual purpose of this note. By the above isomorphisms, it is easy to exhibit examples of disconnected graphs that have multiple non-equivalent factorisations. For example, consider the polynomial identity (1 + x+ x2)(1 + x3) = (1 + x2 + x4)(1 + x). (3.1) We have factorisations 1 + x3 = (1 + x)(1 − x + x2) and 1 + x2 + x4 = (1 − x + x2)(1 + x+ x2), but as these contain factors with negative coefficients, they do not corre- spond to honest graph factorisation. Restricting ourselves to the semiringN of polynomials with nonnegative integer coefficients, it follows that all the factors occurring in (3.1) are irreducible, and hence so are the corresponding graphs, if we let x correspond to some ir- reducible connected simple graph of our choice (as K1 is a “unit”, we do not consider it to be irreducible). Mapping x to K2, the graph with two nodes and one edge, we obtain (K1 +K2 +K ,2 2 ) (K1 +K ,3 2 ) = (K1 +K ,2 2 +K ,4 2 ) (K1 +K2), where is either the Cartesian or the strong product, andG ,n means the n-fold -product of G with itself (also called the nth -power of G). For the direct product, we can use the same example. However, here we must use K∗1 (the vertex with a loop) as the neutral element, and the choice for φ(x) must be some irreducible connected nonbipartite graph, such as K∗2 (two vertices with loops and an edge between them). Another example, due to Nüsken [5] and containing nontrivial integer coefficients, is (2 + x+ x3)(2 + x) = (1 + x)(4 + x2 + x3). (3.2) Here the factor 2 − x + x2 divides both cubic factors, and it follows that the latter are irreducible in the semiring N . However, by the structure theorem 2.7, it follows that every instance of non-unique factorisation existing among graphs arises from a non-unique factorisation in N . We can C. E. van de Woestijne: Factors of disconnected graphs and polynomials with. . . 313 use this fact to limit the possible phenomena inside our sets of graphs. Every graph cor- responds to a polynomial, with each connected component corresponding to a monomial, whose coefficient is equal to the number of components that share the same isomorphism class. Hence, what we will do in the sequel is to give a precise description of all factorisations of a given polynomial (in several variables) with nonnegative integer coefficients. It turns out that this can be done variable by variable, and (for a univariate polynomial) that it is useful to classify the polynomials by number of terms (i.e., evaluation of the polynomial at 1) rather than degree. We will prove results for the cases where the number of terms is at most 10, or equal to a prime number, with the aid of computer algebra systems such as MAGMA [2]. All software used to produce these proofs is available from the author. 3.1 General remarks By definition of the polynomial ring (even in infinitely many variables), every given poly- nomial involves only finitely many variables of R; therefore, also all its possible factorisa- tions in R, taken together, comprise only finitely many variables, if we identify isomorphic factors that differ only in the labelling of the variables. Thus, we may assume we are in the ring Rm = Z[X1, . . . , Xm]. Let Nm ⊆ Rm be the subsemiring of polynomials in X1, . . . , Xm with nonnegative integer coefficients. Every polynomial P ∈ Nm has a very sparse representation given by P = n∑ i=1 Xαi where we use the shortcut notation Xγ = ∏m j=1X γj j for a vector γ = (γ1, . . . , γm) of nonnegative integer exponents. The vectors αi may be repeated in order to accommodate nontrivial coefficients. We immediately have the following results. Lemma 3.1. Let P ∈ Nm be a sum of n monomials (possibly repeated, all with coefficient 1), and suppose it factors in Nm as P = ST , where S has s monomials and T has t. Then n = st. If all monomials of P are distinct, then so are those of S and T . Proof. Suppose P = ST where S, T are in Nm. We have n = P (1, 1, . . . , 1) = S(1, 1, . . . , 1)T (1, 1, . . . , 1) = st. This proves the first claim. Now assume all monomials of P are distinct. Then each term of P arises in at most one way as the product of a term of S and a term of T , and hence S and T cannot have repeated terms. Lemma 3.2. Let P ∈ Nm be a sum of n monomials, where n is prime. Then P has unique factorisation inside Nm. Proof. Obviously, in any factorisation P = ST , either S or T is a monomial. Now the greatest monomial factor is just the greatest common divisor of all terms of P , and all other monomial factors of P divide it. Thus P is the product of a sum of n terms, without common factor, that is irreducible in Nm, and a monomial. But monomials clearly have unique factorisation in Nm. 314 Ars Math. Contemp. 5 (2012) 307–323 As soon as the number of terms is not prime, the problem becomes more difficult. In order to keep track of all possible factorisations, it is important to consider the order of terms in a polynomial as fixed, and to fix the order in which we form the terms of the product of two polynomials. This leads to the following definition. Definition 3.3. Let X1, . . . , Xm be variables, and let c1, . . . , ct be vectors (of length m) of nonnegative integers. A factorisation of the polynomial ∑t i=1X ci , of the form (Xa1 + . . .+Xar ) ( Xb1 + . . .+Xbs ) = Xc1 + . . .+Xct , (3.3) is given by two sequences (a1, . . . , ar) and (b1, . . . , bs) of length-m vectors of nonnegative integers and a bijective mapping ρ : {1, . . . , r} × {1, . . . , s} → {1, . . . , t} such that ai + bj = cρ(i,j) whenever 1 ≤ i ≤ r and 1 ≤ j ≤ s. (3.4) Of course, for a factorisation to exist, we must have t = rs. As remarked before, we may assume that the polynomials to be factored are not divisible by variables, and hence we may always assume that mini{cij} = 0 for j = 1, . . . ,m. We now show that all possible nonunique factorisations in the semiring N1 = Z≥0[X] are parametrised by the numbers of terms r and s and (given r, s) the bijections ρ. Lemma 3.4. Let c1, . . . , ct ∈ Nm such that mini{cij} = 0 for 1 ≤ j ≤ m, let r, s be positive integers such that t = rs, and let ρ be a bijection ρ : {1, . . . , r} × {1, . . . , s} → {1, . . . , t}. Then there exists at most one choice of sequences (a1, . . . , ar) and (b1, . . . , bs) of elements of Nm such that ai + bj = cρ(i,j) for all i, j. If such a choice is possible, then we have mini{aij} = mini{bij} = 0 and {aij} ∪ {bij} ⊆ {cij} for 1 ≤ j ≤ m. Proof. We consider only the first components of all vectors. We get a system ai1 + bj1 = cρ(i,j),1 1 ≤ i ≤ s, 1 ≤ j ≤ r of linear equations, to be solved in nonnegative integers. Without loss of generality, we assume c11 = 0 and ρ(1, 1) = 1. This means that a11 + b11 = c11 = 0, and hence a11 = b11 = 0. The other sums a11 + bj1 and ai1 + b11 all occur as the left hand side of an equation, and hence all ai1 and bj1 are determined and must occur among the ci1. The remaining equations then define relations that the ci1 must satisfy among themselves in order for the system to be soluble. It follows that the system has at most one solution for a given ρ. Finally, it is obvious that the systems for the other components are completely analo- gous and independent from each other, and hence must all be satisfied independently. It follows that there is at most one solution. Corollary 3.5. Let X1, . . . , Xm be variables. Given r, s, (c1, . . . , ct) ⊆ Nm, and ρ, there exists at most one factorisation of the form (3.3). The last observation in this section shows that the problem of parametrising all factori- sations can be immediately reduced to the univariate case. C. E. van de Woestijne: Factors of disconnected graphs and polynomials with. . . 315 Lemma 3.6. Let X1, . . . , Xm be variables, and let c1, . . . , ct ∈ Nm. A quintuple (r, s, ρ, (a1, . . . , ar), (b1, . . . , bs)) is a factorisation of ∑t i=1X ci in Nm if and only if (r, s, ρ, (a1j , . . . , arj), (b1j , . . . , bsj)) is a factorisation of ∑t i=1X cij j inside N[Xj ], for j = 1, . . . ,m. Proof. A polynomial in Nm in very sparse representation is determined by its exponent vectors c1, . . . , ct. If we set all variables except X1, say, to one, this corresponds to setting all components of the ci, except the first, to zero. If we do this for all the Xj separately, we see that no information in the ci is lost; in fact, we map the matrix (cij) to the set of its columns. In particular, factorisations are preserved, and factorisations with respect to each variable separately can be pieced together to obtain a factorisation of the original polynomial. Note that the maps described in the proof are not the same as the semiring homo- morphisms of evaluating all variables (except one) at 1. For example, the polynomial XY + 1 in very sparse representation maps to (X + 1, Y + 1) as usual, but X + Y maps to (X + 1, 1 + Y ), which is different since the order of terms is fixed. This allows us to reconstruct polynomials in Nm from their images under these partial evaluations; in fact, the number of terms (in the very sparse sense) does not change under our maps. 3.2 The univariate case From now on, we restrict attention to the case of polynomials in N1. More precisely, let t be a nonnegative integer; we consider polynomials P ∈ N1 such that P (1) = t and P (0) > 0, so that P is not divisible by the variable. By what we just proved, it follows that we can obtain all possible factorisations of P insideN1 by listing all nontrivial factorisations t = rs (i.e., r > 1 and s > 1), and for every pair (r, s), listing all possible bijections ρ : {1, . . . , r} × {1, . . . , s} → {1, . . . , t}. To complete the arguments, we will need to prove that the factors thus found are irreducible; if they are not, we will have to consider products of more than two factors. We will give complete descriptions of the cases t = 1, . . . , 11; of course, the cases where t is prime were already dealt with by Lemma 3.2. Suppose r and s are given. We will assume that factorisations have the form (3.3), where moreover we have 0 = c1 ≤ c2 ≤ . . . ≤ ct; (3.5) 0 = a1 ≤ . . . ≤ ar and 0 = b1 ≤ . . . ≤ bs. (3.6) As in the proof of Lemma 3.4, the exponents a1 + bj = bj correspond to cρ(1,j), and ai + b1 = ai to cρ(i,1). Therefore, we obtain the equations cρ(i,j) = cρ(i,1) + cρ(1,j) (2 ≤ i ≤ r, 2 ≤ j ≤ s). (3.7) Thus, for every bijection ρ, the polynomials possessing a factorisation of the form (3.3) with bijection ρ correspond to the solutions in the (nonnegative integer) variables ci of the system of linear equations and inequalities made up by (3.5) together with (3.7). Such systems are closely related to integer linear programs. The difference is that there is no cost function to be optimised; instead, we are interested in all solutions, which hopefully 316 Ars Math. Contemp. 5 (2012) 307–323 will admit a compact description. If the polynomial P is to have two different factori- sations, then the ci must satisfy two such linear programs simultaneously, namely those corresponding to two different ρ. To facilitate the analysis, we can use the fact that (3.7) also implies a partial ordering of the ci; in fact, because all exponents are nonnegative, we have cρ(i,j) ≥ cρ(i,1) and cρ(i,j) ≥ cρ(1,j) (2 ≤ i ≤ r, 2 ≤ j ≤ s). (3.8) Furthermore, in the end we will drop the fixed term ordering of the factors, so that we may assume (3.6). The implication is that cρ(i,j) ≥ cρ(i′,j′) (1 ≤ i′ ≤ i ≤ r, 1 ≤ j′ ≤ j ≤ s). (3.9) The number of pairs of ci whose ordering is thus determined is( r 2 )( s 2 ) + r ( s 2 ) + ( r 2 ) s = r2s2 + rs2 + r2s− 3rs 4 , to be compared with the total number ( rs 2 ) = r 2s2−rs 2 of pairs. The idea is that the partial ordering (3.9) severely limits the possibilities for ρ. In the (computer-aided) proofs below, we will repeatedly compute all possibilities for the bijection ρ that are compatible with the partial order (3.9). It is readily seen that this problem is equivalent to the topological sorting of a given directed acyclic graph (dag) with nodes {1, . . . , rs}. Here the graph represents the few ordering relationships that are known, and the task is to produce a total ordering of the nodes such that node i comes before node j whenever the graph contains an edge (i, j). Such orderings exist if and only if the graph is acyclic, and are not unique. To find all possible such orderings, we apply Kahn’s algorithm, with backtracking. (It is possible to use a depth-first search to find a topological ordering, and this is the algorithm given in [4, Section 23.4], but this algorithm is unable to derive all topological orderings — cf. Exercise 23.4-2 in [4]. In fact, on the graph with three nodes and edges (1, 3) and (2, 3), depth-first search will never produce the ordering 123, which is perfectly valid.) Kahn’s algorithm works as follows: take any node with zero in-degree, write it down, remove it and all its incident edges from the graph, and continue recursively with the re- mainder until the graph is trivial. By backtracking on every choice that we make, we smoothly produce all possible topological orderings. 3.3 Results for polynomials with few terms Using the above framework, we arrive at the following results. Theorem 3.7. Let P ∈ N1 be a sum of 4 monomials, not necessarily distinct. Then P has unique factorisation inside N1. Proof. We may assume the variable does not divide P . Putting t = 4, the only nontrivial factorisation is one having r = s = 2. Let us see which bijections ρ can occur in the factorisation (1 +Xa2)(1 +Xb2) = 1 +Xc2 +Xc3 +Xc4 . C. E. van de Woestijne: Factors of disconnected graphs and polynomials with. . . 317 We may put ρ(1, 1) = 1 and ρ(2, 2) = 4, because cρ(2,2) = a2 + b2 must be maximal among the ci. The only remaining choice for ρ is whether ρ(1, 2) = 2 or 3 (i.e., whether c2 = a2 or c3 = a2). But this choice corresponds to exchanging the factors on the left, and this leaves the factorisation is essentially unchanged. Thus ρ is fixed, and P is either irreducible (if c4 6= c2 + c3) or breaks up uniquely into two factors of 2 terms each, by Corollary 3.5. Theorem 3.8. Let P ∈ N1 be a sum of 6 monomials, not necessarily distinct. If P has non-unique factorisation, then it is of the form Xa(1 +Xb +X2b +X3b +X4b +X5b) for nonnegative integers a and b ≥ 1. Note that 1+X+X2+X3+X4+X5 = (1+X2+X4)(1+X) = (1+X+X2)(1+X3). All factors are irreducible in N1 by Lemma 3.2. Proof. We may assume the variable does not divide P . Any nontrivial factorisation is of the form (1 +Xa2 +Xa3)(1 +Xb2). We use the topological sorting algorithm described above to find all bijections ρ that are compatible with the partial ordering (3.9), and find that there are the following 5 possibili- ties (to be read such that the first pair corresponds to c1, the next to c2, and so on): Case: c1 c2 c3 c4 c5 c6 1 (1, 1) (1, 2) (2, 1) (2, 2) (3, 1) (3, 2) 2 (1, 1) (1, 2) (2, 1) (3, 1) (2, 2) (3, 2) 3 (1, 1) (2, 1) (1, 2) (2, 2) (3, 1) (3, 2) 4 (1, 1) (2, 1) (1, 2) (3, 1) (2, 2) (3, 2) 5 (1, 1) (2, 1) (3, 1) (1, 2) (2, 2) (3, 2) We now check whether any combination of two ρ admits a simultaneous solution of the respective sets of equations (3.7). For example, the first line implies the equations c4 = c2 + c3 and c6 = c2 + c5, whereas the fifth line gives c5 = c2 + c4 and c6 = c3 + c4. The general solution to these four equations combined is c2 free, c3 = 2c2, c4 = 3c2, c5 = 4c2, c6 = 5c2, and this corresponds to the factorisation given in the theorem. To see this, note that the bijection ρ from the first line results in a2 = c3, a3 = c5, and b2 = c2, whereas the fifth line gives a2 = c2, a3 = c3, and b2 = c4. It is easily (but tediously) verified that in all the factorisations given by combining two other lines of the table, the left and right hand sides coincide. Hence the only nonunique factorisation is the one given in the Theorem, and a fortiori, polynomials that possess three inequivalent factorisations do not exist. 318 Ars Math. Contemp. 5 (2012) 307–323 Theorem 3.9. Let P ∈ N1 be a sum of 8 monomials, not necessarily distinct. Then P has unique factorisation inside N1. Proof. We may assume the variable does not divide P . If P is reducible in N1, then it can be written as a product of factors with 2 and 4 terms, where the latter possibly again breaks up as a product of factors with 2 terms each. We will first establish all possible nonunique factorisations of type (1 +Xa2)(1 +Xb2 +Xb3 +Xb4). All bijections ρ : {1, 2} × {1, 2, 3, 4} → {1, . . . , 8} that are compatible with the partial ordering (3.9) are enumerated by MAGMA as Case: c1 c2 c3 c4 c5 c6 c7 c8 1 (1, 1) (1, 2) (1, 3) (1, 4) (2, 1) (2, 2) (2, 3) (2, 4) 2 (1, 1) (1, 2) (1, 3) (2, 1) (1, 4) (2, 2) (2, 3) (2, 4) 3 (1, 1) (1, 2) (1, 3) (2, 1) (2, 2) (1, 4) (2, 3) (2, 4) 4 (1, 1) (1, 2) (1, 3) (2, 1) (2, 2) (2, 3) (1, 4) (2, 4) 5 (1, 1) (1, 2) (2, 1) (1, 3) (1, 4) (2, 2) (2, 3) (2, 4) 6 (1, 1) (1, 2) (2, 1) (1, 3) (2, 2) (1, 4) (2, 3) (2, 4) 7 (1, 1) (1, 2) (2, 1) (1, 3) (2, 2) (2, 3) (1, 4) (2, 4) 8 (1, 1) (1, 2) (2, 1) (2, 2) (1, 3) (1, 4) (2, 3) (2, 4) 9 (1, 1) (1, 2) (2, 1) (2, 2) (1, 3) (2, 3) (1, 4) (2, 4) 10 (1, 1) (2, 1) (1, 2) (1, 3) (1, 4) (2, 2) (2, 3) (2, 4) 11 (1, 1) (2, 1) (1, 2) (1, 3) (2, 2) (1, 4) (2, 3) (2, 4) 12 (1, 1) (2, 1) (1, 2) (1, 3) (2, 2) (2, 3) (1, 4) (2, 4) 13 (1, 1) (2, 1) (1, 2) (2, 2) (1, 3) (1, 4) (2, 3) (2, 4) 14 (1, 1) (2, 1) (1, 2) (2, 2) (1, 3) (2, 3) (1, 4) (2, 4) The equations (3.7) are cρ(2,2) = cρ(2,1) + cρ(1,2) = a2 + b2; cρ(2,3) = cρ(2,1) + cρ(1,3) = a2 + b3; cρ(2,4) = cρ(2,1) + cρ(1,4) = a2 + b4. As a typical example, we will consider polynomials admitting factorisations under both bijections 1 and 8. Besides c1 = 0, which always holds, we find c6 = c2 + c5; c7 = c3 + c5; c8 = c4 + c5; c4 = c2 + c3; c7 = c3 + c5; c8 = c3 + c6, which is obviously solvable taking c2, c3, and c5 as free (nonnegative integer) parameters. The corresponding inequivalent factorisations are (1 +Xc5)(1 +Xc2 +Xc3 +Xc2+c3) = (1 +Xc3)(1 +Xc2 +Xc5 +Xc2+c5). However, in fact both can be further reduced to (1 +Xc2)(1 +Xc3)(1 +Xc5). Automated verification by MAGMA shows that likewise all pairs of inequivalent 2 × 4- factorisations that arise by combining two cases from the table can be further reduced to equivalent 2× 2× 2-factorisations. This proves the theorem. C. E. van de Woestijne: Factors of disconnected graphs and polynomials with. . . 319 Theorem 3.10. Let P ∈ N1 be a sum of 9 monomials, not necessarily distinct. Then P has unique factorisation inside N1. Proof. We may assume the variable does not divide P . Putting t = 9, the only nontrivial factorisation is one having r = s = 3. We establish all factorisations of the form (1+Xa2 +Xa3)(1+Xb2 +Xb3) = 1+Xc2 +Xc3 +Xc4 +Xc5 +Xc6 +Xc7 +Xc8 +Xc9 . Exchanging the factors does not change the factorisation, so in addition to the partial or- dering (3.9), we also require that a2 ≥ b2, hence cρ(2,1) ≥ cρ(1,2). All bijections ρ that are compatible with these orderings are enumerated by MAGMA to be Case: c1 c2 c3 c4 c5 c6 c7 c8 c9 1 (1, 1) (1, 2) (1, 3) (2, 1) (2, 2) (2, 3) (3, 1) (3, 2) (3, 3) 2 (1, 1) (1, 2) (1, 3) (2, 1) (2, 2) (3, 1) (2, 3) (3, 2) (3, 3) 3 (1, 1) (1, 2) (1, 3) (2, 1) (2, 2) (3, 1) (3, 2) (2, 3) (3, 3) 4 (1, 1) (1, 2) (1, 3) (2, 1) (3, 1) (2, 2) (2, 3) (3, 2) (3, 3) 5 (1, 1) (1, 2) (1, 3) (2, 1) (3, 1) (2, 2) (3, 2) (2, 3) (3, 3) 6 (1, 1) (1, 2) (2, 1) (1, 3) (2, 2) (2, 3) (3, 1) (3, 2) (3, 3) 7 (1, 1) (1, 2) (2, 1) (1, 3) (2, 2) (3, 1) (2, 3) (3, 2) (3, 3) 8 (1, 1) (1, 2) (2, 1) (1, 3) (2, 2) (3, 1) (3, 2) (2, 3) (3, 3) 9 (1, 1) (1, 2) (2, 1) (1, 3) (3, 1) (2, 2) (2, 3) (3, 2) (3, 3) 10 (1, 1) (1, 2) (2, 1) (1, 3) (3, 1) (2, 2) (3, 2) (2, 3) (3, 3) 11 (1, 1) (1, 2) (2, 1) (2, 2) (1, 3) (2, 3) (3, 1) (3, 2) (3, 3) 12 (1, 1) (1, 2) (2, 1) (2, 2) (1, 3) (3, 1) (2, 3) (3, 2) (3, 3) 13 (1, 1) (1, 2) (2, 1) (2, 2) (1, 3) (3, 1) (3, 2) (2, 3) (3, 3) 14 (1, 1) (1, 2) (2, 1) (2, 2) (3, 1) (1, 3) (2, 3) (3, 2) (3, 3) 15 (1, 1) (1, 2) (2, 1) (2, 2) (3, 1) (1, 3) (3, 2) (2, 3) (3, 3) 16 (1, 1) (1, 2) (2, 1) (2, 2) (3, 1) (3, 2) (1, 3) (2, 3) (3, 3) 17 (1, 1) (1, 2) (2, 1) (3, 1) (1, 3) (2, 2) (2, 3) (3, 2) (3, 3) 18 (1, 1) (1, 2) (2, 1) (3, 1) (1, 3) (2, 2) (3, 2) (2, 3) (3, 3) 19 (1, 1) (1, 2) (2, 1) (3, 1) (2, 2) (1, 3) (2, 3) (3, 2) (3, 3) 20 (1, 1) (1, 2) (2, 1) (3, 1) (2, 2) (1, 3) (3, 2) (2, 3) (3, 3) 21 (1, 1) (1, 2) (2, 1) (3, 1) (2, 2) (3, 2) (1, 3) (2, 3) (3, 3) As before, we consider the systems of 8 equations in 8 variables (putting the trivial c1 = 0 apart) that arise by combining two possibilities for ρ as given in the table. Among the 8 variables, at most four are conceptually suited as free parameters, namely those corre- sponding to one of the variables a2, a3, b2, and b3 under both bijections simultaneously. It is interesting to note that it is always possible to choose the free parameters among this small set of “interesting” variables (it would be even more interesting to prove this before- hand), even if some of the occurring systems have rank as small as 5 (out of 8). We let MAGMA run through all combinations of two bijections, and the result is that in all cases, the obtained factorisations are equivalent. Theorem 3.11. Let P ∈ N1 be a sum of 10 monomials, not necessarily distinct. If P has 320 Ars Math. Contemp. 5 (2012) 307–323 non-unique factorisation, then it is of the form (1 +X)(1 +X2 +X4 +X6 +X8) = (1 +X5)(1 +X +X2 +X3 +X4); (1 +X)(1 +X4 +X6 +X8 +X12) = (1 +X5)(1 +X +X4 +X7 +X8); (1 +X3)(1 +X2 +X4 +X6 +X8) = (1 +X5)(1 +X2 +X3 +X4 +X6), up to multiplication by a power of X , and up to replacing X by a power, or it has one of the forms (1 +X3b)(1 +Xa +Xb +Xa+b+Xa+2b) = (1 +Xb)(1 +Xa +Xa+2b +X3b +Xa+4b); (1 +X3b)(1 +Xa +Xb +Xa+b +X2b) = (1 +Xb)(1 +Xa +X2b +Xa+3b +X4b) for integers a ≥ 0 and b ≥ 1, up to multiplication by a power of X . The products in the theorem evaluate to 1 +X +X2 +X3 +X4 +X5 +X6 +X7 +X8 +X9; 1 +X +X4 +X5 +X6 +X7 +X8 +X9 +X12 +X13; 1 +X2 +X3 +X4 +X5 +X6 +X7 +X8 +X9 +X11; 1 +Xa +Xb +Xa+b +Xa+2b +X3b +Xa+3b +X4b +Xa+4b +X5b; 1 +Xa +Xb +Xa+b +X2b +X3b +Xa+3b +X4b +Xa+4b +X5b, respectively. All factors are irreducible in N1 by Lemma 3.2. Note that the first three cases are all self-reciprocal; the reciprocals of all polynomials in the two 2-parameter families again belong to one of these two families. Proof. We may assume the variable does not divide P . Any nontrivial factorisation is of the form (1 +Xa2)(1 +Xb2 +Xb3 +Xb4 +Xb5). We use topological sorting and backtracking to find all bijections ρ that are compatible with the partial ordering (3.9), and find the cases listed in Figure 1. Solving the linear systems obtained by every combination of two entries in the table, this time we find 102 pairs with nonequivalent factorisations. A good way to classify the cases is to look at the two values for the variable a2, i.e., the nontrivial exponent of X in the left-hand factor. In some cases, such as the combination Cases 5 and 38, the two choices for the left- hand factor are (1 + Xa) and (1 + X−a), for a free parameter a. As the parameter must be integer and nonnegative, it is forced to be 0, and the corresponding factorisations are equivalent after all. In the combinations 1 and 42, as well as 10 and 42, the left-hand factors are (1 + Xa) and (1 +X5a), giving the first and second case in the theorem. In the combinations (1, 9), (1, 17), (1, 30), (2, 12), (2, 20), (2, 33), (3, 14), (3, 22), (6, 25), (6, 38), and (7, 27), the left-hand factors are (1 +X3a) and (1 +X5a), giving the third case in the theorem (all combinations yield the same right-hand factors). C. E. van de Woestijne: Factors of disconnected graphs and polynomials with. . . 321 Case: c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 1 (1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (2, 1) (2, 2) (2, 3) (2, 4) (2, 5) 2 (1, 1) (1, 2) (1, 3) (1, 4) (2, 1) (1, 5) (2, 2) (2, 3) (2, 4) (2, 5) 3 (1, 1) (1, 2) (1, 3) (1, 4) (2, 1) (2, 2) (1, 5) (2, 3) (2, 4) (2, 5) 4 (1, 1) (1, 2) (1, 3) (1, 4) (2, 1) (2, 2) (2, 3) (1, 5) (2, 4) (2, 5) 5 (1, 1) (1, 2) (1, 3) (1, 4) (2, 1) (2, 2) (2, 3) (2, 4) (1, 5) (2, 5) 6 (1, 1) (1, 2) (1, 3) (2, 1) (1, 4) (1, 5) (2, 2) (2, 3) (2, 4) (2, 5) 7 (1, 1) (1, 2) (1, 3) (2, 1) (1, 4) (2, 2) (1, 5) (2, 3) (2, 4) (2, 5) 8 (1, 1) (1, 2) (1, 3) (2, 1) (1, 4) (2, 2) (2, 3) (1, 5) (2, 4) (2, 5) 9 (1, 1) (1, 2) (1, 3) (2, 1) (1, 4) (2, 2) (2, 3) (2, 4) (1, 5) (2, 5) 10 (1, 1) (1, 2) (1, 3) (2, 1) (2, 2) (1, 4) (1, 5) (2, 3) (2, 4) (2, 5) 11 (1, 1) (1, 2) (1, 3) (2, 1) (2, 2) (1, 4) (2, 3) (1, 5) (2, 4) (2, 5) 12 (1, 1) (1, 2) (1, 3) (2, 1) (2, 2) (1, 4) (2, 3) (2, 4) (1, 5) (2, 5) 13 (1, 1) (1, 2) (1, 3) (2, 1) (2, 2) (2, 3) (1, 4) (1, 5) (2, 4) (2, 5) 14 (1, 1) (1, 2) (1, 3) (2, 1) (2, 2) (2, 3) (1, 4) (2, 4) (1, 5) (2, 5) 15 (1, 1) (1, 2) (2, 1) (1, 3) (1, 4) (1, 5) (2, 2) (2, 3) (2, 4) (2, 5) 16 (1, 1) (1, 2) (2, 1) (1, 3) (1, 4) (2, 2) (1, 5) (2, 3) (2, 4) (2, 5) 17 (1, 1) (1, 2) (2, 1) (1, 3) (1, 4) (2, 2) (2, 3) (1, 5) (2, 4) (2, 5) 18 (1, 1) (1, 2) (2, 1) (1, 3) (1, 4) (2, 2) (2, 3) (2, 4) (1, 5) (2, 5) 19 (1, 1) (1, 2) (2, 1) (1, 3) (2, 2) (1, 4) (1, 5) (2, 3) (2, 4) (2, 5) 20 (1, 1) (1, 2) (2, 1) (1, 3) (2, 2) (1, 4) (2, 3) (1, 5) (2, 4) (2, 5) 21 (1, 1) (1, 2) (2, 1) (1, 3) (2, 2) (1, 4) (2, 3) (2, 4) (1, 5) (2, 5) 22 (1, 1) (1, 2) (2, 1) (1, 3) (2, 2) (2, 3) (1, 4) (1, 5) (2, 4) (2, 5) 23 (1, 1) (1, 2) (2, 1) (1, 3) (2, 2) (2, 3) (1, 4) (2, 4) (1, 5) (2, 5) 24 (1, 1) (1, 2) (2, 1) (2, 2) (1, 3) (1, 4) (1, 5) (2, 3) (2, 4) (2, 5) 25 (1, 1) (1, 2) (2, 1) (2, 2) (1, 3) (1, 4) (2, 3) (1, 5) (2, 4) (2, 5) 26 (1, 1) (1, 2) (2, 1) (2, 2) (1, 3) (1, 4) (2, 3) (2, 4) (1, 5) (2, 5) 27 (1, 1) (1, 2) (2, 1) (2, 2) (1, 3) (2, 3) (1, 4) (1, 5) (2, 4) (2, 5) 28 (1, 1) (1, 2) (2, 1) (2, 2) (1, 3) (2, 3) (1, 4) (2, 4) (1, 5) (2, 5) 29 (1, 1) (2, 1) (1, 2) (1, 3) (1, 4) (1, 5) (2, 2) (2, 3) (2, 4) (2, 5) 30 (1, 1) (2, 1) (1, 2) (1, 3) (1, 4) (2, 2) (1, 5) (2, 3) (2, 4) (2, 5) 31 (1, 1) (2, 1) (1, 2) (1, 3) (1, 4) (2, 2) (2, 3) (1, 5) (2, 4) (2, 5) 32 (1, 1) (2, 1) (1, 2) (1, 3) (1, 4) (2, 2) (2, 3) (2, 4) (1, 5) (2, 5) 33 (1, 1) (2, 1) (1, 2) (1, 3) (2, 2) (1, 4) (1, 5) (2, 3) (2, 4) (2, 5) 34 (1, 1) (2, 1) (1, 2) (1, 3) (2, 2) (1, 4) (2, 3) (1, 5) (2, 4) (2, 5) 35 (1, 1) (2, 1) (1, 2) (1, 3) (2, 2) (1, 4) (2, 3) (2, 4) (1, 5) (2, 5) 36 (1, 1) (2, 1) (1, 2) (1, 3) (2, 2) (2, 3) (1, 4) (1, 5) (2, 4) (2, 5) 37 (1, 1) (2, 1) (1, 2) (1, 3) (2, 2) (2, 3) (1, 4) (2, 4) (1, 5) (2, 5) 38 (1, 1) (2, 1) (1, 2) (2, 2) (1, 3) (1, 4) (1, 5) (2, 3) (2, 4) (2, 5) 39 (1, 1) (2, 1) (1, 2) (2, 2) (1, 3) (1, 4) (2, 3) (1, 5) (2, 4) (2, 5) 40 (1, 1) (2, 1) (1, 2) (2, 2) (1, 3) (1, 4) (2, 3) (2, 4) (1, 5) (2, 5) 41 (1, 1) (2, 1) (1, 2) (2, 2) (1, 3) (2, 3) (1, 4) (1, 5) (2, 4) (2, 5) 42 (1, 1) (2, 1) (1, 2) (2, 2) (1, 3) (2, 3) (1, 4) (2, 4) (1, 5) (2, 5) Figure 1: Bijections for factorisations into 2× 5 terms 322 Ars Math. Contemp. 5 (2012) 307–323 In all other combinations, the ratio of the exponents of X in the left-hand factors is 1 : 3, and we find that all cases are covered by the two-parameter families given in the theorem. Here, some combinations give one of the two-parameter families, while others give a specialisation of either family, obtained by putting a = kb for k ∈ {0, 1, 2, 3, 4, 5}. In fact (an observation of Wilfried Imrich), each of the theorems given above yields a slightly more general result. Namely, if instead of considering just terms with coefficient 1, we give each term of our polynomials a positive integer coefficient, then the same proofs show that there is at most one factorisation of P of the given form (for example, a fac- torisation of a 10-term polynomial into a product of a 2-term and a 5-term polynomial). For it to hold, now also the coefficients must satisfy some easy relations. However, if we have nontrivial coefficients, the number of terms a factor has need not divide the number of terms of the polynomial itself, and therefore (unfortunately) this is not enough to show that all quadrinomials have unique factorisation in N1. The method above clearly reduces the classification of all non-unique factorisations of univariate polynomials with a given number of terms n to a finite computation. However, it is also clear that the cost of these computations increases exponentially with n. Hence we refrain from attacking the complicated case n = 12. We only note that factorisation of 12-term polynomials in N1 is non-unique, as witnessed by Nüsken’s example (3.2). Also, although cases where n is a prime power apparently tend to possess few nonunique factorisations or none at all, there do exist examples, such as (1 +X3 +X5 +X6)(1 +X +X2 +X4) = (1 +X)(1 +X2)(1 + 2X4 +X7) (3.10) for n = 16, which also shows that the monoid N1 is not half-factorial. Acknowledgement I would like to thank Richard Hammack and Wilfried Imrich for introducing me to the subject in such an agreeable way, and Alfred Geroldinger for his interest and for pointing me to the recent paper [3]. References [1] G. Abay-Asmerom, R. H. Hammack, C. E. Larson and D. T. Taylor, Direct product factor- ization of bipartite graphs with bipartition-reversing involutions, SIAM J. Discrete Math. 23 (2009/10), 2042–2052. [2] W. Bosma, J. Cannon and C. Playoust, The Magma algebra system, I., The user language, J. Symbolic Comput. 24 (1997), 235–265. [3] P. Cesarz, S. T. Chapman, S. McAdam and G. J. Schaeffer, Elastic properties of some semirings defined by positive systems, in: Commutative algebra and its applications, Walter de Gruyter, Berlin, 2009, 89–101. [4] T. H. Cormen, C. E. Leiserson and R. L. Rivest, Introduction to algorithms, The MIT Electrical Engineering and Computer Science Series, MIT Press, Cambridge, MA, 1990. [5] A. Fernández, T. Leighton and J. L. López-Presa, Containment properties of product and power graphs, Discrete Appl. Math. 155 (2007), 300–311. [6] R. H. Hammack, Isomorphic components of direct products of bipartite graphs, Discuss. Math. Graph Theory 26 (2006), 231–248. C. E. van de Woestijne: Factors of disconnected graphs and polynomials with. . . 323 [7] R. H. Hammack, Proof of a conjecture concerning the direct product of bipartite graphs, Euro- pean J. Combin. 30 (2009), 1114–1118. [8] R. H. Hammack, W. Imrich and S. Klavžar, Handbook of Product Graphs, CRC Press, sec- ond ed., 2011. [9] W. Imrich, S. Klavžar and D. F. Rall, Cancellation properties of products of graphs, Discrete Appl. Math. 155 (2007), 2362–2364. [10] L. Lovász, On the cancellation law among finite relational structures, Period. Math. Hungar. 1 (1971), 145–156.