Abstract
We investigate the computational complexity of deciding whether a given univariate integer polynomial has a factor satisfying specific additional constraints. When the only constraint imposed on is to have a degree smaller than the degree of and greater than zero, the problem is equivalent to testing the irreducibility of and then it is solvable in polynomial time. We prove that deciding whether a given monic univariate integer polynomial has factors satisfying additional properties is NP-complete in the strong sense. In particular, given any constant value , we prove that it is NP-complete in the strong sense to detect the existence of a factor that returns a prescribed value when evaluated at (Theorem 1) or to detect the existence of a pair of factors—whose product is equal to the original polynomial—that return the same value when evaluated at (Theorem 2). The list of all the properties we have investigated in this paper is reported at the end of Section Introduction.
MSC:
68R01; 68Q17; 13P05; 11C08
1. Introduction
The idea of decomposing a polynomial into the product of smaller ones is definitely not new. A large amount of literature has been devoted to the factorization of polynomials (without claim of exhaustiveness, see [1,2,3]) as well as to the decomposition of other mathematical objects, e.g., numbers, matrices, graphs and so on. The basic idea behind factorization is decomposing a complex object into smaller and easier to analyze pieces. Properties satisfied by each piece might shed some light on the properties satisfied by the entire object. As an example, from irreducible factors of a polynomial, we can recover valuable information about its roots. As far as polynomials are concerned, much attention has been dedicated to the problem of factoring them into irreducible polynomials, i.e., into no furtherly factorable elements. The first polynomial factorization algorithm was published by Theodor Von Schubert in 1793 [4]. Since then, dozens of papers on the computational complexity of polynomial factorization have been published. In 1982, Arjen K. Lenstra, Hendric W. Lenstra, and Laszlo Lovasz [2] published the first polynomial time algorithm for factoring polynomials over and then over .
When dealing with the computational complexity of problems whose input is a polynomial, it is crucial to specify the way we represent it. The standard way of representing a polynomial is by giving the list of its coefficients. In this case, the size of the polynomial is proportional to n and does not depend on the number of zero coefficients in . The other way to represent a polynomial (called lacunary or sparse representation) consists of the list of nonzero monomials. Lacunary representation may lead to an exponentially shorter representation of the same polynomial with respect to the standard notation. The computational cost of an algorithm can be polynomially bounded in the standard input size and, at the same time, exponentially large in the lacunary input size. Testing the irreducibility of lacunary polynomials or computing the greatest common divisor of two lacunary polynomials are NP-hard problems [5,6,7]. Computing the irreducible factors of bounded degree of lacunary polynomials can be accomplished in polynomial time [8] as well as computing the integer roots of lacunary integer polynomials [9].
In this paper, we will use standard notation for polynomials. This makes our NP-completeness results even stronger.
Irreducible factorization of polynomials, under some conditions, is unique and any other factorization into not necessarily irreducible elements can be obtained by properly grouping suitable irreducible factors. In this paper we focus our attention on some particular types of factors, not necessarily irreducible, and on the computational complexity of detecting their existence. We will prove that some types of factors are hard to detect while some others are not. In other words, we show that computing irreducible factors of a polynomial can be much easier than computing other types of factors. It turns out, as expected, that the boundary between polynomially computable factors and “hard to compute” ones is far from being completely understood.
We wish to emphasize that the main aim of this paper is not to provide technically difficult proofs of long standing open problems, but rather to show a different perspective in dealing with polynomial decomposition problems.
We face the following general problem. Given an integer polynomial and some specific property P, decide whether admits one or more factors that satisfy P.
Here is a list of problems we have analyzed in this paper.
- Q1.
- Let be any fixed integer.Given and , decide whether there exists a factor of such that . (Theorem 1).
- Q2.
- Given and , decide whether there exists a factor of such that the sum of all the coefficients of is equal to h. (Corollary 1).
- Q3.
- Given and , decide whether there exists a factor of such that the constant term of is equal to h. (Corollary 2).
- Q4.
- Let be any fixed integer.Given , decide whether there exists two factors of such that and . (Theorem 2).
- Q5.
- Given , decide whether there exists two factors of such that and the sum of all the coefficients of is equal to the sum of all the coefficients of . (Corollary 4).
- Q6.
- Given , decide whether there exists two factors of such that and constant term of is equal to the constant term of . (Corollary 3).
- Q7.
- Given , decide whether there exists two factors of such that . (Question 1).
- Q8.
- Given and , decide whether there exists a factor of such that the coefficient of the monomial with degree m in is equal h. (Question 2).
2. Definitions and Known Results
Let denote the set of integer numbers and the set of integer polynomials (polynomials with coefficients in ). Given two integer polynomials and , we say that divides (we write ) if and only if there exists an integer polynomial such that . The degree of a polynomial with (denoted by is n. Given an integer polynomial , we say that is a factor of if and only if . An integer polynomial with degree n is reducible if and only if it admits a factor such that . It is irreducible otherwise. In the rest of the paper, we will only consider monic integer polynomials, i.e., integer polynomials whose leading coefficient (coefficient of the highest degree monomial) is equal to 1.
We now introduce some well-known NP-complete computational problems that we will use for our reductions.
Definition 1
(subset-sum). Given positive integers decide whether there exist such that
Definition 2
(subset-product). Given positive integers decide whether there exist such that
Definition 3
(product-partition). Given n positive integers decide whether there exists a partition of the set into two nonempty subsets I and J such that
The subset-sum problem (problem [SP13], page 224 in [10]) has been proved to be NP-complete in [11]. It is solvable in pseudo-polynomial time. The subset-product problem (problem [SP14], page 225 in [10]) has been proved to be NP-complete in the strong sense in [10,12]. The product-partition problem has been proved to be NP-complete in the strong sense in [13]. A problem is said to be NP-complete in the strong sense if it remains NP-complete even when all of its numerical parameters are bounded by a polynomial in the length of the input (see [14] for details).
3. Hard to Detect Factors
In this section, we prove that problems from Q1 to Q6 are NP-complete in the strong sense. The following observation completely characterizes any factor of a monic univariate integer polynomial with integer roots.
Remark 1.
Let and be n integers. Let be the following monic univariate integer polynomial
An integer polynomial , , is a factor of if and only if
Remark 2.
Computing all the coefficients of an integer polynomial
takes operations.
Proof.
Let . Let . It is easy to verify that the degree of is equal to k and then the number of coefficients of is at most . Computing from takes operations. Then, computing takes operations. □
Definition 4
(k-factor problem). Let be any fixed integer. The k-factor problem is defined as follows.
- Input: and
- Output: - yes if has a factor such that ,- no otherwise.
Theorem 1.
For any fixed , k-factor problem is NP-complete in the strong sense.
Proof.
Let be any fixed integer. We reduce the subset-product problem (Definition 2) to the k-factor problem.
Let be any instance of subset-product. Let for and
Let be the corresponding instance of k-factor.
is a yes instance of k-factor if and only if there exists a factor of such that . Or equivalently, by Observation 1, if and only if
Equation (1) is true if and only if
Since
we conclude that if and only if . This is true if and only if is a yes instance of subset-product. □
Remark 3.
It is easy to check (directly from the proof of Theorem 1) that the k-factor problem remains NP-complete in the strong sense even if we restrict the set of input polynomials to monic polynomials with all integer roots.
Definition 5
(sum-of-coefficients problem). The sum-of-coefficients problem is defined as follows.
- Input: and
- Output: - yes if has a factor such that the sum of all the coefficients of is equal to s,- no otherwise.
Corollary 1.
The sum-of-coefficients problem is NP-complete in the strong sense.
Proof.
We prove this result as a Corollary of Theorem 1. We reduce the k-factor problem with (NP-complete in the strong sense by Theorem 1) to the sum-of-coefficients problem.
Let be any factor of . Since is equal to the sum of all the coefficients of , we conclude that if and only if the sum of all the coefficients of is equal to h. □
Definition 6.
The constant-term problem is defined as follows.
- Input: and
- Output: - yes if has a factor such that the constant term of is equal to t,- no otherwise.
Corollary 2.
The constant-term problem is NP-complete in the strong sense.
Proof.
We prove this result as a Corollary of Theorem 1. We reduce the k-factor problem with (NP-complete in the strong sense by Theorem 1) to the constant-term problem.
Let be any factor of . Since is equal to the constant term of , we conclude that if and only if the constant term of is equal to h. □
Definition 7
(k-equal-factor problem). Let be any fixed integer. The problem k-equal-factor is defined as follows.
- Input:
- Output: - yes if has two factors such thatand- no otherwise.
Theorem 2.
k-equal-factor is NP-complete in the strong sense.
Proof.
Let be any fixed integer. We reduce the product-partition problem (Definition 3) to the k-equal-factor problem.
Let be any instance of product partition. Let for and
We now prove that is a yes instance for k-equal-factor if and only if is a yes instance for product-partition.
is a yes instance of k-equal-factor if and only if has two factors such that and . Or, equivalently, by Observation 1, if and only if the set can be partitioned into two nonempty subsets I and J such that
Definition 8
(equal-sum-of-coefficients problem). The equal-sum-of-coefficients problem is defined as follows.
- Input:
- Output: - yes if there exist such that and the sum of all thecoefficients of is equal to the sum of all the coefficients of ,- no otherwise.
Corollary 3.
The equal-sum-of-coefficients problem is strongly NP-complete.
Proof.
Since the sum of the coefficients of any polynomial is equal to , the proof of this Corollary follows from Theorem 2 setting . □
Definition 9
(equal-constant-term problem). The equal-constant-term problem is defined as follows.
- Input:
- Output: - yes if there exist such thatand the constant term of is equal to the constant term of ,- no otherwise.
Corollary 4.
The equal-constant-term problem is strongly NP-complete.
Proof.
Since the constant term of any polynomial is equal to , the proof of this Corollary follows from Theorem 2 setting . □
4. Open Questions
4.1. Natural Factors Detection Problem
Let denote the set of natural numbers (non-negative integer numbers) and the set of natural polynomials (polynomials with coefficients in ). with the usual sum and product operations is a commutative semiring. In fact, this is the free commutative semiring on a single generator . For theoretical results regarding natural polynomials, we refer the reader to [15].
Definition 10.
The natural-reducibility problem is defined as follows.
- Input:
- Output: - yes if has two factors such that ,- no otherwise.
Question 1.
Is the natural-reducibility problem NP-complete?
The following example shows a polynomial that is irreducible when considered as an element of and reducible when considered as an element of .
Example 1.
Let . The complete factorization of in is while is irreducible in .
In the next example, we show that the prime factorization of integer polynomials in is not unique.
Example 2.
Let . The complete factorization of in is . Since and , then we have two distinct factorizations of in .
Our conjecture is that the natural-reducibility problem is NP-complete, but we have not been able to prove it.
4.2. Factors with Specific Coefficients Detection Problem
Let be any integer polynomial. We denote by , , the coefficient . For values of m outside the interval , is equal to 0. According to this definition, is the coefficient of the monomial in with maximum degree (for monic polynomials is always equal to 1) and is the constant term of .
The factor with specific coefficients detection problem is defined as follows.
Definition 11
(factor-with-specific-coefficients). Let be any fixed integer.
- Input: and
- Output: - yes if has a factor such that ,- no otherwise.
By Corollary 2, we have that for , factor-with-specific-coefficients problem is NP-complete in the strong sense. In fact, when , the problem is equivalent to the constant-term problem.
We now define a problem that is a sort of combination of subset-sum and subset-product problems.
Definition 12
(subset-sum-of-products). Let k be any fixed integer. Given positive integers decide whether there exist such that
Note that for , the subset-sum-of-products problem is nothing but the subset-sum problem (Definition 1) and then it is NP-complete.
In the following theorem, we prove that the factor-with-specific-coefficients detection problem is not easier than the subset-sum-of-products problem.
To this extent we recall the Vieta’s formulas (customized for monic polynomials over the integers with integer roots) that relate the roots of a polynomial to its coefficients.
Theorem 3
(Vieta’s Formulas for monic polynomials over the integers with integer roots). Let
with . We have
Example 3.
Let
Theorem 4.
The subset-sum-of-products problem is reducible to the factor-with-specific-coefficients detection problem.
Proof.
Let be any instance of subset-sum-of-products. Let , and
Let be the corresponding instance of factor-with-specific-coefficients. We now prove that is a yes instance of subset-sum-of-products if and only if is a yes instance of factor-with-specific-coefficients.
is a yes instance of factor-with-specific-coefficients if and only if there exists a factor of such that . By Observation 1, any factor of has the form
where is a suitable subset of .
By Vieta’s formulas, we know that can be written as
This ends the proof. □
We end this section with the following open question.
Question 2.
For which values of m (other than the case ) is the factor-with-specific-coefficients problem NP-complete?
5. Conclusions and Further Works
In this paper, we have introduced and analyzed the computational complexity of the problem of detecting the existence of factors of integer polynomials satisfying specific additional constraints. Even if detecting the existence of factors of an integer polynomial can be accomplished in polynomial time, it turns out that adding simple constraints on factors leads to hard to solve variants of the problem. We prove that problems Q1 to Q6 listed at the end of Section 1 are NP-complete in the strong sense.
Section 4 provides some ideas for further works. In particular, we were surprised that Question 1 (to our knowledge) had not already been previously addressed in the literature since the problem of factoring an integer polynomial over instead of over seems to us a very natural and interesting question to investigate.
Author Contributions
Investigation, A.D., E.F. and L.M.; Resources, E.F. All authors have read and agreed to the published version of the manuscript.
Funding
The APC was funded by Laboratoire I3S of Université Côte d’Azur.
Data Availability Statement
No data is used or generated.
Conflicts of Interest
The authors declare no conflict of interest.
References
- Hoeij, M.V. Factoring polynomials and the knapsack problem. J. Number Theory 2002, 95, 167–189. [Google Scholar] [CrossRef]
- Lenstra, A.K.; Lenstra, H.W.; Lovasz, L. Factoring polynomials with rational coefficients. Math. Ann. 1982, 261, 515–534. [Google Scholar] [CrossRef]
- Kaltofen, E. Polynomial factorization 1987–1991. In Proceedings of the LATIN ′92, 1st Latin American Symposium on Theoretical Informatics, São Paulo, Brazil, 6–10 April 1992; Simon, I., Ed.; Proceedings; Lecture Notes in Computer Science. Springer: Berlin, Germany, 1992; Volume 583, pp. 294–313. [Google Scholar] [CrossRef]
- Schubert, F. De Inventione Divisorum. Nova Acta Acad. Sci. Petropolitanae 1793, 11, 172–182. [Google Scholar]
- Plaisted, D.A. Sparse Complex Polynomials and Polynomial Reducibility. J. Comput. Syst. Sci. 1977, 14, 210–221. [Google Scholar] [CrossRef]
- Karpinski, M.; Shparlinski, I.E. On the Computational Hardness of Testing Square-Freeness of Sparse Polynomials. In Proceedings of the AAECC, Honolulu, HI, USA, 15–19 November 1999; Fossorier, M.P.C., Imai, H., Lin, S., Poli, A., Eds.; Lecture Notes in Computer Science. Springer: Berlin, Germany, 1999; Volume 1719, pp. 492–497. [Google Scholar]
- Kaltofen, E.; Koiran, P. On the complexity of factoring bivariate supersparse (Lacunary) polynomials. In Proceedings of the ISSAC, Beijing, China, 24–27 July 2005; Kauers, M., Ed.; pp. 208–215. [Google Scholar]
- Grenet, B. Bounded-degree factors of lacunary multivariate polynomials. J. Symb. Comput. 2016, 75, 171–192. [Google Scholar] [CrossRef]
- Cucker, F.; Koiran, P.; Smale, S. A Polynomial Time Algorithm for Diophantine Equations in One Variable. J. Symb. Comput. 1999, 27, 21–29. [Google Scholar] [CrossRef]
- Garey, M.R.; Johnson, D.S. Computers and Intractability: A Guide to the Theory of NP-Completeness (Series of Books in the Mathematical Sciences); W. H. Freeman: New York, NY, USA, 1979. [Google Scholar]
- Karp, R. Reducibility among combinatorial problems. In Complexity of Computer Computations; Miller, R., Thatcher, J., Eds.; Plenum Press: New York, NY, USA, 1972; pp. 85–103. [Google Scholar]
- Yao, A.C.C. Technical Report CS-TR-1978-662; New Algorithms in Bin Packing; Department of Computer Science, Stanford University: Stanford, CA, USA, 1978. [Google Scholar]
- Ng, C.; Barketau, M.; Cheng, T.; Kovalyov, M.Y. Product partition and related problems of scheduling and systems reliability: Computational complexity and approximation. Eur. J. Oper. Res. 2010, 207, 601–604. [Google Scholar] [CrossRef]
- Garey, M.R.; Johnson, D.S. “Strong” NP-Completeness results: Motivation, examples, and Implications. J. ACM 1978, 25, 499–508. [Google Scholar] [CrossRef]
- Campanini, F.; Facchini, A. Factorizations of polynomials with integral non-negative coefficients. Semigroup Forum 2019, 99, 317–332. [Google Scholar] [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).