{'fraction_non_alphanumeric': 0.035569480280132695, 'fraction_numerical': 0.008688326049181192, 'mean_word_length': 4.024871014684482, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Enumeration of the Monomials of a Polynomial and Related Complexity Classes

We study the problem of generating monomials of a polynomial in the context of enumeration complexity. In this setting, the complexity measure is the delay between two solutions and the total time. We present two new algorithms for restricted classes of polynomials, which have a good delay and the same global running time as the classical ones. Moreover they are simple to describe, use little evaluation points and one of them is parallelizable. We introduce three new complexity classes, TotalPP, IncPP and DelayPP, which are probabilistic counterparts of the most common classes for enumeration problems, hoping that randomization will be a tool as strong for enumeration as it is for decision. Our interpolation algorithms proves that a lot of interesting problems are in these classes like the enumeration of the spanning hypertrees of a 3-uniform hypergraph. Finally we give a method to interpolate a degree 2 polynomials with an acceptable (incremental) delay. We also prove that finding a specified monomial in a degree 2 polynomial is hard unless RP = NP. It suggests that there is no algorithm with a delay as good (polynomial) as the one we achieve for multilinear polynomials.


Introduction
Enumeration, the task of generating all solutions of a given problem, is an interesting generalization of decision and counting. Since a problem typically has an exponential number of solutions, the way we study enumeration complexity is quite different from decision. In particular, the delay between two solutions and the time taken by an algorithm relative to the number of solutions seem to be the most considered complexity measures. In this paper, we revisit the famous problem of polynomial interpolation, that is to say finding the monomials of a polynomial from its values, with these measures in mind.
It has long been known that a finite number of evaluation points is enough to interpolate a polynomial and efficient procedures (both deterministic and probabilistic) have been studied by several authors [1,2,3]. The complexity depends mostly on the number of monomials of the polynomial and on an a priori bound on this number which may be exponential in the number of variables. The deterministic methods rely on prime numbers as evaluation points, with the drawback that they are very large. The probabilistic methods crucially use the Schwarz-Zippel lemma, which is also a tool in this article, and efficient solving of particular linear systems.
As a consequence of a result about random efficient identity testing [4], Klivans and Spielman give an interpolation algorithm, which happens to have an incremental delay.
In this vein, the present paper studies the problem of generating the monomials of a polynomial with the best possible delay. In particular we consider natural classes of polynomials such as multilinear polynomials, for which we prove that interpolation can be done efficiently. Similar restrictions have been studied in other works about identity testing (the decision version of interpolation) for a quantum model [5] or for depth 3 circuits which thus define almost linear polynomials [6]. Moreover, a lot of interesting polynomials are multilinear like the Determinant, the Pfaffian, the Permanent, the elementary symmetric polynomials or anything which may be defined by a syntactically multilinear arithmetic circuit.
In Sec. 4 we present an algorithm which works for polynomials such that no two of their monomials use the same set of variables. It is structured as in [4] but is simpler and has better delay, though polynomially related. In Sec. 5 we propose a second algorithm which works for multilinear polynomials; it has a delay polynomal in the numberof variables, which makes it exponentially better than the previous one and is also easily parallelizable. In addition both algorithms enjoy a global complexity as good as the algorithms of the literature, are deterministic for monotone polynomials and use only small evaluation points making them suitable to work over finite fields.
We describe in Sec. 6 three complexity classes for enumeration, namely TotalP, IncP, DelayP which are now commonly used [7,8,9,10] to formalize what is an efficiently enumerable problem. We introduce probabilistic variants of these classes, which happen to characterize the enumeration complexity of the different interpolation algorithms. Their use on polynomials computable in polynomial time enable us to prove that well-known problems are in these classes. Those problems already have better enumeration algorithms except the last, enumeration of the spanning hypertrees of a 3-uniform hypergraph, for which our method gives the first efficient enumeration algorithm.
In the last section we discuss how to combine the two algorithms we have presented to interpolate degree 2 polynomials with incremental delay. We also prove that the problem of finding a specified monomial in a degree 2 polynomial is hard by encoding a restricted version of the hamiltonian path problem in a polynomial given by the Matrix-Tree theorem (see [11]). Thus there is no polynomial delay interpolation algorithm for degree 2 polynomials similar to the one for degree 1 because it would solve the later problem and would imply RP = NP. Finally we compare our two algorithms with several classical ones and show that they are good with regard to parameters like number of calls to the black box or size of the evaluation points.
Please note that most proofs are given in the appendix.

Enumeration Problems
In this section, we recall basic definitions about enumeration problems and complexity measures and we introduce the central problem of this article. The computation model is a RAM machine as defined in [10] which has, in addition to the classical definition, an instruction W rite(A) which outputs the content of the register A. The result of a computation of a RAM machine is the sequence of integers which were in A when the instructions W rite(A) were executed. For simplicity we consider that these integers encode words, and that the input of the machine is also a word represented by suitable integers in the input registers. Let M be such a machine and x a word, we write M (x) the result of the computation of M on x. The order in which the outputs are given does not matter, therefore M (x) will denote the set of outputs as well as the sequence. We choose a RAM machine instead of a Turing machine since it may be useful to deal with an exponential amount of memory in polynomial time, see for instance the enumeration of the maximal independent sets of a graph [7].
Definition 1 (Enumeration Problem). Let A be a polynomially balanced binary predicate, i.e. A(x, y) ⇒ |y| ≤ Q(|x|), for a certain polynomial Q. We write A(x) for the set of y such that A(x, y). We say that a RAM machine M solves the enumeration problem associated to A, Enum·A for short, if M (x) = A(x) and there is no repetition of solutions in the computation.
Let T (x, i) be the time taken by a machine M to return i outputs from the instance x. As for decision problems, we are interested by the total time taken by M , namely T (x, |M (x)|). We are also interested by the delay between two solutions, that is to say T (x, i + 1) − T (x, i). M has an incremental delay when it is polynomial in |x| and i, and M has a polynomial delay when it is polynomial in |x| only.
A probabilistic RAM machine has a special instruction rand which writes in a specific register the integer 0 or 1 with equal probability. All outcomes of the instruction rand during a run of a RAM machine are independent.
Definition 2 (Probabilistic enumeration). We say that the probabilistic RAM machine M solves Enum·A with probability p if P [A(x) = M (x)] > p and there is no repetition of solutions in the computation.
We adapt the model to the case of a computation with an oracle, by a special instruction which calls the oracle on a word contained in a specific register and then writes the answer in another register in unit time.
In this article we interpret the famous problem of interpolating a polynomial given by a black box as a enumeration problem. It means that we try to find all the monomials of a polynomial given by the number of its variables and an oracle which allows to evaluate the polynomial on any point in unit time. This problem is denoted by Enum·P oly but will be solved in this article only on restricted classes of polynomials.

Finding one Monomial
In this section we introduce all the basic tools we need to build interpolation algorithms. One consider polynomials with n variables and rational coefficients. A sequence of n positive integers e = (e 1 , . . . , e n ) characterizes the monomial X e = X e1 1 X e2 2 . . . X en n . We call t the number of monomials of a polynomial P written P (X) = 1≤j≤t λ j X ej .
The degree of a monomial is the maximum of the degrees of its variables and the total degree is the sum of the degrees of its variables. Let d (respectively D) denote the degree (respectively the total degree) of the polynomial we consider, that is to say the maximum of its monomial's degree (respectively total degree). In Sec. 5 we assume that the polynomial is multilinear i.e. d = 1 and D is thus bounded by n.
We assume that the maximum of the bitsize of the coefficients appearing in a polynomial is O(n) to simplify the statement of some results, in the examples of Sec. 6 it is even O(1). When analyzing the delay of an algorithm solving Enum·P oly we are interested in both the number of calls to the black box and the time spent between two generated monomials. We are also interested in the size of the integers used in the calls to the oracle, since in real cases the complexity of the evaluation depends on it.
The support of a monomial is the set of indices of variables which appears in the monomial. Let L be a set of indices of variables, for instance a support, then f L is the homomorphism of Q[X 1 , . . . , X n ] defined by X i → X i if i ∈ L X i → 0 otherwise From now on, we denote f L (P ) by P L . It is the polynomial obtained by substituting 0 to every variable of index not in L, that is to say all the monomials of P which have their support in L. We call X L the multilinear term of support L, which is the product of all X i with i in L.
Lemma 1. Let P be a polynomial without constant term and whose monomials have distinct supports and L a minimal set (for inclusion) of variables such that P L is not identically zero. Then there is an integer λ such that P L = λX L .
The first problem we want to solve is to decide if a polynomial given by a black box is the zero polynomial, a problem called Polynomial Identity Testing. We are especially interested in the corresponding search problem, i.e. giving explicitly one term and its coefficient. Indeed, we show in Sec. 4 how to turn any algorithm solving this problem into an incremental interpolation algorithm.
It is easy to see [2] that a polynomial with t monomials has to be evaluated in t points to be sure that it is zero. If we do not have any a priori bound on t, then we must evaluate the polynomial on at least (d + 1) n n-tuples of integers to determine it. As we are not satisfied with this exponential complexity, we introduce probabilistic algorithms, which nonetheless have a good and manageable bound on the error.
Lemma 2 (Schwarz-Zippel [12]). Let P be a non zero polynomial with n variables of total degree D, if x 1 , . . . , x n are randomly chosen in a set of integers S of size D ǫ then the probability that P (x 1 , . . . , x n ) = 0 is bounded by ǫ.
A classical probabilistic algorithm to decide if a polynomial P is identically zero can be derived from this lemma. It picks x 1 , . . . , x n randomly in [ D ǫ ] 1 and calls the oracle to compute P (x 1 , . . . , x n ). If the result is zero, the algorithm decides that the polynomial is zero otherwise it decides that it is non zero. Remark that the algorithm never gives a false answer when the polynomial is zero. The probability of error when the polynomial is non zero is bounded by ǫ thanks to Lemma 2: Polynomial Identity Testing is thus in the class recognizable by a polynomial time algorithmRP.
This procedure makes exactly one call to the black box on points of size log( D ǫ ). The error rate may then be made exponentially smaller by increasing the size of the points. There is an other way to achieve the same reduction of error. Repeat the previous algorithm k times for ǫ = 1 2 , that is to say the points are randomly chosen in [2D]. If all runs return zero, then the algorithm decides that the polynomial is zero else it decides it is non zero. The probability of error of this algorithm is bounded by 2 −k , thus to achieve an error bound of ǫ we have to set k = log( 1 ǫ ). We denote by not zero(P, ǫ) the latter procedure, which is given as inputs a black box polynomial P and the maximum probability of failure ǫ. It uses slightly more random bits but it only involves numbers less than 2D.
Up to Sec. 5, all polynomials have monomials with distinct supports and no constant term. This class of polynomials contains the multilinear polynomials but is much bigger. Moreover being without constant term is not restrictive since we can always replace a polynomial by the same polynomial minus its constant term that we compute beforehand by a single oracle call to P (0, . . . , 0).
We now give an algorithm which finds a monomial of a polynomial P , in randomized polynomial time thanks to the previous lemmas. In this algorithm, L is a set of indices of variables and i an integer used to denote the index of the current variable.

Algorithm 1: find monomial
Data: A polynomial P with n variables and the error bound ǫ Once a set L is found such that P L is a monomial λX e , we must compute λ and e. The evaluation of P L on (1, . . . , 1) returns λ. For each i ∈ L the evaluation of P L on X i = 2 and for j = i, X j = 1 returns λ2 ei . From these n calls to the black box, we compute e in linear time and thus output λX e .
We analyze this algorithm, assuming first that the procedure not zero never makes a mistake. We also assume that P is not zero, which means that the algorithm has not answered "Zero". In this case at the end of the algorithm, P L is not zero. In fact we remove an element from L only if this condition is respected. As removing another element from L would make P L zero by construction, the set L is minimal for the property of P L being non zero. Then by Lemma 1 we know that P L is a monomial of P , which allows us to output it as previously explained.
Errors only appear in the procedure not zero with probability ǫ n+1 . Since we use this procedure n + 1 times we can bound the total probability of error by ǫ. The total complexity of this algorithm is O(n log( n ǫ )) since each of the n calls to the procedure not zero makes O(log( n ǫ )) calls to the oracle in time O(1). We summarize the properties of this algorithm in the next proposition. Proposition 1. Given a polynomial P as a black box, whose monomials have distinct supports, Algorithm 1 finds, with probability 1 − ǫ, a monomial of P by making O(n log( n ǫ )) calls to the black box on entries of size log(2D).

An Incremental Algorithm for Polynomials with Distinct Supports
We build an algorithm which enumerates the monomials of a polynomial incrementally by using the procedure find monomial defined in Proposition 1. Recall that incrementally means that the delay between two consecutive monomials is bounded by a polynomial in the number of already found monomials. We need a procedure subtract (P , Q) which acts as a black box for the polynomial P − Q when P is given as a black box and Q as an explicit set of monomials with their coefficients. Let D be the total degree of Q, C a bound on the size of its coefficients and i be the number of its monomials. One evaluates the polynomial subtract (P , Q) on points of size m as follows: Let P be a polynomial whose monomials have distinct supports with n variables, t monomials and total degree D. Algorithm 2 computes the set of monomials of P with probability 1 − ǫ. The delay between the i th and i + 1 th outputted monomials is bounded by O(iDn 2 (n + log( 1 ǫ ))) in time and O(n(n + log( 1 ǫ ))) calls to the oracle. The algorithm performs O(tn(n + log( 1 ǫ ))) calls to the oracle on points of size log(2D).

A Polynomial Delay Algorithm for Multilinear Polynomials
In this section we introduce an algorithm which enumerates the monomials of a multilinear polynomial with a polynomial delay. This algorithm has the interesting property of being easily parallelizable, which is obviously not the case of the incremental one. Let P be a multilinear polynomial with n variables of total degree D. Let L 1 and L 2 be two disjoint sets of indices of variables and l the cardinal of L 2 . We can write P L1∪L2 = X L2 P 1 (X) + P 2 (X), where X L2 does not divide P 2 (X). We want to decide if there is a monomial of P , whose support contains L 2 and is contained in L 1 ∪ L 2 , which is equivalent to deciding wether P 1 (X) is not the zero polynomial. To do this, we define a univariate polynomial H(Y ) from P L1∪L2 : 1. substitute a randomly chosen value The polynomial H(Y ) can be written Y l P 1 (x) + P 2 (x, Y ). If P 1 is a non zero polynomial then P 1 (x) is a non zero constant with probability at least 1 2 because of Lemma 2. Moreover P 2 (x, Y ) is a polynomial of degree strictly less than l. Hence, to decide if the polynomial P 1 is not zero, we have to decide if H(Y ) is of degree l.
To this aim we do a univariate interpolation of H(Y ): for this we need to make l oracle calls on values from 1 to l. The time needed to do an interpolation thanks to these values, with s a bound on the size of H(i) for 1 ≤ i ≤ l, is O(l 2 log(s)). We improve the probability of error of the described procedure from 1 2 to ǫ by repeating it log( 1 ǫ ) times and name it not zero improved (L 1 , L 2 , P, ǫ).
We now describe a binary tree which contains informations about the monomials of P . The set of node of this tree is the pairs of list (L 1 , L 2 ) such that there exists a monomial of support L in P with L 2 ⊆ L ⊆ L 1 ∪ L 2 . Consider a node labeled by (L 1 , L 2 ), we note i the smallest element of L 1 , it has for left child (L 1 \ {i}, L 2 ) and for right child (L 1 \ {i}, L 2 ∪ {i}) if they exist. The root of this tree is ([n], ∅) and the leaves are of the form (∅, L 2 ). There is a bijection between the leaves of this tree and the monomials of P : a leaf (∅, L 2 ) represents the monomial of support L 2 .
To enumerate the monomials of P , Algorithm 3 does a depth first search in this tree using not zero improved and when it visits a leaf, it outputs the corresponding monomial thanks to the procedure coefficient (P , L) that we now describe. We have L of cardinality l the support of a term and we want to find its coefficient. Consider H(Y ) built from L 1 = ∅ and L 2 = L, the coefficient of Y l in this polynomial is the coefficient of the monomial of support L. We interpolate H(Y ) with l calls to the oracle as before and return this coefficient. Theorem 2. Let P be a multilinear polynomial with n variables, t monomials and total degree D. Algorithm 3 computes the set of monomials of P with probability 1 − ǫ. The delay between the i th and i + 1 th outputted monomials is bounded in time by O(D 2 n 2 log(n)(n+log( 1 ǫ ))) and by O(nD(n+log( 1 ǫ ))) oracle calls. The whole algorithm performs O(tnD(n + log( 1 ǫ ))) calls to the oracle on points of size O(log(D)). There is a possible trade-off in the way not zero improved and coefficient are implemented: if one knows a bound on the size of the coefficients of the polynomial and use exponentially bigger evaluations points then one needs only one oracle call. The number of calls in the algorithm is then less than tn which is close to the optimal 2t.
Remark that when a polynomial is monotone (coefficients all positive or all negative) and is evaluated on positive points, the result is zero if and only if it is the zero polynomial. Algorithms 2 and 3 may then be modified to work deterministically for monotone polynomials with an even better complexity.
Moreover both algorithms work for polynomials over Q but we can extend them to work over finite fields. Since they only use evaluation points less than 2D, polynomials over any field of size more than 2D can be interpolated with very few modifications, which is good in comparison with other classical algorithms.

Complexity Classes for Enumeration
In this part the results about interpolation in the black box formalism are transposed into more classical complexity results. We are interested in enumeration problems defined by predicates A(x, y) such that there is for each x a polynomial P x whose monomials are in bijection with A(x). If P x is efficiently computable, an interpolation algorithm gives an effective way of enumerating its monomials and thus to solve Enum·A. Example 1. We associate to each graph G the determinant of its adjacency matrix. The monomials of this multilinear polynomial are in bijection with the cycle covers of G. Hence the problem of enumerating the monomials of det(M ) is equivalent to enumerating the cycle covers of G.
The specialization of different interpolation algorithms to efficiently computable polynomials naturally correspond to three "classical" complexity classes for enumeration and their probabilistic counterparts. We present several problems related to a polynomial as in Example 1 to illustrate how easily the interpolation methods described in this article produce enumeration algorithms for combinatorial problems. Although the first two examples already had efficient enumeration algorithms, the last did not, which shows that interpolation methods can bring new results in enumeration complexity.
In all the following definitions, we assume that the predicate which defines the enumeration problem is decidable in polynomial time, that is to say the corresponding decision problem is in P.

Definition 3. A problem
Enum·A is decidable in polynomial total time TotalP (resp. probabilistic polynomial total time TotalPP) if there is a polynomial Q(x, y) and a machine M which solves Enum·A (resp. with probability greater than 2 3 ) and satisfies for all x, T (x, |M (x)|) < Q(|x|, |M (x)|).
TotalPP is very similar to the class BPP for decision problems. By repeating a polynomial number of times an algorithm working in total polynomial time and returning the set of solutions we find in the majority of runs, we decrease exponentially the probability of error. The choice of 2 3 is hence arbitrary, everything greater than 1 2 would do. This property holds for the other probabilistic classes we are going to introduce, but unlike TotalPP the predicate which defines the enumeration problem needs then to be decidable in polynomial time Early termination versions of Zippel's algorithm [2,3] solve enumP oly in a time polynomial in the number of monomials. If we now use this algorithm on the Determinant which is computable in polynomial time, we enumerate its monomials in probabilistic polynomial total time. Thanks to Example 1, the enumeration of the cycle covers of a graph is in TotalPP.

Definition 4.
A problem Enum·A is decidable in incremental polynomial time IncP (resp. probabilistic polynomial total time IncPP) if there is a polynomial Q(x, y) and a machine M which solves Enum·A (resp. with probability greater than 2 3 ) and satisfies for all The classes IncP and IncPP can be related to the following search problem, parametrized by a polynomially balanced predicate A. Since Zippel's algorithm finds all monomials in its last step, it seems hard to turn it into an incremental algorithm. On the other hand Algorithm 2 whose design has been inspired by Proposition 2 does the interpolation with incremental delay.

Example 2.
To each graph we associate a polynomial PerfMatch, whose monomials represent the perfect matchings of this graph. For graphs with a "Pfaffian" orientation, such as the planar graphs, this polynomial is related to a Pfaffian and is then efficiently computable. Moreover all the coefficients of this graph are positive, therefore we can use Algorithm 2 to interpolate it deterministically with incremental delay. We have then proved that the enumeration of perfect matching is in IncP.

Definition 5.
A problem Enum·A is decidable in polynomial delay DelayP, (resp. probabilistic polynomial delay time DelayPP) if there is a polynomial Q(x, y) and a machine M which solves Enum·A (resp. with probability greater than 2 3 ) and satisfies for all x, T (x, i + 1) − T (x, i) ≤ Q(|x|).
Example 3 (Spanning Hypertrees). The notion of a spanning tree of a graph has several interesting generalizations to the case of hypergraphs. Nevertheless deciding if there is a spanning hypertree is polynomially computable only for the notion of Berge acyclicity and 3-uniform hypergraphs [13] thanks to an adaptation of the Lovász matching algorithm in linear polymatroids [14].
A polynomial Z is defined for each 3-uniform hypergraph [15] with coefficients −1 or 1, whose monomials are in bijection with the spanning hypertrees of the hypergraph. A new Matrix-Tree theorem [15] shows that Z is the Pfaffian of a matrix, whose coefficients are linear polynomials depending on the hypergraph. Thus Z is efficiently computable by first evaluating a few linear polynomials and then a Pfaffian. This has been used to give a simple RP algorithm [16] to decide the existence of a spanning hypertree in a 3-uniform hypergraph.
If we use Algorithm 3 we can enumerate the monomials of Z with probabilistic polynomial delay. The delay is good since the total degree of the monomials is low and the size of the coefficients is 1, which helps in the interpolation of the univariate polynomials. As a conclusion, the problem of enumerating the spanning hypertrees of a 3-uniform hypergraph is in DelayPP.

An Incremental Algorithm for Degree 2 Polynomials
We now give an incremental algorithm for the case of polynomials of degree d = 2. It is enough to describe a procedure which finds a monomial of a polynomial P , then Algorithm 2 turns it into an incremental algorithm.
First remark that we may use Algorithm 1 on a polynomial P of arbitrary degree to find a minimal support L in P . Since it is minimal, all monomials of P L have L as support and P L (X) = X L Q(X) with Q a multilinear polynomial. Therefore if we find a monomial of Q(X) and multiply it by X L , we have a monomial of P .
We may simulate an oracle call to Q(X) by a call to the oracle giving P L and a division by the value of X L as long as no X i is chosen to be 0. Remark that the procedure not zero improved (L ′ , L\L ′ , Q, ǫ) calls the black box only on strictly positive values since L = L ′ ∪ (L \ L ′ ). It allows us to decide if Q has a monomial whose support contains L ′ . In Algorithm 4 we find a L ′ such that it is contained in the support of a monomial and is maximal for this property. Since Q(X) is multilinear there is only one monomial of support L ′ and we find its coefficient by the procedure coefficient(Q,L ′ ).

Algorithm 4: Finding a monomial of a degree two polynomial
Data: A polynomial P L = X L Q(X) of degree 2 with n variables, an error bound ǫ Thanks to Algorithm 4 we have a monomial of Q and if we multiply it by X L it is a monomial of P . We then use it to implement find monomial in Algorithm 1 and obtain an incremental interpolation algorithm for degree 2 polynomials.

Limit to the Polynomial Delay Approach
Here we study the problem of deciding if a monomial has coefficient zero in a polynomial. In the case of a multilinear polynomial the procedure not zero improved solves the problem in polynomial time but for degree 2 polynomials we prove it is unpossible unless RP = NP. Therefore there is no generalization of Algorithm 3 to higher degree polynomials, although a polynomial delay algorithm may exist. Proof. Let G be a directed graphs on n vertices, the Laplace matrix L(G) is defined by X i,j and 0 otherwise. The Matrix-Tree theorem is the following equality where T s is the set of spanning trees of G whose all edges are oriented away from the vertex s and L(G) s,t is the minor of L(G) where row s and column t have been deleted: We substitute to X i,j the product of variables Y i Z j in the polynomial det(L(G) s,t ) which makes it a polynomial in 2n variables still computable in polynomial time. Every monomial represents a spanning tree whose maximum outdegree is the degree of the polynomial. We assume that every vertex of G has indegree and outdegree less or equal to 2 therefore det(L(G) s,t ) is of degree 2.
Remark now that a spanning tree, all of whose vertices have outdegree and indegree less or equal to 1 is an Hamiltonian path. Therefore G has an Hamiltonian path beginning by s and finishing by a vertex v if and only if det(L(G) s,t ) contains the monomial There is only a polynomial number of pairs (s, v), thus if we assume there is a probabilistic polynomial time algorithm to test if a monomial is in a degree 2 polynomial, we can decide in probabilistic polynomial time if G of outdegree and indegree at most 2 has an Hamiltonian path. Since this problem is NP complete [17] we have RP = NP.

Conclusion
Let us compare our method to three classical interpolation algorithms, which unlike our method can interpolate polynomials of any degree. Once restricted to multilinear polynomials, Algorithm 3 is really efficient compared to the algorithm of Klivans and Spielman (KS), which is the only known method with a bound on the delay. Note also that Algorithm 2, which is not presented in the next table, needs n 2 calls to the black box to guess one monomial, whereas KS needs (nD) 6 calls and then the same method is used to recover the whole polynomial from this procedure.
In the table T is a bound on t the number of monomials that Ben-Or Tiwari and Zippel algorithms need to do the interpolation. In the row labeled Enumeration is written the kind of enumeration algorithm the interpolation method gives when the polynomial is polynomially computable.
Ben-Or Tiwari [1] Zippel [2] KS [4] Algorithm 3 Algorithm type Deterministic Probabilistic Probabilistic Probabilistic Number of calls 2T tnD t(nD) 6 tnD(n + log( 1 ǫ )) Total time Quadratic in T Quadratic in t Quadratic in t Linear in t Enumeration Exponential TotalPP IncPP DelayPP Size of points T log(n) log( nT 2 ǫ ) log( nD ǫ ) log(D) Correction : We analyze this algorithm under the assumption that the procedures not zero and find monomial do not make mistakes.
We have the following invariant of the while loop : Q is made from a subset of the monomials of P . It is true at the beginning because Q is zero. Assume that Q satisfies this property at a certain point of the while loop, since we know that not zero(subtract (P ,Q)), P − Q is non zero and is then a non empty subset of the monomials of P . The outcome of find monomial (subtract (P ,Q)) is thus a monomial of P which is not in Q, therefore Q plus this monomial still satisfies the invariant. Remark that we have also proved that the number of monomials of Q is increasing by one at each step of the while loop. The algorithm must then terminate after t steps and when it does not zero(subtract (P ,Q)) gives a negative answer meaning that Q = P .

Probability of error :
The probability of failure is bounded by the sum of the probabilities of error coming from not zero and find monomial. We both call these procedures t times with an error bounded by ǫ 2 n+1 . Since 2t ≤ 2 n+1 , the total probability of error is bounded by ǫ.

Complexity :
The procedure not zero is called t times and uses the oracle n + log( 1 ǫ ) times, whereas find monomial is called t times but uses n(n + log( 1 ǫ )) oracle calls, which adds up to t(n + 1)(n + log( 1 ǫ )) calls to the oracle. In both cases the evaluation points are of size O(D).
The delay between two solutions is bounded by the evaluation of find monomial, which is dominated by the execution of subtract (P, Q) at each oracle call on points of size D. The algorithm calls subtract (P, Q) n(n + log( 1 ǫ )) times and each of these calls needs O(iD max(C, D)), which gives a delay of O(iD max(C, D)n(n + log( 1 ǫ ))).

⊓ ⊔
Alternate method to implement not zero improved : We want to decide if P 1 (X) is the zero polynomial in P L1∪L2 = X L2 P 1 (X) + P 2 (X). We let α be the integer 2 2(n+C+D log( 2D ǫ )) and l the cardinal of L 2 . We do a call to the oracle on the values (x i ) i∈[n] : The value of a variable which is not in L 2 is bounded by 2D ǫ , therefore a monomial of P 2 (which contains at most l−1 variables of L 2 ) has its contribution to P (x 1 , . . . , x n ) bounded by 2 C ( 2D ǫ ) D α l−1 . Hence the total contribution of P 2 is bounded in absolute value by 2 n+C+D log( 2D ǫ ) α l−1 which is equal to α l− 1 2 . If P 1 (x 1 , . . . , x n ) is zero, this also bounds the absolute value of P (x 1 , . . . , x n ).
Assume now that P 1 (x 1 , . . . , x n ) is not zero, since x L2 is equal to α l , the absolute value of x L2 P 1 (x 1 , . . . , x n ) has α l for lower bound. By the triangle inequality We can then decide if P 1 (x 1 , . . . , x n ) is zero by comparison of P (x 1 , . . . , x n ) to α l− 1 2 . Remark that P 1 (x 1 , . . . , x n ) may be zero even if P 1 is not zero. Nonetheless P 1 only depends on variables which are in L 1 and are thus randomly taken in [ 2D ǫ ]. By Lemma 2, the probability that the polynomial P 1 is not zero although P 1 (x 1 , . . . , x n ) has value zero is bounded by ǫ. We have then designed an algorithm which decides with probability 1 − ǫ if P has a monomial whose support contains L 2 and is contained in Remark that this implementation of not zero improved needs only one oracle call but requires big evaluation points and to know C in advance. To implement coefficient just do the same oracle call and an integer division of the value by α l to get the coefficient.

Proof of Theorem 2 :
The procedure not zero improved does one interpolation on a degree l polynomial where l is bounded by D. We can bound the value of the polynomial on points of value less than D by 2 n 2 C D D , where C is a bound on the size of the coefficients of the polynomial. Since we have assumed that C = O(n) and that D < n because the polynomial is multilinear, the logarithm of the values taken by the polynomial for the interpolation is bounded by n log(n). The univariate interpolation then needs a time O(D 2 n log(n)) and D oracle calls on points of size log(D).
The procedure not zero improved is called in Algorithm 3 with an error parameter ǫ n2 n , it therefore repeats the previously described interpolation O(n + log( 1 ǫ )) times. Each call to not zero improved needs a time O(D 2 n log(n))(n + log( 1 ǫ )) and D(n + log( 1 ǫ )) oracle calls. Between the visit of two leaves, we call the procedure not zero improved at most n times and once the procedure coefficient which has a similar complexity. Hence the delay is bounded in time by O(D 2 n 2 log(n))(n + log( 1 ǫ )) and by nD(n + log( 1 ǫ )) oracle calls on points of size log(2D).
Finally since we call the procedures not zero improved and coefficient less than nt times during the algorithm, the error is bounded by nt ǫ n2 n < ǫ.

⊓ ⊔
We describe here the way to a improve the error bound for IncPP algorithms, but it would work equally well on DelayPP ones. Note that in both cases we need an exponential space and there is a slight overhead. Proof. Since A is in IncPP, there is a machine M which computes the solution of A with probability 2 3 and a delay bounded by Q(|x|, i). Since A(x, y) may be tested in polynomial time, we can assume that every output of M is a correct solution, by checking A(x, y) before outputting y and stopping if not A(x, y). We now simulate k runs in parallel of the machine M on input x. Each time we should output a solution, we add it to a set of solution (with no repetition). Assume we have already outputted i solutions, we let the k runs be simulated for another Q(|x|, i) steps each before outputting a new solution of the set of found solutions and stop if it is empty. This algorithm clearly works in incremental polynomial time and if one of the run finds all solutions, it also finds all solutions. Then the probability of finding all solutions is more than 1 − 1 3 k . If we set k = log( 1 ǫ ) log(3) , we have a probability of 1 − ǫ, which achieves the proof.

Proof of Proposition 2 :
Assume AnotherSolution A is computable in probabilistic polynomial time, we want to enumerate the solution of the enumeration problem A on the input x. We know a bound on the number of solutions of A, that we call B. We assume that the algorithm which decides AnotherSolution A has a probability of error of 1 3B . That is achievable by repeating at most log(B) times the original algorithm, therefore the running time is still polynomial. We apply this algorithm to x and the empty set, we add the found solution to the set of solutions and we go on like this until we have found all solutions. The delay between the i th and the i + 1 th solution is bounded by the execution of the algorithm AnotherSolution which is polynomial in |x| and i the size of the set of already found solutions. Moreover the probability of error is bounded by 1 3 = B × 1 3B . This proves that A is in IncPP.
Conversely if A ∈ IncPP, on an instance (x,S) of AnotherSolution A we want to find a solution which is not in S. We enumerate |S| + 1 solutions by the IncPP algorithm, in time polynomial in |S| and |x|. If one of these solutions is not in S, it is the output of the algorithm. If S is the set of all solutions, the enumeration will end in time polynomial in S and x, which allow us to output the value meaning there is no other solutions.